[dpdk-dev] [PATCH v2 49/62] net/cnxk: add initial version of rte flow support

Jerin Jacob jerinjacobk at gmail.com
Tue Jun 15 14:45:52 CEST 2021


On Mon, Jun 7, 2021 at 11:39 PM Nithin Dabilpuram
<ndabilpuram at marvell.com> wrote:
>
> From: Kiran Kumar K <kirankumark at marvell.com>
>
> Adding initial version of rte_flow support for cnxk family device.
> Supported rte_flow ops are flow_validate, flow_create, flow_crstroy,
> flow_flush, flow_query, flow_isolate.
>
> Signed-off-by: Kiran Kumar K <kirankumark at marvell.com>
> ---
>  doc/guides/nics/cnxk.rst          | 118 ++++++++++++++++
>  doc/guides/nics/features/cnxk.ini |  42 ++++++
>  drivers/net/cnxk/cnxk_rte_flow.c  | 282 ++++++++++++++++++++++++++++++++++++++
>  drivers/net/cnxk/cnxk_rte_flow.h  |  69 ++++++++++
>  drivers/net/cnxk/meson.build      |   1 +
>  5 files changed, 512 insertions(+)
>  create mode 100644 drivers/net/cnxk/cnxk_rte_flow.c
>  create mode 100644 drivers/net/cnxk/cnxk_rte_flow.h
>
> diff --git a/doc/guides/nics/cnxk.rst b/doc/guides/nics/cnxk.rst
> index c2a6fbb..87401f0 100644
> --- a/doc/guides/nics/cnxk.rst
> +++ b/doc/guides/nics/cnxk.rst
> @@ -24,6 +24,7 @@ Features of the CNXK Ethdev PMD are:
>  - Multiple queues for TX and RX
>  - Receiver Side Scaling (RSS)
>  - MAC filtering
> +- Generic flow API
>  - Inner and Outer Checksum offload
>  - Port hardware statistics
>  - Link state information
> @@ -222,3 +223,120 @@ Debugging Options
>     +---+------------+-------------------------------------------------------+
>     | 2 | NPC        | --log-level='pmd\.net.cnxk\.flow,8'                   |
>     +---+------------+-------------------------------------------------------+
> +
> +RTE Flow Support
> +----------------
> +
> +The OCTEON CN9K/CN10K SoC family NIC has support for the following patterns and
> +actions.
> +
> +Patterns:
> +
> +.. _table_cnxk_supported_flow_item_types:
> +
> +.. table:: Item types
> +
> +   +----+--------------------------------+
> +   | #  | Pattern Type                   |
> +   +====+================================+
> +   | 1  | RTE_FLOW_ITEM_TYPE_ETH         |
> +   +----+--------------------------------+
> +   | 2  | RTE_FLOW_ITEM_TYPE_VLAN        |
> +   +----+--------------------------------+
> +   | 3  | RTE_FLOW_ITEM_TYPE_E_TAG       |
> +   +----+--------------------------------+
> +   | 4  | RTE_FLOW_ITEM_TYPE_IPV4        |
> +   +----+--------------------------------+
> +   | 5  | RTE_FLOW_ITEM_TYPE_IPV6        |
> +   +----+--------------------------------+
> +   | 6  | RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4|
> +   +----+--------------------------------+
> +   | 7  | RTE_FLOW_ITEM_TYPE_MPLS        |
> +   +----+--------------------------------+
> +   | 8  | RTE_FLOW_ITEM_TYPE_ICMP        |
> +   +----+--------------------------------+
> +   | 9  | RTE_FLOW_ITEM_TYPE_UDP         |
> +   +----+--------------------------------+
> +   | 10 | RTE_FLOW_ITEM_TYPE_TCP         |
> +   +----+--------------------------------+
> +   | 11 | RTE_FLOW_ITEM_TYPE_SCTP        |
> +   +----+--------------------------------+
> +   | 12 | RTE_FLOW_ITEM_TYPE_ESP         |
> +   +----+--------------------------------+
> +   | 13 | RTE_FLOW_ITEM_TYPE_GRE         |
> +   +----+--------------------------------+
> +   | 14 | RTE_FLOW_ITEM_TYPE_NVGRE       |
> +   +----+--------------------------------+
> +   | 15 | RTE_FLOW_ITEM_TYPE_VXLAN       |
> +   +----+--------------------------------+
> +   | 16 | RTE_FLOW_ITEM_TYPE_GTPC        |
> +   +----+--------------------------------+
> +   | 17 | RTE_FLOW_ITEM_TYPE_GTPU        |
> +   +----+--------------------------------+
> +   | 18 | RTE_FLOW_ITEM_TYPE_GENEVE      |
> +   +----+--------------------------------+
> +   | 19 | RTE_FLOW_ITEM_TYPE_VXLAN_GPE   |
> +   +----+--------------------------------+
> +   | 20 | RTE_FLOW_ITEM_TYPE_IPV6_EXT    |
> +   +----+--------------------------------+
> +   | 21 | RTE_FLOW_ITEM_TYPE_VOID        |
> +   +----+--------------------------------+
> +   | 22 | RTE_FLOW_ITEM_TYPE_ANY         |
> +   +----+--------------------------------+
> +   | 23 | RTE_FLOW_ITEM_TYPE_GRE_KEY     |
> +   +----+--------------------------------+
> +   | 24 | RTE_FLOW_ITEM_TYPE_HIGIG2      |
> +   +----+--------------------------------+
> +
> +.. note::
> +
> +   ``RTE_FLOW_ITEM_TYPE_GRE_KEY`` works only when checksum and routing
> +   bits in the GRE header are equal to 0.
> +
> +Actions:
> +
> +.. _table_cnxk_supported_ingress_action_types:
> +
> +.. table:: Ingress action types
> +
> +   +----+-----------------------------------------+
> +   | #  | Action Type                             |
> +   +====+=========================================+
> +   | 1  | RTE_FLOW_ACTION_TYPE_VOID               |
> +   +----+-----------------------------------------+
> +   | 2  | RTE_FLOW_ACTION_TYPE_MARK               |
> +   +----+-----------------------------------------+
> +   | 3  | RTE_FLOW_ACTION_TYPE_FLAG               |
> +   +----+-----------------------------------------+
> +   | 4  | RTE_FLOW_ACTION_TYPE_COUNT              |
> +   +----+-----------------------------------------+
> +   | 5  | RTE_FLOW_ACTION_TYPE_DROP               |
> +   +----+-----------------------------------------+
> +   | 6  | RTE_FLOW_ACTION_TYPE_QUEUE              |
> +   +----+-----------------------------------------+
> +   | 7  | RTE_FLOW_ACTION_TYPE_RSS                |
> +   +----+-----------------------------------------+
> +   | 8  | RTE_FLOW_ACTION_TYPE_PF                 |
> +   +----+-----------------------------------------+
> +   | 9  | RTE_FLOW_ACTION_TYPE_VF                 |
> +   +----+-----------------------------------------+
> +   | 10 | RTE_FLOW_ACTION_TYPE_OF_POP_VLAN        |
> +   +----+-----------------------------------------+
> +
> +.. _table_cnxk_supported_egress_action_types:
> +
> +.. table:: Egress action types
> +
> +   +----+-----------------------------------------+
> +   | #  | Action Type                             |
> +   +====+=========================================+
> +   | 1  | RTE_FLOW_ACTION_TYPE_COUNT              |
> +   +----+-----------------------------------------+
> +   | 2  | RTE_FLOW_ACTION_TYPE_DROP               |
> +   +----+-----------------------------------------+
> +   | 3  | RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN       |
> +   +----+-----------------------------------------+
> +   | 4  | RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID    |
> +   +----+-----------------------------------------+
> +   | 5  | RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP    |
> +   +----+-----------------------------------------+


See below,


> diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
> index 192c15a..3c59494 100644
> --- a/doc/guides/nics/features/cnxk.ini
> +++ b/doc/guides/nics/features/cnxk.ini
> @@ -39,3 +39,45 @@ Module EEPROM dump   = Y
>  Linux                = Y
>  ARMv8                = Y
>  Usage doc            = Y
> +
> +[rte_flow items]
> +any                  = Y
> +arp_eth_ipv4         = Y
> +esp                  = Y
> +eth                  = Y
> +e_tag                = Y
> +geneve               = Y
> +gre                  = Y
> +gre_key              = Y
> +gtpc                 = Y
> +gtpu                 = Y
> +higig2               = Y
> +icmp                 = Y
> +ipv4                 = Y
> +ipv6                 = Y
> +ipv6_ext             = Y
> +mpls                 = Y
> +nvgre                = Y
> +raw                  = Y
> +sctp                 = Y
> +tcp                  = Y
> +udp                  = Y
> +vlan                 = Y
> +vxlan                = Y
> +vxlan_gpe            = Y
> +
> +[rte_flow actions]
> +count                = Y
> +drop                 = Y
> +flag                 = Y
> +mark                 = Y
> +of_pop_vlan          = Y
> +of_push_vlan         = Y
> +of_set_vlan_pcp      = Y
> +of_set_vlan_vid      = Y
> +pf                   = Y
> +port_id              = Y
> +queue                = Y
> +rss                  = Y
> +security             = Y
> +vf                   = Y

Now that we have this generic doc, The above driver-specific
documentation can be removed.
We can just keep limitations in the driver documentation.


More information about the dev mailing list