From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Gregory Etelson <getelson@nvidia.com>, <dev@dpdk.org>,
<viacheslavo@nvidia.com>
Subject: Re: [dpdk-dev] [PATCH] doc: add flex item API examples
Date: Fri, 19 Nov 2021 17:08:21 +0000 [thread overview]
Message-ID: <857beced-415e-221c-60ae-775185174bda@intel.com> (raw)
In-Reply-To: <20211110093841.32153-1-getelson@nvidia.com>
On 11/10/2021 9:38 AM, Gregory Etelson wrote:
> Demonstrate flex item API usage on known network protocols.
>
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
<...>
> +* Match Geneve basic header
> +
> + .. code-block:: c
> + :linenos:
> +
> + const struct geneve_hdr geneve_basic_header_spec = {
> + .ver = 0,
> + .opt_len = 0,
> + };
> + const struct geneve_hdr geneve_basic_header_mask = {
> + .ver = 3,
> + .opt_len = 0x3f,
> + };
> +
> + const struct rte_flow_item_flex geneve_basic_header_flex_spec = {
> + .handle = geneve_flex_handle,
> + .length = sizeof(geneve_basic_header_spec),
> + .pattern = &geneve_basic_header_spec
> + };
> +
> + const struct rte_flow_item_flex geneve_basic_header_flex_mask = {
> + .handle = geneve_flex_handle,
> + .length = sizeof(geneve_basic_header_mask),
> + .pattern = &geneve_basic_header_mask
> + };
> +
> + const struct rte_flow_item geneve_basic_header_flow_item = {
> + .type = RTE_FLOW_ITEM_TYPE_FLEX,
> + .spec = (const void *)&geneve_basic_header_flex_spec,
> + .maks = (const void *)&geneve_basic_header_flex_mask,
s/maks/mask/
> + };
> +
> +* Match if the first option class is Open vSwitch
> +
> + .. code-block:: c
> + :linenos:
> +
> + const struct geneve_option_hdr geneve_ovs_opt_spec = {
> + .class = rte_cpu_to_be16(0x0101),
> + };
> +
> + const struct geneve_option_hdr geneve_ovs_opt_mask = {
> + .class = 0xffff,
> + };
> +
> + const struct geneve_hdr geneve_hdr_with_ovs_spec = {
> + .ver = 0,
> + .options = (const unsigned long *)&geneve_ovs_opt_spec
> + };
> +
> + const struct geneve_hdr geneve_hdr_with_ovs_mask = {
> + .ver = 3,
> + .options = (const unsigned long *)&geneve_ovs_opt_mask
> + };
> +
> + const struct rte_flow_item_flex geneve_flex_spec = {
> + .handle = geneve_flex_handle,
> + .length = sizeof(geneve_hdr_with_ovs_spec) + sizeof(geneve_ovs_opt_spec),
> + .pattern = &geneve_hdr_with_ovs_spec
> + };
> +
> + const struct rte_flow_item_flex geneve_flex_mask = {
> + .handle = geneve_flex_handle,
> + .length = sizeof(geneve_hdr_with_ovs_mask) + sizeof(geneve_ovs_opt_mask),
> + .pattern = &geneve_hdr_with_ovs_mask
> + };
> +
> + const struct rte_flow_item geneve_vni_flow_item = {
> + .type = RTE_FLOW_ITEM_TYPE_FLEX,
> + .spec = (const void *)&geneve_flex_spec,
> + .maks = (const void *)&geneve_flex_mask,
ditto
next prev parent reply other threads:[~2021-11-19 17:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 9:38 Gregory Etelson
2021-11-19 17:08 ` Ferruh Yigit [this message]
2021-11-21 8:20 ` Gregory Etelson
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=857beced-415e-221c-60ae-775185174bda@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=getelson@nvidia.com \
--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
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).