DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	"Wu, Yanglong" <yanglong.wu@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Yao, Lei A" <lei.a.yao@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix max frame size checking
Date: Mon, 30 Jul 2018 01:05:26 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153261286@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB977258DF51E8DE@irsmsx105.ger.corp.intel.com>



> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Friday, July 27, 2018 4:13 PM
> To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yao, Lei A <lei.a.yao@intel.com>
> Subject: RE: [PATCH v2] net/i40e: fix max frame size checking
> 
> 
> 
> > -----Original Message-----
> > From: Wu, Yanglong
> > Sent: Friday, July 27, 2018 5:40 AM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu,
> > Yanglong <yanglong.wu@intel.com>
> > Subject: [PATCH v2] net/i40e: fix max frame size checking
> >
> > Check patcket size according to TSO or no-TSO.
> >
> > Fixes: bfeed0262b0c ("net/i40e: check illegal packets")
> >
> > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > ---
> > v2:
> > change as comments.
> > ---
> >  drivers/net/i40e/i40e_ethdev.h | 1 +
> >  drivers/net/i40e/i40e_rxtx.c   | 9 +++++----
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.h
> > b/drivers/net/i40e/i40e_ethdev.h index cb5e5b5d8..3fffe5a55 100644
> > --- a/drivers/net/i40e/i40e_ethdev.h
> > +++ b/drivers/net/i40e/i40e_ethdev.h
> > @@ -28,6 +28,7 @@
> >  #define I40E_NUM_DESC_ALIGN       32
> >  #define I40E_BUF_SIZE_MIN         1024
> >  #define I40E_FRAME_SIZE_MAX       9728
> > +#define I40E_TSO_FRAME_SIZE_MAX   262144
> >  #define I40E_QUEUE_BASE_ADDR_UNIT 128
> >  /* number of VSIs and queue default setting */
> >  #define I40E_MAX_QP_NUM_PER_VF    16
> > diff --git a/drivers/net/i40e/i40e_rxtx.c
> > b/drivers/net/i40e/i40e_rxtx.c index 3be87fe6a..1bbc0340b 100644
> > --- a/drivers/net/i40e/i40e_rxtx.c
> > +++ b/drivers/net/i40e/i40e_rxtx.c
> > @@ -1439,13 +1439,15 @@ i40e_prep_pkts(__rte_unused void *tx_queue,
> > struct rte_mbuf **tx_pkts,
> >
> >  		/* Check for m->nb_segs to not exceed the limits. */
> >  		if (!(ol_flags & PKT_TX_TCP_SEG)) {
> > -			if (m->nb_segs > I40E_TX_MAX_MTU_SEG) {
> > +			if (m->nb_segs > I40E_TX_MAX_MTU_SEG ||
> > +			    m->pkt_len > I40E_FRAME_SIZE_MAX) {
> >  				rte_errno = -EINVAL;
> >  				return i;
> >  			}
> >  		} else if (m->nb_segs > I40E_TX_MAX_SEG ||
> >  			   m->tso_segsz < I40E_MIN_TSO_MSS ||
> > -			   m->tso_segsz > I40E_MAX_TSO_MSS) {
> > +			   m->tso_segsz > I40E_MAX_TSO_MSS ||
> > +			   m->pkt_len > I40E_TSO_FRAME_SIZE_MAX) {
> >  			/* MSS outside the range (256B - 9674B) are considered
> >  			 * malicious
> >  			 */
> > @@ -1459,8 +1461,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;
> >  		}
> > --
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied to dpdk-next-net-intel.

Thanks!
Qi
> 
> > 2.11.0

      reply	other threads:[~2018-07-30  1:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26  6:46 [dpdk-dev] [PATCH] " Yanglong Wu
2018-07-26  9:16 ` Ananyev, Konstantin
2018-07-26 12:13   ` Zhang, Qi Z
2018-07-26 12:25     ` Zhang, Qi Z
2018-07-26 12:33       ` Ananyev, Konstantin
2018-07-26 12:47         ` Zhang, Qi Z
2018-07-26 12:56           ` Ananyev, Konstantin
2018-07-27  4:40 ` [dpdk-dev] [PATCH v2] " Yanglong Wu
2018-07-27  8:13   ` Ananyev, Konstantin
2018-07-30  1:05     ` Zhang, Qi Z [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=039ED4275CED7440929022BC67E7061153261286@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=lei.a.yao@intel.com \
    --cc=yanglong.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).