diff mbox series

[v2,21/41] net/mlx5: add set MTU routine

Message ID 20211007184350.73858-22-srikanth.k@oneconvergence.com (mailing list archive)
State New
Delegated to: Raslan Darawsheh
Headers show
Series add MLX5 FreeBSD support | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Srikanth Kaka Oct. 7, 2021, 6:43 p.m. UTC
using IOCTL call MTU is set

Signed-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>
Signed-off-by: Vag Singh <vag.singh@oneconvergence.com>
Signed-off-by: Anand Thulasiram <avelu@juniper.net>
---
 drivers/net/mlx5/freebsd/mlx5_ethdev_os.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c
index b470c4ddec..10069302bb 100644
--- a/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c
@@ -119,6 +119,25 @@  mlx5_get_mtu(struct rte_eth_dev *dev, uint16_t *mtu)
 	return 0;
 }
 
+/**
+ * Set device MTU.
+ *
+ * @param dev
+ *   Pointer to Ethernet device.
+ * @param mtu
+ *   MTU value to set.
+ *
+ * @return
+ *   0 on success, a negative errno value otherwise and rte_errno is set.
+ */
+int
+mlx5_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
+{
+	struct ifreq request = { .ifr_mtu = mtu, };
+
+	return mlx5_ifreq(dev, SIOCSIFMTU, &request);
+}
+
 /**
  * Get MAC address by querying netdevice.
  *