[dpdk-dev] [PATCH v2 6/7] net/e1000: set min and max MTU for igb devices

Zhang, Qi Z qi.z.zhang at intel.com
Wed Mar 27 08:02:18 CET 2019



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Wednesday, March 27, 2019 9:14 AM
> To: Ananyev, Konstantin <konstantin.ananyev at intel.com>; Yigit, Ferruh
> <ferruh.yigit at intel.com>; Stokes, Ian <ian.stokes at intel.com>; dev at dpdk.org
> Cc: stephen at networkplumber.org; Lu, Wenzhuo <wenzhuo.lu at intel.com>; Xing,
> Beilei <beilei.xing at intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2 6/7] net/e1000: set min and max MTU for igb
> devices
> 
> 
> 
> > -----Original Message-----
> > From: Ananyev, Konstantin
> > Sent: Tuesday, March 26, 2019 10:18 PM
> > To: Zhang, Qi Z <qi.z.zhang at intel.com>; Yigit, Ferruh
> > <ferruh.yigit at intel.com>; Stokes, Ian <ian.stokes at intel.com>;
> > dev at dpdk.org
> > Cc: stephen at networkplumber.org; Lu, Wenzhuo <wenzhuo.lu at intel.com>;
> > Xing, Beilei <beilei.xing at intel.com>
> > Subject: RE: [dpdk-dev] [PATCH v2 6/7] net/e1000: set min and max MTU
> > for igb devices
> >
> >
> > > >
> > > > Hi Qi,
> > > >
> > > > > >
> > > > > > On 3/22/2019 1:01 PM, Ian Stokes wrote:
> > > > > > > This commit sets the min and max supported MTU values for
> > > > > > > igb devices via the eth_igb_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. To aid in these calculations a new MACRO
> > > > > > > 'E1000_ETH_OVERHEAD' has been introduced to consolidate
> > > > > > > overhead calculation and avoid
> > duplication.
> > > > > > >
> > > > > > > Signed-off-by: Ian Stokes <ian.stokes at intel.com>
> > > > > > > ---
> > > > > > >  drivers/net/e1000/e1000_ethdev.h | 6 ++++++
> > > > > > >  drivers/net/e1000/igb_ethdev.c   | 7 +++++--
> > > > > > >  2 files changed, 11 insertions(+), 2 deletions(-)
> > > > > > >
> > > > > > > diff --git a/drivers/net/e1000/e1000_ethdev.h
> > > > > > > b/drivers/net/e1000/e1000_ethdev.h
> > > > > > > index 94edff08e..3e74cd8fe 100644
> > > > > > > --- a/drivers/net/e1000/e1000_ethdev.h
> > > > > > > +++ b/drivers/net/e1000/e1000_ethdev.h
> > > > > > > @@ -89,6 +89,12 @@
> > > > > > >  	ETH_RSS_IPV6_UDP_EX)
> > > > > > >
> > > > > > >  /*
> > > > > > > + * The overhead from MTU to max frame size.
> > > > > > > + * Considering VLAN so a tag needs to be counted.
> > > > > > > + */
> > > > > > > +#define E1000_ETH_OVERHEAD (ETHER_HDR_LEN + ETHER_CRC_LEN
> +
> > > > > > > +VLAN_TAG_SIZE)
> > > > > >
> > > > > > As an overhead, following drivers set:
> > > > > > i40e: HDR + CRC + 2 * VLAN
> > > > > > ixgbe: HDR + CRC

> > > > > > e1000: HDR + CRC + VLAN
> > > > > >
> > > > > > I wonder if this difference is HW limitation, or driver
> > > > > > limitation or just implementation inconsistency.
> > > > >
> > > > > I think this is implementation inconsistency
> > > > >
> > > > > The NIC only accept Max Frame Size.

Sorry , I need to correct above statement, by checking the ixgbe datasheet, actually max frame size is not include VLAN
Packet with VLAN can be as large as MFS +4 and packet with double vlan can be MFS + 8. It's different with i40e.

So current implementation for mtu overhead subtraction for i40e and ixgbe looks good for me.

> > > > >
> > > > > The problem here is seems all of three setup are not perfect.
> > > > >
> > > > > HDR + CRC + 2 * VLAN - it may allow non vlan or single vlan
> > > > > packet that exceed
> > > > mtu.
> > > >
> > > > Hmm, wonder how?
> > >
> > > I'm talking about the case:
> > >
> > > Assume mtu = 1500,  we will set max frame size to 1500 + 14 + 4 +
> > > 2*4 = 1526 Let's assume a non vlan packet with 1522 size, so its l2
> > > payload will be 1504 that exceed the mtu,  but it will still be
> > > accepted, does it
> > break the configure?
> >
> > Of course it would, but as I can read the mail, we discussing overhead
> > to subtract from max_rx_pkt_len to report max allowable mtu.
> > From that perspective bigger overhead is more conservative and makes
> > sure our tx packet will never be bigger than max_rx_pkt_len.
> > Konstantin
> 
> I'm OK to choose HDR + CRC + 2 * VLAN as MTU overhead to keep all driver
> consistent.

> 
> Qi
> 
> >
> > >
> > > >
> > > > > HDR + CRC - it may reject vlan or double vlan packet that follow mtu.
> > > > > HDR + CRC + VLAN ,  it may reject double vlan packet that follow
> > > > > mtu
> > > > >
> > > > > I agree it's better to keep consistent on all drivers, but
> > > > > before this, we may need to decide which one we should take :)
> > > > >
> > > > > Regards
> > > > > Qi
> > > > >
> > > > > >
> > > > > > Better to confirm it that it is not implementation inconsistency.
> > > > > >
> > > > > > Wenzhuo, Konstantin, Beilei, Qi,
> > > > > >
> > > > > > Can you please comment?
> > > > > >
> > > > > > Thanks,
> > > > > > ferruh



More information about the dev mailing list