Add basic flow support for corenic firmware
Subsystems (2)
cover Add basic flow support for corenic firmware
Add the very basic rte_flow support for corenic firmware.
Chaoyong He (11):
net/nfp: move some source files
drivers: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items
drivers: support MARK flow action
net/nfp: support QUEUE flow action
drivers/common/nfp/nfp_common_ctrl.h | 2 +
drivers/net/nfp/flower/nfp_conntrack.h | 2 +-
drivers/net/nfp/flower/nfp_flower_cmsg.h | 2 +-
.../{nfp_flow.c => flower/nfp_flower_flow.c} | 4 +-
.../{nfp_flow.h => flower/nfp_flower_flow.h} | 10 +-
.../net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/meson.build | 4 +-
drivers/net/nfp/nfp_ethdev.c | 27 +-
drivers/net/nfp/nfp_net_cmsg.c | 66 ++
drivers/net/nfp/nfp_net_cmsg.h | 176 +++
drivers/net/nfp/nfp_net_common.h | 12 +
drivers/net/nfp/nfp_net_ctrl.h | 1 +
drivers/net/nfp/nfp_net_flow.c | 1003 +++++++++++++++++
drivers/net/nfp/nfp_net_flow.h | 30 +
drivers/net/nfp/nfp_rxtx.c | 18 +
15 files changed, 1341 insertions(+), 18 deletions(-)
rename drivers/net/nfp/{nfp_flow.c => flower/nfp_flower_flow.c} (99%)
rename drivers/net/nfp/{nfp_flow.h => flower/nfp_flower_flow.h} (96%)
create mode 100644 drivers/net/nfp/nfp_net_cmsg.c
create mode 100644 drivers/net/nfp/nfp_net_cmsg.h
create mode 100644 drivers/net/nfp/nfp_net_flow.c
create mode 100644 drivers/net/nfp/nfp_net_flow.hSignature · 1 line
2.39.1
PATCH 1/11 net/nfp: move some source files
Rename module 'nfp_flow' into 'nfp_flower_flow' and move the source files into the 'flower' sub-directory.
---
drivers/net/nfp/flower/nfp_conntrack.h | 2 +-
drivers/net/nfp/flower/nfp_flower_cmsg.h | 2 +-
.../net/nfp/{nfp_flow.c => flower/nfp_flower_flow.c} | 4 ++--
.../net/nfp/{nfp_flow.h => flower/nfp_flower_flow.h} | 10 +++++-----
drivers/net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/meson.build | 2 +-
6 files changed, 11 insertions(+), 11 deletions(-)
rename drivers/net/nfp/{nfp_flow.c => flower/nfp_flower_flow.c} (99%)
rename drivers/net/nfp/{nfp_flow.h => flower/nfp_flower_flow.h} (96%)drivers/net/nfp/flower/nfp_conntrack.h +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <rte_flow.h> -#include "../nfp_flow.h" +#include "nfp_flower_flow.h" struct nfp_ct_map_entry ;
drivers/net/nfp/flower/nfp_flower_cmsg.h +1 -1
@@ -6,8 +6,8 @@ #ifndef __NFP_CMSG_H__ #define __NFP_CMSG_H__ -#include "../nfp_flow.h" #include "nfp_flower.h" +#include "nfp_flower_flow.h" struct nfp_flower_cmsg_hdr { rte_be16_t pad;
drivers/net/nfp/flower/nfp_flower_flow.c renamed from drivers/net/nfp/nfp_flow.c +2 -2
@@ -3,7 +3,7 @@* All rights reserved. */ -#include "nfp_flow.h" +#include "nfp_flower_flow.h" #include <rte_flow_driver.h> #include <rte_hash.h>
@@ -4318,7 +4318,7 @@ static const struct rte_flow_ops nfp_flow_ops = { };int -nfp_net_flow_ops_get (struct rte_eth_dev *dev, +nfp_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops) {if ((dev->data->dev_flags &RTE_ETH_DEV_REPRESENTOR ) ==0 ) {
drivers/net/nfp/flower/nfp_flower_flow.h renamed from drivers/net/nfp/nfp_flow.h +5 -5
@@ -3,10 +3,10 @@* All rights reserved. */ -#ifndef __NFP_FLOW_H__ -#define __NFP_FLOW_H__ +#ifndef __NFP_FLOWER_FLOW_H__ +#define __NFP_FLOWER_FLOW_H__ -#include "nfp_net_common.h" +#include "../nfp_net_common.h" /* The firmware expects lengths in units of long words */ #define NFP_FL_LW_SIZ 2
@@ -182,7 +182,7 @@ struct nfp_flower_representor;int nfp_flow_priv_init (struct nfp_pf_dev *pf_dev);void nfp_flow_priv_uninit (struct nfp_pf_dev *pf_dev); -int nfp_net_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops); +int nfp_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops);bool nfp_flow_inner_item_get (const struct rte_flow_item items[],const struct rte_flow_item **inner_item); struct rte_flow *nfp_flow_process(struct nfp_flower_representor *representor,
@@ -202,4 +202,4 @@ int nfp_flow_destroy(struct rte_eth_dev *dev,struct rte_flow *nfp_flow, struct rte_flow_error *error); -#endif /* __NFP_FLOW_H__ */ +#endif /* __NFP_FLOWER_FLOW_H__ */
drivers/net/nfp/flower/nfp_flower_representor.c +1 -1
@@ -334,7 +334,7 @@ static const struct eth_dev_ops nfp_flower_repr_dev_ops = { .mac_addr_set = nfp_flower_repr_mac_addr_set, .fw_version_get = nfp_net_firmware_version_get, - .flow_ops_get = nfp_net_flow_ops_get, + .flow_ops_get = nfp_flow_ops_get, .mtr_ops_get = nfp_net_mtr_ops_get, };
drivers/net/nfp/meson.build +1 -1
@@ -11,6 +11,7 @@ sources = files( 'flower/nfp_flower.c', 'flower/nfp_flower_cmsg.c', 'flower/nfp_flower_ctrl.c', + 'flower/nfp_flower_flow.c', 'flower/nfp_flower_representor.c', 'nfd3/nfp_nfd3_dp.c', 'nfdk/nfp_nfdk_dp.c',
@@ -30,7 +31,6 @@ sources = files( 'nfp_cpp_bridge.c', 'nfp_ethdev.c', 'nfp_ethdev_vf.c', - 'nfp_flow.c', 'nfp_ipsec.c', 'nfp_logs.c', 'nfp_mtr.c',
Signature · 1 line
2.39.1
PATCH 2/11 drivers: add the structures and functions for flow offload
In reply to Chaoyong HeAdd the structures and functions to process flow table, which is used in the rte_flow offload logics.
This module is used for the CoreNIC firmware.
--- drivers/common/nfp/nfp_common_ctrl.h | 1 + drivers/net/nfp/meson.build | 1 + drivers/net/nfp/nfp_ethdev.c | 26 +++-- drivers/net/nfp/nfp_net_common.h | 11 ++ drivers/net/nfp/nfp_net_flow.c | 162 +++++++++++++++++++++++++++ drivers/net/nfp/nfp_net_flow.h | 28 +++++ 6 files changed, 222 insertions(+), 7 deletions(-) create mode 100644 drivers/net/nfp/nfp_net_flow.c create mode 100644 drivers/net/nfp/nfp_net_flow.h
drivers/common/nfp/nfp_common_ctrl.h +1 -0
@@ -223,6 +223,7 @@ struct nfp_net_fw_ver {#define NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP (0x1 << 3)/**< SA short match lookup */ #define NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP (0x1 << 4)/**< SA long match lookup */ #define NFP_NET_CFG_CTRL_MULTI_PF (0x1 << 5) +#define NFP_NET_CFG_CTRL_FLOW_STEER (0x1 << 8)/**< Flow Steering */ #define NFP_NET_CFG_CTRL_IN_ORDER (0x1 << 11)/**< Virtio in-order flag */ #define NFP_NET_CFG_CAP_WORD1 0x00a4
drivers/net/nfp/meson.build +1 -0
@@ -36,6 +36,7 @@ sources = files( 'nfp_mtr.c', 'nfp_net_common.c', 'nfp_net_ctrl.c', + 'nfp_net_flow.c', 'nfp_rxtx.c', )
drivers/net/nfp/nfp_ethdev.c +19 -7
@@ -23,6 +23,7 @@#include "nfp_cpp_bridge.h" #include "nfp_ipsec.h" #include "nfp_logs.h" +#include "nfp_net_flow.h" #define NFP_PF_DRIVER_NAME net_nfp_pf
@@ -150,6 +151,10 @@ nfp_net_start(struct rte_eth_dev *dev) ctrl_extend |=NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP |NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP ; +/* Enable flow steer by extend ctrl word1. */ +if ((cap_extend &NFP_NET_CFG_CTRL_FLOW_STEER ) !=0 ) + ctrl_extend |=NFP_NET_CFG_CTRL_FLOW_STEER ; + update =NFP_NET_CFG_UPDATE_GEN ;if (nfp_ext_reconfig (hw, ctrl_extend, update) !=0 )return -EIO ;
@@ -692,6 +697,14 @@ nfp_net_init(struct rte_eth_dev *eth_dev)/* Recording current stats counters values */ nfp_net_stats_reset (eth_dev); +if ((hw->cap_ext &NFP_NET_CFG_CTRL_FLOW_STEER ) !=0 ) { + err =nfp_net_flow_priv_init (pf_dev, port); +if (err !=0 ) { +PMD_INIT_LOG (ERR ,"Init net flow priv failed" ); +return err; + } + } +return 0 ; }
@@ -1115,14 +1128,13 @@ nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev, port_cleanup:for (i =0 ; i < app_fw_nic->total_phyports; i++) { id =nfp_function_id_get (pf_dev, i); + hw = app_fw_nic->ports[id]; -if (app_fw_nic->ports[id] !=NULL && - app_fw_nic->ports[id]->eth_dev !=NULL ) { -struct rte_eth_dev *tmp_dev; - tmp_dev = app_fw_nic->ports[id]->eth_dev; -nfp_ipsec_uninit (tmp_dev); -rte_eth_dev_release_port (tmp_dev); - app_fw_nic->ports[id] =NULL ; +if (hw !=NULL && hw->eth_dev !=NULL ) { +nfp_ipsec_uninit (hw->eth_dev); +if ((hw->super.cap_ext &NFP_NET_CFG_CTRL_FLOW_STEER ) !=0 ) +nfp_net_flow_priv_uninit (pf_dev, id); +rte_eth_dev_release_port (hw->eth_dev); } }nfp_cpp_area_free (pf_dev->ctrl_area);
drivers/net/nfp/nfp_net_common.h +11 -0
@@ -108,6 +108,14 @@ struct nfp_pf_dev {struct nfp_multi_pf multi_pf; }; +#define NFP_NET_FLOW_LIMIT 1024 + +struct nfp_net_priv { +uint32_t hash_seed;/**< Hash seed for hash tables in this structure. */ +struct rte_hash *flow_table;/**< Hash table to store flow rules. */ +uint16_t flow_count;/**< Flow count in hash table */ +}; +struct nfp_app_fw_nic {/** Backpointer to the PF device */ struct nfp_pf_dev *pf_dev;
@@ -177,6 +185,9 @@ struct nfp_net_hw {struct nfp_net_tlv_caps tlv_caps;struct nfp_net_ipsec_data *ipsec_data; + +/** Used for rte_flow of CoreNIC firmware */ +struct nfp_net_priv *priv; }; static inline uint32_t
drivers/net/nfp/nfp_net_flow.c new file +162 -0
162 lines not on this page · raw message
drivers/net/nfp/nfp_net_flow.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright (c) 2023 Corigine, Inc. +* All rights reserved. +*/ + +#ifndef __NFP_NET_FLOW_H__ +#define __NFP_NET_FLOW_H__ + +#include "nfp_net_common.h" + +struct nfp_net_flow_payload { +uint16_t cmsg_type; +uint8_t match_len; +uint8_t action_len; +char *match_data; +char *action_data; +}; + +struct rte_flow { +struct nfp_net_flow_payload payload; +uint32_t hash_key; +uint32_t port_id; +}; + +int nfp_net_flow_priv_init (struct nfp_pf_dev *pf_dev,uint16_t port); +void nfp_net_flow_priv_uninit (struct nfp_pf_dev *pf_dev,uint16_t port); + +#endif /* __NFP_NET_FLOW_H__ */
Signature · 1 line
2.39.1
PATCH 3/11 net/nfp: add the control message channel
In reply to Chaoyong HeUsing the mailbox, which serves as the control message channel between driver and CoreNIC firmware.
--- drivers/net/nfp/meson.build | 1 + drivers/net/nfp/nfp_net_cmsg.c | 66 ++++++++++++++++++++++++++++++++++ drivers/net/nfp/nfp_net_cmsg.h | 37 +++++++++++++++++++ drivers/net/nfp/nfp_net_ctrl.h | 1 + 4 files changed, 105 insertions(+) create mode 100644 drivers/net/nfp/nfp_net_cmsg.c create mode 100644 drivers/net/nfp/nfp_net_cmsg.h
drivers/net/nfp/meson.build +1 -0
@@ -34,6 +34,7 @@ sources = files( 'nfp_ipsec.c', 'nfp_logs.c', 'nfp_mtr.c', + 'nfp_net_cmsg.c', 'nfp_net_common.c', 'nfp_net_ctrl.c', 'nfp_net_flow.c',
drivers/net/nfp/nfp_net_cmsg.c new file +66 -0
66 lines not on this page · raw message
drivers/net/nfp/nfp_net_cmsg.h new file +37 -0
@@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright (c) 2023 Corigine, Inc. +* All rights reserved. +*/ + +#ifndef __NFP_NET_CMSG_H__ +#define __NFP_NET_CMSG_H__ + +#include "nfp_net_common.h" + +enum nfp_net_cfg_mbox_cmd { +NFP_NET_CFG_MBOX_CMD_FS_ADD_V4 ,/* Add Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_V4 ,/* Delete Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_ADD_V6 ,/* Add Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_V6 ,/* Delete Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_ADD_ETHTYPE ,/* Add Flow Steer rule for Ethtype table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_ETHTYPE ,/* Delete Flow Steer rule for Ethtype table */ +}; + +enum nfp_net_cfg_mbox_ret { +NFP_NET_CFG_MBOX_RET_FS_OK ,/* No error happen */ +NFP_NET_CFG_MBOX_RET_FS_ERR_NO_SPACE ,/* Return error code no space */ +NFP_NET_CFG_MBOX_RET_FS_ERR_MASK_FULL ,/* Return error code mask table full */ +NFP_NET_CFG_MBOX_RET_FS_ERR_CMD_INVALID ,/* Return error code invalid cmd */ +}; + +/* 4B cmd, and up to 500B data. */ +struct nfp_net_cmsg { +uint32_t cmd;/**< One of nfp_net_cfg_mbox_cmd */ +uint32_t data[0 ]; +}; + +struct nfp_net_cmsg *nfp_net_cmsg_alloc (uint32_t msg_size); +void nfp_net_cmsg_free (struct nfp_net_cmsg *cmsg); +int nfp_net_cmsg_xmit (struct nfp_net_hw *hw,struct nfp_net_cmsg *cmsg,uint32_t msg_size); + +#endif /* __NFP_NET_CMSG_H__ */
drivers/net/nfp/nfp_net_ctrl.h +1 -0
@@ -92,6 +92,7 @@#define NFP_NET_CFG_MBOX_SIMPLE_VAL 0x8#define NFP_NET_CFG_MBOX_CMD_IPSEC 3 +#define NFP_NET_CFG_MBOX_CMD_FLOW_STEER 10/* * TLV capabilities
Signature · 1 line
2.39.1
PATCH 4/11 net/nfp: support flow API for CoreNIC firmware
In reply to Chaoyong HeAdd the flow validate/create/destroy/flush API of nfp PMD with CoreNIC firmware.
The flow create API construct a control cmsg and send it to firmware, then add this flow to the hash table.
The flow destroy API construct a control cmsg and send it to firmware, then delete this flow from the hash table.
The flow flush API just iterate the flows in hash table and call the flow destroy API.
--- drivers/net/nfp/nfp_ethdev.c | 1 + drivers/net/nfp/nfp_net_cmsg.h | 28 +++ drivers/net/nfp/nfp_net_common.h | 1 + drivers/net/nfp/nfp_net_flow.c | 409 ++++++++++++++++++++++++++++++- drivers/net/nfp/nfp_net_flow.h | 2 + 5 files changed, 434 insertions(+), 7 deletions(-)
drivers/net/nfp/nfp_ethdev.c +1 -0
@@ -530,6 +530,7 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = { .fw_version_get = nfp_net_firmware_version_get, .flow_ctrl_get = nfp_net_flow_ctrl_get, .flow_ctrl_set = nfp_net_flow_ctrl_set, + .flow_ops_get = nfp_net_flow_ops_get, }; static inline void
drivers/net/nfp/nfp_net_cmsg.h +28 -0
@@ -8,6 +8,34 @@#include "nfp_net_common.h" +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ +#define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ +#define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */ + +/** +* Action data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-------------------------------+-------------------------------+ +* 0 | | Queue | Actions | +* +-----------------+-------------+-------------------------------+ +* 1 | Mark ID | +* +---------------------------------------------------------------+ +* +* Queue – Queue ID, 7 bits. +* Actions – An action bitmap, each bit represents an action type: +* - Bit 0: Drop action. Drop the packet. +* - Bit 1: Queue action. Use the queue specified by “Queue” field. +* If not set, the queue is usually specified by RSS. +* - Bit 2: Mark action. Mark packet with Mark ID. +*/ +struct nfp_net_cmsg_action { +uint16_t action; +uint8_t queue; +uint8_t spare; +uint16_t mark_id; +}; +enum nfp_net_cfg_mbox_cmd {NFP_NET_CFG_MBOX_CMD_FS_ADD_V4 ,/* Add Flow Steer rule for V4 table */ NFP_NET_CFG_MBOX_CMD_FS_DEL_V4 ,/* Delete Flow Steer rule for V4 table */
drivers/net/nfp/nfp_net_common.h +1 -0
@@ -114,6 +114,7 @@ struct nfp_net_priv {uint32_t hash_seed;/**< Hash seed for hash tables in this structure. */ struct rte_hash *flow_table;/**< Hash table to store flow rules. */ uint16_t flow_count;/**< Flow count in hash table */ +bool flow_position[NFP_NET_FLOW_LIMIT ];/**< Flow position array */ };struct nfp_app_fw_nic {
drivers/net/nfp/nfp_net_flow.c +402 -7
460 lines not on this page · raw message
drivers/net/nfp/nfp_net_flow.h +2 -0
@@ -20,9 +20,11 @@ struct rte_flow {struct nfp_net_flow_payload payload;uint32_t hash_key;uint32_t port_id; + uint32_t position; /**< Use as priority */ };int nfp_net_flow_priv_init (struct nfp_pf_dev *pf_dev,uint16_t port);void nfp_net_flow_priv_uninit (struct nfp_pf_dev *pf_dev,uint16_t port); +int nfp_net_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops);#endif /* __NFP_NET_FLOW_H__ */
Signature · 1 line
2.39.1
PATCH 5/11 net/nfp: support Ethernet flow item
In reply to Chaoyong HeAdd the corresponding data structure and logics, to support the offload of ethernet item.
--- drivers/net/nfp/nfp_net_cmsg.h | 13 +++ drivers/net/nfp/nfp_net_flow.c | 169 +++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+)
drivers/net/nfp/nfp_net_cmsg.h +13 -0
@@ -8,6 +8,19 @@#include "nfp_net_common.h" +/** +* Match EtherType data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-------------------------------+-------------------------------+ +* 0 | | Ethtype | +* +-----------------+-------------+-------------------------------+ +*/ +struct nfp_net_cmsg_match_eth { +uint16_t ether_type; +uint16_t spare; +}; +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ #define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ #define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */
drivers/net/nfp/nfp_net_flow.c +169 -0
193 lines not on this page · raw message
Signature · 1 line
2.39.1
PATCH 6/11 net/nfp: support drop flow action
In reply to Chaoyong HeAdd the corresponding logics to support the offload of drop action.
--- drivers/net/nfp/nfp_net_flow.c | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
drivers/net/nfp/nfp_net_flow.c +38 -1
@@ -335,6 +335,37 @@ nfp_net_flow_compile_items(const struct rte_flow_item items[],return ret; } +static void +nfp_net_flow_action_drop (struct rte_flow *nfp_flow) +{ +struct nfp_net_cmsg_action *action_data; + + action_data = (struct nfp_net_cmsg_action *)nfp_flow->payload.action_data; + + action_data->action =NFP_NET_CMSG_ACTION_DROP ; +} + +static int +nfp_net_flow_compile_actions (const struct rte_flow_action actions[], +struct rte_flow *nfp_flow) +{ +const struct rte_flow_action *action; + +for (action = actions; action->type !=RTE_FLOW_ACTION_TYPE_END ; ++action) { +switch (action->type) { +case RTE_FLOW_ACTION_TYPE_DROP : +PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_DROP" ); +nfp_net_flow_action_drop (nfp_flow); +return 0 ; +default : +PMD_DRV_LOG (ERR ,"Unsupported action type: %d" , action->type); +return -ENOTSUP ; + } + } + +return 0 ; +} +static void nfp_net_flow_process_priority(__rte_unused struct rte_flow *nfp_flow,uint32_t match_len)
@@ -349,7 +380,7 @@ static struct rte_flow * nfp_net_flow_setup(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, const struct rte_flow_item items[], - __rte_unused const struct rte_flow_action actions[]) + const struct rte_flow_action actions[]) { int ret;char *hash_data;
@@ -387,6 +418,12 @@ nfp_net_flow_setup(struct rte_eth_dev *dev, goto free_flow; } + ret =nfp_net_flow_compile_actions (actions, nfp_flow); +if (ret !=0 ) { +PMD_DRV_LOG (ERR ,"NFP flow action process failed." ); + goto free_flow; + } +/* Calculate and store the hash_key for later use */ hash_data = nfp_flow->payload.match_data; nfp_flow->hash_key = rte_jhash(hash_data, match_len + action_len,
Signature · 1 line
2.39.1
PATCH 7/11 net/nfp: support IPv4 flow item
In reply to Chaoyong HeAdd the corresponding data structure and logics, to support the offload of IPv4 item.
--- drivers/net/nfp/nfp_net_cmsg.h | 37 ++++++++++++++++++++++ drivers/net/nfp/nfp_net_flow.c | 58 ++++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 2 deletions(-)
drivers/net/nfp/nfp_net_cmsg.h +37 -0
@@ -21,6 +21,43 @@ struct nfp_net_cmsg_match_eth {uint16_t spare; }; +/** +* Match IPv4 data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-----+-------------------------+---------------+---------------+ +* 0 | | Position | L4 Proto | L4 Proto Mask | +* +-----+-------------------------+---------------+---------------+ +* 1 | SIP4 | +* +---------------------------------------------------------------+ +* 2 | SIP4 Mask | +* +---------------------------------------------------------------+ +* 3 | DIP4 | +* +---------------------------------------------------------------+ +* 4 | DIP4 Mask | +* +-------------------------------+-------------------------------+ +* 5 | SPort | SPort Mask | +* +-------------------------------+-------------------------------+ +* 6 | DPort | DPort Mask | +* +-----------------+-------------+-------------------------------+ +* +* Position – Position index of the rule, 13bits. +* As priority, smaller value indicates higher priority. +*/ +struct nfp_net_cmsg_match_v4 { +uint8_t l4_protocol_mask; +uint8_t l4_protocol; +uint16_t position; +uint32_t src_ipv4; +uint32_t src_ipv4_mask; +uint32_t dst_ipv4; +uint32_t dst_ipv4_mask; +uint16_t src_port; +uint16_t src_port_mask; +uint16_t dst_port; +uint16_t dst_port_mask; +}; +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ #define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ #define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */
drivers/net/nfp/nfp_net_flow.c +56 -2
86 lines not on this page · raw message
Signature · 1 line
2.39.1
PATCH 8/11 net/nfp: support IPv6 flow item
In reply to Chaoyong HeAdd the corresponding data structure and logics, to support the offload of IPv6 item.
--- drivers/net/nfp/nfp_net_cmsg.h | 61 +++++++++++++++++++++++++++++++ drivers/net/nfp/nfp_net_flow.c | 66 +++++++++++++++++++++++++++++++++- 2 files changed, 126 insertions(+), 1 deletion(-)
drivers/net/nfp/nfp_net_cmsg.h +61 -0
@@ -58,6 +58,67 @@ struct nfp_net_cmsg_match_v4 {uint16_t dst_port_mask; }; +/** +* Match IPv6 data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-----+-------------------------+---------------+---------------+ +* 0 | | Position | L4 Proto | L4 Proto Mask | +* +-----+-------------------------+---------------+---------------+ +* 1 | SIP6 (0-3B) | +* +---------------------------------------------------------------+ +* 2 | SIP6 (4-7B) | +* +---------------------------------------------------------------+ +* 3 | SIP6 (8-11B) | +* +---------------------------------------------------------------+ +* 4 | SIP6 (12-15B) | +* +---------------------------------------------------------------+ +* 5 | SIP6 Mask (0-3B) | +* +---------------------------------------------------------------+ +* 6 | SIP6 Mask (4-7B) | +* +---------------------------------------------------------------+ +* 7 | SIP6 Mask (8-11B) | +* +---------------------------------------------------------------+ +* 8 | SIP6 Mask (12-15B) | +* +---------------------------------------------------------------+ +* 9 | DIP6 (0-3B) | +* +---------------------------------------------------------------+ +* 10 | DIP6 (4-7B) | +* +---------------------------------------------------------------+ +* 11 | DIP6 (8-11B) | +* +---------------------------------------------------------------+ +* 12 | DIP6 (12-15B) | +* +---------------------------------------------------------------+ +* 13 | DIP6 Mask (0-3B) | +* +---------------------------------------------------------------+ +* 14 | DIP6 Mask (4-7B) | +* +---------------------------------------------------------------+ +* 15 | DIP6 Mask (8-11B) | +* +---------------------------------------------------------------+ +* 16 | DIP6 Mask (12-15B) | +* +-------------------------------+-------------------------------+ +* 17 | SPort | SPort Mask | +* +-------------------------------+-------------------------------+ +* 18 | DPort | DPort Mask | +* +-----------------+-------------+-------------------------------+ +* +* Position – Position index of the rule, 13bits. +* As priority, smaller value indicates higher priority. +*/ +struct nfp_net_cmsg_match_v6 { +uint8_t l4_protocol_mask; +uint8_t l4_protocol; +uint16_t position; +uint8_t src_ipv6[16 ]; +uint8_t src_ipv6_mask[16 ]; +uint8_t dst_ipv6[16 ]; +uint8_t dst_ipv6_mask[16 ]; +uint16_t src_port_mask; +uint16_t src_port; +uint16_t dst_port_mask; +uint16_t dst_port; +}; +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ #define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ #define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */
drivers/net/nfp/nfp_net_flow.c +65 -1
100 lines not on this page · raw message
Signature · 1 line
2.39.1
PATCH 9/11 net/nfp: support TCP/UDP/SCTP flow items
In reply to Chaoyong HeAdd the corresponding logics to support the offload of TCP/UDP/SCTP items.
--- drivers/net/nfp/nfp_net_flow.c | 86 ++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+)
drivers/net/nfp/nfp_net_flow.c +86 -0
@@ -299,6 +299,53 @@ nfp_net_flow_merge_ipv6(struct rte_flow *nfp_flow,return 0 ; } +static int +nfp_flow_merge_l4 (struct rte_flow *nfp_flow, +const struct rte_flow_item *item, +const struct nfp_net_flow_item_proc *proc) +{ +const struct rte_flow_item_tcp *mask; +const struct rte_flow_item_tcp *spec; +struct nfp_net_cmsg_match_v4 *ipv4 =NULL ; +struct nfp_net_cmsg_match_v6 *ipv6 =NULL ; + + spec = item->spec; +if (spec ==NULL ) { +PMD_DRV_LOG (ERR ,"NFP flow merge tcp: no item->spec!" ); +return -EINVAL ; + } + + mask = (item->mask !=NULL ) ? item->mask : proc->mask_default; + +switch (nfp_flow->payload.cmsg_type) { +case NFP_NET_CFG_MBOX_CMD_FS_ADD_V4 : + ipv4 = (struct nfp_net_cmsg_match_v4 *)nfp_flow->payload.match_data; +break ; +case NFP_NET_CFG_MBOX_CMD_FS_ADD_V6 : + ipv6 = (struct nfp_net_cmsg_match_v6 *)nfp_flow->payload.match_data; +break ; +default : +PMD_DRV_LOG (ERR ,"L3 layer neither IPv4 nor IPv6." ); +return -EINVAL ; + } + +if (ipv4 !=NULL ) { + ipv4->src_port_mask =rte_be_to_cpu_16 (mask->hdr.src_port); + ipv4->dst_port_mask =rte_be_to_cpu_16 (mask->hdr.dst_port); + + ipv4->src_port =rte_be_to_cpu_16 (spec->hdr.src_port); + ipv4->dst_port =rte_be_to_cpu_16 (spec->hdr.dst_port); + }else { + ipv6->src_port_mask =rte_be_to_cpu_16 (mask->hdr.src_port); + ipv6->dst_port_mask =rte_be_to_cpu_16 (mask->hdr.dst_port); + + ipv6->src_port =rte_be_to_cpu_16 (spec->hdr.src_port); + ipv6->dst_port =rte_be_to_cpu_16 (spec->hdr.dst_port); + } + +return 0 ; +} +/* Graph of supported items and associated process function */ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { [RTE_FLOW_ITEM_TYPE_END ] = {
@@ -310,6 +357,9 @@ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { .merge = nfp_net_flow_merge_eth, }, [RTE_FLOW_ITEM_TYPE_IPV4] = { + .next_item =NEXT_ITEM (RTE_FLOW_ITEM_TYPE_TCP , +RTE_FLOW_ITEM_TYPE_UDP , + RTE_FLOW_ITEM_TYPE_SCTP), .mask_support = &(const struct rte_flow_item_ipv4 ){ .hdr = { .next_proto_id =0xff ,
@@ -322,6 +372,9 @@ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { .merge = nfp_net_flow_merge_ipv4, }, [RTE_FLOW_ITEM_TYPE_IPV6] = { + .next_item =NEXT_ITEM (RTE_FLOW_ITEM_TYPE_TCP , +RTE_FLOW_ITEM_TYPE_UDP , + RTE_FLOW_ITEM_TYPE_SCTP), .mask_support = &(const struct rte_flow_item_ipv6 ){ .hdr = { .proto =0xff ,
@@ -335,6 +388,39 @@ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { .mask_sz = sizeof(struct rte_flow_item_ipv6), .merge = nfp_net_flow_merge_ipv6, }, + [RTE_FLOW_ITEM_TYPE_TCP] = { + .mask_support = &(const struct rte_flow_item_tcp ){ + .hdr = { + .src_port =RTE_BE16 (0xffff ), + .dst_port =RTE_BE16 (0xffff ), + }, + }, + .mask_default = &rte_flow_item_tcp_mask, + .mask_sz = sizeof(struct rte_flow_item_tcp), + .merge = nfp_flow_merge_l4, + }, + [RTE_FLOW_ITEM_TYPE_UDP] = { + .mask_support = &(const struct rte_flow_item_udp ){ + .hdr = { + .src_port =RTE_BE16 (0xffff ), + .dst_port =RTE_BE16 (0xffff ), + }, + }, + .mask_default = &rte_flow_item_udp_mask, + .mask_sz = sizeof(struct rte_flow_item_udp), + .merge = nfp_flow_merge_l4, + }, + [RTE_FLOW_ITEM_TYPE_SCTP] = { + .mask_support = &(const struct rte_flow_item_sctp ){ + .hdr = { + .src_port =RTE_BE16 (0xffff ), + .dst_port =RTE_BE16 (0xffff ), + }, + }, + .mask_default = &rte_flow_item_sctp_mask, + .mask_sz = sizeof(struct rte_flow_item_sctp), + .merge = nfp_flow_merge_l4, + }, }; static int
Signature · 1 line
2.39.1
PATCH 10/11 drivers: support MARK flow action
In reply to Chaoyong HeAdd the corresponding logics to support the offload of MARK action. Also add the related logics to parse the mark id and put into the mbuf structure, and assigned the offload flags.
--- drivers/common/nfp/nfp_common_ctrl.h | 1 + drivers/net/nfp/nfp_net_flow.c | 18 ++++++++++++++++++ drivers/net/nfp/nfp_rxtx.c | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+)
drivers/common/nfp/nfp_common_ctrl.h +1 -0
@@ -33,6 +33,7 @@/* Prepend field types */ #define NFP_NET_META_HASH 1/* Next field carries hash type */ +#define NFP_NET_META_MARK 2#define NFP_NET_META_VLAN 4#define NFP_NET_META_PORTID 5#define NFP_NET_META_IPSEC 9
drivers/net/nfp/nfp_net_flow.c +18 -0
@@ -538,6 +538,20 @@ nfp_net_flow_action_drop(struct rte_flow *nfp_flow) action_data->action =NFP_NET_CMSG_ACTION_DROP ; } +static void +nfp_net_flow_action_mark (struct rte_flow *nfp_flow, +const struct rte_flow_action *action) +{ +struct nfp_net_cmsg_action *action_data; +const struct rte_flow_action_mark *mark; + + action_data = (struct nfp_net_cmsg_action *)nfp_flow->payload.action_data; + mark = action->conf; + + action_data->action |=NFP_NET_CMSG_ACTION_MARK ; + action_data->mark_id = mark->id; +} +static int nfp_net_flow_compile_actions (const struct rte_flow_action actions[],struct rte_flow *nfp_flow)
@@ -550,6 +564,10 @@ nfp_net_flow_compile_actions(const struct rte_flow_action actions[],PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_DROP" );nfp_net_flow_action_drop (nfp_flow);return 0 ; +case RTE_FLOW_ACTION_TYPE_MARK : +PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_MARK" ); +nfp_net_flow_action_mark (nfp_flow, action); +break ;default :PMD_DRV_LOG (ERR ,"Unsupported action type: %d" , action->type);return -ENOTSUP ;
drivers/net/nfp/nfp_rxtx.c +18 -0
@@ -25,6 +25,8 @@ struct nfp_meta_parsed {uint32_t port_id;/**< Port id value */ uint32_t sa_idx;/**< IPsec SA index */ uint32_t hash;/**< RSS hash value */ +uint32_t mark_id;/**< Mark id value */ +uint16_t flags;/**< Bitmap to indicate if meta exist */ uint8_t hash_type;/**< RSS hash type */ uint8_t ipsec_type;/**< IPsec type */ uint8_t vlan_layer;/**< The valid number of value in @vlan[] */
@@ -290,6 +292,10 @@ nfp_net_parse_chained_meta(uint8_t *meta_base, meta->sa_idx =rte_be_to_cpu_32 (*(rte_be32_t *)meta_offset); meta->ipsec_type = meta_info &NFP_NET_META_FIELD_MASK ;break ; +case NFP_NET_META_MARK : + meta->flags |= (1 <<NFP_NET_META_MARK ); + meta->mark_id =rte_be_to_cpu_32 (*(rte_be32_t *)meta_offset); +break ;default :/* Unsupported metadata can be a performance issue */ return false;
@@ -434,6 +440,17 @@ nfp_net_parse_meta_ipsec(struct nfp_meta_parsed *meta, } } +static void +nfp_net_parse_meta_mark (const struct nfp_meta_parsed *meta, +struct rte_mbuf *mbuf) +{ +if (((meta->flags >>NFP_NET_META_MARK ) &0x1 ) ==0 ) +return ; + + mbuf->hash.fdir.hi = meta->mark_id; + mbuf->ol_flags |=RTE_MBUF_F_RX_FDIR |RTE_MBUF_F_RX_FDIR_ID ; +} +/* Parse the metadata from packet */ static void nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
@@ -458,6 +475,7 @@ nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,nfp_net_parse_meta_vlan (meta, rxds, rxq, mb);nfp_net_parse_meta_qinq (meta, rxq, mb);nfp_net_parse_meta_ipsec (meta, rxq, mb); +nfp_net_parse_meta_mark (meta, mb); }else {PMD_RX_LOG (DEBUG ,"RX chained metadata format is wrong!" ); }
Signature · 1 line
2.39.1
PATCH 11/11 net/nfp: support QUEUE flow action
In reply to Chaoyong HeAdd the corresponding logics to support the offload of QUEUE action.
--- drivers/net/nfp/nfp_net_flow.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/net/nfp/nfp_net_flow.c +18 -0
@@ -552,6 +552,20 @@ nfp_net_flow_action_mark(struct rte_flow *nfp_flow, action_data->mark_id = mark->id; } +static void +nfp_net_flow_action_queue (struct rte_flow *nfp_flow, +const struct rte_flow_action *action) +{ +struct nfp_net_cmsg_action *action_data; +const struct rte_flow_action_queue *queue; + + action_data = (struct nfp_net_cmsg_action *)nfp_flow->payload.action_data; + queue = action->conf; + + action_data->action |=NFP_NET_CMSG_ACTION_QUEUE ; + action_data->queue = queue->index; +} +static int nfp_net_flow_compile_actions (const struct rte_flow_action actions[],struct rte_flow *nfp_flow)
@@ -568,6 +582,10 @@ nfp_net_flow_compile_actions(const struct rte_flow_action actions[],PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_MARK" );nfp_net_flow_action_mark (nfp_flow, action);break ; +case RTE_FLOW_ACTION_TYPE_QUEUE : +PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_QUEUE" ); +nfp_net_flow_action_queue (nfp_flow, action); +break ;default :PMD_DRV_LOG (ERR ,"Unsupported action type: %d" , action->type);return -ENOTSUP ;
Signature · 1 line
2.39.1
Quoted 15 lines · Chaoyong He
Add the very basic
rte_flowsupport for corenic firmware.Chaoyong He (11):
net/nfp: move some source files
drivers: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items
drivers: support MARK flow action
net/nfp: support QUEUE flow action
Recheck-request: iol-compile-amd64-testing, iol-unit-amd64-testing
Quoted 17 lines · Chaoyong He
Quoted 15 lines
Add the very basic
rte_flowsupport for corenic firmware.Chaoyong He (11):
net/nfp: move some source files
drivers: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items
drivers: support MARK flow action
net/nfp: support QUEUE flow action
Quoted 1 line
Recheck-request: iol-compile-amd64-testing, iol-unit-amd64-testing
Seems both compile problems was introduced by this commit:
https://github.com/Corigine/dpdk-next-net-private/commit/34ff088cc24159c9fa6e61242efb76d0289b4e37
``` ethdev: set and query RSS hash algorithm Currently, rte_eth_rss_conf supports configuring and querying RSS hash functions, rss key and it's length, but not RSS hash algorithm. The structure ``rte_eth_dev_info`` is extended by adding a new field "rss_algo_capa". Drivers are responsible for reporting this capa and configurations of RSS hash algorithm can be verified based on the capability. The default value of "rss_algo_capa" is RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it. The structure ``rte_eth_rss_conf`` is extended by adding a new field "algorithm". This represents the RSS algorithms to apply. If the value of "algorithm" used for configuration is a gibberish value, drivers should report the error. To check whether the drivers report valid "algorithm", it is set to default value before querying in rte_eth_dev_rss_hash_conf_get(). Signed-off-by: Jie Hai <[email protected]> Signed-off-by: Dongdong Liu <[email protected]> Acked-by: Huisong Li <[email protected]> Acked-by: Chengwen Feng <[email protected]> Reviewed-by: Ferruh Yigit <[email protected]> ```
Which was not related with this patch series, I think?
Quoted 49 lines · Chaoyong He
Quoted 17 lines · Chaoyong He
Quoted 15 lines
Add the very basic
rte_flowsupport for corenic firmware.Chaoyong He (11):
net/nfp: move some source files
drivers: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items
drivers: support MARK flow action
net/nfp: support QUEUE flow actionQuoted 1 line
Recheck-request: iol-compile-amd64-testing, iol-unit-amd64-testing
Seems both compile problems was introduced by this commit:
https://github.com/Corigine/dpdk-next-net-private/commit/34ff088cc24159c9fa6e61242efb76d0289b4e37``` ethdev: set and query RSS hash algorithm Currently, rte_eth_rss_conf supports configuring and querying RSS hash functions, rss key and it's length, but not RSS hash algorithm. The structure ``rte_eth_dev_info`` is extended by adding a new field "rss_algo_capa". Drivers are responsible for reporting this capa and configurations of RSS hash algorithm can be verified based on the capability. The default value of "rss_algo_capa" is RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it. The structure ``rte_eth_rss_conf`` is extended by adding a new field "algorithm". This represents the RSS algorithms to apply. If the value of "algorithm" used for configuration is a gibberish value, drivers should report the error. To check whether the drivers report valid "algorithm", it is set to default value before querying in rte_eth_dev_rss_hash_conf_get(). Signed-off-by: Jie Hai <[email protected]> Signed-off-by: Dongdong Liu <[email protected]> Acked-by: Huisong Li <[email protected]> Acked-by: Chengwen Feng <[email protected]> Reviewed-by: Ferruh Yigit <[email protected]> ```
Quoted 2 lines
Which was not related with this patch series, I think?
Yes, build error is not related with this patch, and it is fixed in next-net, that is why I tried to re-trigger the test, but it didn't work somehow [1].
Btw, this set is pending because of other change request, not because of the reported build failure.
[1]
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
Quoted 50 lines · Chaoyong He
Quoted 17 lines
Quoted 17 lines · Chaoyong He
Quoted 15 lines
Add the very basic
rte_flowsupport for corenic firmware.Chaoyong He (11):
net/nfp: move some source files
drivers: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items
drivers: support MARK flow action
net/nfp: support QUEUE flow actionQuoted 4 lines
Quoted 1 line
Recheck-request: iol-compile-amd64-testing, iol-unit-amd64-testing
Seems both compile problems was introduced by this commit:
https://github.com/Corigine/dpdk-next-net-private/commit/34ff088cc2415
Quoted 27 lines
9c9fa6e61242efb76d0289b4e37```
ethdev: set and query RSS hash algorithm Currently,rte_eth_rss_confsupports configuring and querying RSS hash functions, rss key and it's length, but not RSS hash algorithm.The structure ``rte_eth_dev_info`` is extended by adding a new field "
rss_algo_capa". Drivers are responsible for reporting this capa and configurations of RSS hash algorithm can be verified based on the capability. The default value of "rss_algo_capa" isRTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT)if drivers do not report it.The structure ``rte_eth_rss_conf`` is extended by adding a new field "algorithm". This represents the RSS algorithms to apply. If the value of "algorithm" used for configuration is a gibberish value, drivers should report the error.
To check whether the drivers report valid "algorithm", it is set to default value before querying in
rte_eth_dev_rss_hash_conf_get().Signed-off-by Jie Hai <[email protected]>Signed-off-by Dongdong Liu <[email protected]>Acked-by Huisong Li <[email protected]>Acked-by Chengwen Feng <[email protected]>Reviewed-by Ferruh Yigit <[email protected]> ```
Quoted 8 lines
Quoted 2 lines
Which was not related with this patch series, I think?
Yes, build error is not related with this patch, and it is fixed in next-net, that is why I tried to re-trigger the test, but it didn't work somehow [1].
Btw, this set is pending because of other change request, not because of the reported build failure.
Oh, yes, I understand, the reason is I need to also update the 'nfp.ini' document. But we decide delay this patch set to the next version of DPDK as we found still need some modification to the logic of flower firmware.
Thanks.
Recheck-request: iol-compile-amd64-testing, iol-unit-amd64-testing
Weird. I will dig up the original job which polled for the previous retest request, and see whether this new one runs through properly.
Sorry, now I understand what is causing confusion. When a retest is requested, that retest is done on the original dpdk artifact we created for the patchseries. We don't pull again, re-apply, and then rerun the testing. I think that is the behavior you were expecting, Ferruh.
We have discussed whether this is an important option to support in future iterations of the retest-request feature. One idea is to add another option in the retest request schema which allows for the requester to indicate they want the patch re-applied onto the newer branch, and testing rerun with that new dpdk. It's good to see that this is a use case which would see application. Will be aiming to add this support in the future.
Quoted 5 lines · Patrick Robb
Sorry, now I understand what is causing confusion. When a retest is requested, that retest is done on the original dpdk artifact we created for the patchseries. We don't pull again, re-apply, and then rerun the testing. I think that is the behavior you were expecting, Ferruh.
Hi Patrick,
Thanks for clarification, yes that was my expectation.
Quoted 8 lines
We have discussed whether this is an important option to support in future iterations of the retest-request feature. One idea is to add another option in the retest request schema which allows for the requester to indicate they want the patch re-applied onto the newer branch, and testing rerun with that new dpdk. It's good to see that this is a use case which would see application. Will be aiming to add this support in the future.
I am also not sure if this is the common usecase, lets record the need, we can decide what to support based on it.
And as a generic approach, what about following syntax:
Recheck-request,attribute=value: ...
And for above case, attribute can be "pull=true" ...
Quoted 11 lines · Ferruh Yigit
I am also not sure if this is the common usecase, lets record the need, we can decide what to support based on it.
And as a generic approach, what about following syntax:
Recheck-request,attribute=value: ...And for above case, attribute can be "pull=true" ...
That syntax looks reasonable, and if it's omitted, default is pull=false.
Thanks!
Quoted 15 lines · Chaoyong He
Add the very basic
rte_flowsupport for corenic firmware.Chaoyong He (11):
net/nfp: move some source files
drivers: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items
drivers: support MARK flow action
net/nfp: support QUEUE flow action
./devtools/check-doc-vs-code.sh gives some warnings [1], can you please check them?
Please update the .ini file in the relevant patch where feature is added, don't update it in a separate patch.
[1]
$ ./devtools/check-doc-vs-code.sh
rte_flow doc out of sync for nfp
action mark
action queuev2 cover Add basic flow support for corenic firmware
In reply to Chaoyong HeAdd the very basic rte_flow support for corenic firmware.
---
v2:
* Update the 'nfp.ini' document.
* Rebase to the latest main branch.
---
Chaoyong He (11):
net/nfp: move some source files
net/nfp: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items net/nfp: support MARK flow action
net/nfp: support QUEUE flow action
doc/guides/nics/features/nfp.ini | 2 +
drivers/common/nfp/nfp_common_ctrl.h | 2 +
drivers/net/nfp/flower/nfp_conntrack.h | 2 +-
drivers/net/nfp/flower/nfp_flower_cmsg.h | 2 +-
.../{nfp_flow.c => flower/nfp_flower_flow.c} | 4 +-
.../{nfp_flow.h => flower/nfp_flower_flow.h} | 10 +-
.../net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/meson.build | 4 +-
drivers/net/nfp/nfp_ethdev.c | 28 +-
drivers/net/nfp/nfp_net_cmsg.c | 66 ++
drivers/net/nfp/nfp_net_cmsg.h | 176 +++
drivers/net/nfp/nfp_net_common.h | 12 +
drivers/net/nfp/nfp_net_ctrl.h | 1 +
drivers/net/nfp/nfp_net_flow.c | 1017 +++++++++++++++++
drivers/net/nfp/nfp_net_flow.h | 30 +
drivers/net/nfp/nfp_rxtx.c | 18 +
16 files changed, 1359 insertions(+), 17 deletions(-)
rename drivers/net/nfp/{nfp_flow.c => flower/nfp_flower_flow.c} (99%)
rename drivers/net/nfp/{nfp_flow.h => flower/nfp_flower_flow.h} (96%)
create mode 100644 drivers/net/nfp/nfp_net_cmsg.c
create mode 100644 drivers/net/nfp/nfp_net_cmsg.h
create mode 100644 drivers/net/nfp/nfp_net_flow.c
create mode 100644 drivers/net/nfp/nfp_net_flow.hSignature · 1 line
2.39.1
PATCH v2 1/11 net/nfp: move some source files
Rename module 'nfp_flow' into 'nfp_flower_flow' and move the source files into the 'flower' sub-directory.
---
drivers/net/nfp/flower/nfp_conntrack.h | 2 +-
drivers/net/nfp/flower/nfp_flower_cmsg.h | 2 +-
.../net/nfp/{nfp_flow.c => flower/nfp_flower_flow.c} | 4 ++--
.../net/nfp/{nfp_flow.h => flower/nfp_flower_flow.h} | 10 +++++-----
drivers/net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/meson.build | 2 +-
6 files changed, 11 insertions(+), 11 deletions(-)
rename drivers/net/nfp/{nfp_flow.c => flower/nfp_flower_flow.c} (99%)
rename drivers/net/nfp/{nfp_flow.h => flower/nfp_flower_flow.h} (96%)drivers/net/nfp/flower/nfp_conntrack.h +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <rte_flow.h> -#include "../nfp_flow.h" +#include "nfp_flower_flow.h" struct nfp_ct_map_entry ;
drivers/net/nfp/flower/nfp_flower_cmsg.h +1 -1
@@ -6,8 +6,8 @@ #ifndef __NFP_CMSG_H__ #define __NFP_CMSG_H__ -#include "../nfp_flow.h" #include "nfp_flower.h" +#include "nfp_flower_flow.h" struct nfp_flower_cmsg_hdr { rte_be16_t pad;
drivers/net/nfp/flower/nfp_flower_flow.c renamed from drivers/net/nfp/nfp_flow.c +2 -2
@@ -3,7 +3,7 @@* All rights reserved. */ -#include "nfp_flow.h" +#include "nfp_flower_flow.h" #include <rte_flow_driver.h> #include <rte_hash.h>
@@ -4318,7 +4318,7 @@ static const struct rte_flow_ops nfp_flow_ops = { };int -nfp_net_flow_ops_get (struct rte_eth_dev *dev, +nfp_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops) {if ((dev->data->dev_flags &RTE_ETH_DEV_REPRESENTOR ) ==0 ) {
drivers/net/nfp/flower/nfp_flower_flow.h renamed from drivers/net/nfp/nfp_flow.h +5 -5
@@ -3,10 +3,10 @@* All rights reserved. */ -#ifndef __NFP_FLOW_H__ -#define __NFP_FLOW_H__ +#ifndef __NFP_FLOWER_FLOW_H__ +#define __NFP_FLOWER_FLOW_H__ -#include "nfp_net_common.h" +#include "../nfp_net_common.h" /* The firmware expects lengths in units of long words */ #define NFP_FL_LW_SIZ 2
@@ -182,7 +182,7 @@ struct nfp_flower_representor;int nfp_flow_priv_init (struct nfp_pf_dev *pf_dev);void nfp_flow_priv_uninit (struct nfp_pf_dev *pf_dev); -int nfp_net_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops); +int nfp_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops);bool nfp_flow_inner_item_get (const struct rte_flow_item items[],const struct rte_flow_item **inner_item); struct rte_flow *nfp_flow_process(struct nfp_flower_representor *representor,
@@ -202,4 +202,4 @@ int nfp_flow_destroy(struct rte_eth_dev *dev,struct rte_flow *nfp_flow, struct rte_flow_error *error); -#endif /* __NFP_FLOW_H__ */ +#endif /* __NFP_FLOWER_FLOW_H__ */
drivers/net/nfp/flower/nfp_flower_representor.c +1 -1
@@ -435,7 +435,7 @@ static const struct eth_dev_ops nfp_flower_repr_dev_ops = { .mac_addr_set = nfp_flower_repr_mac_addr_set, .fw_version_get = nfp_net_firmware_version_get, - .flow_ops_get = nfp_net_flow_ops_get, + .flow_ops_get = nfp_flow_ops_get, .mtr_ops_get = nfp_net_mtr_ops_get, };
drivers/net/nfp/meson.build +1 -1
@@ -11,6 +11,7 @@ sources = files( 'flower/nfp_flower.c', 'flower/nfp_flower_cmsg.c', 'flower/nfp_flower_ctrl.c', + 'flower/nfp_flower_flow.c', 'flower/nfp_flower_representor.c', 'nfd3/nfp_nfd3_dp.c', 'nfdk/nfp_nfdk_dp.c',
@@ -30,7 +31,6 @@ sources = files( 'nfp_cpp_bridge.c', 'nfp_ethdev.c', 'nfp_ethdev_vf.c', - 'nfp_flow.c', 'nfp_ipsec.c', 'nfp_logs.c', 'nfp_mtr.c',
Signature · 1 line
2.39.1
PATCH v2 2/11 net/nfp: add the structures and functions for flow offload
In reply to Chaoyong HeAdd the structures and functions to process flow table, which is used in the rte_flow offload logics.
This module is used for the CoreNIC firmware.
--- drivers/common/nfp/nfp_common_ctrl.h | 1 + drivers/net/nfp/meson.build | 1 + drivers/net/nfp/nfp_ethdev.c | 27 ++++- drivers/net/nfp/nfp_net_common.h | 11 ++ drivers/net/nfp/nfp_net_flow.c | 166 +++++++++++++++++++++++++++ drivers/net/nfp/nfp_net_flow.h | 28 +++++ 6 files changed, 228 insertions(+), 6 deletions(-) create mode 100644 drivers/net/nfp/nfp_net_flow.c create mode 100644 drivers/net/nfp/nfp_net_flow.h
drivers/common/nfp/nfp_common_ctrl.h +1 -0
@@ -223,6 +223,7 @@ struct nfp_net_fw_ver {#define NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP (0x1 << 3)/**< SA short match lookup */ #define NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP (0x1 << 4)/**< SA long match lookup */ #define NFP_NET_CFG_CTRL_MULTI_PF (0x1 << 5) +#define NFP_NET_CFG_CTRL_FLOW_STEER (0x1 << 8)/**< Flow Steering */ #define NFP_NET_CFG_CTRL_IN_ORDER (0x1 << 11)/**< Virtio in-order flag */ #define NFP_NET_CFG_CAP_WORD1 0x00a4
drivers/net/nfp/meson.build +1 -0
@@ -36,6 +36,7 @@ sources = files( 'nfp_mtr.c', 'nfp_net_common.c', 'nfp_net_ctrl.c', + 'nfp_net_flow.c', 'nfp_rxtx.c', )
drivers/net/nfp/nfp_ethdev.c +21 -6
@@ -23,6 +23,7 @@#include "nfp_cpp_bridge.h" #include "nfp_ipsec.h" #include "nfp_logs.h" +#include "nfp_net_flow.h" #define NFP_PF_DRIVER_NAME net_nfp_pf
@@ -151,6 +152,10 @@ nfp_net_start(struct rte_eth_dev *dev) ctrl_extend |=NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP |NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP ; +/* Enable flow steer by extend ctrl word1. */ +if ((cap_extend &NFP_NET_CFG_CTRL_FLOW_STEER ) !=0 ) + ctrl_extend |=NFP_NET_CFG_CTRL_FLOW_STEER ; + update =NFP_NET_CFG_UPDATE_GEN ;if (nfp_ext_reconfig (hw, ctrl_extend, update) !=0 )return -EIO ;
@@ -323,6 +328,10 @@ nfp_net_uninit(struct rte_eth_dev *eth_dev)struct nfp_net_hw *net_hw; net_hw = eth_dev->data->dev_private; + +if ((net_hw->super.cap_ext &NFP_NET_CFG_CTRL_FLOW_STEER ) !=0 ) +nfp_net_flow_priv_uninit (net_hw->pf_dev, net_hw->idx); +rte_free (net_hw->eth_xstats_base);nfp_ipsec_uninit (eth_dev);if (net_hw->mac_stats_area !=NULL )
@@ -762,6 +771,14 @@ nfp_net_init(struct rte_eth_dev *eth_dev)/* Recording current stats counters values */ nfp_net_stats_reset (eth_dev); +if ((hw->cap_ext &NFP_NET_CFG_CTRL_FLOW_STEER ) !=0 ) { + err =nfp_net_flow_priv_init (pf_dev, port); +if (err !=0 ) { +PMD_INIT_LOG (ERR ,"Init net flow priv failed" ); + goto xstats_free; + } + } +return 0 ; xstats_free:
@@ -1195,13 +1212,11 @@ nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev, port_cleanup:for (i =0 ; i < app_fw_nic->total_phyports; i++) { id =nfp_function_id_get (pf_dev, i); + hw = app_fw_nic->ports[id]; -if (app_fw_nic->ports[id] !=NULL && - app_fw_nic->ports[id]->eth_dev !=NULL ) { -struct rte_eth_dev *tmp_dev; - tmp_dev = app_fw_nic->ports[id]->eth_dev; -nfp_net_uninit (tmp_dev); -rte_eth_dev_release_port (tmp_dev); +if (hw !=NULL && hw->eth_dev !=NULL ) { +nfp_net_uninit (hw->eth_dev); +rte_eth_dev_release_port (hw->eth_dev); } }nfp_cpp_area_release_free (pf_dev->ctrl_area);
drivers/net/nfp/nfp_net_common.h +11 -0
@@ -108,6 +108,14 @@ struct nfp_pf_dev {struct nfp_multi_pf multi_pf; }; +#define NFP_NET_FLOW_LIMIT 1024 + +struct nfp_net_priv { +uint32_t hash_seed;/**< Hash seed for hash tables in this structure. */ +struct rte_hash *flow_table;/**< Hash table to store flow rules. */ +uint16_t flow_count;/**< Flow count in hash table */ +}; +struct nfp_app_fw_nic {/** Backpointer to the PF device */ struct nfp_pf_dev *pf_dev;
@@ -177,6 +185,9 @@ struct nfp_net_hw {struct nfp_net_tlv_caps tlv_caps;struct nfp_net_ipsec_data *ipsec_data; + +/** Used for rte_flow of CoreNIC firmware */ +struct nfp_net_priv *priv; }; static inline uint32_t
drivers/net/nfp/nfp_net_flow.c new file +166 -0
166 lines not on this page · raw message
drivers/net/nfp/nfp_net_flow.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright (c) 2023 Corigine, Inc. +* All rights reserved. +*/ + +#ifndef __NFP_NET_FLOW_H__ +#define __NFP_NET_FLOW_H__ + +#include "nfp_net_common.h" + +struct nfp_net_flow_payload { +uint16_t cmsg_type; +uint8_t match_len; +uint8_t action_len; +char *match_data; +char *action_data; +}; + +struct rte_flow { +struct nfp_net_flow_payload payload; +uint32_t hash_key; +uint32_t port_id; +}; + +int nfp_net_flow_priv_init (struct nfp_pf_dev *pf_dev,uint16_t port); +void nfp_net_flow_priv_uninit (struct nfp_pf_dev *pf_dev,uint16_t port); + +#endif /* __NFP_NET_FLOW_H__ */
Signature · 1 line
2.39.1
PATCH v2 3/11 net/nfp: add the control message channel
In reply to Chaoyong HeUsing the mailbox, which serves as the control message channel between driver and CoreNIC firmware.
--- drivers/net/nfp/meson.build | 1 + drivers/net/nfp/nfp_net_cmsg.c | 66 ++++++++++++++++++++++++++++++++++ drivers/net/nfp/nfp_net_cmsg.h | 37 +++++++++++++++++++ drivers/net/nfp/nfp_net_ctrl.h | 1 + 4 files changed, 105 insertions(+) create mode 100644 drivers/net/nfp/nfp_net_cmsg.c create mode 100644 drivers/net/nfp/nfp_net_cmsg.h
drivers/net/nfp/meson.build +1 -0
@@ -34,6 +34,7 @@ sources = files( 'nfp_ipsec.c', 'nfp_logs.c', 'nfp_mtr.c', + 'nfp_net_cmsg.c', 'nfp_net_common.c', 'nfp_net_ctrl.c', 'nfp_net_flow.c',
drivers/net/nfp/nfp_net_cmsg.c new file +66 -0
66 lines not on this page · raw message
drivers/net/nfp/nfp_net_cmsg.h new file +37 -0
@@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright (c) 2023 Corigine, Inc. +* All rights reserved. +*/ + +#ifndef __NFP_NET_CMSG_H__ +#define __NFP_NET_CMSG_H__ + +#include "nfp_net_common.h" + +enum nfp_net_cfg_mbox_cmd { +NFP_NET_CFG_MBOX_CMD_FS_ADD_V4 ,/* Add Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_V4 ,/* Delete Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_ADD_V6 ,/* Add Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_V6 ,/* Delete Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_ADD_ETHTYPE ,/* Add Flow Steer rule for Ethtype table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_ETHTYPE ,/* Delete Flow Steer rule for Ethtype table */ +}; + +enum nfp_net_cfg_mbox_ret { +NFP_NET_CFG_MBOX_RET_FS_OK ,/* No error happen */ +NFP_NET_CFG_MBOX_RET_FS_ERR_NO_SPACE ,/* Return error code no space */ +NFP_NET_CFG_MBOX_RET_FS_ERR_MASK_FULL ,/* Return error code mask table full */ +NFP_NET_CFG_MBOX_RET_FS_ERR_CMD_INVALID ,/* Return error code invalid cmd */ +}; + +/* 4B cmd, and up to 500B data. */ +struct nfp_net_cmsg { +uint32_t cmd;/**< One of nfp_net_cfg_mbox_cmd */ +uint32_t data[0 ]; +}; + +struct nfp_net_cmsg *nfp_net_cmsg_alloc (uint32_t msg_size); +void nfp_net_cmsg_free (struct nfp_net_cmsg *cmsg); +int nfp_net_cmsg_xmit (struct nfp_net_hw *hw,struct nfp_net_cmsg *cmsg,uint32_t msg_size); + +#endif /* __NFP_NET_CMSG_H__ */
drivers/net/nfp/nfp_net_ctrl.h +1 -0
@@ -92,6 +92,7 @@#define NFP_NET_CFG_MBOX_SIMPLE_VAL 0x8#define NFP_NET_CFG_MBOX_CMD_IPSEC 3 +#define NFP_NET_CFG_MBOX_CMD_FLOW_STEER 10/* * TLV capabilities
Signature · 1 line
2.39.1
Re: [PATCH v2 03/11] net/nfp: add the control message channel
Quoted 28 lines · Chaoyong He
drivers/net/nfp/nfp_net_cmsg.h new file +21
-0@@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright (c) 2023 Corigine, Inc. +* All rights reserved. +*/ + +#ifndef __NFP_NET_CMSG_H__ +#define __NFP_NET_CMSG_H__ + +#include "nfp_net_common.h" + +enum nfp_net_cfg_mbox_cmd { +NFP_NET_CFG_MBOX_CMD_FS_ADD_V4 ,/* Add Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_V4 ,/* Delete Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_ADD_V6 ,/* Add Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_V6 ,/* Delete Flow Steer rule for V4 table */ +NFP_NET_CFG_MBOX_CMD_FS_ADD_ETHTYPE ,/* Add Flow Steer rule for Ethtype table */ +NFP_NET_CFG_MBOX_CMD_FS_DEL_ETHTYPE ,/* Delete Flow Steer rule for Ethtype table */ +}; + +enum nfp_net_cfg_mbox_ret { + NFP_NET_CFG_MBOX_RET_FS_OK, /* No error happen */
drivers/net/nfp/nfp_net_cmsg.h line 31
Quoted 10 lines
drivers/net/nfp/nfp_net_cmsg.h new file +10
-0+NFP_NET_CFG_MBOX_RET_FS_ERR_NO_SPACE ,/* Return error code no space */ +NFP_NET_CFG_MBOX_RET_FS_ERR_MASK_FULL ,/* Return error code mask table full */ + NFP_NET_CFG_MBOX_RET_FS_ERR_CMD_INVALID, /* Return error code invalid cmd */ +}; + +/* 4B cmd, and up to 500B data. */ +struct nfp_net_cmsg { +uint32_t cmd;/**< One of nfp_net_cfg_mbox_cmd */ +uint32_t data[0 ]; +};
Converted 'data' to flex array, 'uint32_t data[];' while merging,
since there is already an effort to switch all zero length array to C99 standard flex array:
https://patchwork.dpdk.org/project/dpdk/list/?series=30410
PATCH v2 4/11 net/nfp: support flow API for CoreNIC firmware
In reply to Chaoyong HeAdd the flow validate/create/destroy/flush API of nfp PMD with CoreNIC firmware.
The flow create API construct a control cmsg and send it to firmware, then add this flow to the hash table.
The flow destroy API construct a control cmsg and send it to firmware, then delete this flow from the hash table.
The flow flush API just iterate the flows in hash table and call the flow destroy API.
--- drivers/net/nfp/nfp_ethdev.c | 1 + drivers/net/nfp/nfp_net_cmsg.h | 28 +++ drivers/net/nfp/nfp_net_common.h | 1 + drivers/net/nfp/nfp_net_flow.c | 409 ++++++++++++++++++++++++++++++- drivers/net/nfp/nfp_net_flow.h | 2 + 5 files changed, 434 insertions(+), 7 deletions(-)
drivers/net/nfp/nfp_ethdev.c +1 -0
@@ -604,6 +604,7 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = { .fw_version_get = nfp_net_firmware_version_get, .flow_ctrl_get = nfp_net_flow_ctrl_get, .flow_ctrl_set = nfp_net_flow_ctrl_set, + .flow_ops_get = nfp_net_flow_ops_get, }; static inline void
drivers/net/nfp/nfp_net_cmsg.h +28 -0
@@ -8,6 +8,34 @@#include "nfp_net_common.h" +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ +#define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ +#define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */ + +/** +* Action data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-------------------------------+-------------------------------+ +* 0 | | Queue | Actions | +* +-----------------+-------------+-------------------------------+ +* 1 | Mark ID | +* +---------------------------------------------------------------+ +* +* Queue – Queue ID, 7 bits. +* Actions – An action bitmap, each bit represents an action type: +* - Bit 0: Drop action. Drop the packet. +* - Bit 1: Queue action. Use the queue specified by “Queue” field. +* If not set, the queue is usually specified by RSS. +* - Bit 2: Mark action. Mark packet with Mark ID. +*/ +struct nfp_net_cmsg_action { +uint16_t action; +uint8_t queue; +uint8_t spare; +uint16_t mark_id; +}; +enum nfp_net_cfg_mbox_cmd {NFP_NET_CFG_MBOX_CMD_FS_ADD_V4 ,/* Add Flow Steer rule for V4 table */ NFP_NET_CFG_MBOX_CMD_FS_DEL_V4 ,/* Delete Flow Steer rule for V4 table */
drivers/net/nfp/nfp_net_common.h +1 -0
@@ -114,6 +114,7 @@ struct nfp_net_priv {uint32_t hash_seed;/**< Hash seed for hash tables in this structure. */ struct rte_hash *flow_table;/**< Hash table to store flow rules. */ uint16_t flow_count;/**< Flow count in hash table */ +bool flow_position[NFP_NET_FLOW_LIMIT ];/**< Flow position array */ };struct nfp_app_fw_nic {
drivers/net/nfp/nfp_net_flow.c +402 -7
460 lines not on this page · raw message
drivers/net/nfp/nfp_net_flow.h +2 -0
@@ -20,9 +20,11 @@ struct rte_flow {struct nfp_net_flow_payload payload;uint32_t hash_key;uint32_t port_id; + uint32_t position; /**< Use as priority */ };int nfp_net_flow_priv_init (struct nfp_pf_dev *pf_dev,uint16_t port);void nfp_net_flow_priv_uninit (struct nfp_pf_dev *pf_dev,uint16_t port); +int nfp_net_flow_ops_get (struct rte_eth_dev *dev,const struct rte_flow_ops **ops);#endif /* __NFP_NET_FLOW_H__ */
Signature · 1 line
2.39.1
PATCH v2 5/11 net/nfp: support Ethernet flow item
In reply to Chaoyong HeAdd the corresponding data structure and logics, to support the offload of ethernet item.
--- drivers/net/nfp/nfp_net_cmsg.h | 13 +++ drivers/net/nfp/nfp_net_flow.c | 169 +++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+)
drivers/net/nfp/nfp_net_cmsg.h +13 -0
@@ -8,6 +8,19 @@#include "nfp_net_common.h" +/** +* Match EtherType data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-------------------------------+-------------------------------+ +* 0 | | Ethtype | +* +-----------------+-------------+-------------------------------+ +*/ +struct nfp_net_cmsg_match_eth { +uint16_t ether_type; +uint16_t spare; +}; +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ #define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ #define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */
drivers/net/nfp/nfp_net_flow.c +169 -0
193 lines not on this page · raw message
Signature · 1 line
2.39.1
PATCH v2 6/11 net/nfp: support drop flow action
In reply to Chaoyong HeAdd the corresponding logics to support the offload of drop action.
--- drivers/net/nfp/nfp_net_flow.c | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
drivers/net/nfp/nfp_net_flow.c +38 -1
@@ -335,6 +335,37 @@ nfp_net_flow_compile_items(const struct rte_flow_item items[],return ret; } +static void +nfp_net_flow_action_drop (struct rte_flow *nfp_flow) +{ +struct nfp_net_cmsg_action *action_data; + + action_data = (struct nfp_net_cmsg_action *)nfp_flow->payload.action_data; + + action_data->action =NFP_NET_CMSG_ACTION_DROP ; +} + +static int +nfp_net_flow_compile_actions (const struct rte_flow_action actions[], +struct rte_flow *nfp_flow) +{ +const struct rte_flow_action *action; + +for (action = actions; action->type !=RTE_FLOW_ACTION_TYPE_END ; ++action) { +switch (action->type) { +case RTE_FLOW_ACTION_TYPE_DROP : +PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_DROP" ); +nfp_net_flow_action_drop (nfp_flow); +return 0 ; +default : +PMD_DRV_LOG (ERR ,"Unsupported action type: %d" , action->type); +return -ENOTSUP ; + } + } + +return 0 ; +} +static void nfp_net_flow_process_priority(__rte_unused struct rte_flow *nfp_flow,uint32_t match_len)
@@ -349,7 +380,7 @@ static struct rte_flow * nfp_net_flow_setup(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, const struct rte_flow_item items[], - __rte_unused const struct rte_flow_action actions[]) + const struct rte_flow_action actions[]) { int ret;char *hash_data;
@@ -387,6 +418,12 @@ nfp_net_flow_setup(struct rte_eth_dev *dev, goto free_flow; } + ret =nfp_net_flow_compile_actions (actions, nfp_flow); +if (ret !=0 ) { +PMD_DRV_LOG (ERR ,"NFP flow action process failed." ); + goto free_flow; + } +/* Calculate and store the hash_key for later use */ hash_data = nfp_flow->payload.match_data; nfp_flow->hash_key = rte_jhash(hash_data, match_len + action_len,
Signature · 1 line
2.39.1
PATCH v2 7/11 net/nfp: support IPv4 flow item
In reply to Chaoyong HeAdd the corresponding data structure and logics, to support the offload of IPv4 item.
--- drivers/net/nfp/nfp_net_cmsg.h | 37 ++++++++++++++++++++++ drivers/net/nfp/nfp_net_flow.c | 58 ++++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 2 deletions(-)
drivers/net/nfp/nfp_net_cmsg.h +37 -0
@@ -21,6 +21,43 @@ struct nfp_net_cmsg_match_eth {uint16_t spare; }; +/** +* Match IPv4 data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-----+-------------------------+---------------+---------------+ +* 0 | | Position | L4 Proto | L4 Proto Mask | +* +-----+-------------------------+---------------+---------------+ +* 1 | SIP4 | +* +---------------------------------------------------------------+ +* 2 | SIP4 Mask | +* +---------------------------------------------------------------+ +* 3 | DIP4 | +* +---------------------------------------------------------------+ +* 4 | DIP4 Mask | +* +-------------------------------+-------------------------------+ +* 5 | SPort | SPort Mask | +* +-------------------------------+-------------------------------+ +* 6 | DPort | DPort Mask | +* +-----------------+-------------+-------------------------------+ +* +* Position – Position index of the rule, 13bits. +* As priority, smaller value indicates higher priority. +*/ +struct nfp_net_cmsg_match_v4 { +uint8_t l4_protocol_mask; +uint8_t l4_protocol; +uint16_t position; +uint32_t src_ipv4; +uint32_t src_ipv4_mask; +uint32_t dst_ipv4; +uint32_t dst_ipv4_mask; +uint16_t src_port; +uint16_t src_port_mask; +uint16_t dst_port; +uint16_t dst_port_mask; +}; +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ #define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ #define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */
drivers/net/nfp/nfp_net_flow.c +56 -2
86 lines not on this page · raw message
Signature · 1 line
2.39.1
PATCH v2 8/11 net/nfp: support IPv6 flow item
In reply to Chaoyong HeAdd the corresponding data structure and logics, to support the offload of IPv6 item.
--- drivers/net/nfp/nfp_net_cmsg.h | 61 +++++++++++++++++++++++++++ drivers/net/nfp/nfp_net_flow.c | 76 +++++++++++++++++++++++++++++++++- 2 files changed, 136 insertions(+), 1 deletion(-)
drivers/net/nfp/nfp_net_cmsg.h +61 -0
@@ -58,6 +58,67 @@ struct nfp_net_cmsg_match_v4 {uint16_t dst_port_mask; }; +/** +* Match IPv6 data +* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +* Word +-----+-------------------------+---------------+---------------+ +* 0 | | Position | L4 Proto | L4 Proto Mask | +* +-----+-------------------------+---------------+---------------+ +* 1 | SIP6 (0-3B) | +* +---------------------------------------------------------------+ +* 2 | SIP6 (4-7B) | +* +---------------------------------------------------------------+ +* 3 | SIP6 (8-11B) | +* +---------------------------------------------------------------+ +* 4 | SIP6 (12-15B) | +* +---------------------------------------------------------------+ +* 5 | SIP6 Mask (0-3B) | +* +---------------------------------------------------------------+ +* 6 | SIP6 Mask (4-7B) | +* +---------------------------------------------------------------+ +* 7 | SIP6 Mask (8-11B) | +* +---------------------------------------------------------------+ +* 8 | SIP6 Mask (12-15B) | +* +---------------------------------------------------------------+ +* 9 | DIP6 (0-3B) | +* +---------------------------------------------------------------+ +* 10 | DIP6 (4-7B) | +* +---------------------------------------------------------------+ +* 11 | DIP6 (8-11B) | +* +---------------------------------------------------------------+ +* 12 | DIP6 (12-15B) | +* +---------------------------------------------------------------+ +* 13 | DIP6 Mask (0-3B) | +* +---------------------------------------------------------------+ +* 14 | DIP6 Mask (4-7B) | +* +---------------------------------------------------------------+ +* 15 | DIP6 Mask (8-11B) | +* +---------------------------------------------------------------+ +* 16 | DIP6 Mask (12-15B) | +* +-------------------------------+-------------------------------+ +* 17 | SPort | SPort Mask | +* +-------------------------------+-------------------------------+ +* 18 | DPort | DPort Mask | +* +-----------------+-------------+-------------------------------+ +* +* Position – Position index of the rule, 13bits. +* As priority, smaller value indicates higher priority. +*/ +struct nfp_net_cmsg_match_v6 { +uint8_t l4_protocol_mask; +uint8_t l4_protocol; +uint16_t position; +uint8_t src_ipv6[16 ]; +uint8_t src_ipv6_mask[16 ]; +uint8_t dst_ipv6[16 ]; +uint8_t dst_ipv6_mask[16 ]; +uint16_t src_port_mask; +uint16_t src_port; +uint16_t dst_port_mask; +uint16_t dst_port; +}; +#define NFP_NET_CMSG_ACTION_DROP (0x1 << 0)/* Drop action */ #define NFP_NET_CMSG_ACTION_QUEUE (0x1 << 1)/* Queue action */ #define NFP_NET_CMSG_ACTION_MARK (0x1 << 2)/* Mark action */
drivers/net/nfp/nfp_net_flow.c +75 -1
110 lines not on this page · raw message
Signature · 1 line
2.39.1
PATCH v2 9/11 net/nfp: support TCP/UDP/SCTP flow items
In reply to Chaoyong HeAdd the corresponding logics to support the offload of TCP/UDP/SCTP items.
--- drivers/net/nfp/nfp_net_flow.c | 86 ++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+)
drivers/net/nfp/nfp_net_flow.c +86 -0
@@ -309,6 +309,53 @@ nfp_net_flow_merge_ipv6(struct rte_flow *nfp_flow,return 0 ; } +static int +nfp_flow_merge_l4 (struct rte_flow *nfp_flow, +const struct rte_flow_item *item, +const struct nfp_net_flow_item_proc *proc) +{ +const struct rte_flow_item_tcp *mask; +const struct rte_flow_item_tcp *spec; +struct nfp_net_cmsg_match_v4 *ipv4 =NULL ; +struct nfp_net_cmsg_match_v6 *ipv6 =NULL ; + + spec = item->spec; +if (spec ==NULL ) { +PMD_DRV_LOG (ERR ,"NFP flow merge tcp: no item->spec!" ); +return -EINVAL ; + } + + mask = (item->mask !=NULL ) ? item->mask : proc->mask_default; + +switch (nfp_flow->payload.cmsg_type) { +case NFP_NET_CFG_MBOX_CMD_FS_ADD_V4 : + ipv4 = (struct nfp_net_cmsg_match_v4 *)nfp_flow->payload.match_data; +break ; +case NFP_NET_CFG_MBOX_CMD_FS_ADD_V6 : + ipv6 = (struct nfp_net_cmsg_match_v6 *)nfp_flow->payload.match_data; +break ; +default : +PMD_DRV_LOG (ERR ,"L3 layer neither IPv4 nor IPv6." ); +return -EINVAL ; + } + +if (ipv4 !=NULL ) { + ipv4->src_port_mask =rte_be_to_cpu_16 (mask->hdr.src_port); + ipv4->dst_port_mask =rte_be_to_cpu_16 (mask->hdr.dst_port); + + ipv4->src_port =rte_be_to_cpu_16 (spec->hdr.src_port); + ipv4->dst_port =rte_be_to_cpu_16 (spec->hdr.dst_port); + }else { + ipv6->src_port_mask =rte_be_to_cpu_16 (mask->hdr.src_port); + ipv6->dst_port_mask =rte_be_to_cpu_16 (mask->hdr.dst_port); + + ipv6->src_port =rte_be_to_cpu_16 (spec->hdr.src_port); + ipv6->dst_port =rte_be_to_cpu_16 (spec->hdr.dst_port); + } + +return 0 ; +} +/* Graph of supported items and associated process function */ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { [RTE_FLOW_ITEM_TYPE_END ] = {
@@ -320,6 +367,9 @@ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { .merge = nfp_net_flow_merge_eth, }, [RTE_FLOW_ITEM_TYPE_IPV4] = { + .next_item =NEXT_ITEM (RTE_FLOW_ITEM_TYPE_TCP , +RTE_FLOW_ITEM_TYPE_UDP , + RTE_FLOW_ITEM_TYPE_SCTP), .mask_support = &(const struct rte_flow_item_ipv4 ){ .hdr = { .next_proto_id =0xff ,
@@ -332,6 +382,9 @@ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { .merge = nfp_net_flow_merge_ipv4, }, [RTE_FLOW_ITEM_TYPE_IPV6] = { + .next_item =NEXT_ITEM (RTE_FLOW_ITEM_TYPE_TCP , +RTE_FLOW_ITEM_TYPE_UDP , + RTE_FLOW_ITEM_TYPE_SCTP), .mask_support = &(const struct rte_flow_item_ipv6 ){ .hdr = { .proto =0xff ,
@@ -345,6 +398,39 @@ static const struct nfp_net_flow_item_proc nfp_net_flow_item_proc_list[] = { .mask_sz = sizeof(struct rte_flow_item_ipv6), .merge = nfp_net_flow_merge_ipv6, }, + [RTE_FLOW_ITEM_TYPE_TCP] = { + .mask_support = &(const struct rte_flow_item_tcp ){ + .hdr = { + .src_port =RTE_BE16 (0xffff ), + .dst_port =RTE_BE16 (0xffff ), + }, + }, + .mask_default = &rte_flow_item_tcp_mask, + .mask_sz = sizeof(struct rte_flow_item_tcp), + .merge = nfp_flow_merge_l4, + }, + [RTE_FLOW_ITEM_TYPE_UDP] = { + .mask_support = &(const struct rte_flow_item_udp ){ + .hdr = { + .src_port =RTE_BE16 (0xffff ), + .dst_port =RTE_BE16 (0xffff ), + }, + }, + .mask_default = &rte_flow_item_udp_mask, + .mask_sz = sizeof(struct rte_flow_item_udp), + .merge = nfp_flow_merge_l4, + }, + [RTE_FLOW_ITEM_TYPE_SCTP] = { + .mask_support = &(const struct rte_flow_item_sctp ){ + .hdr = { + .src_port =RTE_BE16 (0xffff ), + .dst_port =RTE_BE16 (0xffff ), + }, + }, + .mask_default = &rte_flow_item_sctp_mask, + .mask_sz = sizeof(struct rte_flow_item_sctp), + .merge = nfp_flow_merge_l4, + }, }; static int
Signature · 1 line
2.39.1
PATCH v2 10/11 net/nfp: support MARK flow action
In reply to Chaoyong HeAdd the corresponding logics to support the offload of MARK action. Also add the related logics to parse the mark id and put into the mbuf structure, and assigned the offload flags.
--- doc/guides/nics/features/nfp.ini | 1 + drivers/common/nfp/nfp_common_ctrl.h | 1 + drivers/net/nfp/nfp_net_flow.c | 18 ++++++++++++++++++ drivers/net/nfp/nfp_rxtx.c | 18 ++++++++++++++++++ 4 files changed, 38 insertions(+)
doc/guides/nics/features/nfp.ini +1 -0
@@ -48,6 +48,7 @@ conntrack = Y count = Y drop = Y jump = Y +mark = Y meter = Y of_pop_vlan = Y of_push_vlan = Y
drivers/common/nfp/nfp_common_ctrl.h +1 -0
@@ -33,6 +33,7 @@/* Prepend field types */ #define NFP_NET_META_HASH 1/* Next field carries hash type */ +#define NFP_NET_META_MARK 2#define NFP_NET_META_VLAN 4#define NFP_NET_META_PORTID 5#define NFP_NET_META_IPSEC 9
drivers/net/nfp/nfp_net_flow.c +18 -0
@@ -548,6 +548,20 @@ nfp_net_flow_action_drop(struct rte_flow *nfp_flow) action_data->action =NFP_NET_CMSG_ACTION_DROP ; } +static void +nfp_net_flow_action_mark (struct rte_flow *nfp_flow, +const struct rte_flow_action *action) +{ +struct nfp_net_cmsg_action *action_data; +const struct rte_flow_action_mark *mark; + + action_data = (struct nfp_net_cmsg_action *)nfp_flow->payload.action_data; + mark = action->conf; + + action_data->action |=NFP_NET_CMSG_ACTION_MARK ; + action_data->mark_id = mark->id; +} +static int nfp_net_flow_compile_actions (const struct rte_flow_action actions[],struct rte_flow *nfp_flow)
@@ -560,6 +574,10 @@ nfp_net_flow_compile_actions(const struct rte_flow_action actions[],PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_DROP" );nfp_net_flow_action_drop (nfp_flow);return 0 ; +case RTE_FLOW_ACTION_TYPE_MARK : +PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_MARK" ); +nfp_net_flow_action_mark (nfp_flow, action); +break ;default :PMD_DRV_LOG (ERR ,"Unsupported action type: %d" , action->type);return -ENOTSUP ;
drivers/net/nfp/nfp_rxtx.c +18 -0
@@ -25,6 +25,8 @@ struct nfp_meta_parsed {uint32_t port_id;/**< Port id value */ uint32_t sa_idx;/**< IPsec SA index */ uint32_t hash;/**< RSS hash value */ +uint32_t mark_id;/**< Mark id value */ +uint16_t flags;/**< Bitmap to indicate if meta exist */ uint8_t hash_type;/**< RSS hash type */ uint8_t ipsec_type;/**< IPsec type */ uint8_t vlan_layer;/**< The valid number of value in @vlan[] */
@@ -290,6 +292,10 @@ nfp_net_parse_chained_meta(uint8_t *meta_base, meta->sa_idx =rte_be_to_cpu_32 (*(rte_be32_t *)meta_offset); meta->ipsec_type = meta_info &NFP_NET_META_FIELD_MASK ;break ; +case NFP_NET_META_MARK : + meta->flags |= (1 <<NFP_NET_META_MARK ); + meta->mark_id =rte_be_to_cpu_32 (*(rte_be32_t *)meta_offset); +break ;default :/* Unsupported metadata can be a performance issue */ return false;
@@ -434,6 +440,17 @@ nfp_net_parse_meta_ipsec(struct nfp_meta_parsed *meta, } } +static void +nfp_net_parse_meta_mark (const struct nfp_meta_parsed *meta, +struct rte_mbuf *mbuf) +{ +if (((meta->flags >>NFP_NET_META_MARK ) &0x1 ) ==0 ) +return ; + + mbuf->hash.fdir.hi = meta->mark_id; + mbuf->ol_flags |=RTE_MBUF_F_RX_FDIR |RTE_MBUF_F_RX_FDIR_ID ; +} +/* Parse the metadata from packet */ static void nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
@@ -458,6 +475,7 @@ nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,nfp_net_parse_meta_vlan (meta, rxds, rxq, mb);nfp_net_parse_meta_qinq (meta, rxq, mb);nfp_net_parse_meta_ipsec (meta, rxq, mb); +nfp_net_parse_meta_mark (meta, mb); }else {PMD_RX_LOG (DEBUG ,"RX chained metadata format is wrong!" ); }
Signature · 1 line
2.39.1
PATCH v2 11/11 net/nfp: support QUEUE flow action
In reply to Chaoyong HeAdd the corresponding logics to support the offload of QUEUE action.
--- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/nfp_net_flow.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+)
doc/guides/nics/features/nfp.ini +1 -0
@@ -54,6 +54,7 @@ of_pop_vlan = Y of_push_vlan = Y of_set_vlan_pcp = Y of_set_vlan_vid = Y +queue = Y raw_decap = Y raw_encap = Y represented_port = Y
drivers/net/nfp/nfp_net_flow.c +18 -0
@@ -562,6 +562,20 @@ nfp_net_flow_action_mark(struct rte_flow *nfp_flow, action_data->mark_id = mark->id; } +static void +nfp_net_flow_action_queue (struct rte_flow *nfp_flow, +const struct rte_flow_action *action) +{ +struct nfp_net_cmsg_action *action_data; +const struct rte_flow_action_queue *queue; + + action_data = (struct nfp_net_cmsg_action *)nfp_flow->payload.action_data; + queue = action->conf; + + action_data->action |=NFP_NET_CMSG_ACTION_QUEUE ; + action_data->queue = queue->index; +} +static int nfp_net_flow_compile_actions (const struct rte_flow_action actions[],struct rte_flow *nfp_flow)
@@ -578,6 +592,10 @@ nfp_net_flow_compile_actions(const struct rte_flow_action actions[],PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_MARK" );nfp_net_flow_action_mark (nfp_flow, action);break ; +case RTE_FLOW_ACTION_TYPE_QUEUE : +PMD_DRV_LOG (DEBUG ,"Process RTE_FLOW_ACTION_TYPE_QUEUE" ); +nfp_net_flow_action_queue (nfp_flow, action); +break ;default :PMD_DRV_LOG (ERR ,"Unsupported action type: %d" , action->type);return -ENOTSUP ;
Signature · 1 line
2.39.1
Quoted 8 lines · Chaoyong He
Add the very basic
rte_flowsupport for corenic firmware.---
v2:
* Update the 'nfp.ini' document.
* Rebase to the latest main branch.
---
Quoted 13 lines
Chaoyong He (11):
net/nfp: move some source files
net/nfp: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items net/nfp: support MARK flow action
net/nfp: support QUEUE flow action
Series applied to dpdk-next-net/main, thanks.
Flower firmware already supports flow API, right?
What is the difference of these two firmware? Are they both actively used?
Quoted 23 lines · Chaoyong He
Quoted 8 lines
Add the very basic
rte_flowsupport for corenic firmware.---
v2:
* Update the 'nfp.ini' document.
* Rebase to the latest main branch.
---Quoted 13 lines
Chaoyong He (11):
net/nfp: move some source files
net/nfp: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items net/nfp: support MARK flow action
net/nfp: support QUEUE flow action
Quoted 4 lines
Series applied to dpdk-next-net/main, thanks.
Flower firmware already supports flow API, right?
Correct.
Quoted 1 line
What is the difference of these two firmware? Are they both actively used?
The flower firmware aims to support as much flow APIs (and match patterns/actions)as possible,
and the corenic firmware will only support very limited ones (just enough) to some strict user case, like flow steering, bond offload ...
Quoted 26 lines · Chaoyong He
Quoted 26 lines · Chaoyong He
Quoted 8 lines
Add the very basic
rte_flowsupport for corenic firmware.---
v2:
* Update the 'nfp.ini' document.
* Rebase to the latest main branch.
---Quoted 13 lines
Chaoyong He (11):
net/nfp: move some source files
net/nfp: add the structures and functions for flow offload net/nfp: add the control message channel net/nfp: support flow API for CoreNIC firmware net/nfp: support Ethernet flow item
net/nfp: support drop flow action
net/nfp: support IPv4 flow item
net/nfp: support IPv6 flow item
net/nfp: support TCP/UDP/SCTP flow items net/nfp: support MARK flow action
net/nfp: support QUEUE flow actionSeries applied to dpdk-next-net/main, thanks.
Quoted 8 lines
Quoted 1 line
Flower firmware already supports flow API, right?
Correct.
Quoted 1 line
What is the difference of these two firmware? Are they both actively used?
The flower firmware aims to support as much flow APIs (and match patterns/actions)as possible,
and the corenic firmware will only support very limited ones (just enough) to some strict user case, like flow steering, bond offload ...
I see, thanks for the information.