[v2] net/ice: set min and max MTU

Message ID 20190507015346.32214-1-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/ice: set min and max MTU |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Qi Zhang May 7, 2019, 1:53 a.m. UTC
  This commit sets the min and max supported MTU values for ice devices
via the ice_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max mtu is calculated as the max packet length
supported minus the transport overhead.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---

v2:
- fix typo

 drivers/net/ice/ice_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Qiming Yang May 14, 2019, 2:15 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Tuesday, May 7, 2019 9:54 AM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Cc: Stokes, Ian <ian.stokes@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH v2] net/ice: set min and max MTU
> 
> This commit sets the min and max supported MTU values for ice devices via
> the ice_dev_info_get() function. Min MTU supported is set to
> ETHER_MIN_MTU and max mtu is calculated as the max packet length
> supported minus the transport overhead.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> 
> v2:
> - fix typo
> 
>  drivers/net/ice/ice_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> 1f06a2c80..9f5f919f4 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -1994,6 +1994,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct
> rte_eth_dev_info *dev_info)
>  	dev_info->max_tx_queues = vsi->nb_qps;
>  	dev_info->max_mac_addrs = vsi->max_macaddrs;
>  	dev_info->max_vfs = pci_dev->max_vfs;
> +	dev_info->max_mtu = dev_info->max_rx_pktlen -
> ICE_ETH_OVERHEAD;
> +	dev_info->min_mtu = ETHER_MIN_MTU;
> 
>  	dev_info->rx_offload_capa =
>  		DEV_RX_OFFLOAD_VLAN_STRIP |
> --
> 2.13.6

Acked-by: Qiming Yang <qiming.yang@intel.com>
  
Qi Zhang May 14, 2019, 1:01 p.m. UTC | #2
> -----Original Message-----
> From: Yang, Qiming
> Sent: Tuesday, May 14, 2019 10:16 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: Stokes, Ian <ian.stokes@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> dev@dpdk.org
> Subject: RE: [PATCH v2] net/ice: set min and max MTU
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z
> > Sent: Tuesday, May 7, 2019 9:54 AM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> > <qiming.yang@intel.com>
> > Cc: Stokes, Ian <ian.stokes@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>
> > Subject: [PATCH v2] net/ice: set min and max MTU
> >
> > This commit sets the min and max supported MTU values for ice devices
> > via the ice_dev_info_get() function. Min MTU supported is set to
> > ETHER_MIN_MTU and max mtu is calculated as the max packet length
> > supported minus the transport overhead.
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> Acked-by: Qiming Yang <qiming.yang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 1f06a2c80..9f5f919f4 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1994,6 +1994,8 @@  ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->max_tx_queues = vsi->nb_qps;
 	dev_info->max_mac_addrs = vsi->max_macaddrs;
 	dev_info->max_vfs = pci_dev->max_vfs;
+	dev_info->max_mtu = dev_info->max_rx_pktlen - ICE_ETH_OVERHEAD;
+	dev_info->min_mtu = ETHER_MIN_MTU;
 
 	dev_info->rx_offload_capa =
 		DEV_RX_OFFLOAD_VLAN_STRIP |