DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Tan, Jianfeng" <jianfeng.tan@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas.monjalon@6wind.com" <thomas.monjalon@6wind.com>,
	"De Lara Guarch,  Pablo" <pablo.de.lara.guarch@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"Zhang, Helin" <helin.zhang@intel.com>,
	"Tao, Zhe" <zhe.tao@intel.com>
Subject: Re: [dpdk-dev] [PATCH v4 3/3] app/testpmd: fix Tx offload on tunneling packet
Date: Wed, 21 Sep 2016 15:47:40 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772583F0B9C94@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <312c9e7b-03eb-6b77-7d2e-0d984d337980@intel.com>


Hi Jianfeng,

> 
> Hi Konstantin,
> 
> 
> On 9/19/2016 8:09 PM, Ananyev, Konstantin wrote:
> > Hi Jainfeng,
> >
> >> -----Original Message-----
> >> From: Tan, Jianfeng
> >> Sent: Monday, August 1, 2016 4:57 AM
> >> To: dev@dpdk.org
> >> Cc: thomas.monjalon@6wind.com; De Lara Guarch, Pablo
> >> <pablo.de.lara.guarch@intel.com>; Ananyev, Konstantin
> >> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> >> Zhang, Helin <helin.zhang@intel.com>; Tan, Jianfeng
> >> <jianfeng.tan@intel.com>; Tao, Zhe <zhe.tao@intel.com>
> >> Subject: [PATCH v4 3/3] app/testpmd: fix Tx offload on tunneling
> >> packet
> >>
> >> Tx offload on tunneling packet now requires applications to correctly
> >> set tunneling type. Without setting it, i40e driver does not parse
> >> tunneling parameters. Besides that, add a check to see if NIC supports TSO on tunneling packet when executing "csum
> parse_tunnel on _port"
> >> after "tso set _size _port" or the other way around.
> >>
> >> Fixes: b51c47536a9e ("app/testpmd: support TSO in checksum forward
> >> engine")
> >>
> >> Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> >> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
> >> ---
> >>   app/test-pmd/cmdline.c  | 42 ++++++++++++++++++++++++++++++++++++------
> >>   app/test-pmd/csumonly.c | 37 +++++++++++++++++++++++++++++--------
> >>   2 files changed, 65 insertions(+), 14 deletions(-)
> >>
> >> [...]
> >>
> >> @@ -745,7 +762,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
> >>   		 * processed in hardware. */
> >>   		if (info.is_tunnel == 1) {
> >>   			ol_flags |= process_outer_cksums(outer_l3_hdr, &info,
> >> -				testpmd_ol_flags);
> >> +				testpmd_ol_flags, ol_flags & PKT_TX_TCP_SEG);
> >>   		}
> >>
> >>   		/* step 4: fill the mbuf meta data (flags and header lengths) */
> >> @@ -806,6 +823,10 @@
> >
> > It was a while since I looked a t it closely, but shouldn't you also update step 4 below:
> >
> > if (info.is_tunnel == 1) {
> >                          if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {
> >                                  m->outer_l2_len = info.outer_l2_len;
> >                                  m->outer_l3_len = info.outer_l3_len;
> >                                  m->l2_len = info.l2_len;
> >                                  m->l3_len = info.l3_len;
> >                                  m->l4_len = info.l4_len;
> >                          }
> >                          else {
> >                                  /* if there is a outer UDP cksum
> >                                     processed in sw and the inner in hw,
> >                                     the outer checksum will be wrong as
> >                                     the payload will be modified by the
> >                                     hardware */
> >                                  m->l2_len = info.outer_l2_len +
> >                                          info.outer_l3_len + info.l2_len;
> >                                  m->l3_len = info.l3_len;
> >                                  m->l4_len = info.l4_len;
> >                          }
> >
> >
> > ?
> >
> > In particular shouldn't it be something like:
> > if ((testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) != 0 ||
> >        ((testmpd_ol_flags & TESTPMD_TX_OFFLOAD_PARSE_TUNNEL) != 0 &&
> > info.tso_segsz != 0)) { ....
> > ?
> 
> Sorry for late response, because I also take some time to refresh memory. And, you are right, I missed this corner case. After applying
> your way above, it works!
> 
> The case below settings in testpmd:
> $ set fwd csum
> $ csum parse_tunnel on 0
> $ tso set 800 0
> <keep outer-ip checksum offload is sw>

Great :)

> 
> And unfortunately, our previous verification is based on "outer-ip checksum offload is hw".
> 
> >
> > Another thought, might be it is worth to introduce new flag:
> > TESTPMD_TX_OFFLOAD_TSO_TUNNEL, and new command in cmdline.c, that would set/clear that flag.
> > Instead of trying to make assumptions does user wants tso for tunneled
> > packets based on 2 different things:
> > - enable/disable tso
> > - enable/disable tunneled packets parsing ?
> 
> Currently, if we do parse_tunnel is based on the command "csum parse_tunnel on/off <port>".
> If we add a command like "tso_tunnel set <length> <port>", it's a little duplicated with "tso set <length> <port>", and there is too
> much info to just set a flag like TESTPMD_TX_OFFLOAD_TSO_TUNNEL; If we add a command like "csum tunnel_tso on <port>", it also
> depends on "csum parse_tunnel on <port>" so that tunnel packets are parsed.

But I thought in some cases user might want to enable tunnel parsing, but do tso for non-tunneled packets only.
I.E.
 - enable tunnel parsing
- for non-tunneled packets do tso
- for tunneled packets don't do tso
My understanding that with current set commands/flags this is not possible, correct? 
Konstantin

> 
> As far as I can see, the new command will always have semantic overlapping with existing commands, because it indeed depends on
> the two different things.
> 
> Thanks,
> Jianfeng
> 
> >
> > Konstantin
> >

  reply	other threads:[~2016-09-21 15:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 20:59 [dpdk-dev] [PATCH v1] i40: fix the VXLAN TSO issue Zhe Tao
2016-07-06  5:38 ` Wu, Jingjing
2016-07-07  4:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
2016-07-07 10:01   ` Ananyev, Konstantin
2016-07-07 10:50   ` Ananyev, Konstantin
2016-07-07 12:24     ` Ananyev, Konstantin
2016-07-15 15:40       ` Bruce Richardson
2016-07-18  2:57       ` Zhe Tao
2016-07-18 11:56   ` [dpdk-dev] [PATCH v3] " Zhe Tao
2016-07-19 10:29     ` Ananyev, Konstantin
2016-07-26 12:22       ` Tan, Jianfeng
2016-07-29  7:11     ` Tan, Jianfeng
2016-07-29  8:45       ` Ananyev, Konstantin
2016-07-29 10:11         ` Tan, Jianfeng
2016-10-10  3:58   ` [dpdk-dev] [PATCH v2] " Wu, Jingjing
2016-10-10  4:14     ` Yuanhan Liu
2016-08-01  3:56 ` [dpdk-dev] [PATCH v4 0/3] Add TSO on tunneling packet Jianfeng Tan
2016-08-01  3:56   ` [dpdk-dev] [PATCH v4 1/3] mbuf: add Tx side tunneling type Jianfeng Tan
2016-08-01  3:56   ` [dpdk-dev] [PATCH v4 2/3] net/i40e: add TSO support on tunneling packet Jianfeng Tan
2016-08-01  3:56   ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: fix Tx offload " Jianfeng Tan
2016-09-19 12:09     ` Ananyev, Konstantin
2016-09-21 12:36       ` Tan, Jianfeng
2016-09-21 15:47         ` Ananyev, Konstantin [this message]
2016-09-22  1:29           ` Tan, Jianfeng
2016-09-22  9:15             ` Ananyev, Konstantin
     [not found]   ` <ED26CBA2FAD1BF48A8719AEF02201E364E5E09BC@SHSMSX103.ccr.corp.intel.com>
     [not found]     ` <2601191342CEEE43887BDE71AB97725836BA2698@irsmsx105.ger.corp.intel.com>
2016-09-27 17:29       ` [dpdk-dev] [PATCH v4 0/3] Add TSO " Ananyev, Konstantin
2016-09-27 17:52         ` Tan, Jianfeng
2016-09-27 19:47           ` Thomas Monjalon
2016-10-09 21:27         ` Thomas Monjalon
2016-09-26 13:48 ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: support tunneled TSO in csum fwd engine Jianfeng Tan
2016-09-27 17:25   ` Ananyev, Konstantin

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=2601191342CEEE43887BDE71AB9772583F0B9C94@irsmsx105.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jianfeng.tan@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=thomas.monjalon@6wind.com \
    --cc=zhe.tao@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).