[v6] net/vmxnet3: Added mtu_set() function to allow setting MTU.
Checks
Commit Message
(Picked up from @Charles Myers patch
https://patchwork.dpdk.org/patch/57771/)
When the mtu_set() function is not implemented, rte_eth_dev_set_mtu()
fails with -ENOTSUP and mtu is not stored in the mtu field in the
rte_eth_dev_data. This causes the mtu in Vmxnet3_MiscConf which is
shared with hypervisor to always be set to 1500.
This may cause issues receiving jumbo frames on Enhanced Data Path
N-VDS.
Signed-off-by: Eduard Serra <eserra@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
Comments
-----Original Message-----
From: Eduard Serra Miralles <eserra@vmware.com>
Date: Wednesday, March 25, 2020 at 12:19 PM
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: Yong Wang <yongwang@vmware.com>
Subject: [PATCH v6] net/vmxnet3: Added mtu_set() function to allow setting MTU.
(Picked up from @Charles Myers patch
https://patchwork.dpdk.org/patch/57771/)
When the mtu_set() function is not implemented, rte_eth_dev_set_mtu()
fails with -ENOTSUP and mtu is not stored in the mtu field in the
rte_eth_dev_data. This causes the mtu in Vmxnet3_MiscConf which is
shared with hypervisor to always be set to 1500.
This may cause issues receiving jumbo frames on Enhanced Data Path
N-VDS.
Signed-off-by: Eduard Serra <eserra@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
---
Acked-by: Yong Wang <yongwang@vmware.com>
drivers/net/vmxnet3/vmxnet3_ethdev.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 705e976..c6e11ad 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -87,6 +87,7 @@ static int vmxnet3_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
static const uint32_t *
vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
+static int vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
uint16_t vid, int on);
static int vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
@@ -124,6 +125,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
.mac_addr_set = vmxnet3_mac_addr_set,
.dev_infos_get = vmxnet3_dev_info_get,
.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
+ .mtu_set = vmxnet3_dev_mtu_set,
.vlan_filter_set = vmxnet3_dev_vlan_filter_set,
.vlan_offload_set = vmxnet3_dev_vlan_offload_set,
.rx_queue_setup = vmxnet3_dev_rx_queue_setup,
@@ -1166,6 +1168,8 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM;
dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */
+ dev_info->min_mtu = VMXNET3_MIN_MTU;
+ dev_info->max_mtu = VMXNET3_MAX_MTU;
dev_info->speed_capa = ETH_LINK_SPEED_10G;
dev_info->max_mac_addrs = VMXNET3_MAX_MAC_ADDRS;
@@ -1212,6 +1216,18 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
}
static int
+vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, __rte_unused uint16_t mtu)
+{
+ if (dev->data->dev_started) {
+ PMD_DRV_LOG(ERR, "Port %d must be stopped to configure MTU",
+ dev->data->port_id);
+ return -EBUSY;
+ }
+
+ return 0;
+}
+
+static int
vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
{
struct vmxnet3_hw *hw = dev->data->dev_private;
--
2.7.4
On 3/31/2020 6:31 PM, Yong Wang wrote:
>
> -----Original Message-----
> From: Eduard Serra Miralles <eserra@vmware.com>
> Date: Wednesday, March 25, 2020 at 12:19 PM
> To: "dev@dpdk.org" <dev@dpdk.org>
> Cc: Yong Wang <yongwang@vmware.com>
> Subject: [PATCH v6] net/vmxnet3: Added mtu_set() function to allow setting MTU.
>
> (Picked up from @Charles Myers patch
> https://patchwork.dpdk.org/patch/57771/)
Thanks for resurrecting the patch.
>
> When the mtu_set() function is not implemented, rte_eth_dev_set_mtu()
> fails with -ENOTSUP and mtu is not stored in the mtu field in the
> rte_eth_dev_data. This causes the mtu in Vmxnet3_MiscConf which is
> shared with hypervisor to always be set to 1500.
>
> This may cause issues receiving jumbo frames on Enhanced Data Path
> N-VDS.
>
> Signed-off-by: Eduard Serra <eserra@vmware.com>
> Acked-by: Yong Wang <yongwang@vmware.com>
> ---
>
> Acked-by: Yong Wang <yongwang@vmware.com>
>
Applied to dpdk-next-net/master, thanks.
@@ -87,6 +87,7 @@ static int vmxnet3_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
static const uint32_t *
vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
+static int vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
uint16_t vid, int on);
static int vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
@@ -124,6 +125,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
.mac_addr_set = vmxnet3_mac_addr_set,
.dev_infos_get = vmxnet3_dev_info_get,
.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
+ .mtu_set = vmxnet3_dev_mtu_set,
.vlan_filter_set = vmxnet3_dev_vlan_filter_set,
.vlan_offload_set = vmxnet3_dev_vlan_offload_set,
.rx_queue_setup = vmxnet3_dev_rx_queue_setup,
@@ -1166,6 +1168,8 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM;
dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */
+ dev_info->min_mtu = VMXNET3_MIN_MTU;
+ dev_info->max_mtu = VMXNET3_MAX_MTU;
dev_info->speed_capa = ETH_LINK_SPEED_10G;
dev_info->max_mac_addrs = VMXNET3_MAX_MAC_ADDRS;
@@ -1212,6 +1216,18 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
}
static int
+vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, __rte_unused uint16_t mtu)
+{
+ if (dev->data->dev_started) {
+ PMD_DRV_LOG(ERR, "Port %d must be stopped to configure MTU",
+ dev->data->port_id);
+ return -EBUSY;
+ }
+
+ return 0;
+}
+
+static int
vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
{
struct vmxnet3_hw *hw = dev->data->dev_private;