[dpdk-dev] [PATCH v3 1/4] ethdev: add more protocol support in flow API
Adrien Mazarguil
adrien.mazarguil at 6wind.com
Thu Apr 19 16:48:30 CEST 2018
On Mon, Apr 16, 2018 at 02:10:39PM +0800, Qi Zhang wrote:
> Add new protocol header match support as below
>
> RTE_FLOW_ITEM_TYPE_ARP_IPV4
> - matches an IPv4 ARP header
> RTE_FLOW_ITEM_TYPE_IPV6_EXT
> - matches an IPv6 extension header with any type.
> RTE_FLOW_ITEM_TYPE_ICMP6
> - matches an ICMPv6 header followed by any message body.
> RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS
> - matches an ICMPv6 header followed by network discovery
> neighbor solicitation.
> RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA
> - matches an ICMPv6 header followed by network discovery
> neighbor advertisement.
> RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_ETH_SLA
> - matches an ICMPv6 header followed by network discovery
> neighbor solicitation contains source Ethernet link-layer
> address option.
> RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_ETH_TLA
> - matches an ICMPv6 header followed by network discovery
> neighbor advertisement contains target Ethernet link-layer
> address option.
>
> Suggested-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
Beside a bunch of nits and typos, I think this patch is fine, please see
below.
> ---
> app/test-pmd/cmdline_flow.c | 224 ++++++++++++++++++++++++++
> app/test-pmd/config.c | 9 ++
> doc/guides/prog_guide/rte_flow.rst | 88 +++++++++++
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 34 ++++
> lib/librte_ether/rte_flow.h | 235 ++++++++++++++++++++++++++++
> 5 files changed, 590 insertions(+)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 59f3b3b57..7950b1b8d 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -150,6 +150,26 @@ enum index {
> ITEM_GENEVE,
> ITEM_GENEVE_VNI,
> ITEM_GENEVE_PROTO,
> + ITEM_ARP_IPV4,
> + ITEM_ARP_IPV4_SHA,
> + ITEM_ARP_IPV4_SIP,
> + ITEM_ARP_IPV4_THA,
> + ITEM_ARP_IPV4_TIP,
> + ITEM_IPV6_EXT,
> + ITEM_IPV6_EXT_NEXT_HDR,
> + ITEM_ICMP6,
> + ITEM_ICMP6_TYPE,
> + ITEM_ICMP6_CODE,
> + ITEM_ICMP6_ND_NS,
> + ITEM_ICMP6_ND_NS_TGT_ADDR,
> + ITEM_ICMP6_ND_NA,
> + ITEM_ICMP6_ND_NA_TGT_ADDR,
> + ITEM_ICMP6_ND_OPT_SLA_ETH,
> + ITEM_ICMP6_ND_OPT_SLA_ETH_TGT_ADDR,
> + ITEM_ICMP6_ND_OPT_SLA_ETH_SLL_ADDR,
> + ITEM_ICMP6_ND_OPT_TLA_ETH,
> + ITEM_ICMP6_ND_OPT_TLA_ETH_TGT_ADDR,
> + ITEM_ICMP6_ND_OPT_TLA_ETH_TLL_ADDR,
>
> /* Validate/create actions. */
> ACTIONS,
> @@ -436,6 +456,13 @@ static const enum index next_item[] = {
> ITEM_GTPC,
> ITEM_GTPU,
> ITEM_GENEVE,
> + ITEM_ARP_IPV4,
> + ITEM_IPV6_EXT,
> + ITEM_ICMP6,
> + ITEM_ICMP6_ND_NS,
> + ITEM_ICMP6_ND_NA,
> + ITEM_ICMP6_ND_OPT_SLA_ETH,
> + ITEM_ICMP6_ND_OPT_TLA_ETH,
> ZERO,
> };
>
> @@ -586,6 +613,47 @@ static const enum index item_geneve[] = {
> ZERO,
> };
>
> +static const enum index item_arp_ipv4[] = {
> + ITEM_ARP_IPV4_SHA,
> + ITEM_ARP_IPV4_SIP,
> + ITEM_ARP_IPV4_THA,
> + ITEM_ARP_IPV4_TIP,
> + ZERO,
> +};
> +
> +static const enum index item_ipv6_ext[] = {
> + ITEM_IPV6_EXT_NEXT_HDR,
> + ZERO,
> +};
> +
> +static const enum index item_icmp6[] = {
> + ITEM_ICMP6_TYPE,
> + ITEM_ICMP6_CODE,
> + ZERO,
> +};
> +
> +static const enum index item_icmp6_nd_ns[] = {
> + ITEM_ICMP6_ND_NS_TGT_ADDR,
> + ZERO,
> +};
> +
> +static const enum index item_icmp6_nd_na[] = {
> + ITEM_ICMP6_ND_NA_TGT_ADDR,
> + ZERO,
> +};
> +
> +static const enum index item_icmp6_nd_opt_sla_eth[] = {
> + ITEM_ICMP6_ND_OPT_SLA_ETH_TGT_ADDR,
> + ITEM_ICMP6_ND_OPT_SLA_ETH_SLL_ADDR,
> + ZERO,
> +};
> +
> +static const enum index item_icmp6_nd_opt_tla_eth[] = {
> + ITEM_ICMP6_ND_OPT_TLA_ETH_TGT_ADDR,
> + ITEM_ICMP6_ND_OPT_TLA_ETH_TLL_ADDR,
> + ZERO,
> +};
> +
> static const enum index next_action[] = {
> ACTION_END,
> ACTION_VOID,
> @@ -1473,6 +1541,162 @@ static const struct token token_list[] = {
> .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
> protocol)),
> },
> + [ITEM_ARP_IPV4] = {
> + .name = "arp",
> + .help = "match IPv4 ARP header",
> + .priv = PRIV_ITEM(ARP_IPV4,
> + sizeof(struct rte_flow_item_arp_ipv4)),
> + .next = NEXT(item_arp_ipv4),
> + .call = parse_vc,
> + },
> + [ITEM_ARP_IPV4_SHA] = {
> + .name = "sha",
> + .help = "sender hardware address",
> + .next = NEXT(item_arp_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_arp_ipv4,
> + arp_sha.addr_bytes)),
> + },
> + [ITEM_ARP_IPV4_SIP] = {
> + .name = "sip",
> + .help = "sender IP address",
> + .next = NEXT(item_arp_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_arp_ipv4,
> + arp_sip)),
> + },
> + [ITEM_ARP_IPV4_THA] = {
> + .name = "tha",
> + .help = "target hardware address",
> + .next = NEXT(item_arp_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_arp_ipv4,
> + arp_tha.addr_bytes)),
> + },
> + [ITEM_ARP_IPV4_TIP] = {
> + .name = "tip",
> + .help = "target IP address",
> + .next = NEXT(item_arp_ipv4, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_arp_ipv4,
> + arp_tip)),
> + },
> + [ITEM_IPV6_EXT] = {
> + .name = "ext",
> + .help = "match IPv6 extend header",
extend => extended
> + .priv = PRIV_ITEM(IPV6_EXT,
> + sizeof(struct rte_flow_item_ipv6_ext)),
> + .next = NEXT(item_ipv6_ext),
> + .call = parse_vc,
> + },
> + [ITEM_IPV6_EXT_NEXT_HDR] = {
> + .name = "next",
> + .help = "next header in IPv6 extend header",
> + .next = NEXT(item_ipv6_ext, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv6_ext,
> + next_hdr)),
> + },
> + [ITEM_ICMP6] = {
> + .name = "icmp6",
> + .help = "match ICMPv6 header",
> + .priv = PRIV_ITEM(ICMP, sizeof(struct rte_flow_item_icmp6)),
> + .next = NEXT(item_icmp6),
> + .call = parse_vc,
> + },
> + [ITEM_ICMP6_TYPE] = {
> + .name = "type",
> + .help = "ICMPv6 packet type",
> + .next = NEXT(item_icmp6, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6,
> + type)),
> + },
> + [ITEM_ICMP6_CODE] = {
> + .name = "code",
> + .help = "ICMPv6 packet code",
> + .next = NEXT(item_icmp6, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6,
> + code)),
> + },
> + [ITEM_ICMP6_ND_NS] = {
> + .name = "ns",
> + .help = "match neighbor solicitation over ICMPv6 ",
Extra space after "ICMPv6".
> + .priv = PRIV_ITEM(ICMP6_ND_NS,
> + sizeof(struct rte_flow_item_icmp6_nd_ns)),
> + .next = NEXT(item_icmp6_nd_ns),
> + .call = parse_vc,
> + },
> + [ITEM_ICMP6_ND_NS_TGT_ADDR] = {
> + .name = "tgt_addr",
> + .help = "target address of neighbor solicitation",
> + .next = NEXT(item_icmp6_nd_ns, NEXT_ENTRY(UNSIGNED),
> + item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6_nd_ns,
> + target_addr)),
> + },
> + [ITEM_ICMP6_ND_NA] = {
> + .name = "na",
> + .help = "match neighbor advertisement over ICMPv6 ",
> + .priv = PRIV_ITEM(ICMP6_ND_NA,
> + sizeof(struct rte_flow_item_icmp6_nd_na)),
> + .next = NEXT(item_icmp6_nd_na),
> + .call = parse_vc,
> + },
> + [ITEM_ICMP6_ND_NA_TGT_ADDR] = {
> + .name = "tgt_addr",
> + .help = "target address of neighbor advertisement",
> + .next = NEXT(item_icmp6_nd_na, NEXT_ENTRY(UNSIGNED),
> + item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6_nd_na,
> + target_addr)),
> + },
> + [ITEM_ICMP6_ND_OPT_SLA_ETH] = {
> + .name = "sla",
> + .help = "match source link-layer address over neighbor solicitation",
> + .priv = PRIV_ITEM(ICMP6_ND_OPT_SLA_ETH,
> + sizeof(struct rte_flow_item_icmp6_nd_opt_sla_eth)),
> + .next = NEXT(item_icmp6_nd_opt_sla_eth),
> + .call = parse_vc,
> + },
> + [ITEM_ICMP6_ND_OPT_SLA_ETH_TGT_ADDR] = {
> + .name = "tgt_addr",
> + .help = "target address of neighbor solicitation",
> + .next = NEXT(item_icmp6_nd_opt_sla_eth, NEXT_ENTRY(UNSIGNED),
> + item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(
> + struct rte_flow_item_icmp6_nd_opt_sla_eth,
> + target_addr)),
> + },
> + [ITEM_ICMP6_ND_OPT_SLA_ETH_SLL_ADDR] = {
> + .name = "sll_addr",
> + .help = "source link-layer address over neighbor solicitation",
> + .next = NEXT(item_icmp6_nd_opt_sla_eth, NEXT_ENTRY(UNSIGNED),
> + item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(
> + struct rte_flow_item_icmp6_nd_opt_sla_eth,
> + sll_addr)),
> + },
> + [ITEM_ICMP6_ND_OPT_TLA_ETH] = {
> + .name = "tla",
> + .help = "match target link-layer address over neighbor advertisement",
> + .priv = PRIV_ITEM(ICMP6_ND_OPT_TLA_ETH,
> + sizeof(struct rte_flow_item_icmp6_nd_opt_tla_eth)),
> + .next = NEXT(item_icmp6_nd_opt_tla_eth),
> + .call = parse_vc,
> + },
> + [ITEM_ICMP6_ND_OPT_TLA_ETH_TGT_ADDR] = {
> + .name = "tgt_addr",
> + .help = "target address of neighbor advertisement",
> + .next = NEXT(item_icmp6_nd_opt_tla_eth, NEXT_ENTRY(UNSIGNED),
> + item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(
> + struct rte_flow_item_icmp6_nd_opt_tla_eth,
> + target_addr)),
> + },
> + [ITEM_ICMP6_ND_OPT_TLA_ETH_TLL_ADDR] = {
> + .name = "tll_addr",
> + .help = "target link-layer address over neighbor advertisement",
> + .next = NEXT(item_icmp6_nd_opt_tla_eth, NEXT_ENTRY(UNSIGNED),
> + item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(
> + struct rte_flow_item_icmp6_nd_opt_tla_eth,
> + tll_addr)),
> + },
>
> /* Validate/create actions. */
> [ACTIONS] = {
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 4bb255c62..4a1af5c57 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -980,6 +980,15 @@ static const struct {
> MK_FLOW_ITEM(GTPC, sizeof(struct rte_flow_item_gtp)),
> MK_FLOW_ITEM(GTPU, sizeof(struct rte_flow_item_gtp)),
> MK_FLOW_ITEM(GENEVE, sizeof(struct rte_flow_item_geneve)),
> + MK_FLOW_ITEM(ARP_IPV4, sizeof(struct rte_flow_item_arp_ipv4)),
> + MK_FLOW_ITEM(IPV6_EXT, sizeof(struct rte_flow_item_ipv6_ext)),
> + MK_FLOW_ITEM(ICMP6, sizeof(struct rte_flow_item_icmp6)),
> + MK_FLOW_ITEM(ICMP6_ND_NS, sizeof(struct rte_flow_item_icmp6_nd_ns)),
> + MK_FLOW_ITEM(ICMP6_ND_NA, sizeof(struct rte_flow_item_icmp6_nd_na)),
> + MK_FLOW_ITEM(ICMP6_ND_OPT_SLA_ETH,
> + sizeof(struct rte_flow_item_icmp6_nd_opt_sla_eth)),
> + MK_FLOW_ITEM(ICMP6_ND_OPT_TLA_ETH,
> + sizeof(struct rte_flow_item_icmp6_nd_opt_tla_eth)),
> };
>
> /** Compute storage space needed by item specification. */
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 961943dda..99468bf60 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -992,6 +992,94 @@ Matches a GENEVE header.
> - ``rsvd1``: reserved, normally 0x00.
> - Default ``mask`` matches VNI only.
>
> +Item: ``ARP_IPV4``
> +^^^^^^^^^^^^^^^^^^
> +
> +Matches an IPv4 ARP header.
> +
> +- ``arp_hdr``: format of hardware address.
> +- ``arp_pro``: format of protocol address.
> +- ``arp_hln``: length of hardware address.
> +- ``arp_pln``: length of protocol address.
> +- ``arp_op``: ARP opcode.
> +- ``sha``: sender hardware address.
> +- ``sip``: sender IP address.
> +- ``tha``: target hardware address.
> +- ``tip``: target IP address.
> +- Default ``mask`` only matches sha, sip, tha, tip.
> +
> +Item: ``IPV6_EXT``
> +^^^^^^^^^^^^^^^^^^
> +
> +Matches an IPv6 Extension header with any type.
> +
> +- ``next_hdr``: protocol of next header.
> +- Default ``mask`` matches protocal of next header.
protocal => protocol
> +
> +Item: ``ICMP6``
> +^^^^^^^^^^^^^^^
> +
> +Matches an ICMPv6 header followed by any message body.
> +
> +- ``type``: ICMPv6 type.
> +- ``code``: ICMPv6 code.
> +- ``checksume``: ICMPv6 checksume.
checksume => checksum
> +- Default ``mask`` matches type and code only.
> +
> +Item: ``ICMP6_ND_NS``
> +^^^^^^^^^^^^^^^^^^^^^
> +
> +Matches an ICMPv6 header followed by network discvoery neighbor solicitation,
discvoery => discovery
> +
> +- ``type``: ICMPv6 type, normally 135.
> +- ``code``: ICMPv6 code, normally 0.
> +- ``checksume``: ICMPv6 checksume.
checksume => checksum
> +- ``reserved``: reserved, normally 0x00.
> +- ``tgt_addr``: target address of neighbor solicitation.
> +- Default ``mask`` matches target address only.
> +
> +Item: ``ICMP6_ND_NA``
> +^^^^^^^^^^^^^^^^^^^^^
> +
> +Matches an ICMPv6 header followed by network discvoery neighbor advertisement,
discvoery => discovery
> +
> +- ``type``: ICMPv6 type, normally 136.
> +- ``code``: ICMPv6 code, normally 0.
> +- ``checksume``: ICMPv6 checksume.
checksume => checksum
> +- ``rso_reserved``: route flag (1b), solicited flag (1b), override flag (1b),
> + reserved (29b).
> +- ``tgt_addr``: target address of neighbor advertisement.
> +- Default ``mask`` matches target address only.
> +
> +Item: ``ICMP6_ND_OPT_SLA_ETH``
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Matches an ICMPv6 header followed by network discvoery neighbor solicitation
discvoery => discovery
> +that contains source Ethernet link-layer address option.
> +
> +- ``type``: ICMPv6 type, normally 135.
> +- ``code``: ICMPv6 code, normally 0.
> +- ``checksume``: ICMPv6 checksume.
checksume => checksum
> +- ``reserved``: reserved, normally 0x00.
> +- ``tgt_addr``: target address of neighbor solicitation.
> +- ``sll_ADDR``: source Ethernet link-layer address.
> +- Default ``mask`` matches target address and source link-layer address only.
> +
> +Item: ``ICMP6_ND_OPT_TLA_ETH``
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Matches an ICMPv6 header followed by network discvoery neighbor advertisement.
discvoery => discovery
> +that contains target Ethernet link-layer address option.
> +
> +- ``type``: ICMPv6 type, normally 136.
> +- ``code``: ICMPv6 code, normally 0.
> +- ``checksume``: ICMPv6 checksume.
checksume => checksum
> +- ``rso_reserved``: route flag (1b), solicited flag (1b), override flag (1b),
> + reserved (29b).
> +- ``tgt_addr``: target address of neighbor advertisement.
> +- ``tll_ADDR``: target Ethernet link-layer address.
> +- Default ``mask`` matches target address and target link-layer address only.
> +
> Actions
> ~~~~~~~
>
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index a766ac795..12d78f10b 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -3305,6 +3305,40 @@ This section lists supported pattern items and their attributes, if any.
> - ``vni {unsigned}``: virtual network identifier.
> - ``protocol {unsigned}``: protocol type.
>
> +- ``arp``: match IPv4 arp header.
> +
> + - ``sha``: sender hardware address.
> + - ``sip``: sender IP address.
> + - ``tha``: target hardware address.
> + - ``tip``: target IP address.
> +
> +- ``ext``: match IPv6 extend header.
> +
> + - ``next {unsigned}``: protocol (next header).
> +
> +- ``icmp6``: match ICMPv6 header.
> +
> + - ``type {unsgined}``: ICMPv6 packet type.
unsgined => unsigned
> + - ``code {unsigned}``: ICMPv6 packet code.
> +
> +- ``ns``: match neighbor solicitation over ICMPv6.
> +
> + - ``tgt_addr {ipv6 address}``: target address of neighbor solicitation.
> +
> +- ``na``: match neighbor advertisement over ICMPv6.
> +
> + - ``tgt_addr {ipv6 address}``: target address of neighbor advertisement.
> +
> +- ``sla``: match source link-layer address over neighbor solicitation.
> +
> + - ``tgt_addr {ipv6 address}``: target address of neighbor solicitation.
> + - ``sll_addr {MAC-48}``: source link-layer address over neightbor solicitation.
neightbor => neighbor
> +
> +- ``tla``: match target link-layer address over neighbor advertisement.
> +
> + - ``tgt_addr {ipv6 address}``: target address of neighbor advertisement.
> + - ``tll_addr {MAC-48}``: target link-layer address over neightbor advertisement.
neightbor => neighbor
> +
> Actions list
> ^^^^^^^^^^^^
>
> diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
> index 56c733451..f84bbfda5 100644
> --- a/lib/librte_ether/rte_flow.h
> +++ b/lib/librte_ether/rte_flow.h
> @@ -323,6 +323,61 @@ enum rte_flow_item_type {
> * See struct rte_flow_item_geneve.
> */
> RTE_FLOW_ITEM_TYPE_GENEVE,
> +
> + /**
> + * Matches an IPv4 ARP header.
> + *
> + * See struct rte_flow_item_arp_ipv4.
> + */
> + RTE_FLOW_ITEM_TYPE_ARP_IPV4,
> +
> + /**
> + * Matches an IPv6 Extension header with any type.
> + *
> + * See struct rte_flow_item_ipv6_ext.
> + */
> + RTE_FLOW_ITEM_TYPE_IPV6_EXT,
> +
> + /**
> + * Matches an ICMPv6 header followed by any message body.
> + *
> + * See struct rte_flow_item_icmp6.
> + */
> + RTE_FLOW_ITEM_TYPE_ICMP6,
> +
> + /**
> + * Matches an ICMPv6 header followed by network discovery
> + * neighbor solicitation.
> + *
> + * See struct rte_flow_item_icmp6_nd_ns.
> + */
> + RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS,
> +
> + /**
> + * Matches an ICMPv6 header followed by network discovery
> + * neighbor advertisement.
> + *
> + * See struct rte_flow_item_icmp6_nd_na.
> + */
> + RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA,
> +
> + /**
> + * Matches an ICMPv6 header followed by network discovery neighbor
> + * solicitation that contains source Ethernet link-layer address
> + * option.
> + *
> + * See struct rte_flow_item_icmp6_nd_opt_sla_eth.
> + */
> + RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH,
> +
> + /**
> + * Matches an ICMPv6 header followed by network discovery neighbor
> + * advertisement that contains target Ethernet link-layer address
> + * option.
> + *
> + * See struct rte_flow_item_icmp6_nd_opt_tla_eth.
> + */
> + RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH,
> };
>
> /**
> @@ -815,6 +870,186 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
> #endif
>
> /**
> + * RTE_FLOW_ITEM_TYPE_ARP_IPV4
> + *
> + * Matches an IPv4 ARP header.
> + */
> +struct rte_flow_item_arp_ipv4 {
> + rte_be16_t arp_hrd; /**< format of hardware address. */
> + rte_be16_t arp_pro; /**< format of protocol address. */
> + uint8_t arp_hln; /**< length of hardware address. */
> + uint8_t arp_pln; /**< length of protocol address. */
> + rte_be16_t arp_op; /**< ARP opcode */
> + struct ether_addr arp_sha; /**< sender hardware address. */
> + rte_be32_t arp_sip; /**< sender IP address. */
> + struct ether_addr arp_tha; /**< target hardware address. */
> + rte_be32_t arp_tip; /**< target IP address. */
> +};
Missing caps on the first word on each comment (keep the style of the file).
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_ARP_IPV4. */
> +#ifndef __cplusplus
> +static const struct rte_flow_item_arp_ipv4 rte_flow_item_arp_ipv4_mask = {
> + .arp_sha = {
> + .addr_bytes = "\xff\xff\xff\xff\xff\xff",
> + },
> + .arp_sip = RTE_BE32(0xffffffff),
> + .arp_tha = {
> + .addr_bytes = "\xff\xff\xff\xff\xff\xff",
> + },
> + .arp_tip = RTE_BE32(0xffffffff),
> +};
> +#endif
> +
> +/**
> + * RTE_FLOW_ITEM_TYPE_IPV6_EXT
> + *
> + * Matches an IPv6 extension header with any type.
> + */
> +struct rte_flow_item_ipv6_ext {
> + uint8_t next_hdr; /**< protocol of next header */
> +};
Ditto.
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_IPV6_EXT. */
> +#ifndef __cplusplus
> +static const
> +struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask = {
> + .next_hdr = 0xff,
> +};
> +#endif
> +
> +/**
> + * RTE_FLOW_ITEM_TYPE_ICMP6
> + *
> + * Matches an ICMPv6 header followed by any message body.
> + */
> +struct rte_flow_item_icmp6 {
> + uint8_t type; /**< ICMPv6 type. */
> + uint8_t code; /**< ICMPv6 code. */
> + uint16_t checksum; /**< ICMPv6 checksum. */
> +};
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6. */
> +#ifndef __cplusplus
> +static const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask = {
> + .type = 0xff,
> + .code = 0xff,
> +};
> +#endif
> +
> +/**
> + * RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS
> + *
> + * Matches an ICMP6 header followed by network discovery
> + * neighbor solicitation.
> + */
> +struct rte_flow_item_icmp6_nd_ns {
> + uint8_t type; /**< ICMPv6 type, normally 135. */
> + uint8_t code; /**< ICMPv6 code, normally 0. */
> + rte_be16_t checksum; /**< ICMPv6 checksum. */
> + rte_be32_t reserved;
> + uint8_t target_addr[16]; /**< Target address. */
> +};
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS */
Missing "."
> +#ifndef __cplusplus
> +static const
> +struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask = {
> + .target_addr =
> + "\xff\xff\xff\xff\xff\xff\xff\xff"
> + "\xff\xff\xff\xff\xff\xff\xff\xff",
> +};
> +#endif
> +
> +/**
> + * RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA
> + *
> + * Matches an ICMPv6 header followed by network discovery
> + * neighbor advertisement.
> + */
> +struct rte_flow_item_icmp6_nd_na {
> + uint8_t type; /**< ICMPv6 type, normally 136. */
> + uint8_t code; /**< ICMPv6 code, normally 0. */
> + rte_be16_t checksum; /**< ICMPv6 checksum. */
> + /**
> + * Route flag (1b), solicited flag (1b), override flag (1b),
> + * reserved (29b).
> + */
> + rte_be32_t rso_reserved;
> + uint8_t target_addr[16]; /**< Target address. */
> +};
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA. */
> +#ifndef __cplusplus
> +static const
> +struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask = {
> + .target_addr =
> + "\xff\xff\xff\xff\xff\xff\xff\xff"
> + "\xff\xff\xff\xff\xff\xff\xff\xff",
> +};
> +#endif
> +
> +/**
> + * RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH
> + *
> + * Matches an ICMPv6 header followed by network discovery neighbor
> + * solicitation that contains source Ethernet link-layer address option.
> + */
> +struct rte_flow_item_icmp6_nd_opt_sla_eth {
> + uint8_t type; /**< ICMPv6 type, normally 135. */
> + uint8_t code; /**< ICMPv6 code, normally 0. */
> + rte_be16_t checksum; /**< ICMPv6 checksum. */
> + rte_be32_t reserved;
> + uint8_t target_addr[16]; /**< Target address. */
> + struct ether_addr sll_addr; /**< Source Ethernet link-layer address. */
> +};
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH. */
> +#ifndef __cplusplus
> +static const struct rte_flow_item_icmp6_nd_opt_sla_eth
> + rte_flow_item_icmp6_nd_opt_sla_eth_mask = {
> + .target_addr =
> + "\xff\xff\xff\xff\xff\xff\xff\xff"
> + "\xff\xff\xff\xff\xff\xff\xff\xff",
> + .sll_addr = {
> + .addr_bytes = "\xff\xff\xff\xff\xff\xff",
> + }
> +};
> +#endif
> +
> +/**
> + * RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH
> + *
> + * Matches an ICMPv6 header followed by network discovery neighbor
> + * advertisement that contains target Ethernet link-layer address option.
> + */
> +struct rte_flow_item_icmp6_nd_opt_tla_eth {
> + uint8_t type; /**< ICMPv6 type, normally 136. */
> + uint8_t code; /**< ICMPv6 code, normally 0. */
> + rte_be16_t checksum; /**< ICMPv6 checksum. */
> + /**
> + * Route flag (1b), solicited flag (1b), override flag (1b),
> + * reserved (29b).
> + */
> + rte_be32_t rso_reserved;
> + uint8_t target_addr[16]; /**< Target address. */
> + struct ether_addr tll_addr; /**< Target Ethernet link-layer address. */
> +
> +};
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH. */
> +#ifndef __cplusplus
> +static const struct rte_flow_item_icmp6_nd_opt_tla_eth
> + rte_flow_item_icmp6_nd_opt_tla_eth_mask = {
> + .target_addr =
> + "\xff\xff\xff\xff\xff\xff\xff\xff"
> + "\xff\xff\xff\xff\xff\xff\xff\xff",
> + .tll_addr = {
> + .addr_bytes = "\xff\xff\xff\xff\xff\xff",
> + }
> +};
> +#endif
> +
> +/**
> * Matching pattern item definition.
> *
> * A pattern is formed by stacking items starting from the lowest protocol
> --
> 2.13.6
>
--
Adrien Mazarguil
6WIND
More information about the dev
mailing list