DPDK patches and discussions
 help / color / mirror / Atom feed
From: Suanming Mou <suanmingm@nvidia.com>
To: Shiri Kuzin <shirik@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Slava Ovsiienko <viacheslavo@nvidia.com>,
	NBU-Contact-Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Ori Kam <orika@nvidia.com>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	"NBU-Contact-Thomas Monjalon" <thomas@monjalon.net>,
	Raslan Darawsheh <rasland@nvidia.com>
Subject: Re: [dpdk-dev] [PATCH v3 2/8] app/testpmd: add GENEVE option item support
Date: Fri, 8 Jan 2021 12:10:58 +0000
Message-ID: <MWHPR1201MB0189F484A7FF103CD037F49CC1AE0@MWHPR1201MB0189.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20210107083838.7355-3-shirik@nvidia.com>

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Shiri Kuzin
> Sent: Thursday, January 7, 2021 4:39 PM
> To: dev@dpdk.org
> Cc: Slava Ovsiienko <viacheslavo@nvidia.com>; NBU-Contact-Adrien Mazarguil
> <adrien.mazarguil@6wind.com>; Ori Kam <orika@nvidia.com>;
> ferruh.yigit@intel.com; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [dpdk-dev] [PATCH v3 2/8] app/testpmd: add GENEVE option item
> support
> 
> From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> The patch adds the GENEVE option rte flow item support to command line
> interpreter. The flow command with GENEVE option items looks like:
> 
>   flow create 0 ingress pattern eth / ipv4 / udp / geneve vni is 100 /
>        geneve-opt class is 99 length is 1 type is 0 data is 0x669988 /
>        end actions drop / end
> 
> The option length should be specified in 32-bit words, this value specifies the
> length of the data pattern/mask arrays (should be multiplied by sizeof(uint32_t)
> to be expressed in bytes. If match on the length itself is not needed the mask
> should be set to zero, in this case length is used to specify the pattern/mask
> array lengths only.
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  app/test-pmd/cmdline_flow.c                 | 102 ++++++++++++++++++--
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |   8 ++
>  2 files changed, 104 insertions(+), 6 deletions(-)
>

snip

>  	/* Output buffer is not necessarily NUL-terminated. */ @@ -7486,6
> +7558,9 @@ flow_item_default_mask(const struct rte_flow_item *item)
>  	case RTE_FLOW_ITEM_TYPE_GENEVE:
>  		mask = &rte_flow_item_geneve_mask;
>  		break;
> +	case RTE_FLOW_ITEM_TYPE_GENEVE_OPT:
> +		mask = &rte_flow_item_geneve_opt_mask;
> +		break;
>  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
>  		mask = &rte_flow_item_pppoe_proto_id_mask;
>  		break;
> @@ -7598,6 +7673,8 @@ cmd_set_raw_parsed(const struct buffer *in)
>  	/* process hdr from upper layer to low layer (L3/L4 -> L2). */
>  	data_tail = data + ACTION_RAW_ENCAP_MAX_DATA;
>  	for (i = n - 1 ; i >= 0; --i) {
> +		const struct rte_flow_item_geneve_opt *opt;
> +
>  		item = in->args.vc.pattern + i;
>  		if (item->spec == NULL)
>  			item->spec = flow_item_default_mask(item); @@ -
> 7650,6 +7727,19 @@ cmd_set_raw_parsed(const struct buffer *in)
>  		case RTE_FLOW_ITEM_TYPE_GENEVE:
>  			size = sizeof(struct rte_geneve_hdr);
>  			break;
> +		case RTE_FLOW_ITEM_TYPE_GENEVE_OPT:
> +			opt = (const struct rte_flow_item_geneve_opt *)
> +								item->spec;
> +			size = sizeof(struct rte_flow_item_geneve_opt) -
> +			       sizeof(opt->data);

If I understand correctly, the potential here is to calculate the geneve option size, right?
Have we confirmed the struct is well aligned for all arch, and will not be aligned to other size?
Or is it better to use "offsetof" here?

> +			if (opt->option_len && opt->data) {
> +				*total_size += opt->option_len *
> +					       sizeof(uint32_t);
> +				rte_memcpy(data_tail - (*total_size),
> +					   opt->data,
> +					   opt->option_len * sizeof(uint32_t));
> +			}
> +			break;
>  		case RTE_FLOW_ITEM_TYPE_L2TPV3OIP:
>  			size = sizeof(rte_be32_t);
>  			proto = 0x73;
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index 9be450066e..37278d31d6 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -3680,6 +3680,14 @@ This section lists supported pattern items and their
> attributes, if any.
>    - ``vni {unsigned}``: virtual network identifier.
>    - ``protocol {unsigned}``: protocol type.
> 
> +- ``geneve-opt``: match GENEVE header option.
> +
> +  - ``class {unsigned}``: GENEVE option class.
> +  - ``type {unsigned}``: GENEVE option type.
> +  - ``length {unsigned}``: GENEVE option length in 32-bit words.
> +  - ``data {hex string}``: GENEVE option data, the legnt is defined by
> +    ``length`` field
> +
>  - ``vxlan-gpe``: match VXLAN-GPE header.
> 
>    - ``vni {unsigned}``: VXLAN-GPE identifier.
> --
> 2.21.0


  reply	other threads:[~2021-01-08 12:11 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210105175358-16712-1-shirik@nvidia.com>
2021-01-07  8:38 ` [dpdk-dev] [PATCH v3 0/8] ethdev: introduce GENEVE header TLV option item Shiri Kuzin
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 1/8] lib/librte_ethdev: " Shiri Kuzin
2021-01-10 10:58     ` Ori Kam
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 2/8] app/testpmd: add GENEVE option item support Shiri Kuzin
2021-01-08 12:10     ` Suanming Mou [this message]
2021-01-08 12:21       ` Slava Ovsiienko
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 3/8] common/mlx5: check GENEVE TLV support in HCA attributes Shiri Kuzin
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 4/8] common/mlx5: create GENEVE TLV option object with DevX Shiri Kuzin
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 5/8] net/mlx5: create GENEVE TLV option management Shiri Kuzin
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 6/8] net/mlx5: add GENEVE TLV option flow validation Shiri Kuzin
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 7/8] net/mlx5: add GENEVE TLV option flow translation Shiri Kuzin
2021-01-07  8:38   ` [dpdk-dev] [PATCH v3 8/8] doc: update GENEVE TLV option support Shiri Kuzin
2021-01-11 14:26   ` [dpdk-dev] [PATCH v4 0/8] ethdev: introduce GENEVE header TLV option item Shiri Kuzin
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 1/8] lib/librte_ethdev: " Shiri Kuzin
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 2/8] app/testpmd: add GENEVE option item support Shiri Kuzin
2021-01-11 15:44       ` Ori Kam
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 3/8] common/mlx5: check GENEVE TLV support in HCA attributes Shiri Kuzin
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 4/8] common/mlx5: create GENEVE TLV option object with DevX Shiri Kuzin
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 5/8] net/mlx5: create GENEVE TLV option management Shiri Kuzin
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 6/8] net/mlx5: add GENEVE TLV option flow validation Shiri Kuzin
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 7/8] net/mlx5: add GENEVE TLV option flow translation Shiri Kuzin
2021-01-11 14:26     ` [dpdk-dev] [PATCH v4 8/8] doc: update GENEVE TLV option support Shiri Kuzin
2021-01-12 14:02     ` [dpdk-dev] [PATCH v5 0/8] ethdev: introduce GENEVE header TLV option item Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 1/8] lib/librte_ethdev: " Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 2/8] app/testpmd: add GENEVE option item support Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 3/8] common/mlx5: check GENEVE TLV support in HCA attributes Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 4/8] common/mlx5: create GENEVE TLV option object with DevX Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 5/8] net/mlx5: create GENEVE TLV option management Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 6/8] net/mlx5: add GENEVE TLV option flow validation Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 7/8] net/mlx5: add GENEVE TLV option flow translation Shiri Kuzin
2021-01-12 14:02       ` [dpdk-dev] [PATCH v5 8/8] doc: update GENEVE TLV option support Shiri Kuzin
2021-01-14  7:07       ` [dpdk-dev] [PATCH v6 0/9] ethdev: introduce GENEVE header TLV option item Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 1/9] lib/librte_ethdev: " Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 2/9] app/testpmd: add GENEVE option item support Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 3/9] app/testpmd: add GENEVE header option length support Shiri Kuzin
2021-01-14 14:36           ` Ori Kam
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 4/9] common/mlx5: check GENEVE TLV support in HCA attributes Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 5/9] common/mlx5: create GENEVE TLV option object with DevX Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 6/9] net/mlx5: create GENEVE TLV option management Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 7/9] net/mlx5: add GENEVE TLV option flow validation Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 8/9] net/mlx5: add GENEVE TLV option flow translation Shiri Kuzin
2021-01-14  7:07         ` [dpdk-dev] [PATCH v6 9/9] doc: update GENEVE TLV option support Shiri Kuzin
2021-01-15  1:33         ` [dpdk-dev] [PATCH v6 0/9] ethdev: introduce GENEVE header TLV option item Ferruh Yigit
2021-01-17  9:19           ` Shiri Kuzin
2021-01-17 10:21         ` [dpdk-dev] [PATCH v7 " Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 1/9] lib/librte_ethdev: " Shiri Kuzin
2021-01-18 14:29             ` Ferruh Yigit
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 2/9] app/testpmd: add GENEVE option item support Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 3/9] app/testpmd: add GENEVE header option length support Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 4/9] common/mlx5: check GENEVE TLV support in HCA attributes Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 5/9] common/mlx5: create GENEVE TLV option object with DevX Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 6/9] net/mlx5: create GENEVE TLV option management Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 7/9] net/mlx5: add GENEVE TLV option flow validation Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 8/9] net/mlx5: add GENEVE TLV option flow translation Shiri Kuzin
2021-01-17 10:21           ` [dpdk-dev] [PATCH v7 9/9] doc: update GENEVE TLV option support Shiri Kuzin
2021-01-18 14:30           ` [dpdk-dev] [PATCH v7 0/9] ethdev: introduce GENEVE header TLV option item Ferruh Yigit
2021-01-18 14:34           ` Ferruh Yigit

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=MWHPR1201MB0189F484A7FF103CD037F49CC1AE0@MWHPR1201MB0189.namprd12.prod.outlook.com \
    --to=suanmingm@nvidia.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=shirik@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git