[v17,09/18] net/idpf: add support for MTU configuration
Checks
Commit Message
From: Junfeng Guo <junfeng.guo@intel.com>
Add dev ops mtu_set.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
doc/guides/nics/features/idpf.ini | 1 +
drivers/net/idpf/idpf_ethdev.c | 13 +++++++++++++
2 files changed, 14 insertions(+)
@@ -4,6 +4,7 @@
; Refer to default.ini for the full list of available PMD features.
;
[Features]
+MTU update = Y
Linux = Y
x86-32 = Y
x86-64 = Y
@@ -83,6 +83,18 @@ idpf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
return 0;
}
+static int
+idpf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused)
+{
+ /* mtu setting is forbidden if port is start */
+ if (dev->data->dev_started) {
+ PMD_DRV_LOG(ERR, "port must be stopped before configuration");
+ return -EBUSY;
+ }
+
+ return 0;
+}
+
static int
idpf_init_vport_req_info(struct rte_eth_dev *dev)
{
@@ -760,6 +772,7 @@ static const struct eth_dev_ops idpf_eth_dev_ops = {
.tx_queue_stop = idpf_tx_queue_stop,
.rx_queue_release = idpf_dev_rx_queue_release,
.tx_queue_release = idpf_dev_tx_queue_release,
+ .mtu_set = idpf_dev_mtu_set,
};
static uint16_t