DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz@6wind.com>
To: "Liu, Jijiang" <jijiang.liu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/4] rte_mbuf:add packet types
Date: Fri, 21 Nov 2014 14:25:38 +0100	[thread overview]
Message-ID: <546F3D52.3070300@6wind.com> (raw)
In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D9D8D6@SHSMSX101.ccr.corp.intel.com>

Hello Jijiang,

On 11/21/2014 01:26 PM, Liu, Jijiang wrote:
>> I have one question about the packet_type: it is not clear to me what the
>> software can expect, for instance when RTE_PTYPE_IPv4_IPv4 is set. What does
>> that mean exactly? Which fields must be valid in the packet to have this type?
>> - L2 ethertype
>> - Presence of vlan?
>> - IP version
>> - IP checksum
>> - IP header length
>> - IP length (compared to packet len)
>> - anything about IP options?
> The RTE_PTYPE_IPv4_IPv4 means that packet format is MAC, IPV4, IPV4, PAY3. The following fields are valid,
> L2 ethertype
> No VLAN
> IPv4,

OK. But IPv4 is not a field, it's a header composed of several fields.
When a network stack receives a packet, it checks the validity of the
IPv4 fields. The offload flags helps the application to avoid doing
some checks, that's why it's important to know what the hardware
already verified when a flag is set.

Here is a example of what the application may check. Knowing the
meaning of the flag is having an answer to these questions. I probably
forgot some, but I think you get the point.


When RTE_PTYPE_IPv4 is set does it mean that IP.version is 4?

When RTE_PTYPE_IPv4 is set does it mean that IP.ihl is not smaller
than 5?

When RTE_PTYPE_IPv4 is set does it mean that IP.ihl is not higher
than 15?

When RTE_PTYPE_IPv4 is set does it mean that IP.checksum is
verified?

When RTE_PTYPE_IPv4 is set does it mean that IP.total_len is
not lower than 20?

When RTE_PTYPE_IPv4 is set does it mean that IP.total_len is
not higher than m_len(m) + 14?

When RTE_PTYPE_IPv4 is set does it mean that IP.total_len is
not lower than m_len(m) + 14? (there is a trap here)

When RTE_PTYPE_IPv4 is set does it mean that (IP.flags & 1) is 0?

When RTE_PTYPE_IPv4 is set does it mean that IP.offset is lower
than 65528?

When RTE_PTYPE_IPv4 is set, can the packet be a fragment?

When RTE_PTYPE_IPv4 is set does it mean that there is no options?

Any condition on source/dest address?


The same questions (but adapted to the protocol) could be asked for
any packet type, that was just an example.

>> - remove similar things in ol_flags to avoid having a redundant API.
> 
> Yes, when all i40e/ixgbe/igb PMDs done, the related IP header offload should be removed.
>  I just changed for i40e, there still are igb&ixgbe need to be changed in DPDK2.0, so we can't remove the IP ol_flags now.

How can an application deal with 2 different APIs ?
The application should work with any driver. It can have a i40e
interface and an ixgbe interface at the same time.


Regards,
Olivier

  reply	other threads:[~2014-11-21 13:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18  7:37 [dpdk-dev] [PATCH 0/4] Translate packet types for i40e Jijiang Liu
2014-11-18  7:37 ` [dpdk-dev] [PATCH 1/4] rte_mbuf:add packet types Jijiang Liu
2014-11-19 10:38   ` Olivier MATZ
2014-11-21 12:26     ` Liu, Jijiang
2014-11-21 13:25       ` Olivier MATZ [this message]
2014-11-18  7:37 ` [dpdk-dev] [PATCH 2/4] rte_mbuf:remove tunneling IP offload flags Jijiang Liu
2014-11-18  7:37 ` [dpdk-dev] [PATCH 3/4] i40e:translate i40e packet types Jijiang Liu
2014-11-18  7:37 ` [dpdk-dev] [PATCH 4/4] testpmd:application changes Jijiang Liu
2014-11-18 11:33 ` [dpdk-dev] [PATCH 0/4] Translate packet types for i40e Ananyev, Konstantin
2014-11-18 13:08   ` Bruce Richardson
2014-11-18 15:29     ` Ananyev, Konstantin
2014-11-19  3:52       ` Liu, Jijiang
2014-11-19  9:47         ` Ananyev, Konstantin
2014-11-18 14:12   ` Zhang, Helin
2014-11-18 15:26     ` Ananyev, Konstantin
2014-11-18 15:55       ` Ananyev, Konstantin
2014-11-19  0:29       ` Zhang, Helin

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=546F3D52.3070300@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jijiang.liu@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).