DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: <longtb5@viettel.com.vn>, <roszenrami@gmail.com>,
	"Olivier Matz" <olivier.matz@6wind.com>
Cc: <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC] function to parse packet headers
Date: Wed, 9 Jan 2019 16:38:39 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35B425B7@smartserver.smartshare.dk> (raw)
In-Reply-To: <002301d4a7ce$d095b240$71c116c0$@viettel.com.vn>

Cutting in Olivier, requesting input as the maintainer of rte_net.

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of
> longtb5@viettel.com.vn
> 
> Hi Morten,
> 
> What is the difference compare to rte_net_get_ptype(), which also
> parses
> packet types and reports on header length.
> 
> In my application I have also done something similar about malformed
> packets. IMO it's very useful to have return value indicate different
> types
> of malformed packets, not just -1, e.g. invalid IP options, IP
> loopback,
> etc.

They are very similar. The main differences are:
- The header length fields are set in the MBUF, not returned in a separate structure. This would only be relevant for a bulk function.
- In theory, it would be possible to set the length fields without accessing the packet data, but just by looking at MBUF->packet_type for some packets; e.g. RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP is quite common due to Google's QUIC protocol (and will be with the coming HTTP/3 protocol).
- Testing for malformed packets, e.g. a length field suggesting that the packet is longer than it actually is, or a header length field suggesting that the header is shorter than the header's structure. (This obviously requires accessing the packet data, which makes the above point about not accessing the packet data irrelevant.)

It might be better to extend rte_net_get_ptype() by adding checks for malformed packets, rather than introducing an almost similar function.

And then the bulk function could use rte_net_get_ptype().

> 
> Regards,
> BL

  reply	other threads:[~2019-01-09 15:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09  3:43 longtb5
2019-01-09 15:38 ` Morten Brørup [this message]
2019-01-10  3:25   ` longtb5
2019-01-10  8:21     ` Morten Brørup
  -- strict thread matches above, loose matches on Subject: below --
2019-01-08 16:48 Morten Brørup
2019-01-08 20:09 ` Rami Rosen
2019-01-09 15:53   ` Morten Brørup
2019-01-09 23:57     ` Thomas Monjalon
2019-01-10  1:03       ` Rami Rosen
2019-01-11  0:11         ` Stephen Hemminger
2019-01-11  7:56           ` Andrew Rybchenko
2019-01-11  8:16             ` Morten Brørup
2019-01-11  8:28               ` Andrew Rybchenko
2019-01-11  8:35             ` Olivier Matz
2019-01-11  9:49               ` Ananyev, Konstantin
2019-01-11 12:04                 ` Morten Brørup

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=98CBD80474FA8B44BF855DF32C47DC35B425B7@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=longtb5@viettel.com.vn \
    --cc=olivier.matz@6wind.com \
    --cc=roszenrami@gmail.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).