All of lore.kernel.org
 help / color / mirror / Atom feed
From: "didier.pallard" <didier.pallard-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH v4 3/3] mbuf:replace the inner_l2_len and the inner_l3_len fields
Date: Tue, 02 Dec 2014 15:53:29 +0100	[thread overview]
Message-ID: <547DD269.2080500@6wind.com> (raw)
In-Reply-To: <1417503172-18642-4-git-send-email-jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Hello,

On 12/02/2014 07:52 AM, Jijiang Liu wrote:
> Replace the inner_l2_len and the inner_l3_len field with the outer_l2_len and outer_l3_len field, and rework csum forward engine and i40e PMD due to  these changes.
>
> Signed-off-by: Jijiang Liu <jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
[...]
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -276,8 +276,8 @@ struct rte_mbuf {
>   			uint64_t tso_segsz:16; /**< TCP TSO segment size */
>   
>   			/* fields for TX offloading of tunnels */
> -			uint64_t inner_l3_len:9; /**< inner L3 (IP) Hdr Length. */
> -			uint64_t inner_l2_len:7; /**< inner L2 (MAC) Hdr Length. */
> +			uint64_t outer_l3_len:9; /**< Outer L3 (IP) Hdr Length. */
> +			uint64_t outer_l2_len:7; /**< Outer L2 (MAC) Hdr Length. */
>   
>   			/* uint64_t unused:8; */
>   		};

Sorry for entering lately this discussion, but i'm not convinced by the 
choice of outer_lx_len rather than inner_lx_len for new fields.
I agree with Olivier that new flags should only be related to the use of 
new fields, to maintain coherency with oldest implementations.
But from a stack point of view, i think it is better to have lx_len 
fields that target the outer layers, and to name new fields inner_lx_len.

Let's discuss the two possibilities.

1) outer_lx_len fields are introduced.
In this case, the stack should have knowledge that it is processing 
tunneled packets to use outer_lx_len rather than lx_len,
or stack should always use outer_lx_len packet and move those fields to 
lx_len packets if no tunneling occurs...
I think it will induce extra processing that does not seem to be really 
needed.

2) inner_lx_len fields are introduced.
In this case, the stack first uses lx_len fields. When packet should be 
tunneled, lx_len fields are moved to inner_lx_len fields.
Then the stack can process the outer layer and still use the lx_len fields.

For  example:
an eth/IP/TCP forged packet will look like this:

Ether/IP/UDP/xxx
   m->flags = IP_CKSUM
   m->l2_len = sizeof(ether)
   m->l3_len = sizeof(ip)
   m->l4_len = sizeof(udp)
   m->inner_l2_len = 0
   m->inner_l3_len = 0

When entering tunnel for example a VXLAN interface, lx_len will be moved 
to inner_lx_len

Ether/IP/UDP/xxx
   m->flags = INNER_IP_CKSUM
   m->l2_len = 0
   m->l3_len = 0
   m->l4_len = 0
   m->inner_l2_len = sizeof(ether)
   m->inner_l3_len = sizeof(ip)
  

once complete encapsulation is processed by the stack, the packet will 
look like

Ether/IP/UDP/VXLAN/Ether/IP/UDP/xxx
   m->flags = IP_CKSUM | INNER_IP_CKSUM
   m->l2_len = sizeof(ether)
   m->l3_len = sizeof(ip)
   m->l4_len = sizeof(udp)
   m->inner_l2_len = sizeof(ether) + sizeof (vxlan)
   m->inner_l3_len = sizeof(ip)


didier

  parent reply	other threads:[~2014-12-02 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02  6:52 [PATCH v4 0/3] i40e VXLAN TX checksum rework Jijiang Liu
     [not found] ` <1417503172-18642-1-git-send-email-jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-02  6:52   ` [PATCH v4 1/3] mbuf:redefine three TX ol_flags Jijiang Liu
2014-12-02  6:52   ` [PATCH v4 2/3] mbuf:add three TX ol_flags and repalce PKT_TX_VXLAN_CKSUM Jijiang Liu
2014-12-02  6:52   ` [PATCH v4 3/3] mbuf:replace the inner_l2_len and the inner_l3_len fields Jijiang Liu
     [not found]     ` <1417503172-18642-4-git-send-email-jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-02 14:53       ` didier.pallard [this message]
     [not found]         ` <547DD269.2080500-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-12-02 15:36           ` Ananyev, Konstantin
     [not found]             ` <2601191342CEEE43887BDE71AB977258213BC075-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-03  8:57               ` Olivier MATZ
     [not found]                 ` <547ED071.3080101-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-12-03 11:11                   ` Ananyev, Konstantin
     [not found]                     ` <2601191342CEEE43887BDE71AB977258213BC3D9-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-03 11:27                       ` Olivier MATZ

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=547DD269.2080500@6wind.com \
    --to=didier.pallard-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.