net/i40e: fix max frame size checking

Message ID 20180726064602.157850-1-yanglong.wu@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers
Series net/i40e: fix max frame size checking |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yanglong Wu July 26, 2018, 6:46 a.m. UTC
  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.

Fixes: bfeed0262b0c ("net/i40e: check illegal packets")

Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Ananyev, Konstantin July 26, 2018, 9:16 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> Sent: Thursday, July 26, 2018 7:46 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu, Yanglong
> <yanglong.wu@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.
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@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
  
Qi Zhang July 26, 2018, 12:13 p.m. UTC | #2
> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Thursday, July 26, 2018 5:17 PM
> To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei <tiwei.bie@intel.com>; Yao,
> Lei A <lei.a.yao@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > Sent: Thursday, July 26, 2018 7:46 AM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu, Yanglong
> > <yanglong.wu@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.

> 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@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
  
Qi Zhang July 26, 2018, 12:25 p.m. UTC | #3
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Thursday, July 26, 2018 8:14 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> Yanglong <yanglong.wu@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@intel.com>; dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> >
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > > Sent: Thursday, July 26, 2018 7:46 AM
> > > To: dev@dpdk.org
> > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > > Yanglong <yanglong.wu@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.

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@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
  
Ananyev, Konstantin July 26, 2018, 12:33 p.m. UTC | #4
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Thursday, July 26, 2018 1:26 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> > Sent: Thursday, July 26, 2018 8:14 PM
> > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>; dev@dpdk.org
> > Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > Yanglong <yanglong.wu@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@intel.com>; dev@dpdk.org
> > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu, Yanglong
> > > <yanglong.wu@intel.com>
> > > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > > > Sent: Thursday, July 26, 2018 7:46 AM
> > > > To: dev@dpdk.org
> > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > > > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > > > Yanglong <yanglong.wu@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.

> 
> 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@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
  
Qi Zhang July 26, 2018, 12:47 p.m. UTC | #5
> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Thursday, July 26, 2018 8:33 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> Yanglong <yanglong.wu@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@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>;
> > dev@dpdk.org
> > Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A
> > <lei.a.yao@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> >
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> > > Sent: Thursday, July 26, 2018 8:14 PM
> > > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> > > <yanglong.wu@intel.com>; dev@dpdk.org
> > > Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A
> > > <lei.a.yao@intel.com>; Wu, Yanglong <yanglong.wu@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@intel.com>; dev@dpdk.org
> > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > > > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > > > Yanglong <yanglong.wu@intel.com>
> > > > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size
> > > > checking
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > > > > Sent: Thursday, July 26, 2018 7:46 AM
> > > > > To: dev@dpdk.org
> > > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > > > > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > > > > Yanglong <yanglong.wu@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@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
  
Ananyev, Konstantin July 26, 2018, 12:56 p.m. UTC | #6
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Thursday, July 26, 2018 1:48 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> 
> 
> 
> > -----Original Message-----
> > From: Ananyev, Konstantin
> > Sent: Thursday, July 26, 2018 8:33 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>; dev@dpdk.org
> > Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > Yanglong <yanglong.wu@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@intel.com>; Ananyev, Konstantin
> > > <konstantin.ananyev@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>;
> > > dev@dpdk.org
> > > Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A
> > > <lei.a.yao@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size checking
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> > > > Sent: Thursday, July 26, 2018 8:14 PM
> > > > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> > > > <yanglong.wu@intel.com>; dev@dpdk.org
> > > > Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yao, Lei A
> > > > <lei.a.yao@intel.com>; Wu, Yanglong <yanglong.wu@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@intel.com>; dev@dpdk.org
> > > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > > > > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > > > > Yanglong <yanglong.wu@intel.com>
> > > > > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix max frame size
> > > > > checking
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > > > > > Sent: Thursday, July 26, 2018 7:46 AM
> > > > > > To: dev@dpdk.org
> > > > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Bie, Tiwei
> > > > > > <tiwei.bie@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > > > > > Yanglong <yanglong.wu@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.

Yep, sounds good.

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

Patch

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;
 		}