All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hu, Jiayu" <jiayu.hu@intel.com>
To: "Kavanagh, Mark B" <mark.b.kavanagh@intel.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Tan, Jianfeng" <jianfeng.tan@intel.com>
Subject: Re: [PATCH v3 2/5] gso: add TCP/IPv4 GSO support
Date: Thu, 14 Sep 2017 09:45:49 +0000	[thread overview]
Message-ID: <ED946F0BEFE0A141B63BABBD629A2A9B387D5058@SHSMSX151.ccr.corp.intel.com> (raw)
In-Reply-To: <DC5AD7FA266D86499789B1BCAEC715F8C31BA880@irsmsx105.ger.corp.intel.com>

Hi Mark,

> -----Original Message-----
> From: Kavanagh, Mark B
> Sent: Thursday, September 14, 2017 4:52 PM
> To: Hu, Jiayu <jiayu.hu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Cc: dev@dpdk.org; Tan, Jianfeng <jianfeng.tan@intel.com>
> Subject: RE: [PATCH v3 2/5] gso: add TCP/IPv4 GSO support
> 
> >From: Hu, Jiayu
> >Sent: Thursday, September 14, 2017 7:07 AM
> >To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> >Cc: dev@dpdk.org; Kavanagh, Mark B <mark.b.kavanagh@intel.com>; Tan,
> Jianfeng
> ><jianfeng.tan@intel.com>
> >Subject: Re: [PATCH v3 2/5] gso: add TCP/IPv4 GSO support
> >
> >Hi Konstantin,
> >
> >On Thu, Sep 14, 2017 at 06:10:37AM +0800, Ananyev, Konstantin wrote:
> >>
> >> Hi Jiayu,
> >>
> >> > >
> >> > >
> >> > > > -----Original Message-----
> >> > > > From: Ananyev, Konstantin
> >> > > > Sent: Tuesday, September 12, 2017 12:18 PM
> >> > > > To: Hu, Jiayu <jiayu.hu@intel.com>; dev@dpdk.org
> >> > > > Cc: Kavanagh, Mark B <mark.b.kavanagh@intel.com>; Tan, Jianfeng
> ><jianfeng.tan@intel.com>
> >> > > > Subject: RE: [PATCH v3 2/5] gso: add TCP/IPv4 GSO support
> >> > > >
> >> > > > > result, when all of its GSOed segments are freed, the packet is
> >freed
> >> > > > > automatically.
> >> > > > > diff --git a/lib/librte_gso/rte_gso.c b/lib/librte_gso/rte_gso.c
> >> > > > > index dda50ee..95f6ea6 100644
> >> > > > > --- a/lib/librte_gso/rte_gso.c
> >> > > > > +++ b/lib/librte_gso/rte_gso.c
> >> > > > > @@ -33,18 +33,53 @@
> >> > > > >
> >> > > > >  #include <errno.h>
> >> > > > >
> >> > > > > +#include <rte_log.h>
> >> > > > > +
> >> > > > >  #include "rte_gso.h"
> >> > > > > +#include "gso_common.h"
> >> > > > > +#include "gso_tcp4.h"
> >> > > > >
> >> > > > >  int
> >> > > > >  rte_gso_segment(struct rte_mbuf *pkt,
> >> > > > > -		struct rte_gso_ctx gso_ctx __rte_unused,
> >> > > > > +		struct rte_gso_ctx gso_ctx,
> >> > > > >  		struct rte_mbuf **pkts_out,
> >> > > > >  		uint16_t nb_pkts_out)
> >> > > > >  {
> >> > > > > +	struct rte_mempool *direct_pool, *indirect_pool;
> >> > > > > +	struct rte_mbuf *pkt_seg;
> >> > > > > +	uint16_t gso_size;
> >> > > > > +	uint8_t ipid_delta;
> >> > > > > +	int ret = 1;
> >> > > > > +
> >> > > > >  	if (pkt == NULL || pkts_out == NULL || nb_pkts_out < 1)
> >> > > > >  		return -EINVAL;
> >> > > > >
> >> > > > > -	pkts_out[0] = pkt;
> >> > > > > +	if (gso_ctx.gso_size >= pkt->pkt_len ||
> >> > > > > +			(pkt->packet_type & gso_ctx.gso_types) !=
> >> > > > > +			pkt->packet_type) {
> >> > > > > +		pkts_out[0] = pkt;
> >> > > > > +		return ret;
> >> > > > > +	}
> >> > > > > +
> >> > > > > +	direct_pool = gso_ctx.direct_pool;
> >> > > > > +	indirect_pool = gso_ctx.indirect_pool;
> >> > > > > +	gso_size = gso_ctx.gso_size;
> >> > > > > +	ipid_delta = gso_ctx.ipid_flag == RTE_GSO_IPID_INCREASE;
> >> > > > > +
> >> > > > > +	if (is_ipv4_tcp(pkt->packet_type)) {
> >> > > >
> >> > > > Probably we need here:
> >> > > > If (is_ipv4_tcp(pkt->packet_type)  && (gso_ctx->gso_types &
> >DEV_TX_OFFLOAD_TCP_TSO) != 0) {...
> >> > >
> >> > > Sorry, actually it probably should be:
> >> > > If (pkt->ol_flags & (PKT_TX_TCP_SEG | PKT_TX_IPV4) == PKT_TX_IPV4
> &&
> >> > >       (gso_ctx->gso_types & DEV_TX_OFFLOAD_TCP_TSO) != 0) {...
> >> >
> >> > I don't quite understand why the GSO library should be aware if the TSO
> >> > flag is set or not. Applications can query device TSO capability before
> >> > they call the GSO library. Do I misundertsand anything?
> >> >
> >> > Additionally, we don't need to check if the packet is a TCP/IPv4 packet
> >here?
> >>
> >> Well, right now  PMD we doesn't rely on ptype to figure out what type of
> >packet and
> >> what TX offload have to be performed.
> >> Instead it looks at TX part of ol_flags, and
> >> My thought was that as what we doing is actually TSO in SW, it would be
> good
> >> to use the same API here too.
> >> Also with that approach, by setting ol_flags properly user can use the
> same
> >gso_ctx and still
> >> specify what segmentation to perform on a per-packet basis.
> >>
> >> Alternative way is to rely on ptype to distinguish should segmentation be
> >performed on that package or not.
> >> The only advantage I see here is that if someone would like to add GSO
> for
> >some new protocol,
> >> he wouldn't need to introduce new TX flag value for mbuf.ol_flags.
> >> Though he still would need to update TX_OFFLOAD_* capabilities and
> probably
> >packet_type definitions.
> >>
> >> So from my perspective first variant (use HW TSO API) is more plausible.
> >> Wonder what is your and Mark opinions here?
> >
> >In the first choice, you mean:
> >the GSO library uses gso_ctx->gso_types and mbuf->ol_flags to call a
> specific
> >GSO
> >segmentation function (e.g. gso_tcp4_segment(), gso_tunnel_xxx()) for
> each
> >input packet.
> >Applications should parse the packet type, and set an exactly correct
> >DEV_TX_OFFLOAD_*_TSO
> >flag to gso_types and ol_flags according to the packet type. That is, the
> >value of gso_types
> >is on a per-packet basis. Using gso_ctx->gso_types and mbuf->ol_flags at
> the
> >same time
> >is because that DEV_TX_OFFLOAD_*_TSO only tells tunnelling type and the
> inner
> >L4 type, and
> >we need to know L3 type by ol_flags. With this design, HW segmentation
> and SW
> >segmentation
> >are indeed consistent.
> >
> >If I understand it correctly, applications need to set 'ol_flags =
> >PKT_TX_IPV4' and
> >'gso_types = DEV_TX_OFFLOAD_VXLAN_TNL_TSO' for a
> >"ether+ipv4+udp+vxlan+ether+ipv4+
> >tcp+payload" packet. But PKT_TX_IPV4 just present the inner L3 type for
> >tunneled packet.
> >How about the outer L3 type? Always assume the inner and the outer L3
> type are
> >the same?
> 
> Hi Jiayu,
> 
> If I'm not mistaken, I think what Konstantin is suggesting is as follows:
> 
> - The DEV_TX_OFFLOAD_*_TSO flags are currently used to describe a NIC's
> TSO capabilities; the GSO capabilities may also be described using the same
> macros, to provide a consistent view of segmentation capabilities across the
> HW and SW implementations.

Yes, DEV_TX_OFFLOAD_*_TSO stored in gso_types are used to by applications
to tell the GSO library what GSO types are required. The GSO library uses ol_flags
to decide which segmentation function to use.

Thanks,
Jiayu
> 
> - As part of segmentation, it's still a case of checking the packet type, but
> then setting the appropriate ol_flags in the mbuf, which the GSO library can
> use to segment the packet.
> 
> Thanks,
> Mark
> 
> >
> >Jiayu
> >> Konstantin

  reply	other threads:[~2017-09-14  9:45 UTC|newest]

Thread overview: 157+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 14:15 [PATCH 0/5] Support TCP/IPv4, VxLAN and GRE GSO in DPDK Jiayu Hu
2017-08-24 14:15 ` [PATCH 1/5] lib: add Generic Segmentation Offload API framework Jiayu Hu
2017-08-30  1:38   ` Ananyev, Konstantin
2017-08-30  7:57     ` Jiayu Hu
2017-08-24 14:15 ` [PATCH 2/5] gso/lib: add TCP/IPv4 GSO support Jiayu Hu
2017-08-30  1:38   ` Ananyev, Konstantin
2017-08-30  2:55     ` Jiayu Hu
2017-08-30  9:25       ` Kavanagh, Mark B
2017-08-30  9:39         ` Ananyev, Konstantin
2017-08-30  9:59           ` Ananyev, Konstantin
2017-08-30 13:27             ` Kavanagh, Mark B
2017-08-30  9:03     ` Jiayu Hu
2017-09-04  3:31     ` Jiayu Hu
2017-09-04  9:54       ` Ananyev, Konstantin
2017-09-05  1:09         ` Hu, Jiayu
2017-09-11 13:04           ` Ananyev, Konstantin
2017-08-24 14:15 ` [PATCH 3/5] lib/gso: add VxLAN " Jiayu Hu
2017-08-24 14:15 ` [PATCH 4/5] lib/gso: add GRE " Jiayu Hu
2017-08-24 14:15 ` [PATCH 5/5] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Jiayu Hu
2017-08-30  1:37 ` [PATCH 0/5] Support TCP/IPv4, VxLAN and GRE GSO in DPDK Ananyev, Konstantin
2017-08-30  7:36   ` Jiayu Hu
2017-08-30 10:49     ` Ananyev, Konstantin
2017-08-30 13:32       ` Kavanagh, Mark B
2017-09-05  7:57 ` [PATCH v2 " Jiayu Hu
2017-09-05  7:57   ` [PATCH v2 1/5] gso: add Generic Segmentation Offload API framework Jiayu Hu
2017-09-05  7:57   ` [PATCH v2 2/5] gso: add TCP/IPv4 GSO support Jiayu Hu
2017-09-05  7:57   ` [PATCH v2 3/5] gso: add VxLAN " Jiayu Hu
2017-09-05  7:57   ` [PATCH v2 4/5] gso: add GRE " Jiayu Hu
2017-09-05  7:57   ` [PATCH v2 5/5] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Jiayu Hu
2017-09-12  2:43   ` [PATCH v3 0/5] Support TCP/IPv4, VxLAN and GRE GSO in DPDK Jiayu Hu
2017-09-12  2:43     ` [PATCH v3 1/5] gso: add Generic Segmentation Offload API framework Jiayu Hu
2017-09-12 10:36       ` Ananyev, Konstantin
2017-09-13  2:11         ` Jiayu Hu
2017-09-14 18:33       ` Ferruh Yigit
2017-09-15  1:12         ` Hu, Jiayu
2017-09-12  2:43     ` [PATCH v3 2/5] gso: add TCP/IPv4 GSO support Jiayu Hu
2017-09-12 11:17       ` Ananyev, Konstantin
2017-09-13  2:48         ` Jiayu Hu
2017-09-13  9:38           ` Ananyev, Konstantin
2017-09-13 10:23             ` Hu, Jiayu
2017-09-13 14:52             ` Kavanagh, Mark B
2017-09-13 15:13               ` Ananyev, Konstantin
2017-09-14  0:59                 ` Hu, Jiayu
2017-09-14  8:35                   ` Kavanagh, Mark B
2017-09-14  8:39                     ` Ananyev, Konstantin
2017-09-14  9:00                       ` Kavanagh, Mark B
2017-09-14  9:10                         ` Ananyev, Konstantin
2017-09-14  9:35                           ` Kavanagh, Mark B
2017-09-12 14:17       ` Ananyev, Konstantin
2017-09-13 10:44         ` Jiayu Hu
2017-09-13 22:10           ` Ananyev, Konstantin
2017-09-14  6:07             ` Jiayu Hu
2017-09-14  8:47               ` Ananyev, Konstantin
2017-09-14  9:29                 ` Hu, Jiayu
2017-09-14  9:35                   ` Ananyev, Konstantin
2017-09-14 10:01                     ` Hu, Jiayu
2017-09-14 15:42                       ` Kavanagh, Mark B
2017-09-14 18:38                         ` Ananyev, Konstantin
2017-09-15  7:54                           ` Hu, Jiayu
2017-09-15  8:15                             ` Ananyev, Konstantin
2017-09-15  8:17                             ` Ananyev, Konstantin
2017-09-15  8:38                               ` Hu, Jiayu
2017-09-14  8:51               ` Kavanagh, Mark B
2017-09-14  9:45                 ` Hu, Jiayu [this message]
2017-09-12  2:43     ` [PATCH v3 3/5] gso: add VxLAN " Jiayu Hu
2017-09-12  2:43     ` [PATCH v3 4/5] gso: add GRE " Jiayu Hu
2017-09-12  2:43     ` [PATCH v3 5/5] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Jiayu Hu
2017-09-14 18:33       ` Ferruh Yigit
2017-09-15  1:13         ` Hu, Jiayu
2017-09-19  7:32     ` [PATCH v4 0/5] Support TCP/IPv4, VxLAN and GRE GSO in DPDK Jiayu Hu
2017-09-19  7:32       ` [PATCH v4 1/5] gso: add Generic Segmentation Offload API framework Jiayu Hu
2017-09-19  7:32       ` [PATCH v4 2/5] gso: add TCP/IPv4 GSO support Jiayu Hu
2017-09-20  7:03         ` Yao, Lei A
2017-09-19  7:32       ` [PATCH v4 3/5] gso: add VxLAN " Jiayu Hu
2017-09-20  3:11         ` Tan, Jianfeng
2017-09-20  3:17           ` Hu, Jiayu
2017-09-19  7:32       ` [PATCH v4 4/5] gso: add GRE " Jiayu Hu
2017-09-20  2:53         ` Tan, Jianfeng
2017-09-20  6:01           ` Hu, Jiayu
2017-09-19  7:32       ` [PATCH v4 5/5] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Jiayu Hu
2017-09-28 22:13       ` [PATCH v5 0/6] Support TCP/IPv4, VxLAN and GRE GSO in DPDK Mark Kavanagh
2017-10-02 16:45         ` [PATCH v6 0/6] Support TCP/IPv4, VxLAN, " Mark Kavanagh
2017-10-02 16:45           ` [PATCH v6 1/6] gso: add Generic Segmentation Offload API framework Mark Kavanagh
2017-10-04 13:11             ` Ananyev, Konstantin
2017-10-04 13:21               ` Kavanagh, Mark B
2017-10-02 16:45           ` [PATCH v6 2/6] gso: add TCP/IPv4 GSO support Mark Kavanagh
2017-10-04 13:32             ` Ananyev, Konstantin
2017-10-04 14:30               ` Kavanagh, Mark B
2017-10-04 14:49                 ` Ananyev, Konstantin
2017-10-04 14:59                   ` Kavanagh, Mark B
2017-10-04 13:35             ` Ananyev, Konstantin
2017-10-04 14:22               ` Kavanagh, Mark B
2017-10-02 16:45           ` [PATCH v6 3/6] gso: add VxLAN " Mark Kavanagh
2017-10-04 14:12             ` Ananyev, Konstantin
2017-10-04 14:35               ` Kavanagh, Mark B
2017-10-04 16:13               ` Kavanagh, Mark B
2017-10-04 16:17                 ` Ananyev, Konstantin
2017-10-02 16:45           ` [PATCH v6 4/6] gso: add GRE " Mark Kavanagh
2017-10-04 14:15             ` Ananyev, Konstantin
2017-10-04 14:36               ` Kavanagh, Mark B
2017-10-02 16:45           ` [PATCH v6 5/6] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Mark Kavanagh
2017-10-04 15:08             ` Ananyev, Konstantin
2017-10-04 16:23               ` Kavanagh, Mark B
2017-10-04 16:26                 ` Ananyev, Konstantin
2017-10-04 16:51                   ` Kavanagh, Mark B
2017-10-02 16:45           ` [PATCH v6 6/6] doc: add GSO programmer's guide Mark Kavanagh
2017-10-04 13:51             ` Mcnamara, John
2017-10-05 11:02           ` [PATCH v7 0/6] Support TCP/IPv4, VxLAN, and GRE GSO in DPDK Mark Kavanagh
2017-10-05 11:02             ` [PATCH v7 1/6] gso: add Generic Segmentation Offload API framework Mark Kavanagh
2017-10-05 11:02             ` [PATCH v7 2/6] gso: add TCP/IPv4 GSO support Mark Kavanagh
2017-10-05 11:02             ` [PATCH v7 3/6] gso: add VxLAN " Mark Kavanagh
2017-10-05 11:02             ` [PATCH v7 4/6] gso: add GRE " Mark Kavanagh
2017-10-05 11:02             ` [PATCH v7 5/6] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Mark Kavanagh
2017-10-05 11:02             ` [PATCH v7 6/6] doc: add GSO programmer's guide Mark Kavanagh
2017-10-05 13:22             ` [PATCH v7 0/6] Support TCP/IPv4, VxLAN, and GRE GSO in DPDK Ananyev, Konstantin
2017-10-05 14:39               ` Kavanagh, Mark B
2017-10-05 15:43             ` [PATCH v8 " Mark Kavanagh
2017-10-05 17:12               ` Ananyev, Konstantin
2017-10-05 20:16                 ` Kavanagh, Mark B
2017-10-05 20:36               ` [PATCH v9 " Mark Kavanagh
2017-10-05 22:24                 ` Ananyev, Konstantin
2017-10-06  8:24                   ` FW: " Kavanagh, Mark B
2017-10-06 10:35                   ` Kavanagh, Mark B
2017-10-06 23:32                 ` Ferruh Yigit
2017-10-06 23:34                   ` Ferruh Yigit
2017-10-07 14:56                 ` [PATCH v10 " Jiayu Hu
2017-10-07 14:56                   ` [PATCH v10 1/6] gso: add Generic Segmentation Offload API framework Jiayu Hu
2017-10-07 14:56                   ` [PATCH v10 2/6] gso: add TCP/IPv4 GSO support Jiayu Hu
2017-10-07 14:56                   ` [PATCH v10 3/6] gso: add VxLAN " Jiayu Hu
2017-10-07 14:56                   ` [PATCH v10 4/6] gso: add GRE " Jiayu Hu
2017-10-07 14:56                   ` [PATCH v10 5/6] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Jiayu Hu
2017-10-07 14:56                   ` [PATCH v10 6/6] doc: add GSO programmer's guide Jiayu Hu
2017-10-08  3:40                   ` [PATCH v10 0/6] Support TCP/IPv4, VxLAN, and GRE GSO in DPDK Ferruh Yigit
2017-10-05 20:36               ` [PATCH v9 1/6] gso: add Generic Segmentation Offload API framework Mark Kavanagh
2017-10-05 20:36               ` [PATCH v9 2/6] gso: add TCP/IPv4 GSO support Mark Kavanagh
2017-10-05 20:36               ` [PATCH v9 3/6] gso: add VxLAN " Mark Kavanagh
2017-10-05 20:36               ` [PATCH v9 4/6] gso: add GRE " Mark Kavanagh
2017-10-05 20:36               ` [PATCH v9 5/6] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Mark Kavanagh
2017-10-05 20:36               ` [PATCH v9 6/6] doc: add GSO programmer's guide Mark Kavanagh
2017-10-06 13:34                 ` Mcnamara, John
2017-10-06 13:41                   ` Kavanagh, Mark B
2017-10-05 15:43             ` [PATCH v8 1/6] gso: add Generic Segmentation Offload API framework Mark Kavanagh
2017-10-05 15:44             ` [PATCH v8 2/6] gso: add TCP/IPv4 GSO support Mark Kavanagh
2017-10-05 15:44             ` [PATCH v8 3/6] gso: add VxLAN " Mark Kavanagh
2017-10-05 15:44             ` [PATCH v8 4/6] gso: add GRE " Mark Kavanagh
2017-10-05 15:44             ` [PATCH v8 5/6] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Mark Kavanagh
2017-10-05 15:44             ` [PATCH v8 6/6] doc: add GSO programmer's guide Mark Kavanagh
2017-10-05 17:57               ` Mcnamara, John
2017-09-28 22:13       ` [PATCH v5 1/6] gso: add Generic Segmentation Offload API framework Mark Kavanagh
2017-09-28 22:13       ` [PATCH v5 2/6] gso: add TCP/IPv4 GSO support Mark Kavanagh
2017-09-29  3:12         ` Jiayu Hu
2017-09-29  9:05           ` Kavanagh, Mark B
2017-09-28 22:13       ` [PATCH v5 3/6] gso: add VxLAN " Mark Kavanagh
2017-09-28 22:13       ` [PATCH v5 4/6] gso: add GRE " Mark Kavanagh
2017-09-28 22:13       ` [PATCH v5 5/6] app/testpmd: enable TCP/IPv4, VxLAN and GRE GSO Mark Kavanagh
2017-09-28 22:13       ` [PATCH v5 6/6] doc: add GSO programmer's guide Mark Kavanagh
2017-09-28 22:18       ` [PATCH v5 2/6] gso: add TCP/IPv4 GSO support Mark Kavanagh

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=ED946F0BEFE0A141B63BABBD629A2A9B387D5058@SHSMSX151.ccr.corp.intel.com \
    --to=jiayu.hu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=mark.b.kavanagh@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 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.