DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>,
	"Hu, Jiayu" <jiayu.hu@intel.com>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>,
	"Varghese, Vipin" <vipin.varghese@intel.com>, <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v5] doc: add GRO API limitations in prog_guide
Date: Wed, 9 Jan 2019 22:31:41 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35B425BA@smartserver.smartshare.dk> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB977258010D901595@irsmsx105.ger.corp.intel.com>

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev, Konstantin
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> >
> > O        be merged.
> > > +
> > > +GRO Library Limitations
> > > +-----------------------
> > > +
> > > +- GRO library uses the values of MBUF->l2_len/l3_len/l4_len/
> > > +  outer_l2_len/outer_l3_len to get protocol headers for the
> > > +  input packet, rather than parsing the packet header. Therefore,
> > > +  before call GRO APIs to merge packets, user applications
> > > +  must set MBUF->l2_len/l3_len/l4_len/outer_l2_len/outer_l3_len
> > > +  to the same values as the protocol headers of the packet.
> > > +
> >
> > Since these length values are critical to other functionality
> > why not require all poll mode drivers to set them.
> 
> Most of current HW doesn't provide that functionality,
> so RX function would need to parse (touch) packet data.

True... In an application where the first process step is to receive the packet from the PMD and put it directly into the appropriate queue (or drops it) solely based on information provided in the "RX part" of the MBUF, two cache misses can be avoided - reading the header in the packet data and writing the "TX part" of the mbuf.

This is a key selling point for NIC hardware with the ability to perform classification, such as the Flow Director feature, so it can efficiently identify and discard packets related to DDOS attacks, as an example.

> From other side not every rx_burst() consumer does use GRO library.
> 

Nonetheless, many applications need to touch the packet header on ingress for classification purposes - either to identify a flow or to identify the attributes used for routing and QoS classification.

I expect that validating packet headers (i.e. identifying malformed packets) somewhere early on the ingress fast path is a very common use case, which is why I on another thread suggested extending rte_net_get_ptype() to check packet validity and building a bulk function on top of that to set the MBUF->l2_len/l3_len... fields, so they are ready for GRO, Fragment Reassembly and other ingress path libraries requiring this information: https://mails.dpdk.org/archives/dev/2019-January/122701.html

> >
> > Many poll mode drivers call rte_net_get_ptype() on the received
> > mbuf and it already handles setting this.
> >
> > One could argue that GRO should just log and die if it
> > gets malformed data.

This would be a good principle! If preconditions are not met, it is a bug and should be treated as such. As I mentioned before, this specific function is not taking foreign input; the application is in full control of passing garbage or not to this function.


Med venlig hilsen / kind regards
- Morten Brørup


  reply	other threads:[~2019-01-09 21:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18  4:25 [dpdk-dev] [PATCH] doc: add GRO API requirement " Jiayu Hu
2018-12-26  4:04 ` [dpdk-dev] [PATCH v2] doc: add GRO API limitations " Jiayu Hu
2019-01-04  7:16   ` [dpdk-dev] [PATCH v3] " Jiayu Hu
2019-01-09  3:00     ` [dpdk-dev] [PATCH V4] " Jiayu Hu
2019-01-09  4:25       ` Varghese, Vipin
2019-01-09  4:27         ` Varghese, Vipin
2019-01-09  5:18           ` Hu, Jiayu
2019-01-09  8:19       ` [dpdk-dev] [PATCH v5] " Jiayu Hu
2019-01-09 18:20         ` Stephen Hemminger
2019-01-09 18:40           ` Ananyev, Konstantin
2019-01-09 21:31             ` Morten Brørup [this message]
2019-01-10  8:06               ` Hu, Jiayu
2019-01-10  8:28                 ` Morten Brørup
2019-01-16  2:13         ` [dpdk-dev] [PATCH v6] doc: add GRO " Jiayu Hu
2019-01-16  9:50           ` Ananyev, Konstantin
2019-01-17 22:08             ` Thomas Monjalon
2019-01-17 13:55           ` Kovacevic, Marko
2019-01-17 22:08             ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-01-04 19:35 ` [dpdk-dev] [PATCH] doc: add GRO API requirement " Stephen Hemminger
2019-01-08  2:35   ` Hu, Jiayu

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=98CBD80474FA8B44BF855DF32C47DC35B425BA@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=jiayu.hu@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=vipin.varghese@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).