net/idpf: support MTU configuration

Add dev ops mtu_set.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
This commit is contained in:
Junfeng Guo 2022-10-31 08:33:37 +00:00 committed by Thomas Monjalon
parent 19b58dba9d
commit f163a00f2a
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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