[dpdk-dev] [PATCH] net/i40e: fix max frame size checking

Zhang, Qi Z qi.z.zhang at intel.com
Thu Jul 26 14:47:37 CEST 2018



> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Thursday, July 26, 2018 8:33 PM
> To: Zhang, Qi Z <qi.z.zhang at intel.com>; Wu, Yanglong
> <yanglong.wu at intel.com>; dev at dpdk.org
> Cc: Bie, Tiwei <tiwei.bie at intel.com>; Yao, Lei A <lei.a.yao at intel.com>; Wu,
> Yanglong <yanglong.wu at intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z
> > Sent: Thursday, July 26, 2018 1:26 PM
> > To: Zhang, Qi Z <qi.z.zhang at intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev at intel.com>; Wu, Yanglong <yanglong.wu at intel.com>;
> > dev at dpdk.org
> > Cc: Bie, Tiwei <tiwei.bie at intel.com>; Yao, Lei A
> > <lei.a.yao at intel.com>; Wu, Yanglong <yanglong.wu at intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> >
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Zhang, Qi Z
> > > Sent: Thursday, July 26, 2018 8:14 PM
> > > To: Ananyev, Konstantin <konstantin.ananyev at intel.com>; Wu, Yanglong
> > > <yanglong.wu at intel.com>; dev at dpdk.org
> > > Cc: Bie, Tiwei <tiwei.bie at intel.com>; Yao, Lei A
> > > <lei.a.yao at intel.com>; Wu, Yanglong <yanglong.wu at intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix max frame size
> > > checking
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Ananyev, Konstantin
> > > > Sent: Thursday, July 26, 2018 5:17 PM
> > > > To: Wu, Yanglong <yanglong.wu at intel.com>; dev at dpdk.org
> > > > Cc: Zhang, Qi Z <qi.z.zhang at intel.com>; Bie, Tiwei
> > > > <tiwei.bie at intel.com>; Yao, Lei A <lei.a.yao at intel.com>; Wu,
> > > > Yanglong <yanglong.wu at intel.com>
> > > > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size
> > > > checking
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Yanglong Wu
> > > > > Sent: Thursday, July 26, 2018 7:46 AM
> > > > > To: dev at dpdk.org
> > > > > Cc: Zhang, Qi Z <qi.z.zhang at intel.com>; Bie, Tiwei
> > > > > <tiwei.bie at intel.com>; Yao, Lei A <lei.a.yao at intel.com>; Wu,
> > > > > Yanglong <yanglong.wu at intel.com>
> > > > > Subject: [dpdk-dev] [PATCH] net/i40e: fix max frame size
> > > > > checking
> > > > >
> > > > > No need to check max frame size in TX, the checking should be
> > > > > done in up layer protocal. This checking will lead to fail for
> > > > > TSO or other application cases.
> > > >
> > > > Not sure why is that?
> > > > i40e doesn't support single packet bigger then 9.5KB (or so), as I
> remember.
> > > > For TSO the limit is 256KB - yes, it is bibber, but still there is a limit.
> > >
> > > I think we can't support more than 8 segment for TSO, right? so if
> > > the limit is 256KB, seems it is a redundant.
> 
> As I remember there is no limit for number of segs for TSO.
> For non-TSO - yes, max 8 segments per packet.

Oh, yes, it's only for non-TSO case, for TSO case, 
So I agree the correct fix is we check the 256KB boundary for TSO case 
And still need to check the 9.5k boundary for non-TSO case.

> 
> >
> > I mean buffer size limit is 16kb according to datasheet.
> >
> > >
> > > > Might be we need to change that check, but I think we still need to keep
> it.
> > > > Konstantin
> > >
> > > >
> > > > >
> > > > > Fixes: bfeed0262b0c ("net/i40e: check illegal packets")
> > > > >
> > > > > Signed-off-by: Yanglong Wu <yanglong.wu at intel.com>
> > > > > ---
> > > > >  drivers/net/i40e/i40e_rxtx.c | 3 +--
> > > > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/drivers/net/i40e/i40e_rxtx.c
> > > > > b/drivers/net/i40e/i40e_rxtx.c index 3be87fe6a..baad433a7 100644
> > > > > --- a/drivers/net/i40e/i40e_rxtx.c
> > > > > +++ b/drivers/net/i40e/i40e_rxtx.c
> > > > > @@ -1459,8 +1459,7 @@ i40e_prep_pkts(__rte_unused void
> > > > > *tx_queue,
> > > > struct rte_mbuf **tx_pkts,
> > > > >  		}
> > > > >
> > > > >  		/* check the size of packet */
> > > > > -		if (m->pkt_len > I40E_FRAME_SIZE_MAX ||
> > > > > -		    m->pkt_len < I40E_TX_MIN_PKT_LEN) {
> > > > > +		if (m->pkt_len < I40E_TX_MIN_PKT_LEN) {
> > > > >  			rte_errno = -EINVAL;
> > > > >  			return i;
> > > > >  		}
> > > > > --
> > > > > 2.11.0



More information about the dev mailing list