Provide flow filter API and statistics
Subsystems (2)
PATCH v5 80/80 net/ntnic: add MTU configuration
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add supporting API rte_eth_dev_set_mtu
--- doc/guides/nics/features/default.ini | 2 +- doc/guides/nics/features/ntnic.ini | 1 + doc/guides/nics/ntnic.rst | 1 + doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/include/flow_api_engine.h | 7 ++ drivers/net/ntnic/include/hw_mod_backend.h | 4 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 96 +++++++++++++++++++ .../profile_inline/flow_api_profile_inline.c | 82 +++++++++++++++- .../profile_inline/flow_api_profile_inline.h | 9 ++ .../flow_api_profile_inline_config.h | 50 ++++++++++ drivers/net/ntnic/ntnic_ethdev.c | 41 ++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 5 + 12 files changed, 296 insertions(+), 3 deletions(-)
doc/guides/nics/features/default.ini +1 -1
@@ -180,7 +180,7 @@ nvgre_decap = nvgre_encap = of_copy_ttl_in = of_copy_ttl_out = -of_dec_mpls_ttl = +of_dec_mpls_ttl =MTU update = Y of_dec_nw_ttl = of_pop_mpls = of_pop_vlan =
doc/guides/nics/features/ntnic.ini +1 -0
@@ -14,6 +14,7 @@ RSS hash = Y RSS key update = Y Basic stats = Y Extended stats = Y +MTU update = Y Linux = Y x86-64 = Y
doc/guides/nics/ntnic.rst +1 -0
@@ -71,6 +71,7 @@ Features - Flow metering, including meter policy API. - Flow update. Update of the action list for specific flow - Asynchronous flow support +- MTU update Limitations ~~~~~~~~~~~
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -168,6 +168,7 @@ New Features * Added meter flow metering and flow policy support * Added flow actions update support * Added asynchronous flow support + * Added MTU update * **Added cryptodev queue pair reset support.**
drivers/net/ntnic/include/flow_api_engine.h +7 -0
@@ -280,6 +280,11 @@ struct nic_flow_def {* AGE action timeout */ struct age_def_s age; + +/* +* TX fragmentation IFR/RPP_LR MTU recipe +*/ +uint8_t flm_mtu_fragmentation_recipe; };enum flow_handle_type {
@@ -340,6 +345,8 @@ struct flow_handle {uint8_t flm_qfi;uint8_t flm_scrub_prof; +uint8_t flm_mtu_fragmentation_recipe; +/* Flow specific pointer to application template table cell stored during * flow create. */
drivers/net/ntnic/include/hw_mod_backend.h +4 -0
@@ -958,8 +958,12 @@ int hw_mod_tpe_rpp_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, i uint32_t value);int hw_mod_tpe_rpp_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_tpe_rpp_ifr_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +uint32_t value);int hw_mod_tpe_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_tpe_ifr_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +uint32_t value);int hw_mod_tpe_ins_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); int hw_mod_tpe_ins_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +96 -0
108 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +80 -2
130 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h +9 -0
@@ -11,6 +11,10 @@#include "flow_api.h" #include "stream_binary_flow_api.h" +#define DISABLE_FRAGMENTATION 0 +#define IPV4_DF_DROP 1 +#define IPV6_DROP 1 +/* * Management */
@@ -120,4 +124,9 @@ int flow_configure_profile_inline(struct flow_eth_dev *dev, uint8_t caller_id,const struct rte_flow_queue_attr *queue_attr[], struct rte_flow_error *error); +/* +* Config API +*/ +int flow_set_mtu_inline (struct flow_eth_dev *dev,uint32_t port,uint16_t mtu); +#endif /* _FLOW_API_PROFILE_INLINE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline_config.h +50 -0
56 lines not on this page · raw message
drivers/net/ntnic/ntnic_ethdev.c +41 -0
83 lines not on this page · raw message
drivers/net/ntnic/ntnic_mod_reg.h +5 -0
@@ -408,6 +408,11 @@ struct profile_inline_ops { const struct rte_flow_port_attr *port_attr, uint16_t nb_queue, const struct rte_flow_queue_attr *queue_attr[], struct rte_flow_error *error); + +/* +* Config API +*/ +int (*flow_set_mtu_inline)(struct flow_eth_dev *dev,uint32_t port,uint16_t mtu); };void register_profile_inline_ops (const struct profile_inline_ops *ops);
Signature · 1 line
2.45.0
Re: [PATCH v5 00/80] Provide flow filter and statistics support
In reply to Serhii IliushykQuoted 119 lines · Serhii Iliushyk
The list of updates provided by the patchset:
- FW version
- Speed capabilities
- Link status (Link update only)
- Unicast MAC filter
- Multicast MAC filter
- Promiscuous mode (Enable only. The device always run promiscuous mode)
- Flow API support.
- Support for multiplerte_flowgroups.
- Multiple TX and RX queues.
- Scattered and gather for TX and RX.
- Jumbo frame support.
- Traffic mirroring.
- VLAN filtering.
- Packet modification: NAT, TTL decrement, DSCP tagging
- Tunnel types: GTP.
- Encapsulation and decapsulation of GTP data.
- RX VLAN stripping via raw decap.
- TX VLAN insertion via raw encap.
- CAM and TCAM based matching.
- Exact match of 140 million flows and policies.
- Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification.
- RSS hash
- RSS key update
- RSS based on VLAN or 5-tuple.
- RSS using different combinations of fields: L3 only, L4 only or both, and source only, destination only or both.
- Several RSS hash keys, one for each flow type.
- Default RSS operation with no hash key specification.
- Port and queue statistics.
- RMON statistics in extended stats.
- Link state information.
- Flow statistics
- Flow aging support
- Flow metering, including meter policy API.
- Flow update. Update of the action list for specific flow
- Asynchronous flow support
- MTU updateUpdate: the pthread API was replaced with RTE spinlock in the separate patch.
Danylo Vodopianov (41):
net/ntnic: add NT flow dev configuration net/ntnic: add item UDP
net/ntnic: add action TCP
net/ntnic: add action VLAN
net/ntnic: add item SCTP
net/ntnic: add items IPv6 and ICMPv6 net/ntnic: add action modify filed
net/ntnic: add items gtp and actions raw encap/decap net/ntnic: add cat module
net/ntnic: add SLC LR module
net/ntnic: add PDB module
net/ntnic: add QSL module
net/ntnic: add KM module
net/ntnic: add hash API
net/ntnic: add TPE module
net/ntnic: add FLM module
net/ntnic: add FLM RCP module
net/ntnic: add learn flow queue handling net/ntnic: match and action db attributes were added net/ntnic: add statistics support
net/ntnic: add rpf module
net/ntnic: add statistics poll
net/ntnic: added flm stat interface net/ntnic: add TSM module
net/ntnic: add xStats
net/ntnic: added flow statistics
net/ntnic: add scrub registers
net/ntnic: add high-level flow aging support net/ntnic: add aging to the inline profile net/ntnic: add flow info and flow configure support net/ntnic: add flow aging event
net/ntnic: add termination thread
net/ntnic: add meter support
net/ntnic: add meter module
net/ntnic: add action update support net/ntnic: add flow action update
net/ntnic: add flow actions update
net/ntnic: add async create/destroy declaration net/ntnic: add async template declaration net/ntnic: add async flow create/delete implementation net/ntnic: add async template implementationOleksandr Kolomeiets (17):
net/ntnic: add flow dump feature
net/ntnic: add flow flush
net/ntnic: sort FPGA registers alphanumerically
net/ntnic: add CSU module registers
net/ntnic: add FLM module registers
net/ntnic: add HFU module registers
net/ntnic: add IFR module registers
net/ntnic: add MAC Rx module registers
net/ntnic: add MAC Tx module registers
net/ntnic: add RPP LR module registers
net/ntnic: add SLC LR module registers
net/ntnic: add Tx CPY module registers
net/ntnic: add Tx INS module registers
net/ntnic: add Tx RPL module registers
net/ntnic: add STA module
net/ntnic: add TSM module
net/ntnic: add MTU configurationSerhii Iliushyk (22):
net/ntnic: add flow filter support
net/ntnic: add minimal create/destroy flow operations net/ntnic: add internal functions for create/destroy net/ntnic: add minimal NT flow inline profile net/ntnic: add management functions for NT flow profile net/ntnic: add NT flow profile management implementation net/ntnic: add create/destroy implementation for NT flows net/ntnic: add infrastructure for for flow actions and items net/ntnic: add action queue
net/ntnic: add action mark
net/ntnic: add ation jump
net/ntnic: add action drop
net/ntnic: add item eth
net/ntnic: add item IPv4
Quoted 9 lines
net/ntnic: add item ICMP
net/ntnic: add item port ID
net/ntnic: add item void
net/ntnic: add GMF (Generic MAC Feeder) module net/ntnic: update alignment for virt queue structs net/ntnic: enable RSS feature
net/ntnic: migrate to the RTE spinlock net/ntnic: remove unnecessary
Series applied to dpdk-next-net/main, thanks.
cover Bugfixes
In reply to Serhii IliushykThis patch set provides further fixes:
Feature RSS:
Fix the Toeplitz key and log with a mask.
Toeplitz's secret keyword order was reversed during programming into FPGA, which leads to unexpected RSS hash values.
Error handling:
The missed error messages were added to the list to avoid incorrect logs
Serhii Iliushyk (2):
net/ntnic: fix incorrect error message net/ntnic: fix of Toeplitz key and log with mask
drivers/net/ntnic/nthw/flow_api/flow_api.c | 14 +++++ .../profile_inline/flow_api_profile_inline.c | 61 +++++++------------ 2 files changed, 35 insertions(+), 40 deletions(-)
Signature · 1 line
2.45.0
PATCH 1/2 net/ntnic: fix incorrect error message
Add missed error messages to the list to avoid incorrect logs
--- drivers/net/ntnic/nthw/flow_api/flow_api.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/net/ntnic/nthw/flow_api/flow_api.c +14 -0
@@ -81,6 +81,20 @@ static const struct { /* 27 */ { "Internal creation of a tunnel end point port failed" }, /* 28 */ { "Unknown or unsupported flow action received" }, /* 29 */ { "Removing flow failed" }, + /* 30 */ { "No output queue specified. Ignore this flow offload and uses default queue"}, + /* 31 */ { "No output queue found"}, + /* 32 */ { "Unsupported EtherType or rejected caused by offload policy"}, + /* 33 */ { "Destination port specified is invalid or not reachable from this NIC"}, + /* 34 */ { "Partial offload is not supported in this configuration"}, + /* 35 */ { "Match failed because of CAT CAM exhausted"}, + /* 36 */ { "Match failed because of CAT CAM Key clashed with an existing KCC Key"}, + /* 37 */ { "Match failed because of CAT CAM write failed"}, + /* 38 */ { "Partial flow mark too big for device"}, + /* 39 */ { "Invalid priority value"}, + /* 40 */ { "Multiple port_id actions for one flow is not supported"}, + /* 41 */ { "Too long hash key for RSS"}, + /* 42 */ { "Action AGE is not supported for flow in group 0"}, + /* 43 */ { "Unknown error"}, };void flow_nic_set_error (enum flow_nic_err_msg_e msg,struct rte_flow_error *error)
Signature · 1 line
2.45.0
Re: [PATCH v1 1/2] net/ntnic: fix incorrect error message
Quoted 14 lines · On Fri, 22 Nov 2024 17:50:21 +0100 Serhii Iliushyk <[email protected]> wrote:
drivers/net/ntnic/nthw/flow_api/flow_api.c +6
-0@@ -81,6 +81,20 @@ static const struct { /* 27 */ { "Internal creation of a tunnel end point port failed" }, /* 28 */ { "Unknown or unsupported flow action received" }, /* 29 */ { "Removing flow failed" }, + /* 30 */ { "No output queue specified. Ignore this flow offload and uses default queue"}, + /* 31 */ { "No output queue found"}, + /* 32 */ { "Unsupported EtherType or rejected caused by offload policy"}, + /* 33 */ { "Destination port specified is invalid or not reachable from this NIC"}, + /* 34 */ { "Partial offload is not supported in this configuration"}, + /* 35 */ { "Match failed because of CAT CAM exhausted"},
drivers/net/ntnic/nthw/flow_api/flow_api.c static const struct { · line 99
Quoted 10 lines
drivers/net/ntnic/nthw/flow_api/flow_api.c +8
-0+ /* 36 */ { "Match failed because of CAT CAM Key clashed with an existing KCC Key"}, + /* 37 */ { "Match failed because of CAT CAM write failed"}, + /* 38 */ { "Partial flow mark too big for device"}, + /* 39 */ { "Invalid priority value"}, + /* 40 */ { "Multiple port_id actions for one flow is not supported"}, + /* 41 */ { "Too long hash key for RSS"}, + /* 42 */ { "Action AGE is not supported for flow in group 0"}, + /* 43 */ { "Unknown error"}, };
Tables like this often get out of sync. Some suggestions.
Use index base initializers, like:
const char *dbg_res_descr[] = {
[ RES_QUEUE] = "RES_QUEUE",
[ RES_CAT_CFN] = "RES_CAT_CFN",PS, why is this string table not static?
Still have to handle NULL string if table ends up missing an element.
Should also check that table has all the strings:
Like:static_assert(RTE_DIM(err_msg) == ERR_MSG_NO_MSG);
void flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error *error)
{
assert(msg < ERR_MSG_NO_MSG);1.
PATCH 2/2 net/ntnic: fix of Toeplitz key and log with mask
In reply to Serhii IliushykToeplitz secret key word order was reversed during programming into FPGA, which lead to unexpected rss hash values.
--- .../profile_inline/flow_api_profile_inline.c | 61 +++++++------------ 1 file changed, 21 insertions(+), 40 deletions(-)
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +21 -40
@@ -3825,7 +3825,6 @@ struct hsh_words {* is used for hash mask calculation */ uint8_t index; -uint8_t toeplitz_index;/* offset in Bytes of given [Q]W inside Toeplitz RSS key */ enum hw_hsh_e pe;/* offset to header part, e.g. beginning of L4 */ enum hw_hsh_e ofs;/* relative offset in BYTES to 'pe' header offset above */ uint16_t bit_len;/* max length of header part in bits to fit into QW/W */
@@ -3874,7 +3873,6 @@ static int flow_nic_set_hasher_part_inline(struct flow_nic_dev *ndev, int hsh_id/* set HW_HSH_RCP_WORD_MASK based on used QW/W and given 'bit_len' */ int mask_bit_len = bit_len;uint32_t mask =0x0 ; -uint32_t mask_be =0x0 ;uint32_t toeplitz_mask[9 ] = {0x0 };/* iterate through all words of QW */ uint16_t words_count = words[word].bit_len /32 ;
@@ -3883,27 +3881,23 @@ static int flow_nic_set_hasher_part_inline(struct flow_nic_dev *ndev, int hsh_idif (mask_bit_len >=32 ) { mask_bit_len -=32 ; mask =0xffffffff ; - mask_be = mask; }else if (mask_bit_len >0 ) { -/* keep bits from left to right, i.e. little to big endian */ - mask_be =0xffffffff >> (32 - mask_bit_len); - mask = mask_be << (32 - mask_bit_len); + mask =0xffffffff >> (32 - mask_bit_len) << (32 - mask_bit_len); mask_bit_len =0 ; }else { mask =0x0 ; - mask_be =0x0 ; }/* reorder QW words mask from little to big endian */ res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_WORD_MASK , hsh_idx, words[word].index + words_count - mask_off, mask); -NT_LOG (DBG ,FILTER , -"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, %d, %d, 0x%" PRIX32 +NT_LOG_DBGX (DBG ,FILTER , +"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, %d, %d, 0x%08" PRIX32 ")" , hsh_idx, words[word].index + words_count - mask_off, mask); - toeplitz_mask[words[word].toeplitz_index + mask_off -1 ] = mask_be; + toeplitz_mask[words[word].index + mask_off -1 ] = mask; }if (toeplitz) {
@@ -3911,9 +3905,9 @@ static int flow_nic_set_hasher_part_inline(struct flow_nic_dev *ndev, int hsh_id"Partial Toeplitz RSS key mask: %08" PRIX32 " %08" PRIX32 " %08" PRIX32 " %08" PRIX32 " %08" PRIX32 " %08" PRIX32 " %08" PRIX32 " %08" PRIX32 " %08" PRIX32 "" , - toeplitz_mask[8 ], toeplitz_mask[7 ], toeplitz_mask[6 ], toeplitz_mask[5 ], - toeplitz_mask[4 ], toeplitz_mask[3 ], toeplitz_mask[2 ], toeplitz_mask[1 ], - toeplitz_mask[0]); + toeplitz_mask[0 ], toeplitz_mask[1 ], toeplitz_mask[2 ], toeplitz_mask[3 ], + toeplitz_mask[4 ], toeplitz_mask[5 ], toeplitz_mask[6 ], toeplitz_mask[7 ], + toeplitz_mask[8]);NT_LOG (DBG ,FILTER ," MSB LSB" ); }
@@ -4632,11 +4626,11 @@ int flow_nic_set_hasher_fields_inline(struct flow_nic_dev *ndev, int hsh_idx,* word | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | */ struct hsh_words words[HSH_WORDS_SIZE ] = { - {0 ,5 ,HW_HSH_RCP_QW0_PE ,HW_HSH_RCP_QW0_OFS ,128 , true }, - {4 ,1 ,HW_HSH_RCP_QW4_PE ,HW_HSH_RCP_QW4_OFS ,128 , true }, - {8 ,0 ,HW_HSH_RCP_W8_PE ,HW_HSH_RCP_W8_OFS ,32 , true }, + {0 ,HW_HSH_RCP_QW0_PE ,HW_HSH_RCP_QW0_OFS ,128 , true }, + {4 ,HW_HSH_RCP_QW4_PE ,HW_HSH_RCP_QW4_OFS ,128 , true }, + {8 ,HW_HSH_RCP_W8_PE ,HW_HSH_RCP_W8_OFS ,32 , true }, { -9 ,255 ,HW_HSH_RCP_W9_PE ,HW_HSH_RCP_W9_OFS ,32 , +9 ,HW_HSH_RCP_W9_PE ,HW_HSH_RCP_W9_OFS ,32 , true },/* not supported for Toeplitz */ };
@@ -4664,34 +4658,21 @@ int flow_nic_set_hasher_fields_inline(struct flow_nic_dev *ndev, int hsh_idx, res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TOEPLITZ , hsh_idx,0 ,1 );uint8_t empty_key =0 ; -/* Toeplitz key (always 40B) must be encoded from little to big endian */ -for (uint8_t i =0 ; i <= (MAX_RSS_KEY_LEN -8 ); i +=8 ) { - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_K , hsh_idx, i /4 , - rss_conf.rss_key[i +4 ] <<24 | - rss_conf.rss_key[i +5 ] <<16 | - rss_conf.rss_key[i +6 ] <<8 | - rss_conf.rss_key[i +7 ]); -NT_LOG (DBG ,FILTER , -"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, %d, %d, 0x%" PRIX32 -")" , - hsh_idx, i /4 , - rss_conf.rss_key[i +4 ] <<24 | rss_conf.rss_key[i +5 ] <<16 | - rss_conf.rss_key[i +6 ] <<8 | rss_conf.rss_key[i +7 ]); - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_K , hsh_idx, i /4 +1 , - rss_conf.rss_key[i] <<24 | - rss_conf.rss_key[i +1 ] <<16 | - rss_conf.rss_key[i +2 ] <<8 | - rss_conf.rss_key[i +3 ]); -NT_LOG (DBG ,FILTER , +/* Toeplitz key (always 40B) words have to be programmed in reverse order */ +for (uint8_t i =0 ; i <= (MAX_RSS_KEY_LEN -4 ); i +=4 ) { + res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_K , hsh_idx,9 - i /4 , + rss_conf.rss_key[i] <<24 | + rss_conf.rss_key[i +1 ] <<16 | + rss_conf.rss_key[i +2 ] <<8 | + rss_conf.rss_key[i +3 ]); +NT_LOG_DBG (DBG ,FILTER ,"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, %d, %d, 0x%" PRIX32 ")" , - hsh_idx, i /4 +1 , + hsh_idx,9 - i /4 , rss_conf.rss_key[i] <<24 | rss_conf.rss_key[i +1 ] <<16 | rss_conf.rss_key[i +2 ] <<8 | rss_conf.rss_key[i +3 ]); empty_key |= rss_conf.rss_key[i] | rss_conf.rss_key[i +1 ] | - rss_conf.rss_key[i +2 ] | rss_conf.rss_key[i +3 ] | - rss_conf.rss_key[i +4 ] | rss_conf.rss_key[i +5 ] | - rss_conf.rss_key[i +6 ] | rss_conf.rss_key[i +7 ]; + rss_conf.rss_key[i +2 ] | rss_conf.rss_key[i +3 ]; }if (empty_key ==0 ) {
Signature · 1 line
2.45.0