Replace static logtypes with static
PATCH v9 14/22 sched: replace RTE_LOGTYPE_SCHED with dynamic type
In reply to Stephen HemmingerAlso can remove unused RTE_LOGTYPE_METER
--- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- lib/sched/rte_pie.c | 1 + lib/sched/rte_sched.c | 5 +++++ lib/sched/rte_sched_log.h | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lib/sched/rte_sched_log.h
lib/eal/common/eal_common_log.c +0 -2
@@ -351,8 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_METER, "lib.meter"}, - {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
lib/eal/include/rte_log.h +2 -2
@@ -37,8 +37,8 @@ extern "C" {/* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ -#define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ -#define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */ +/* was RTE_LOGTYPE_METER */ +/* was RTE_LOGTYPE_SCHED */ #define RTE_LOGTYPE_PORT 13/**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */
lib/sched/rte_pie.c +1 -0
@@ -6,6 +6,7 @@#include <stdlib.h> #include <string.h> +#include "rte_sched_log.h" #include "rte_pie.h" #ifdef __INTEL_COMPILER
lib/sched/rte_sched.c +5 -0
@@ -16,9 +16,12 @@#include <rte_reciprocal.h> #include "rte_sched.h" +#include "rte_sched_log.h" #include "rte_sched_common.h" +#include "rte_approx.h" +#ifdef __INTEL_COMPILER#pragma warning(disable:2259)/* conversion may lose significant bits */ #endif
@@ -3002,3 +3005,5 @@ rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uintreturn count; } + +RTE_LOG_REGISTER_DEFAULT (sched_logtype,INFO );
lib/sched/rte_sched_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int sched_logtype; +#define RTE_LOGTYPE_SCHED sched_logtype
Signature · 1 line
2.39.1
PATCH v9 15/22 examples/ipsecgw: replace RTE_LOGTYPE_PORT
In reply to Stephen HemmingerLooks like some code got copy/paste in to the IPSEC gateway example from another place. Shouldn't be using RTE_LOGTYPE_PORT here.
--- examples/ipsec-secgw/sa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
examples/ipsec-secgw/sa.c +3 -3
@@ -1127,7 +1127,7 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso)if (inbound) {if ((dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_SECURITY ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware RX IPSec offload is not supported\n" );return -EINVAL ; }
@@ -1135,13 +1135,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) }else {/* outbound */ if ((dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_SECURITY ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware TX IPSec offload is not supported\n" );return -EINVAL ; }if (tso && (dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_TCP_TSO ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware TCP TSO offload is not supported\n" );return -EINVAL ; }
Signature · 1 line
2.39.1
RE: [EXT] [PATCH v9 15/22] examples/ipsecgw: replace RTE_LOGTYPE_PORT
Quoted 2 lines
Subject: [EXT] [PATCH v9 15/22] examples/ipsecgw: replace
RTE_LOGTYPE_PORT
Title should be
examples/ipsec-secgw: replace RTE_LOGTYPE_PORT
Quoted 8 lines
Looks like some code got copy/paste in to the IPSEC gateway example from another place. Shouldn't be using
RTE_LOGTYPE_PORThere.Fixes ec17993a145a ("examples/ipsec-secgw: support security offload")Signed-off-by Stephen Hemminger <[email protected]>
PATCH v9 16/22 port: replace RTE_LOGTYPE_PORT with dynamic type
In reply to Stephen HemmingerSplit up the single static RTE_LOGTYPE_PORT into separate sub types for each component: port.ethdev, port.evendev, ...
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/port/rte_port_ethdev.c | 3 +++ lib/port/rte_port_eventdev.c | 4 ++++ lib/port/rte_port_fd.c | 3 +++ lib/port/rte_port_frag.c | 3 +++ lib/port/rte_port_kni.c | 3 +++ lib/port/rte_port_ras.c | 3 +++ lib/port/rte_port_ring.c | 3 +++ lib/port/rte_port_sched.c | 3 +++ lib/port/rte_port_source_sink.c | 3 +++ lib/port/rte_port_sym_crypto.c | 3 +++ 12 files changed, 32 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"},
lib/eal/include/rte_log.h +1 -1
@@ -39,7 +39,7 @@ extern "C" {/* was RTE_LOGTYPE_POWER */ /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ -#define RTE_LOGTYPE_PORT 13/**< Log related to port. */ +/* was RTE_LOGTYPE_PORT */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */
lib/port/rte_port_ethdev.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_ethdev.h" +RTE_LOG_REGISTER_SUFFIX (port_ethdev_logtype, ethdev,INFO ); +#define RTE_LOGTYPE_PORT port_ethdev_logtype +/* * Port ETHDEV Reader */
lib/port/rte_port_eventdev.c +4 -0
@@ -5,11 +5,15 @@#include <string.h> #include <stdint.h> +#include <rte_log.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include "rte_port_eventdev.h" +RTE_LOG_REGISTER_SUFFIX (port_eventdev_logtype, eventdev,INFO ); +#define RTE_LOGTYPE_PORT port_eventdev_logtype +/* * Port EVENTDEV Reader */
lib/port/rte_port_fd.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_fd.h" +RTE_LOG_REGISTER_SUFFIX (port_fd_logtype, fd,INFO ); +#define RTE_LOGTYPE_PORT port_fd_logtype +/* * Port FD Reader */
lib/port/rte_port_frag.c +3 -0
@@ -7,6 +7,9 @@#include "rte_port_frag.h" +RTE_LOG_REGISTER_SUFFIX (port_frag_logtype, frag,INFO ); +#define RTE_LOGTYPE_PORT port_frag_logtype +/* Max number of fragments per packet allowed */ #define RTE_PORT_FRAG_MAX_FRAGS_PER_PACKET 0x80
lib/port/rte_port_kni.c +3 -0
@@ -9,6 +9,9 @@#include "rte_port_kni.h" +RTE_LOG_REGISTER_SUFFIX (port_kni_logtype, kni,INFO ); +#define RTE_LOGTYPE_PORT port_kni_logtype +/* * Port KNI Reader */
lib/port/rte_port_ras.c +3 -0
@@ -9,6 +9,9 @@#include "rte_port_ras.h" +RTE_LOG_REGISTER_SUFFIX (port_ras_logtype, ras,INFO ); +#define RTE_LOGTYPE_PORT port_ras_logtype +#ifndef RTE_PORT_RAS_N_BUCKETS #define RTE_PORT_RAS_N_BUCKETS 4094#endif
lib/port/rte_port_ring.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_ring.h" +RTE_LOG_REGISTER_SUFFIX (port_ring_logtype, ring,INFO ); +#define RTE_LOGTYPE_PORT port_ring_logtype +/* * Port RING Reader */
lib/port/rte_port_sched.c +3 -0
@@ -7,6 +7,9 @@#include "rte_port_sched.h" +RTE_LOG_REGISTER_SUFFIX (port_sched_logtype, sched,INFO ); +#define RTE_LOGTYPE_PORT port_sched_logtype +/* * Reader */
lib/port/rte_port_source_sink.c +3 -0
@@ -15,6 +15,9 @@#include "rte_port_source_sink.h" +RTE_LOG_REGISTER_SUFFIX (port_source_logtype, source,INFO ); +#define RTE_LOGTYPE_PORT port_source_logtype +/* * Port SOURCE */
lib/port/rte_port_sym_crypto.c +3 -0
@@ -8,6 +8,9 @@#include "rte_port_sym_crypto.h" +RTE_LOG_REGISTER_SUFFIX (port_crypto_logtype, crypto,INFO ); +#define RTE_LOGTYPE_PORT port_crypto_logtype +/* * Port Crypto Reader */
Signature · 1 line
2.39.1
PATCH v9 17/22 table: convert RTE_LOGTYPE_TABLE to dynamic logtype
In reply to Stephen HemmingerUse logtype suffixes for various components of this library.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/table/rte_table_acl.c | 3 +++ lib/table/rte_table_array.c | 3 +++ lib/table/rte_table_hash_cuckoo.c | 3 +++ lib/table/rte_table_hash_ext.c | 3 +++ lib/table/rte_table_hash_key16.c | 3 +++ lib/table/rte_table_hash_key32.c | 5 ++++- lib/table/rte_table_hash_key8.c | 5 ++++- lib/table/rte_table_hash_lru.c | 3 +++ lib/table/rte_table_lpm.c | 3 +++ lib/table/rte_table_lpm_ipv6.c | 3 +++ lib/table/rte_table_stub.c | 3 +++ 13 files changed, 36 insertions(+), 4 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
lib/eal/include/rte_log.h +1 -1
@@ -40,7 +40,7 @@ extern "C" {/* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ -#define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ +/* was RTE_LOGTYPE_TABLE */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */
lib/table/rte_table_acl.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_acl.h" +RTE_LOG_REGISTER_SUFFIX (table_acl_logtype, acl,INFO ); +#define RTE_LOGTYPE_TABLE table_acl_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ACL_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_array.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_array.h" +RTE_LOG_REGISTER_SUFFIX (table_array_logtype, array,INFO ); +#define RTE_LOGTYPE_TABLE table_array_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ARRAY_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_hash_cuckoo.c +3 -0
@@ -10,6 +10,9 @@#include "rte_table_hash_cuckoo.h" +RTE_LOG_REGISTER_SUFFIX (table_hash_logtype, hash,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_CUCKOO_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_hash_ext.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_hash.h" +RTE_LOG_REGISTER_SUFFIX (table_hash_ext_logtype, hash.ext,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_ext_logtype +#define KEYS_PER_BUCKET 4struct bucket {
lib/table/rte_table_hash_key16.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_hash.h" #include "rte_lru.h" +RTE_LOG_REGISTER_SUFFIX (table_hash16_logtype, hash16,INFO ); +#define RTE_LOGTYPE_TABLE table_hash16_logtype +#define KEY_SIZE 16#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_key32.c +4 -1
@@ -11,7 +11,10 @@#include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 32 +RTE_LOG_REGISTER_SUFFIX (table_hash32_logtype, hash32,INFO ); +#define RTE_LOGTYPE_TABLE table_hash32_logtype + +#define KEY_SIZE 32#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_key8.c +4 -1
@@ -11,7 +11,10 @@#include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 8 +RTE_LOG_REGISTER_SUFFIX (table_hash8_logtype, hash8,INFO ); +#define RTE_LOGTYPE_TABLE table_hash8_logtype + +#define KEY_SIZE 8#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_lru.c +3 -0
@@ -14,6 +14,9 @@#define KEYS_PER_BUCKET 4 +RTE_LOG_REGISTER_SUFFIX (table_hash_lru_logtype, hash_lru,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_lru_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_LRU_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_lpm.c +3 -0
@@ -13,6 +13,9 @@#include "rte_table_lpm.h" +RTE_LOG_REGISTER_SUFFIX (table_lpm_logtype, lpm,INFO ); +#define RTE_LOGTYPE_TABLE table_lpm_logtype +#ifndef RTE_TABLE_LPM_MAX_NEXT_HOPS #define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536#endif
lib/table/rte_table_lpm_ipv6.c +3 -0
@@ -12,6 +12,9 @@#include "rte_table_lpm_ipv6.h" +RTE_LOG_REGISTER_SUFFIX (table_lpm6_logtype, lpm6,INFO ); +#define RTE_LOGTYPE_TABLE table_lpm6_logtype +#define RTE_TABLE_LPM_MAX_NEXT_HOPS 256#ifdef RTE_TABLE_STATS_COLLECT
lib/table/rte_table_stub.c +3 -0
@@ -8,6 +8,9 @@#include "rte_table_stub.h" +RTE_LOG_REGISTER_SUFFIX (table_stub_logtype, stub,INFO ); +#define RTE_LOGTYPE_TABLE table_stub_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_LPM_STATS_PKTS_IN_ADD (table, val) \
Signature · 1 line
2.39.1
PATCH v9 18/22 app/test: remove use of RTE_LOGTYPE_PIPELINE
In reply to Stephen HemmingerInstead of using static type PIPELINE for logging in test application use stderr instead. If not testing RTE_LOG() better to not use it since log also goes to syslog.
--- app/test/test_table_acl.c | 50 ++++++++++++++++------------------ app/test/test_table_pipeline.c | 40 +++++++++++++-------------- 2 files changed, 43 insertions(+), 47 deletions(-)
app/test/test_table_acl.c +23 -27
@@ -165,7 +165,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRC_FIELD_IPV4 ].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read src address/mask: %s\n" , +fprintf (stderr,"failed to read src address/mask: %s\n" , in[CB_FLD_SRC_ADDR ]);return rc; }
@@ -178,7 +178,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DST_FIELD_IPV4 ].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest address/mask: %s\n" , +fprintf (stderr,"failed to read dest address/mask: %s\n" , in[CB_FLD_DST_ADDR ]);return rc; }
@@ -190,7 +190,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRCP_FIELD_IPV4 ].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read source port range: %s\n" , +fprintf (stderr,"failed to read source port range: %s\n" , in[CB_FLD_SRC_PORT_RANGE ]);return rc; }
@@ -202,7 +202,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DSTP_FIELD_IPV4 ].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest port range: %s\n" , +fprintf (stderr,"failed to read dest port range: %s\n" , in[CB_FLD_DST_PORT_RANGE ]);return rc; }
@@ -254,7 +254,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRC_FIELD_IPV4 ].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read src address/mask: %s\n" , +fprintf (stderr,"failed to read src address/mask: %s\n" , in[CB_FLD_SRC_ADDR ]);return rc; }
@@ -267,7 +267,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DST_FIELD_IPV4 ].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest address/mask: %s\n" , +fprintf (stderr,"failed to read dest address/mask: %s\n" , in[CB_FLD_DST_ADDR ]);return rc; }
@@ -279,7 +279,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRCP_FIELD_IPV4 ].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read source port range: %s\n" , +fprintf (stderr,"failed to read source port range: %s\n" , in[CB_FLD_SRC_PORT_RANGE ]);return rc; }
@@ -291,7 +291,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DSTP_FIELD_IPV4 ].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest port range: %s\n" , +fprintf (stderr,"failed to read dest port range: %s\n" , in[CB_FLD_DST_PORT_RANGE ]);return rc; }
@@ -346,7 +346,7 @@ setup_acl_pipeline(void)/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; }
@@ -410,7 +410,7 @@ setup_acl_pipeline(void) table_params.f_action_miss =NULL ; table_params.action_data_size =0 ; -RTE_LOG (INFO ,PIPELINE ,"miss_action=%x\n" , +printf ("miss_action=%x\n" , table_entry_miss_action); printf("RTE_ACL_RULE_SZ(%zu) = %zu\n", DIM(ipv4_defs),
@@ -471,9 +471,8 @@ setup_acl_pipeline(void) ret =parser (line, &keys[n]);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -513,9 +512,8 @@ setup_acl_pipeline(void) ret =parse_cb_ipv4_rule_del (line, &keys[n]);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -549,9 +547,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -575,8 +572,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"line %u: parse rule " -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -602,8 +599,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"line %u: parse rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -667,7 +664,7 @@ test_pipeline_single_filter(int expected_count) memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple, sizeof(struct ipv4_5tuple)); -RTE_LOG (INFO ,PIPELINE ,"%s: Enqueue onto ring %d\n" , +printf ("%s: Enqueue onto ring %d\n" , __func__, i);rte_ring_enqueue (rings_rx[i], mbuf); }
@@ -702,9 +699,8 @@ test_pipeline_single_filter(int expected_count) }if (tx_count != expected_count) { -RTE_LOG (INFO ,PIPELINE , -"%s: Unexpected packets for ACL test, " -"expected %d, got %d\n" , +fprintf (stderr, +"%s: Unexpected packets for ACL test, expected %d, got %d\n" , __func__, expected_count, tx_count); goto fail; }
app/test/test_table_pipeline.c +20 -20
@@ -6,7 +6,6 @@#include <string.h> #include <rte_pipeline.h> -#include <rte_log.h> #include <inttypes.h> #include <rte_hexdump.h> #include "test_table.h"
@@ -173,30 +172,31 @@ check_pipeline_invalid_params(void) p =rte_pipeline_create (NULL );if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE , +fprintf (stderr,"%s: configured pipeline with null params\n" , __func__); goto fail; } p =rte_pipeline_create (&pipeline_params_1);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with NULL " -"name\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with NULL name\n" , __func__); goto fail; } p =rte_pipeline_create (&pipeline_params_2);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with invalid " -"socket\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with invalid socket\n" , __func__); goto fail; }if (rte_eal_has_hugepages ()) { p =rte_pipeline_create (&pipeline_params_3);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with " -"invalid socket\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with invalid socket\n" , + __func__); goto fail; } }
@@ -224,20 +224,20 @@ setup_pipeline(int test_type) .socket_id = 0, }; -RTE_LOG (INFO ,PIPELINE ,"%s: **** Setting up %s test\n" , +fprintf (stderr,"%s: **** Setting up %s test\n" , __func__, pipeline_test_names[test_type]);/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; } ret =rte_pipeline_free (p);if (ret !=0 ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to free pipeline\n" , +fprintf (stderr,"%s: Failed to free pipeline\n" , __func__); goto fail; }
@@ -245,7 +245,7 @@ setup_pipeline(int test_type)/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; }
@@ -411,7 +411,7 @@ test_pipeline_single_filter(int test_type, int expected_count)int ret;int tx_count; -RTE_LOG (INFO ,PIPELINE ,"%s: **** Running %s test\n" , +fprintf (stderr,"%s: **** Running %s test\n" , __func__, pipeline_test_names[test_type]);/* Run pipeline once */ for (i =0 ; i <N_PORTS ; i++)
@@ -420,7 +420,7 @@ test_pipeline_single_filter(int test_type, int expected_count) ret =rte_pipeline_flush (NULL );if (ret != -EINVAL ) { -RTE_LOG (INFO ,PIPELINE , +fprintf (stderr,"%s: No pipeline flush error NULL pipeline (%d)\n" , __func__, ret); goto fail;
@@ -445,7 +445,7 @@ test_pipeline_single_filter(int test_type, int expected_count) k32 = (uint32_t *) key; k32[0 ] =0xadadadad >> (j %2 ); -RTE_LOG (INFO ,PIPELINE ,"%s: Enqueue onto ring %d\n" , +fprintf (stderr,"%s: Enqueue onto ring %d\n" , __func__, i);rte_ring_enqueue (rings_rx[i], m); }
@@ -487,9 +487,9 @@ test_pipeline_single_filter(int test_type, int expected_count) }if (tx_count != expected_count) { -RTE_LOG (INFO ,PIPELINE , -"%s: Unexpected packets out for %s test, expected %d, " -"got %d\n" , __func__, pipeline_test_names[test_type], +fprintf (stderr, +"%s: Unexpected packets out for %s test, expected %d, got %d\n" , + __func__, pipeline_test_names[test_type], expected_count, tx_count); goto fail; }
@@ -564,8 +564,8 @@ test_table_pipeline(void) connect_miss_action_to_table =0 ;if (check_pipeline_invalid_params ()) { -RTE_LOG (INFO ,PIPELINE ,"%s: Check pipeline invalid params " -"failed.\n" , __func__); +fprintf (stderr,"%s: Check pipeline invalid params failed.\n" , + __func__);return -1 ; }
Signature · 1 line
2.39.1
PATCH v9 19/22 pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type
In reply to Stephen HemmingerUse a dynamically allocated logtype.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/pipeline/rte_pipeline.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"},
lib/eal/include/rte_log.h +1 -1
@@ -41,7 +41,7 @@ extern "C" {/* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ /* was RTE_LOGTYPE_TABLE */ -#define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ +/* was RTE_LOGTYPE_PIPELINE */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */
lib/pipeline/rte_pipeline.c +3 -0
@@ -12,6 +12,9 @@#include "rte_pipeline.h" +RTE_LOG_REGISTER_DEFAULT (pipeline_logtype,INFO ); +#define RTE_LOGTYPE_PIPELINE pipeline_logtype +#define RTE_TABLE_INVALID UINT32_MAX#ifdef RTE_PIPELINE_STATS_COLLECT
Signature · 1 line
2.39.1
PATCH v9 20/22 hash: move rte_thash_gfni stubs out of header file
In reply to Stephen HemmingerHaving stubs in header file makes it harder to update RTE_LOG(). Also modify to only print warning once.
--- lib/hash/meson.build | 8 ++++++- lib/hash/rte_thash_gfni.c | 47 +++++++++++++++++++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 28 +++++------------------ lib/hash/version.map | 4 ++++ 4 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 lib/hash/rte_thash_gfni.c
lib/hash/meson.build +7 -1
@@ -17,7 +17,13 @@ indirect_headers += files( 'rte_thash_x86_gfni.h', ) -sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') +sources = files( + 'rte_cuckoo_hash.c', + 'rte_fbk_hash.c', + 'rte_thash.c', + 'rte_thash_gfni.c' +) + deps += ['net'] deps += ['ring'] deps += ['rcu']
lib/hash/rte_thash_gfni.c new file +47 -0
47 lines not on this page · raw message
lib/hash/rte_thash_gfni.h +5 -23
@@ -9,13 +9,8 @@extern "C" {#endif -#include <rte_compat.h> -#include <rte_log.h> -#ifdef RTE_ARCH_X86 -#include <rte_thash_x86_gfni.h> -#endif #ifndef RTE_THASH_GFNI_DEFINED
@@ -38,13 +33,8 @@ extern "C" {* Calculated Toeplitz hash value. */ __rte_experimental -static inline uint32_t -rte_thash_gfni(const uint64_t *mtrx __rte_unused, - const uint8_t *key __rte_unused, int len __rte_unused) -{ -RTE_LOG (ERR ,HASH ,"%s is undefined under given arch\n" , __func__); -return 0 ; -} +uint32_t +rte_thash_gfni (const uint64_t *mtrx,const uint8_t *key,int len);/** * Bulk implementation for Toeplitz hash.
@@ -67,17 +57,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused,* Number of tuples to hash. */ __rte_experimental -static inline void -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, - int len __rte_unused, uint8_t *tuple[] __rte_unused, -uint32_t val[],uint32_t num) -{ -unsigned int i; - -RTE_LOG (ERR ,HASH ,"%s is undefined under given arch\n" , __func__); -for (i =0 ; i < num; i++) - val[i] =0 ; -} +void +rte_thash_gfni_bulk (const uint64_t *mtrx,int len,uint8_t *tuple[], +uint32_t val[],uint32_t num);#endif /* RTE_THASH_GFNI_DEFINED */
lib/hash/version.map +4 -0
@@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; };
Signature · 1 line
2.39.1
PATCH v9 21/22 hash: move rte_hash_set_alg out header
In reply to Stephen HemmingerThe code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of RTE_LOG().
Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the same.
--- lib/hash/meson.build | 1 + lib/hash/rte_crc_arm64.h | 8 ++--- lib/hash/rte_crc_x86.h | 10 +++--- lib/hash/rte_hash_crc.c | 68 ++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------------- lib/hash/version.map | 7 +++++ 6 files changed, 88 insertions(+), 54 deletions(-) create mode 100644 lib/hash/rte_hash_crc.c
lib/hash/meson.build +1 -0
@@ -19,6 +19,7 @@ indirect_headers += files( sources = files( 'rte_cuckoo_hash.c', + 'rte_hash_crc.c', 'rte_fbk_hash.c', 'rte_thash.c', 'rte_thash_gfni.c'
lib/hash/rte_crc_arm64.h +4 -4
@@ -53,7 +53,7 @@ crc32c_arm64_u64(uint64_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_1byte (uint8_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u8 (data, init_val);return crc32c_1byte (data, init_val);
@@ -67,7 +67,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_2byte (uint16_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u16 (data, init_val);return crc32c_2bytes (data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u32 (data, init_val);return crc32c_1word (data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u64 (data, init_val);return crc32c_2words (data, init_val);
lib/hash/rte_crc_x86.h +5 -5
@@ -67,7 +67,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)static inline uint32_t rte_hash_crc_1byte (uint8_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u8 (data, init_val);return crc32c_1byte (data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_2byte (uint16_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u16 (data, init_val);return crc32c_2bytes (data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u32 (data, init_val);return crc32c_1word (data, init_val);
@@ -110,11 +110,11 @@ static inline uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val) {#ifdef RTE_ARCH_X86_64 -if (likely (crc32_alg == CRC32_SSE42_x64)) +if (likely (rte_hash_crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val);#endif -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val);return crc32c_2words (data, init_val);
lib/hash/rte_hash_crc.c new file +68 -0
68 lines not on this page · raw message
lib/hash/rte_hash_crc.h +3 -45
66 lines not on this page · raw message
lib/hash/version.map +7 -0
@@ -9,6 +9,7 @@ DPDK_23 { rte_hash_add_key_with_hash; rte_hash_add_key_with_hash_data; rte_hash_count; + rte_hash_crc_set_alg; rte_hash_create; rte_hash_del_key; rte_hash_del_key_with_hash;
@@ -56,3 +57,9 @@ EXPERIMENTAL { rte_thash_gfni; rte_thash_gfni_bulk; }; + +INTERNAL { + global: + + rte_hash_crc32_alg; +};
Signature · 1 line
2.39.1
PATCH v9 22/22 hash: convert RTE_LOGTYPE_HASH to dynamic type
In reply to Stephen HemmingerUse dynamic type for hash and add subtypes for crc and gfni.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/hash/rte_cuckoo_hash.c | 5 +++++ lib/hash/rte_fbk_hash.c | 5 +++++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 6 files changed, 17 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -350,7 +350,6 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, {RTE_LOGTYPE_PMD ,"pmd" }, - {RTE_LOGTYPE_HASH ,"lib.hash" }, {RTE_LOGTYPE_CRYPTODEV ,"lib.cryptodev" }, {RTE_LOGTYPE_EVENTDEV ,"lib.eventdev" }, {RTE_LOGTYPE_USER1 ,"user1" },
lib/eal/include/rte_log.h +1 -1
@@ -32,7 +32,7 @@ extern "C" {/* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ +/* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */
lib/hash/rte_cuckoo_hash.c +5 -0
@@ -24,6 +24,11 @@#include <rte_tailq.h> #include "rte_hash.h" + +/* needs to be before rte_cuckoo_hash.h */ +RTE_LOG_REGISTER_DEFAULT (hash_logtype,INFO ); +#define RTE_LOGTYPE_HASH hash_logtype +#include "rte_cuckoo_hash.h" /* Mask of all flags supported by this version */
lib/hash/rte_fbk_hash.c +5 -0
@@ -8,6 +8,8 @@#include <errno.h> #include <sys/queue.h> + +#include <rte_cpuflags.h> #include <rte_eal_memconfig.h> #include <rte_malloc.h> #include <rte_common.h>
@@ -18,6 +20,9 @@#include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX (fbk_hash_logtype, fbk,INFO ); +#define RTE_LOGTYPE_HASH fbk_hash_logtype +TAILQ_HEAD (rte_fbk_hash_list, rte_tailq_entry);static struct rte_tailq_elem rte_fbk_hash_tailq = {
lib/hash/rte_thash.c +3 -0
@@ -13,6 +13,9 @@#include <rte_log.h> #include <rte_malloc.h> +RTE_LOG_REGISTER_SUFFIX (thash_logtype, thash,INFO ); +#define RTE_LOGTYPE_HASH thash_logtype +#define THASH_NAME_LEN 64#define TOEPLITZ_HASH_LEN 32
lib/hash/rte_thash_gfni.c +3 -0
@@ -10,6 +10,9 @@#ifndef RTE_THASH_GFNI_DEFINED +RTE_LOG_REGISTER_SUFFIX (hash_gfni_logtype, gfni,INFO ); +#define RTE_LOGTYPE_HASH hash_gfni_logtype +uint32_t rte_thash_gfni(const uint64_t *mtrx __rte_unused, const uint8_t *key __rte_unused, int len __rte_unused)
Signature · 1 line
2.39.1
v10 cover Convert static log type values in libraries
In reply to Stephen HemmingerThis patchset removes the main uses of static LOGTYPE's in DPDK libraries. It starts with the easy one and goes on to the more complex ones.
There are several options on how to treat the old static types:
leave them there, mark as deprecated, or remove them. This version removes them since there is no guarantee in current DPDK policies that says they can't be removed.
Note: there is one patch in this series that will get flagged incorrectly as an ABI change.
v10 - add necessary rte_compat.h in thash_gfni stub for arm
v9 - fix handling of crc32 alg in lib/hash.
make it an internal global variable.
fix gfni stubs for case where they are not used.
Stephen Hemminger (22):
gso: don't log message on non TCP/UDP
eal: drop no longer used GSO logtype
log: drop unused RTE_LOGTYPE_TIMER
efd: replace RTE_LOGTYPE_EFD with dynamic type
mbuf: replace RTE_LOGTYPE_MBUF with dynamic type
acl: replace LOGTYPE_ACL with dynamic type examples/power: replace use of RTE_LOGTYPE_POWER examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER
power: replace RTE_LOGTYPE_POWER with dynamic type
ring: replace RTE_LOGTYPE_RING with dynamic type
mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type
lpm: replace RTE_LOGTYPE_LPM with dynamic types
kni: replace RTE_LOGTYPE_KNI with dynamic type
sched: replace RTE_LOGTYPE_SCHED with dynamic type examples/ipsecgw: replace RTE_LOGTYPE_PORT
port: replace RTE_LOGTYPE_PORT with dynamic type
table: convert RTE_LOGTYPE_TABLE to dynamic logtype app/test: remove use of RTE_LOGTYPE_PIPELINE
pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type
hash: move rte_thash_gfni stubs out of header file
hash: move rte_hash_set_alg out header
hash: convert RTE_LOGTYPE_HASH to dynamic type
app/test/test_acl.c | 3 +- app/test/test_table_acl.c | 50 +++++++++++------------ app/test/test_table_pipeline.c | 40 +++++++++--------- examples/distributor/main.c | 2 +- examples/ipsec-secgw/sa.c | 6 +-- examples/l3fwd-power/main.c | 15 +++---- lib/acl/acl_bld.c | 1 + lib/acl/acl_gen.c | 1 + lib/acl/acl_log.h | 4 ++ lib/acl/rte_acl.c | 4 ++ lib/acl/tb_mem.c | 3 +- lib/eal/common/eal_common_log.c | 17 -------- lib/eal/include/rte_log.h | 34 ++++++++-------- lib/efd/rte_efd.c | 4 ++ lib/fib/fib_log.h | 4 ++ lib/fib/rte_fib.c | 3 ++ lib/fib/rte_fib6.c | 2 + lib/gso/rte_gso.c | 5 +-- lib/gso/rte_gso.h | 1 + lib/hash/meson.build | 9 +++- lib/hash/rte_crc_arm64.h | 8 ++-- lib/hash/rte_crc_x86.h | 10 ++--- lib/hash/rte_cuckoo_hash.c | 5 +++ lib/hash/rte_fbk_hash.c | 5 +++ lib/hash/rte_hash_crc.c | 68 +++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------- lib/hash/rte_thash.c | 3 ++ lib/hash/rte_thash_gfni.c | 50 +++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 29 +++---------- lib/hash/version.map | 11 +++++ lib/kni/rte_kni.c | 3 ++ lib/lpm/lpm_log.h | 4 ++ lib/lpm/rte_lpm.c | 3 ++ lib/lpm/rte_lpm6.c | 1 + lib/mbuf/mbuf_log.h | 4 ++ lib/mbuf/rte_mbuf.c | 4 ++ lib/mbuf/rte_mbuf_dyn.c | 2 + lib/mbuf/rte_mbuf_pool_ops.c | 2 + lib/mempool/rte_mempool.c | 2 + lib/mempool/rte_mempool.h | 8 ++++ lib/mempool/version.map | 3 ++ lib/pipeline/rte_pipeline.c | 3 ++ lib/port/rte_port_ethdev.c | 3 ++ lib/port/rte_port_eventdev.c | 4 ++ lib/port/rte_port_fd.c | 3 ++ lib/port/rte_port_frag.c | 3 ++ lib/port/rte_port_kni.c | 3 ++ lib/port/rte_port_ras.c | 3 ++ lib/port/rte_port_ring.c | 3 ++ lib/port/rte_port_sched.c | 3 ++ lib/port/rte_port_source_sink.c | 3 ++ lib/port/rte_port_sym_crypto.c | 3 ++ lib/power/guest_channel.c | 3 +- lib/power/power_common.c | 2 + lib/power/power_common.h | 3 +- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + lib/rib/rib_log.h | 4 ++ lib/rib/rte_rib.c | 3 ++ lib/rib/rte_rib6.c | 3 ++ lib/ring/rte_ring.c | 3 ++ lib/sched/rte_pie.c | 1 + lib/sched/rte_sched.c | 5 +++ lib/sched/rte_sched_log.h | 4 ++ lib/table/rte_table_acl.c | 3 ++ lib/table/rte_table_array.c | 3 ++ lib/table/rte_table_hash_cuckoo.c | 3 ++ lib/table/rte_table_hash_ext.c | 3 ++ lib/table/rte_table_hash_key16.c | 3 ++ lib/table/rte_table_hash_key32.c | 5 ++- lib/table/rte_table_hash_key8.c | 5 ++- lib/table/rte_table_hash_lru.c | 3 ++ lib/table/rte_table_lpm.c | 3 ++ lib/table/rte_table_lpm_ipv6.c | 3 ++ lib/table/rte_table_stub.c | 3 ++ 75 files changed, 406 insertions(+), 179 deletions(-) create mode 100644 lib/acl/acl_log.h create mode 100644 lib/fib/fib_log.h create mode 100644 lib/hash/rte_hash_crc.c create mode 100644 lib/hash/rte_thash_gfni.c create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/mbuf/mbuf_log.h create mode 100644 lib/rib/rib_log.h create mode 100644 lib/sched/rte_sched_log.h
Signature · 1 line
2.39.1
PATCH v10 1/22 gso: don't log message on non TCP/UDP
If a large packet is passed into GSO routines of unknown protocol then library would log a message.
Better to tell the application instead of logging.
--- lib/gso/rte_gso.c | 5 ++--- lib/gso/rte_gso.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-)
lib/gso/rte_gso.c +2 -3
@@ -80,9 +80,8 @@ rte_gso_segment(struct rte_mbuf *pkt, ret =gso_udp4_segment (pkt, gso_size, direct_pool, indirect_pool, pkts_out, nb_pkts_out); }else { -/* unsupported packet, skip */ -RTE_LOG (DEBUG ,GSO ,"Unsupported packet type\n" ); - ret =0 ; + ret = -ENOTSUP ;/* only UDP or TCP allowed */ + }if (ret <0 ) {
lib/gso/rte_gso.h +1 -0
@@ -114,6 +114,7 @@ struct rte_gso_ctx {* - The number of GSO segments filled in pkts_out on success. * - Return 0 if it does not need to be GSO'd. * - Return -ENOMEM if run out of memory in MBUF pools. +* - Return -ENOTSUP for protocols that can not be segmentd (not UDP or TCP) * - Return -EINVAL for invalid parameters. */ int rte_gso_segment(struct rte_mbuf *pkt,
Signature · 1 line
2.39.1
PATCH v10 2/22 eal: drop no longer used GSO logtype
In reply to Stephen HemmingerThe message that used this was replaced in previous patch.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -368,7 +368,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, - {RTE_LOGTYPE_GSO, "lib.gso"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, {RTE_LOGTYPE_USER3, "user3"},
lib/eal/include/rte_log.h +1 -1
@@ -46,7 +46,7 @@ extern "C" {#define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ #define RTE_LOGTYPE_EFD 18/**< Log related to EFD. */ #define RTE_LOGTYPE_EVENTDEV 19/**< Log related to eventdev. */ -#define RTE_LOGTYPE_GSO 20/**< Log related to GSO. */ +/* was RTE_LOGTYPE_GSO */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 24/**< User-defined log type 1. */
Signature · 1 line
2.39.1
PATCH v10 3/22 log: drop unused RTE_LOGTYPE_TIMER
In reply to Stephen HemmingerThe timer code does not use rte_log.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -352,7 +352,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_MALLOC, "lib.malloc"}, {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, - {RTE_LOGTYPE_TIMER, "lib.timer"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"},
lib/eal/include/rte_log.h +1 -1
@@ -30,7 +30,7 @@ extern "C" {#define RTE_LOGTYPE_MALLOC 1/**< Log related to malloc. */ #define RTE_LOGTYPE_RING 2/**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ -#define RTE_LOGTYPE_TIMER 4/**< Log related to timers. */ +/* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */
Signature · 1 line
2.39.1
PATCH v10 4/22 efd: replace RTE_LOGTYPE_EFD with dynamic type
In reply to Stephen HemmingerReplace all uses of the global logtype with a dynamic log type.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/efd/rte_efd.c | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -365,7 +365,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, - {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"},
lib/eal/include/rte_log.h +1 -1
@@ -44,7 +44,7 @@ extern "C" {#define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ #define RTE_LOGTYPE_MBUF 16/**< Log related to mbuf. */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ -#define RTE_LOGTYPE_EFD 18/**< Log related to EFD. */ +/* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19/**< Log related to eventdev. */ /* was RTE_LOGTYPE_GSO */
lib/efd/rte_efd.c +4 -0
@@ -9,6 +9,7 @@#include <errno.h> #include <sys/queue.h> +#include <rte_cpuflags.h> #include <rte_string_fns.h> #include <rte_log.h> #include <rte_eal_memconfig.h>
@@ -28,6 +29,9 @@#include "rte_efd_arm64.h" #endif +RTE_LOG_REGISTER_DEFAULT (efd_logtype,INFO ); +#define RTE_LOGTYPE_EFD efd_logtype +#define EFD_KEY (key_idx, table) (table->keys + ((key_idx) * table->key_len))/** Hash function used to determine chunk_id and bin_id for a group */ #define EFD_HASH (key, table) \
Signature · 1 line
2.39.1
PATCH v10 5/22 mbuf: replace RTE_LOGTYPE_MBUF with dynamic type
In reply to Stephen HemmingerIntroduce a new dynamic logtype for mbuf related messages. Since this is used in multiple files put one macro in mbuf_log.h
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mbuf/mbuf_log.h | 4 ++++ lib/mbuf/rte_mbuf.c | 4 ++++ lib/mbuf/rte_mbuf_dyn.c | 2 ++ lib/mbuf/rte_mbuf_pool_ops.c | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/mbuf/mbuf_log.h
lib/eal/common/eal_common_log.c +0 -1
@@ -363,7 +363,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, - {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"},
lib/eal/include/rte_log.h +1 -1
@@ -42,7 +42,7 @@ extern "C" {#define RTE_LOGTYPE_PORT 13/**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ -#define RTE_LOGTYPE_MBUF 16/**< Log related to mbuf. */ +/* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19/**< Log related to eventdev. */
lib/mbuf/mbuf_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int mbuf_logtype; +#define RTE_LOGTYPE_MBUF mbuf_logtype
lib/mbuf/rte_mbuf.c +4 -0
@@ -20,6 +20,10 @@#include <rte_errno.h> #include <rte_memcpy.h> +#include "mbuf_log.h" + +RTE_LOG_REGISTER_DEFAULT (mbuf_logtype,INFO ); +/* * pktmbuf pool constructor, given as a callback function to * rte_mempool_create(), or called directly if using
lib/mbuf/rte_mbuf_dyn.c +2 -0
@@ -17,6 +17,8 @@#include <rte_mbuf.h> #include <rte_mbuf_dyn.h> +#include "mbuf_log.h" +#define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"struct mbuf_dynfield_elt {
lib/mbuf/rte_mbuf_pool_ops.c +2 -0
@@ -8,6 +8,8 @@#include <rte_errno.h> #include <rte_mbuf_pool_ops.h> +#include "mbuf_log.h" +int rte_mbuf_set_platform_mempool_ops (const char *ops_name) {
Signature · 1 line
2.39.1
PATCH v10 6/22 acl: replace LOGTYPE_ACL with dynamic type
In reply to Stephen HemmingerGet rid of RTE_LOGTYPE_ACL and RTE_LOGTYPE_MALLOC. For ACL library use a dynamic type.
The one message using RTE_LOGTYPE_MALLOC should have been under the ACL logtype anyway.
The test code should not have been using fixed log type so just change that to stderr.
--- app/test/test_acl.c | 3 ++- lib/acl/acl_bld.c | 1 + lib/acl/acl_gen.c | 1 + lib/acl/acl_log.h | 4 ++++ lib/acl/rte_acl.c | 4 ++++ lib/acl/tb_mem.c | 3 ++- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 lib/acl/acl_log.h
app/test/test_acl.c +2 -1
@@ -154,7 +154,8 @@ rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx,for (i =0 ; i != num; i++) { rc =acl_ipv4vlan_check_rule (rules + i);if (rc !=0 ) { -RTE_LOG (ERR ,ACL ,"%s: rule #%u is invalid\n" , +fprintf (stderr, +"%s: rule #%u is invalid\n" , __func__, i +1 );return rc; }
lib/acl/acl_bld.c +1 -0
@@ -5,6 +5,7 @@#include <rte_acl.h> #include "tb_mem.h" #include "acl.h" +#include "acl_log.h" #define ACL_POOL_ALIGN 8#define ACL_POOL_ALLOC_MIN 0x800000
lib/acl/acl_gen.c +1 -0
@@ -4,6 +4,7 @@#include <rte_acl.h> #include "acl.h" +#include "acl_log.h" #define QRANGE_MIN ((uint8_t)INT8_MIN)
lib/acl/acl_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int acl_logtype; +#define RTE_LOGTYPE_ACL acl_logtype
lib/acl/rte_acl.c +4 -0
@@ -6,8 +6,12 @@#include <rte_string_fns.h> #include <rte_acl.h> #include <rte_tailq.h> +#include <rte_log.h> #include "acl.h" +#include "acl_log.h" + +RTE_LOG_REGISTER_DEFAULT (acl_logtype,INFO );TAILQ_HEAD (rte_acl_list, rte_tailq_entry);
lib/acl/tb_mem.c +2 -1
@@ -3,6 +3,7 @@*/ #include "tb_mem.h" +#include "acl_log.h" /* * Memory management routines for temporary memory.
@@ -25,7 +26,7 @@ tb_pool(struct tb_mem_pool *pool, size_t sz) size = sz + pool->alignment -1 ; block =calloc (1 , size +sizeof (*pool->block));if (block ==NULL ) { -RTE_LOG (ERR ,MALLOC ,"%s(%zu)\n failed, currently allocated " +RTE_LOG (ERR ,ACL ,"%s(%zu)\n failed, currently allocated " "by pool: %zu bytes\n" , __func__, sz, pool->alloc);siglongjmp (pool->fail, -ENOMEM );return NULL ;
lib/eal/common/eal_common_log.c +0 -2
@@ -349,14 +349,12 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, - {RTE_LOGTYPE_MALLOC ,"lib.malloc" }, {RTE_LOGTYPE_RING ,"lib.ring" }, {RTE_LOGTYPE_MEMPOOL ,"lib.mempool" }, {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_HASH ,"lib.hash" }, {RTE_LOGTYPE_LPM ,"lib.lpm" }, {RTE_LOGTYPE_KNI ,"lib.kni" }, - {RTE_LOGTYPE_ACL ,"lib.acl" }, {RTE_LOGTYPE_POWER ,"lib.power" }, {RTE_LOGTYPE_METER ,"lib.meter" }, {RTE_LOGTYPE_SCHED ,"lib.sched" },
lib/eal/include/rte_log.h +2 -2
@@ -27,7 +27,7 @@ extern "C" {/* SDK log type */ #define RTE_LOGTYPE_EAL 0/**< Log related to eal. */ -#define RTE_LOGTYPE_MALLOC 1/**< Log related to malloc. */ +/* was RTE_LOGTYPE_MALLOC */ #define RTE_LOGTYPE_RING 2/**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */
@@ -35,7 +35,7 @@ extern "C" {#define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ -#define RTE_LOGTYPE_ACL 9/**< Log related to ACL. */ +/* was RTE_LOGTYPE_ACL */ #define RTE_LOGTYPE_POWER 10/**< Log related to power. */ #define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */
Signature · 1 line
2.39.1
PATCH v10 7/22 examples/power: replace use of RTE_LOGTYPE_POWER
In reply to Stephen HemmingerDon't use static logtype in sample application.
--- examples/distributor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/distributor/main.c +1 -1
@@ -679,7 +679,7 @@ init_power_library(void)/* init power management library */ ret =rte_power_init (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +fprintf (stderr,"Library initialization failed on core %u\n" , lcore_id);/*
Signature · 1 line
2.39.1
Re: [PATCH v10 07/22] examples/power: replace use of RTE_LOGTYPE_POWER
Quoted 12 lines · Stephen Hemminger
Don't use static logtype in sample application.
Signed-off-by Stephen Hemminger <[email protected]>--- examples/distributor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)examples/distributor/main.c +0
-0
examples/distributor/main.c init_power_library(void) · line 685
Quoted 8 lines
examples/distributor/main.c +1
-1@@ -679,7 +679,7 @@ init_power_library(void)/* init power management library */ ret =rte_power_init (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +fprintf (stderr,"Library initialization failed on core %u\n" , lcore_id);/*
PATCH v10 8/22 examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER
In reply to Stephen HemmingerConvert to using a dynamic logtype for the application.
--- examples/l3fwd-power/main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
examples/l3fwd-power/main.c +8 -7
@@ -51,7 +51,8 @@#include "perf_core.h" #include "main.h" -#define RTE_LOGTYPE_L3FWD_POWER RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER (l3fwd_power_logtype, l3fwd.power,INFO ); +#define RTE_LOGTYPE_L3FWD_POWER l3fwd_power_logtype#define MAX_PKT_BURST 32
@@ -2236,7 +2237,7 @@ init_power_library(void)/* init power management library */ ret =rte_power_init (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Library initialization failed on core %u\n" , lcore_id);return ret;
@@ -2245,7 +2246,7 @@ init_power_library(void) env =rte_power_get_env ();if (env !=PM_ENV_ACPI_CPUFREQ && env !=PM_ENV_PSTATE_CPUFREQ ) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Only ACPI and PSTATE mode are supported\n" );return -1 ; }
@@ -2263,7 +2264,7 @@ deinit_power_library(void)/* deinit power management library */ ret =rte_power_exit (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Library deinitialization failed on core %u\n" , lcore_id);return ret;
@@ -2332,7 +2333,7 @@ update_telemetry(__rte_unused struct rte_timer *tim, ret =rte_metrics_update_values (RTE_METRICS_GLOBAL , telstats_index, values,RTE_DIM (values));if (ret <0 ) -RTE_LOG (WARNING ,POWER ,"failed to update metrics\n" ); +RTE_LOG (WARNING ,L3FWD_POWER ,"failed to update metrics\n" ); } static int
@@ -2381,7 +2382,7 @@ launch_timer(unsigned int lcore_id) rte_get_main_lcore()); } -RTE_LOG (INFO ,POWER ,"Bring up the Timer\n" ); +RTE_LOG (INFO ,L3FWD_POWER ,"Bring up the Timer\n" );telemetry_setup_timer ();
@@ -2397,7 +2398,7 @@ launch_timer(unsigned int lcore_id) } } -RTE_LOG (INFO ,POWER ,"Timer_subsystem is done\n" ); +RTE_LOG (INFO ,L3FWD_POWER ,"Timer_subsystem is done\n" );return 0 ; }
Signature · 1 line
2.39.1
Re: [PATCH v10 08/22] examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER
Quoted 67 lines · Stephen Hemminger
Convert to using a dynamic logtype for the application.
Signed-off-by Stephen Hemminger <[email protected]>--- examples/l3fwd-power/main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)examples/l3fwd-power/main.c +7
-6@@ -51,7 +51,8 @@#include "perf_core.h" #include "main.h" -#define RTE_LOGTYPE_L3FWD_POWER RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER (l3fwd_power_logtype, l3fwd.power,INFO ); +#define RTE_LOGTYPE_L3FWD_POWER l3fwd_power_logtype#define MAX_PKT_BURST 32@@ -2236,7 +2237,7 @@ init_power_library(void)/* init power management library */ ret =rte_power_init (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Library initialization failed on core %u\n" , lcore_id);return ret;@@ -2245,7 +2246,7 @@ init_power_library(void) env =rte_power_get_env ();if (env !=PM_ENV_ACPI_CPUFREQ && env !=PM_ENV_PSTATE_CPUFREQ ) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Only ACPI and PSTATE mode are supported\n" );return -1 ; }@@ -2263,7 +2264,7 @@ deinit_power_library(void)/* deinit power management library */ ret =rte_power_exit (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Library deinitialization failed on core %u\n" , lcore_id);return ret;@@ -2332,7 +2333,7 @@ update_telemetry(__rte_unused struct rte_timer *tim, ret =rte_metrics_update_values (RTE_METRICS_GLOBAL , telstats_index, values,RTE_DIM (values));if (ret <0 ) -RTE_LOG (WARNING ,POWER ,"failed to update metrics\n" ); +RTE_LOG (WARNING ,L3FWD_POWER ,"failed to update metrics\n" ); } static int@@ -2381,7 +2382,7 @@ launch_timer(unsigned int lcore_id) rte_get_main_lcore()); } -RTE_LOG (INFO ,POWER ,"Bring up the Timer\n" ); +RTE_LOG (INFO ,L3FWD_POWER ,"Bring up the Timer\n" );telemetry_setup_timer ();
examples/l3fwd-power/main.c launch_timer(unsigned int lcore_id) · line 2404
Quoted 8 lines
examples/l3fwd-power/main.c +1
-1@@ -2397,7 +2398,7 @@ launch_timer(unsigned int lcore_id) } } -RTE_LOG (INFO ,POWER ,"Timer_subsystem is done\n" ); +RTE_LOG (INFO ,L3FWD_POWER ,"Timer_subsystem is done\n" );return 0 ; }
PATCH v10 9/22 power: replace RTE_LOGTYPE_POWER with dynamic type
In reply to Stephen HemmingerUse dynamic log type for power library.
Also replace use of RTE_LOGTYPE_USER1 with lib.power.guest.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 3 ++- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + 7 files changed, 9 insertions(+), 4 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"},
lib/eal/include/rte_log.h +1 -1
@@ -36,7 +36,7 @@ extern "C" {#define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ -#define RTE_LOGTYPE_POWER 10/**< Log related to power. */ +/* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 13/**< Log related to port. */
lib/power/guest_channel.c +2 -1
@@ -17,7 +17,8 @@#include "guest_channel.h" -#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER_SUFFIX (guest_channel_logtype, guest,INFO ); +#define RTE_LOGTYPE_GUEST_CHANNEL guest_channel_logtype/* Timeout for incoming message in milliseconds. */ #define TIMEOUT 10
lib/power/power_common.c +2 -0
@@ -12,6 +12,8 @@#include "power_common.h" +RTE_LOG_REGISTER_DEFAULT (power_logtype,INFO ); +#define POWER_SYSFILE_SCALING_DRIVER \ "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver"#define POWER_SYSFILE_GOVERNOR \
lib/power/power_common.h +2 -1
@@ -5,11 +5,12 @@#ifndef _POWER_COMMON_H_#define _POWER_COMMON_H_ -#include <rte_common.h> #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype#ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \
lib/power/power_kvm_vm.c +1 -0
@@ -8,6 +8,7 @@#include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent"
lib/power/rte_power.c +1 -0
@@ -10,6 +10,7 @@#include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h"
Signature · 1 line
2.39.1
Re: [PATCH v10 09/22] power: replace RTE_LOGTYPE_POWER with dynamic type
Quoted 101 lines · Stephen Hemminger
Use dynamic log type for power library.
Also replace use ofRTE_LOGTYPE_USER1with lib.power.guest.Signed-off-by Stephen Hemminger <[email protected]>--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 3 ++- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + 7 files changed, 9 insertions(+), 4 deletions(-)lib/eal/common/eal_common_log.c +0
-1@@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"},lib/eal/include/rte_log.h +1
-1@@ -36,7 +36,7 @@ extern "C" {#define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ -#define RTE_LOGTYPE_POWER 10/**< Log related to power. */ +/* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 13/**< Log related to port. */ lib/power/guest_channel.c +2
-1@@ -17,7 +17,8 @@#include "guest_channel.h" -#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER_SUFFIX (guest_channel_logtype, guest,INFO ); +#define RTE_LOGTYPE_GUEST_CHANNEL guest_channel_logtype/* Timeout for incoming message in milliseconds. */ #define TIMEOUT 10lib/power/power_common.c +2
-0@@ -12,6 +12,8 @@#include "power_common.h" +RTE_LOG_REGISTER_DEFAULT (power_logtype,INFO ); +#define POWER_SYSFILE_SCALING_DRIVER \ "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver"#define POWER_SYSFILE_GOVERNOR \lib/power/power_common.h +2
-1@@ -5,11 +5,12 @@#ifndef _POWER_COMMON_H_#define _POWER_COMMON_H_ -#include <rte_common.h> #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype#ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \lib/power/power_kvm_vm.c +1
-0@@ -8,6 +8,7 @@#include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent"lib/power/rte_power.c +0
-0
lib/power/rte_power.c line 15
Quoted 6 lines
lib/power/rte_power.c +1
-0@@ -10,6 +10,7 @@#include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h"
Quoted 1 line
PATCH v10 10/22 ring: replace RTE_LOGTYPE_RING with dynamic type
In reply to Stephen HemmingerThe logtype for ring only used in library.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/ring/rte_ring.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -349,7 +349,6 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, - {RTE_LOGTYPE_RING ,"lib.ring" }, {RTE_LOGTYPE_MEMPOOL ,"lib.mempool" }, {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_HASH ,"lib.hash" },
lib/eal/include/rte_log.h +1 -1
@@ -28,7 +28,7 @@ extern "C" {/* SDK log type */ #define RTE_LOGTYPE_EAL 0/**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ -#define RTE_LOGTYPE_RING 2/**< Log related to ring. */ +/* was RTE_LOGTYPE_RING */ #define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */
lib/ring/rte_ring.c +3 -0
@@ -26,6 +26,9 @@#include "rte_ring.h" #include "rte_ring_elem.h" +RTE_LOG_REGISTER_DEFAULT (ring_logtype,INFO ); +#define RTE_LOGTYPE_RING ring_logtype +TAILQ_HEAD (rte_ring_list, rte_tailq_entry);static struct rte_tailq_elem rte_ring_tailq = {
Signature · 1 line
2.39.1
PATCH v10 11/22 mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type
In reply to Stephen HemmingerConvert from RTE_LOGTYPE_MEMPOOL to logtype_mempool.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mempool/rte_mempool.c | 2 ++ lib/mempool/rte_mempool.h | 8 ++++++++ lib/mempool/version.map | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -349,7 +349,6 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, - {RTE_LOGTYPE_MEMPOOL ,"lib.mempool" }, {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_HASH ,"lib.hash" }, {RTE_LOGTYPE_LPM ,"lib.lpm" },
lib/eal/include/rte_log.h +1 -1
@@ -29,7 +29,7 @@ extern "C" {#define RTE_LOGTYPE_EAL 0/**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ /* was RTE_LOGTYPE_RING */ -#define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ +/* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */
lib/mempool/rte_mempool.c +2 -0
@@ -31,6 +31,8 @@#include "mempool_trace.h" #include "rte_mempool.h" +RTE_LOG_REGISTER_DEFAULT (rte_mempool_logtype,INFO ); +TAILQ_HEAD (rte_mempool_list, rte_tailq_entry);static struct rte_tailq_elem rte_mempool_tailq = {
lib/mempool/rte_mempool.h +8 -0
@@ -43,6 +43,7 @@#include <rte_spinlock.h> #include <rte_debug.h> #include <rte_lcore.h> +#include <rte_log.h> #include <rte_branch_prediction.h> #include <rte_ring.h> #include <rte_memcpy.h>
@@ -175,6 +176,13 @@ struct rte_mempool_objtlr {#endif + +/** +* @internal Logtype used for mempool related messages. +*/ +extern int rte_mempool_logtype; +#define RTE_LOGTYPE_MEMPOOL rte_mempool_logtype +/** * A list of memory where objects are stored */
lib/mempool/version.map +3 -0
@@ -57,4 +57,7 @@ INTERNAL { # added in 21.11 rte_mempool_event_callback_register; rte_mempool_event_callback_unregister; + + # added in 23.07 + rte_mempool_logtype; };
Signature · 1 line
2.39.1
PATCH v10 12/22 lpm: replace RTE_LOGTYPE_LPM with dynamic types
In reply to Stephen HemmingerSplit lpm and lpm6 into separate log types since they are in different files and user may want to change log levels for IPv4 vs IPv6.
For rib and fib libraries give them own types as well.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/fib/fib_log.h | 4 ++++ lib/fib/rte_fib.c | 3 +++ lib/fib/rte_fib6.c | 2 ++ lib/lpm/lpm_log.h | 4 ++++ lib/lpm/rte_lpm.c | 3 +++ lib/lpm/rte_lpm6.c | 1 + lib/rib/rib_log.h | 4 ++++ lib/rib/rte_rib.c | 3 +++ lib/rib/rte_rib6.c | 3 +++ 11 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 lib/fib/fib_log.h create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/rib/rib_log.h
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"},
lib/eal/include/rte_log.h +1 -1
@@ -33,7 +33,7 @@ extern "C" {/* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ -#define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */ +/* was RTE_LOGTYPE_LPM */ #define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */
lib/fib/fib_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int fib_logtype; +#define RTE_LOGTYPE_LPM fib_logtype
lib/fib/rte_fib.c +3 -0
@@ -16,6 +16,9 @@#include <rte_fib.h> #include "dir24_8.h" +#include "fib_log.h" + +RTE_LOG_REGISTER_DEFAULT (fib_logtype,INFO );TAILQ_HEAD (rte_fib_list, rte_tailq_entry);static struct rte_tailq_elem rte_fib_tailq = {
lib/fib/rte_fib6.c +2 -0
@@ -9,6 +9,7 @@#include <rte_eal_memconfig.h> #include <rte_tailq.h> #include <rte_errno.h> +#include <rte_log.h> #include <rte_malloc.h> #include <rte_string_fns.h>
@@ -16,6 +17,7 @@#include <rte_fib6.h> #include "trie.h" +#include "fib_log.h" TAILQ_HEAD (rte_fib6_list, rte_tailq_entry);static struct rte_tailq_elem rte_fib6_tailq = {
lib/lpm/lpm_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int lpm_logtype; +#define RTE_LOGTYPE_LPM lpm_logtype
lib/lpm/rte_lpm.c +3 -0
@@ -18,6 +18,9 @@#include <rte_tailq.h> #include "rte_lpm.h" +#include "lpm_log.h" + +RTE_LOG_REGISTER_DEFAULT (lpm_logtype,INFO );TAILQ_HEAD (rte_lpm_list, rte_tailq_entry);
lib/lpm/rte_lpm6.c +1 -0
@@ -20,6 +20,7 @@#include <rte_tailq.h> #include "rte_lpm6.h" +#include "lpm_log.h" #define RTE_LPM6_TBL24_NUM_ENTRIES (1 << 24)#define RTE_LPM6_TBL8_GROUP_NUM_ENTRIES 256
lib/rib/rib_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int rib_logtype; +#define RTE_LOGTYPE_LPM rib_logtype
lib/rib/rte_rib.c +3 -0
@@ -15,6 +15,9 @@#include <rte_rib.h> +RTE_LOG_REGISTER_DEFAULT (rib_logtype,INFO ); +#define RTE_LOGTYPE_LPM rib_logtype +TAILQ_HEAD (rte_rib_list, rte_tailq_entry);static struct rte_tailq_elem rte_rib_tailq = { .name ="RTE_RIB" ,
lib/rib/rte_rib6.c +3 -0
@@ -8,6 +8,7 @@#include <rte_eal_memconfig.h> #include <rte_errno.h> +#include <rte_log.h> #include <rte_malloc.h> #include <rte_mempool.h> #include <rte_string_fns.h>
@@ -15,6 +16,8 @@#include <rte_rib6.h> +#include "rib_log.h" +#define RTE_RIB_VALID_NODE 1#define RIB6_MAXDEPTH 128/* Maximum length of a RIB6 name. */
Signature · 1 line
2.39.1
PATCH v10 13/22 kni: replace RTE_LOGTYPE_KNI with dynamic type
In reply to Stephen HemmingerEven though KNI will eventually disappear, fix the logtype now.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/kni/rte_kni.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"},
lib/eal/include/rte_log.h +1 -1
@@ -34,7 +34,7 @@ extern "C" {#define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ /* was RTE_LOGTYPE_LPM */ -#define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ +/* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */
lib/kni/rte_kni.c +3 -0
@@ -23,6 +23,9 @@#include <rte_kni_common.h> #include "rte_kni_fifo.h" +RTE_LOG_REGISTER_DEFAULT (kni_logtype,INFO ); +#define RTE_LOGTYPE_KNI kni_logtype +#define MAX_MBUF_BURST_NUM 32/* Maximum number of ring entries */
Signature · 1 line
2.39.1
PATCH v10 14/22 sched: replace RTE_LOGTYPE_SCHED with dynamic type
In reply to Stephen HemmingerAlso can remove unused RTE_LOGTYPE_METER
--- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- lib/sched/rte_pie.c | 1 + lib/sched/rte_sched.c | 5 +++++ lib/sched/rte_sched_log.h | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lib/sched/rte_sched_log.h
lib/eal/common/eal_common_log.c +0 -2
@@ -351,8 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_METER, "lib.meter"}, - {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
lib/eal/include/rte_log.h +2 -2
@@ -37,8 +37,8 @@ extern "C" {/* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ -#define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ -#define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */ +/* was RTE_LOGTYPE_METER */ +/* was RTE_LOGTYPE_SCHED */ #define RTE_LOGTYPE_PORT 13/**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */
lib/sched/rte_pie.c +1 -0
@@ -6,6 +6,7 @@#include <stdlib.h> #include <string.h> +#include "rte_sched_log.h" #include "rte_pie.h" #ifdef __INTEL_COMPILER
lib/sched/rte_sched.c +5 -0
@@ -16,9 +16,12 @@#include <rte_reciprocal.h> #include "rte_sched.h" +#include "rte_sched_log.h" #include "rte_sched_common.h" +#include "rte_approx.h" +#ifdef __INTEL_COMPILER#pragma warning(disable:2259)/* conversion may lose significant bits */ #endif
@@ -3002,3 +3005,5 @@ rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uintreturn count; } + +RTE_LOG_REGISTER_DEFAULT (sched_logtype,INFO );
lib/sched/rte_sched_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int sched_logtype; +#define RTE_LOGTYPE_SCHED sched_logtype
Signature · 1 line
2.39.1
PATCH v10 15/22 examples/ipsecgw: replace RTE_LOGTYPE_PORT
In reply to Stephen HemmingerLooks like some code got copy/paste in to the IPSEC gateway example from another place. Shouldn't be using RTE_LOGTYPE_PORT here.
--- examples/ipsec-secgw/sa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
examples/ipsec-secgw/sa.c +3 -3
@@ -1127,7 +1127,7 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso)if (inbound) {if ((dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_SECURITY ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware RX IPSec offload is not supported\n" );return -EINVAL ; }
@@ -1135,13 +1135,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) }else {/* outbound */ if ((dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_SECURITY ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware TX IPSec offload is not supported\n" );return -EINVAL ; }if (tso && (dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_TCP_TSO ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware TCP TSO offload is not supported\n" );return -EINVAL ; }
Signature · 1 line
2.39.1
PATCH v10 16/22 port: replace RTE_LOGTYPE_PORT with dynamic type
In reply to Stephen HemmingerSplit up the single static RTE_LOGTYPE_PORT into separate sub types for each component: port.ethdev, port.evendev, ...
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/port/rte_port_ethdev.c | 3 +++ lib/port/rte_port_eventdev.c | 4 ++++ lib/port/rte_port_fd.c | 3 +++ lib/port/rte_port_frag.c | 3 +++ lib/port/rte_port_kni.c | 3 +++ lib/port/rte_port_ras.c | 3 +++ lib/port/rte_port_ring.c | 3 +++ lib/port/rte_port_sched.c | 3 +++ lib/port/rte_port_source_sink.c | 3 +++ lib/port/rte_port_sym_crypto.c | 3 +++ 12 files changed, 32 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"},
lib/eal/include/rte_log.h +1 -1
@@ -39,7 +39,7 @@ extern "C" {/* was RTE_LOGTYPE_POWER */ /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ -#define RTE_LOGTYPE_PORT 13/**< Log related to port. */ +/* was RTE_LOGTYPE_PORT */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */
lib/port/rte_port_ethdev.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_ethdev.h" +RTE_LOG_REGISTER_SUFFIX (port_ethdev_logtype, ethdev,INFO ); +#define RTE_LOGTYPE_PORT port_ethdev_logtype +/* * Port ETHDEV Reader */
lib/port/rte_port_eventdev.c +4 -0
@@ -5,11 +5,15 @@#include <string.h> #include <stdint.h> +#include <rte_log.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include "rte_port_eventdev.h" +RTE_LOG_REGISTER_SUFFIX (port_eventdev_logtype, eventdev,INFO ); +#define RTE_LOGTYPE_PORT port_eventdev_logtype +/* * Port EVENTDEV Reader */
lib/port/rte_port_fd.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_fd.h" +RTE_LOG_REGISTER_SUFFIX (port_fd_logtype, fd,INFO ); +#define RTE_LOGTYPE_PORT port_fd_logtype +/* * Port FD Reader */
lib/port/rte_port_frag.c +3 -0
@@ -7,6 +7,9 @@#include "rte_port_frag.h" +RTE_LOG_REGISTER_SUFFIX (port_frag_logtype, frag,INFO ); +#define RTE_LOGTYPE_PORT port_frag_logtype +/* Max number of fragments per packet allowed */ #define RTE_PORT_FRAG_MAX_FRAGS_PER_PACKET 0x80
lib/port/rte_port_kni.c +3 -0
@@ -9,6 +9,9 @@#include "rte_port_kni.h" +RTE_LOG_REGISTER_SUFFIX (port_kni_logtype, kni,INFO ); +#define RTE_LOGTYPE_PORT port_kni_logtype +/* * Port KNI Reader */
lib/port/rte_port_ras.c +3 -0
@@ -9,6 +9,9 @@#include "rte_port_ras.h" +RTE_LOG_REGISTER_SUFFIX (port_ras_logtype, ras,INFO ); +#define RTE_LOGTYPE_PORT port_ras_logtype +#ifndef RTE_PORT_RAS_N_BUCKETS #define RTE_PORT_RAS_N_BUCKETS 4094#endif
lib/port/rte_port_ring.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_ring.h" +RTE_LOG_REGISTER_SUFFIX (port_ring_logtype, ring,INFO ); +#define RTE_LOGTYPE_PORT port_ring_logtype +/* * Port RING Reader */
lib/port/rte_port_sched.c +3 -0
@@ -7,6 +7,9 @@#include "rte_port_sched.h" +RTE_LOG_REGISTER_SUFFIX (port_sched_logtype, sched,INFO ); +#define RTE_LOGTYPE_PORT port_sched_logtype +/* * Reader */
lib/port/rte_port_source_sink.c +3 -0
@@ -15,6 +15,9 @@#include "rte_port_source_sink.h" +RTE_LOG_REGISTER_SUFFIX (port_source_logtype, source,INFO ); +#define RTE_LOGTYPE_PORT port_source_logtype +/* * Port SOURCE */
lib/port/rte_port_sym_crypto.c +3 -0
@@ -8,6 +8,9 @@#include "rte_port_sym_crypto.h" +RTE_LOG_REGISTER_SUFFIX (port_crypto_logtype, crypto,INFO ); +#define RTE_LOGTYPE_PORT port_crypto_logtype +/* * Port Crypto Reader */
Signature · 1 line
2.39.1
PATCH v10 17/22 table: convert RTE_LOGTYPE_TABLE to dynamic logtype
In reply to Stephen HemmingerUse logtype suffixes for various components of this library.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/table/rte_table_acl.c | 3 +++ lib/table/rte_table_array.c | 3 +++ lib/table/rte_table_hash_cuckoo.c | 3 +++ lib/table/rte_table_hash_ext.c | 3 +++ lib/table/rte_table_hash_key16.c | 3 +++ lib/table/rte_table_hash_key32.c | 5 ++++- lib/table/rte_table_hash_key8.c | 5 ++++- lib/table/rte_table_hash_lru.c | 3 +++ lib/table/rte_table_lpm.c | 3 +++ lib/table/rte_table_lpm_ipv6.c | 3 +++ lib/table/rte_table_stub.c | 3 +++ 13 files changed, 36 insertions(+), 4 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
lib/eal/include/rte_log.h +1 -1
@@ -40,7 +40,7 @@ extern "C" {/* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ -#define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ +/* was RTE_LOGTYPE_TABLE */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */
lib/table/rte_table_acl.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_acl.h" +RTE_LOG_REGISTER_SUFFIX (table_acl_logtype, acl,INFO ); +#define RTE_LOGTYPE_TABLE table_acl_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ACL_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_array.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_array.h" +RTE_LOG_REGISTER_SUFFIX (table_array_logtype, array,INFO ); +#define RTE_LOGTYPE_TABLE table_array_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ARRAY_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_hash_cuckoo.c +3 -0
@@ -10,6 +10,9 @@#include "rte_table_hash_cuckoo.h" +RTE_LOG_REGISTER_SUFFIX (table_hash_logtype, hash,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_CUCKOO_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_hash_ext.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_hash.h" +RTE_LOG_REGISTER_SUFFIX (table_hash_ext_logtype, hash.ext,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_ext_logtype +#define KEYS_PER_BUCKET 4struct bucket {
lib/table/rte_table_hash_key16.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_hash.h" #include "rte_lru.h" +RTE_LOG_REGISTER_SUFFIX (table_hash16_logtype, hash16,INFO ); +#define RTE_LOGTYPE_TABLE table_hash16_logtype +#define KEY_SIZE 16#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_key32.c +4 -1
@@ -11,7 +11,10 @@#include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 32 +RTE_LOG_REGISTER_SUFFIX (table_hash32_logtype, hash32,INFO ); +#define RTE_LOGTYPE_TABLE table_hash32_logtype + +#define KEY_SIZE 32#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_key8.c +4 -1
@@ -11,7 +11,10 @@#include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 8 +RTE_LOG_REGISTER_SUFFIX (table_hash8_logtype, hash8,INFO ); +#define RTE_LOGTYPE_TABLE table_hash8_logtype + +#define KEY_SIZE 8#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_lru.c +3 -0
@@ -14,6 +14,9 @@#define KEYS_PER_BUCKET 4 +RTE_LOG_REGISTER_SUFFIX (table_hash_lru_logtype, hash_lru,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_lru_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_LRU_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_lpm.c +3 -0
@@ -13,6 +13,9 @@#include "rte_table_lpm.h" +RTE_LOG_REGISTER_SUFFIX (table_lpm_logtype, lpm,INFO ); +#define RTE_LOGTYPE_TABLE table_lpm_logtype +#ifndef RTE_TABLE_LPM_MAX_NEXT_HOPS #define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536#endif
lib/table/rte_table_lpm_ipv6.c +3 -0
@@ -12,6 +12,9 @@#include "rte_table_lpm_ipv6.h" +RTE_LOG_REGISTER_SUFFIX (table_lpm6_logtype, lpm6,INFO ); +#define RTE_LOGTYPE_TABLE table_lpm6_logtype +#define RTE_TABLE_LPM_MAX_NEXT_HOPS 256#ifdef RTE_TABLE_STATS_COLLECT
lib/table/rte_table_stub.c +3 -0
@@ -8,6 +8,9 @@#include "rte_table_stub.h" +RTE_LOG_REGISTER_SUFFIX (table_stub_logtype, stub,INFO ); +#define RTE_LOGTYPE_TABLE table_stub_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_LPM_STATS_PKTS_IN_ADD (table, val) \
Signature · 1 line
2.39.1
PATCH v10 18/22 app/test: remove use of RTE_LOGTYPE_PIPELINE
In reply to Stephen HemmingerInstead of using static type PIPELINE for logging in test application use stderr instead. If not testing RTE_LOG() better to not use it since log also goes to syslog.
--- app/test/test_table_acl.c | 50 ++++++++++++++++------------------ app/test/test_table_pipeline.c | 40 +++++++++++++-------------- 2 files changed, 43 insertions(+), 47 deletions(-)
app/test/test_table_acl.c +23 -27
@@ -165,7 +165,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRC_FIELD_IPV4 ].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read src address/mask: %s\n" , +fprintf (stderr,"failed to read src address/mask: %s\n" , in[CB_FLD_SRC_ADDR ]);return rc; }
@@ -178,7 +178,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DST_FIELD_IPV4 ].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest address/mask: %s\n" , +fprintf (stderr,"failed to read dest address/mask: %s\n" , in[CB_FLD_DST_ADDR ]);return rc; }
@@ -190,7 +190,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRCP_FIELD_IPV4 ].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read source port range: %s\n" , +fprintf (stderr,"failed to read source port range: %s\n" , in[CB_FLD_SRC_PORT_RANGE ]);return rc; }
@@ -202,7 +202,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DSTP_FIELD_IPV4 ].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest port range: %s\n" , +fprintf (stderr,"failed to read dest port range: %s\n" , in[CB_FLD_DST_PORT_RANGE ]);return rc; }
@@ -254,7 +254,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRC_FIELD_IPV4 ].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read src address/mask: %s\n" , +fprintf (stderr,"failed to read src address/mask: %s\n" , in[CB_FLD_SRC_ADDR ]);return rc; }
@@ -267,7 +267,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DST_FIELD_IPV4 ].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest address/mask: %s\n" , +fprintf (stderr,"failed to read dest address/mask: %s\n" , in[CB_FLD_DST_ADDR ]);return rc; }
@@ -279,7 +279,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRCP_FIELD_IPV4 ].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read source port range: %s\n" , +fprintf (stderr,"failed to read source port range: %s\n" , in[CB_FLD_SRC_PORT_RANGE ]);return rc; }
@@ -291,7 +291,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DSTP_FIELD_IPV4 ].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest port range: %s\n" , +fprintf (stderr,"failed to read dest port range: %s\n" , in[CB_FLD_DST_PORT_RANGE ]);return rc; }
@@ -346,7 +346,7 @@ setup_acl_pipeline(void)/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; }
@@ -410,7 +410,7 @@ setup_acl_pipeline(void) table_params.f_action_miss =NULL ; table_params.action_data_size =0 ; -RTE_LOG (INFO ,PIPELINE ,"miss_action=%x\n" , +printf ("miss_action=%x\n" , table_entry_miss_action); printf("RTE_ACL_RULE_SZ(%zu) = %zu\n", DIM(ipv4_defs),
@@ -471,9 +471,8 @@ setup_acl_pipeline(void) ret =parser (line, &keys[n]);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -513,9 +512,8 @@ setup_acl_pipeline(void) ret =parse_cb_ipv4_rule_del (line, &keys[n]);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -549,9 +547,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -575,8 +572,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"line %u: parse rule " -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -602,8 +599,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"line %u: parse rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -667,7 +664,7 @@ test_pipeline_single_filter(int expected_count) memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple, sizeof(struct ipv4_5tuple)); -RTE_LOG (INFO ,PIPELINE ,"%s: Enqueue onto ring %d\n" , +printf ("%s: Enqueue onto ring %d\n" , __func__, i);rte_ring_enqueue (rings_rx[i], mbuf); }
@@ -702,9 +699,8 @@ test_pipeline_single_filter(int expected_count) }if (tx_count != expected_count) { -RTE_LOG (INFO ,PIPELINE , -"%s: Unexpected packets for ACL test, " -"expected %d, got %d\n" , +fprintf (stderr, +"%s: Unexpected packets for ACL test, expected %d, got %d\n" , __func__, expected_count, tx_count); goto fail; }
app/test/test_table_pipeline.c +20 -20
@@ -6,7 +6,6 @@#include <string.h> #include <rte_pipeline.h> -#include <rte_log.h> #include <inttypes.h> #include <rte_hexdump.h> #include "test_table.h"
@@ -173,30 +172,31 @@ check_pipeline_invalid_params(void) p =rte_pipeline_create (NULL );if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE , +fprintf (stderr,"%s: configured pipeline with null params\n" , __func__); goto fail; } p =rte_pipeline_create (&pipeline_params_1);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with NULL " -"name\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with NULL name\n" , __func__); goto fail; } p =rte_pipeline_create (&pipeline_params_2);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with invalid " -"socket\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with invalid socket\n" , __func__); goto fail; }if (rte_eal_has_hugepages ()) { p =rte_pipeline_create (&pipeline_params_3);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with " -"invalid socket\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with invalid socket\n" , + __func__); goto fail; } }
@@ -224,20 +224,20 @@ setup_pipeline(int test_type) .socket_id = 0, }; -RTE_LOG (INFO ,PIPELINE ,"%s: **** Setting up %s test\n" , +fprintf (stderr,"%s: **** Setting up %s test\n" , __func__, pipeline_test_names[test_type]);/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; } ret =rte_pipeline_free (p);if (ret !=0 ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to free pipeline\n" , +fprintf (stderr,"%s: Failed to free pipeline\n" , __func__); goto fail; }
@@ -245,7 +245,7 @@ setup_pipeline(int test_type)/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; }
@@ -411,7 +411,7 @@ test_pipeline_single_filter(int test_type, int expected_count)int ret;int tx_count; -RTE_LOG (INFO ,PIPELINE ,"%s: **** Running %s test\n" , +fprintf (stderr,"%s: **** Running %s test\n" , __func__, pipeline_test_names[test_type]);/* Run pipeline once */ for (i =0 ; i <N_PORTS ; i++)
@@ -420,7 +420,7 @@ test_pipeline_single_filter(int test_type, int expected_count) ret =rte_pipeline_flush (NULL );if (ret != -EINVAL ) { -RTE_LOG (INFO ,PIPELINE , +fprintf (stderr,"%s: No pipeline flush error NULL pipeline (%d)\n" , __func__, ret); goto fail;
@@ -445,7 +445,7 @@ test_pipeline_single_filter(int test_type, int expected_count) k32 = (uint32_t *) key; k32[0 ] =0xadadadad >> (j %2 ); -RTE_LOG (INFO ,PIPELINE ,"%s: Enqueue onto ring %d\n" , +fprintf (stderr,"%s: Enqueue onto ring %d\n" , __func__, i);rte_ring_enqueue (rings_rx[i], m); }
@@ -487,9 +487,9 @@ test_pipeline_single_filter(int test_type, int expected_count) }if (tx_count != expected_count) { -RTE_LOG (INFO ,PIPELINE , -"%s: Unexpected packets out for %s test, expected %d, " -"got %d\n" , __func__, pipeline_test_names[test_type], +fprintf (stderr, +"%s: Unexpected packets out for %s test, expected %d, got %d\n" , + __func__, pipeline_test_names[test_type], expected_count, tx_count); goto fail; }
@@ -564,8 +564,8 @@ test_table_pipeline(void) connect_miss_action_to_table =0 ;if (check_pipeline_invalid_params ()) { -RTE_LOG (INFO ,PIPELINE ,"%s: Check pipeline invalid params " -"failed.\n" , __func__); +fprintf (stderr,"%s: Check pipeline invalid params failed.\n" , + __func__);return -1 ; }
Signature · 1 line
2.39.1
PATCH v10 19/22 pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type
In reply to Stephen HemmingerUse a dynamically allocated logtype.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/pipeline/rte_pipeline.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"},
lib/eal/include/rte_log.h +1 -1
@@ -41,7 +41,7 @@ extern "C" {/* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ /* was RTE_LOGTYPE_TABLE */ -#define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ +/* was RTE_LOGTYPE_PIPELINE */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */
lib/pipeline/rte_pipeline.c +3 -0
@@ -12,6 +12,9 @@#include "rte_pipeline.h" +RTE_LOG_REGISTER_DEFAULT (pipeline_logtype,INFO ); +#define RTE_LOGTYPE_PIPELINE pipeline_logtype +#define RTE_TABLE_INVALID UINT32_MAX#ifdef RTE_PIPELINE_STATS_COLLECT
Signature · 1 line
2.39.1
PATCH v10 20/22 hash: move rte_thash_gfni stubs out of header file
In reply to Stephen HemmingerHaving stubs in header file makes it harder to update RTE_LOG(). Also modify to only print warning once.
--- lib/hash/meson.build | 8 ++++++- lib/hash/rte_thash_gfni.c | 47 +++++++++++++++++++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 29 +++++------------------- lib/hash/version.map | 4 ++++ 4 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 lib/hash/rte_thash_gfni.c
lib/hash/meson.build +7 -1
@@ -17,7 +17,13 @@ indirect_headers += files( 'rte_thash_x86_gfni.h', ) -sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') +sources = files( + 'rte_cuckoo_hash.c', + 'rte_fbk_hash.c', + 'rte_thash.c', + 'rte_thash_gfni.c' +) + deps += ['net'] deps += ['ring'] deps += ['rcu']
lib/hash/rte_thash_gfni.c new file +47 -0
47 lines not on this page · raw message
lib/hash/rte_thash_gfni.h +6 -23
@@ -9,16 +9,12 @@extern "C" {#endif -#include <rte_compat.h> -#include <rte_log.h> -#ifdef RTE_ARCH_X86 -#include <rte_thash_x86_gfni.h> -#endif #ifndef RTE_THASH_GFNI_DEFINED +#include <rte_compat.h> /** * Calculate Toeplitz hash.
@@ -38,13 +34,8 @@ extern "C" {* Calculated Toeplitz hash value. */ __rte_experimental -static inline uint32_t -rte_thash_gfni(const uint64_t *mtrx __rte_unused, - const uint8_t *key __rte_unused, int len __rte_unused) -{ -RTE_LOG (ERR ,HASH ,"%s is undefined under given arch\n" , __func__); -return 0 ; -} +uint32_t +rte_thash_gfni (const uint64_t *mtrx,const uint8_t *key,int len);/** * Bulk implementation for Toeplitz hash.
@@ -67,17 +58,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused,* Number of tuples to hash. */ __rte_experimental -static inline void -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, - int len __rte_unused, uint8_t *tuple[] __rte_unused, -uint32_t val[],uint32_t num) -{ -unsigned int i; - -RTE_LOG (ERR ,HASH ,"%s is undefined under given arch\n" , __func__); -for (i =0 ; i < num; i++) - val[i] =0 ; -} +void +rte_thash_gfni_bulk (const uint64_t *mtrx,int len,uint8_t *tuple[], +uint32_t val[],uint32_t num);#endif /* RTE_THASH_GFNI_DEFINED */
lib/hash/version.map +4 -0
@@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; };
Signature · 1 line
2.39.1
PATCH v10 21/22 hash: move rte_hash_set_alg out header
In reply to Stephen HemmingerThe code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of RTE_LOG().
Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the same.
--- lib/hash/meson.build | 1 + lib/hash/rte_crc_arm64.h | 8 ++--- lib/hash/rte_crc_x86.h | 10 +++--- lib/hash/rte_hash_crc.c | 68 ++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------------- lib/hash/version.map | 7 +++++ 6 files changed, 88 insertions(+), 54 deletions(-) create mode 100644 lib/hash/rte_hash_crc.c
lib/hash/meson.build +1 -0
@@ -19,6 +19,7 @@ indirect_headers += files( sources = files( 'rte_cuckoo_hash.c', + 'rte_hash_crc.c', 'rte_fbk_hash.c', 'rte_thash.c', 'rte_thash_gfni.c'
lib/hash/rte_crc_arm64.h +4 -4
@@ -53,7 +53,7 @@ crc32c_arm64_u64(uint64_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_1byte (uint8_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u8 (data, init_val);return crc32c_1byte (data, init_val);
@@ -67,7 +67,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_2byte (uint16_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u16 (data, init_val);return crc32c_2bytes (data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u32 (data, init_val);return crc32c_1word (data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u64 (data, init_val);return crc32c_2words (data, init_val);
lib/hash/rte_crc_x86.h +5 -5
@@ -67,7 +67,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)static inline uint32_t rte_hash_crc_1byte (uint8_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u8 (data, init_val);return crc32c_1byte (data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_2byte (uint16_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u16 (data, init_val);return crc32c_2bytes (data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u32 (data, init_val);return crc32c_1word (data, init_val);
@@ -110,11 +110,11 @@ static inline uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val) {#ifdef RTE_ARCH_X86_64 -if (likely (crc32_alg == CRC32_SSE42_x64)) +if (likely (rte_hash_crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val);#endif -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val);return crc32c_2words (data, init_val);
lib/hash/rte_hash_crc.c new file +68 -0
68 lines not on this page · raw message
lib/hash/rte_hash_crc.h +3 -45
66 lines not on this page · raw message
lib/hash/version.map +7 -0
@@ -9,6 +9,7 @@ DPDK_23 { rte_hash_add_key_with_hash; rte_hash_add_key_with_hash_data; rte_hash_count; + rte_hash_crc_set_alg; rte_hash_create; rte_hash_del_key; rte_hash_del_key_with_hash;
@@ -56,3 +57,9 @@ EXPERIMENTAL { rte_thash_gfni; rte_thash_gfni_bulk; }; + +INTERNAL { + global: + + rte_hash_crc32_alg; +};
Signature · 1 line
2.39.1
PATCH v10 22/22 hash: convert RTE_LOGTYPE_HASH to dynamic type
In reply to Stephen HemmingerUse dynamic type for hash and add subtypes for crc and gfni.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/hash/rte_cuckoo_hash.c | 5 +++++ lib/hash/rte_fbk_hash.c | 5 +++++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 6 files changed, 17 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -350,7 +350,6 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, {RTE_LOGTYPE_PMD ,"pmd" }, - {RTE_LOGTYPE_HASH ,"lib.hash" }, {RTE_LOGTYPE_CRYPTODEV ,"lib.cryptodev" }, {RTE_LOGTYPE_EVENTDEV ,"lib.eventdev" }, {RTE_LOGTYPE_USER1 ,"user1" },
lib/eal/include/rte_log.h +1 -1
@@ -32,7 +32,7 @@ extern "C" {/* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ +/* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */
lib/hash/rte_cuckoo_hash.c +5 -0
@@ -24,6 +24,11 @@#include <rte_tailq.h> #include "rte_hash.h" + +/* needs to be before rte_cuckoo_hash.h */ +RTE_LOG_REGISTER_DEFAULT (hash_logtype,INFO ); +#define RTE_LOGTYPE_HASH hash_logtype +#include "rte_cuckoo_hash.h" /* Mask of all flags supported by this version */
lib/hash/rte_fbk_hash.c +5 -0
@@ -8,6 +8,8 @@#include <errno.h> #include <sys/queue.h> + +#include <rte_cpuflags.h> #include <rte_eal_memconfig.h> #include <rte_malloc.h> #include <rte_common.h>
@@ -18,6 +20,9 @@#include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX (fbk_hash_logtype, fbk,INFO ); +#define RTE_LOGTYPE_HASH fbk_hash_logtype +TAILQ_HEAD (rte_fbk_hash_list, rte_tailq_entry);static struct rte_tailq_elem rte_fbk_hash_tailq = {
lib/hash/rte_thash.c +3 -0
@@ -13,6 +13,9 @@#include <rte_log.h> #include <rte_malloc.h> +RTE_LOG_REGISTER_SUFFIX (thash_logtype, thash,INFO ); +#define RTE_LOGTYPE_HASH thash_logtype +#define THASH_NAME_LEN 64#define TOEPLITZ_HASH_LEN 32
lib/hash/rte_thash_gfni.c +3 -0
@@ -10,6 +10,9 @@#ifndef RTE_THASH_GFNI_DEFINED +RTE_LOG_REGISTER_SUFFIX (hash_gfni_logtype, gfni,INFO ); +#define RTE_LOGTYPE_HASH hash_gfni_logtype +uint32_t rte_thash_gfni(const uint64_t *mtrx __rte_unused, const uint8_t *key __rte_unused, int len __rte_unused)
Signature · 1 line
2.39.1
v11 cover Convert static log type values in libraries
In reply to Stephen HemmingerThis patchset removes the main uses of static LOGTYPE's in DPDK libraries. It starts with the easy one and goes on to the more complex ones.
There are several options on how to treat the old static types:
leave them there, mark as deprecated, or remove them. This version removes them since there is no guarantee in current DPDK policies that says they can't be removed.
Note: there is one patch in this series that will get flagged incorrectly as an ABI change.
v11 - fix include check on arm cross build
v10 - add necessary rte_compat.h in thash_gfni stub for arm
v9 - fix handling of crc32 alg in lib/hash.
make it an internal global variable.
fix gfni stubs for case where they are not used.
Stephen Hemminger (22):
gso: don't log message on non TCP/UDP
eal: drop no longer used GSO logtype
log: drop unused RTE_LOGTYPE_TIMER
efd: replace RTE_LOGTYPE_EFD with dynamic type
mbuf: replace RTE_LOGTYPE_MBUF with dynamic type
acl: replace LOGTYPE_ACL with dynamic type examples/power: replace use of RTE_LOGTYPE_POWER examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER
power: replace RTE_LOGTYPE_POWER with dynamic type
ring: replace RTE_LOGTYPE_RING with dynamic type
mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type
lpm: replace RTE_LOGTYPE_LPM with dynamic types
kni: replace RTE_LOGTYPE_KNI with dynamic type
sched: replace RTE_LOGTYPE_SCHED with dynamic type examples/ipsecgw: replace RTE_LOGTYPE_PORT
port: replace RTE_LOGTYPE_PORT with dynamic type
table: convert RTE_LOGTYPE_TABLE to dynamic logtype app/test: remove use of RTE_LOGTYPE_PIPELINE
pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type
hash: move rte_thash_gfni stubs out of header file
hash: move rte_hash_set_alg out header
hash: convert RTE_LOGTYPE_HASH to dynamic type
app/test/test_acl.c | 3 +- app/test/test_table_acl.c | 50 +++++++++++------------ app/test/test_table_pipeline.c | 40 +++++++++--------- examples/distributor/main.c | 2 +- examples/ipsec-secgw/sa.c | 6 +-- examples/l3fwd-power/main.c | 15 +++---- lib/acl/acl_bld.c | 1 + lib/acl/acl_gen.c | 1 + lib/acl/acl_log.h | 4 ++ lib/acl/rte_acl.c | 4 ++ lib/acl/tb_mem.c | 3 +- lib/eal/common/eal_common_log.c | 17 -------- lib/eal/include/rte_log.h | 34 ++++++++-------- lib/efd/rte_efd.c | 4 ++ lib/fib/fib_log.h | 4 ++ lib/fib/rte_fib.c | 3 ++ lib/fib/rte_fib6.c | 2 + lib/gso/rte_gso.c | 5 +-- lib/gso/rte_gso.h | 1 + lib/hash/meson.build | 9 +++- lib/hash/rte_crc_arm64.h | 8 ++-- lib/hash/rte_crc_x86.h | 10 ++--- lib/hash/rte_cuckoo_hash.c | 5 +++ lib/hash/rte_fbk_hash.c | 5 +++ lib/hash/rte_hash_crc.c | 68 +++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------- lib/hash/rte_thash.c | 3 ++ lib/hash/rte_thash_gfni.c | 50 +++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 30 ++++---------- lib/hash/version.map | 11 +++++ lib/kni/rte_kni.c | 3 ++ lib/lpm/lpm_log.h | 4 ++ lib/lpm/rte_lpm.c | 3 ++ lib/lpm/rte_lpm6.c | 1 + lib/mbuf/mbuf_log.h | 4 ++ lib/mbuf/rte_mbuf.c | 4 ++ lib/mbuf/rte_mbuf_dyn.c | 2 + lib/mbuf/rte_mbuf_pool_ops.c | 2 + lib/mempool/rte_mempool.c | 2 + lib/mempool/rte_mempool.h | 8 ++++ lib/mempool/version.map | 3 ++ lib/pipeline/rte_pipeline.c | 3 ++ lib/port/rte_port_ethdev.c | 3 ++ lib/port/rte_port_eventdev.c | 4 ++ lib/port/rte_port_fd.c | 3 ++ lib/port/rte_port_frag.c | 3 ++ lib/port/rte_port_kni.c | 3 ++ lib/port/rte_port_ras.c | 3 ++ lib/port/rte_port_ring.c | 3 ++ lib/port/rte_port_sched.c | 3 ++ lib/port/rte_port_source_sink.c | 3 ++ lib/port/rte_port_sym_crypto.c | 3 ++ lib/power/guest_channel.c | 3 +- lib/power/power_common.c | 2 + lib/power/power_common.h | 3 +- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + lib/rib/rib_log.h | 4 ++ lib/rib/rte_rib.c | 3 ++ lib/rib/rte_rib6.c | 3 ++ lib/ring/rte_ring.c | 3 ++ lib/sched/rte_pie.c | 1 + lib/sched/rte_sched.c | 5 +++ lib/sched/rte_sched_log.h | 4 ++ lib/table/rte_table_acl.c | 3 ++ lib/table/rte_table_array.c | 3 ++ lib/table/rte_table_hash_cuckoo.c | 3 ++ lib/table/rte_table_hash_ext.c | 3 ++ lib/table/rte_table_hash_key16.c | 3 ++ lib/table/rte_table_hash_key32.c | 5 ++- lib/table/rte_table_hash_key8.c | 5 ++- lib/table/rte_table_hash_lru.c | 3 ++ lib/table/rte_table_lpm.c | 3 ++ lib/table/rte_table_lpm_ipv6.c | 3 ++ lib/table/rte_table_stub.c | 3 ++ 75 files changed, 409 insertions(+), 177 deletions(-) create mode 100644 lib/acl/acl_log.h create mode 100644 lib/fib/fib_log.h create mode 100644 lib/hash/rte_hash_crc.c create mode 100644 lib/hash/rte_thash_gfni.c create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/mbuf/mbuf_log.h create mode 100644 lib/rib/rib_log.h create mode 100644 lib/sched/rte_sched_log.h
Signature · 1 line
2.39.1
PATCH v11 1/22 gso: don't log message on non TCP/UDP
If a large packet is passed into GSO routines of unknown protocol then library would log a message.
Better to tell the application instead of logging.
--- lib/gso/rte_gso.c | 5 ++--- lib/gso/rte_gso.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-)
lib/gso/rte_gso.c +2 -3
@@ -80,9 +80,8 @@ rte_gso_segment(struct rte_mbuf *pkt, ret =gso_udp4_segment (pkt, gso_size, direct_pool, indirect_pool, pkts_out, nb_pkts_out); }else { -/* unsupported packet, skip */ -RTE_LOG (DEBUG ,GSO ,"Unsupported packet type\n" ); - ret =0 ; + ret = -ENOTSUP ;/* only UDP or TCP allowed */ + }if (ret <0 ) {
lib/gso/rte_gso.h +1 -0
@@ -114,6 +114,7 @@ struct rte_gso_ctx {* - The number of GSO segments filled in pkts_out on success. * - Return 0 if it does not need to be GSO'd. * - Return -ENOMEM if run out of memory in MBUF pools. +* - Return -ENOTSUP for protocols that can not be segmentd (not UDP or TCP) * - Return -EINVAL for invalid parameters. */ int rte_gso_segment(struct rte_mbuf *pkt,
Signature · 1 line
2.39.1
PATCH v11 2/22 eal: drop no longer used GSO logtype
In reply to Stephen HemmingerThe message that used this was replaced in previous patch.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -368,7 +368,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, - {RTE_LOGTYPE_GSO, "lib.gso"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, {RTE_LOGTYPE_USER3, "user3"},
lib/eal/include/rte_log.h +1 -1
@@ -46,7 +46,7 @@ extern "C" {#define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ #define RTE_LOGTYPE_EFD 18/**< Log related to EFD. */ #define RTE_LOGTYPE_EVENTDEV 19/**< Log related to eventdev. */ -#define RTE_LOGTYPE_GSO 20/**< Log related to GSO. */ +/* was RTE_LOGTYPE_GSO */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 24/**< User-defined log type 1. */
Signature · 1 line
2.39.1
PATCH v11 3/22 log: drop unused RTE_LOGTYPE_TIMER
In reply to Stephen HemmingerThe timer code does not use rte_log.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -352,7 +352,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_MALLOC, "lib.malloc"}, {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, - {RTE_LOGTYPE_TIMER, "lib.timer"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"},
lib/eal/include/rte_log.h +1 -1
@@ -30,7 +30,7 @@ extern "C" {#define RTE_LOGTYPE_MALLOC 1/**< Log related to malloc. */ #define RTE_LOGTYPE_RING 2/**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ -#define RTE_LOGTYPE_TIMER 4/**< Log related to timers. */ +/* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */
Signature · 1 line
2.39.1
PATCH v11 4/22 efd: replace RTE_LOGTYPE_EFD with dynamic type
In reply to Stephen HemmingerReplace all uses of the global logtype with a dynamic log type.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/efd/rte_efd.c | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -365,7 +365,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, - {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"},
lib/eal/include/rte_log.h +1 -1
@@ -44,7 +44,7 @@ extern "C" {#define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ #define RTE_LOGTYPE_MBUF 16/**< Log related to mbuf. */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ -#define RTE_LOGTYPE_EFD 18/**< Log related to EFD. */ +/* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19/**< Log related to eventdev. */ /* was RTE_LOGTYPE_GSO */
lib/efd/rte_efd.c +4 -0
@@ -9,6 +9,7 @@#include <errno.h> #include <sys/queue.h> +#include <rte_cpuflags.h> #include <rte_string_fns.h> #include <rte_log.h> #include <rte_eal_memconfig.h>
@@ -28,6 +29,9 @@#include "rte_efd_arm64.h" #endif +RTE_LOG_REGISTER_DEFAULT (efd_logtype,INFO ); +#define RTE_LOGTYPE_EFD efd_logtype +#define EFD_KEY (key_idx, table) (table->keys + ((key_idx) * table->key_len))/** Hash function used to determine chunk_id and bin_id for a group */ #define EFD_HASH (key, table) \
Signature · 1 line
2.39.1
PATCH v11 5/22 mbuf: replace RTE_LOGTYPE_MBUF with dynamic type
In reply to Stephen HemmingerIntroduce a new dynamic logtype for mbuf related messages. Since this is used in multiple files put one macro in mbuf_log.h
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mbuf/mbuf_log.h | 4 ++++ lib/mbuf/rte_mbuf.c | 4 ++++ lib/mbuf/rte_mbuf_dyn.c | 2 ++ lib/mbuf/rte_mbuf_pool_ops.c | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/mbuf/mbuf_log.h
lib/eal/common/eal_common_log.c +0 -1
@@ -363,7 +363,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, - {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"},
lib/eal/include/rte_log.h +1 -1
@@ -42,7 +42,7 @@ extern "C" {#define RTE_LOGTYPE_PORT 13/**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ -#define RTE_LOGTYPE_MBUF 16/**< Log related to mbuf. */ +/* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19/**< Log related to eventdev. */
lib/mbuf/mbuf_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int mbuf_logtype; +#define RTE_LOGTYPE_MBUF mbuf_logtype
lib/mbuf/rte_mbuf.c +4 -0
@@ -20,6 +20,10 @@#include <rte_errno.h> #include <rte_memcpy.h> +#include "mbuf_log.h" + +RTE_LOG_REGISTER_DEFAULT (mbuf_logtype,INFO ); +/* * pktmbuf pool constructor, given as a callback function to * rte_mempool_create(), or called directly if using
lib/mbuf/rte_mbuf_dyn.c +2 -0
@@ -17,6 +17,8 @@#include <rte_mbuf.h> #include <rte_mbuf_dyn.h> +#include "mbuf_log.h" +#define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"struct mbuf_dynfield_elt {
lib/mbuf/rte_mbuf_pool_ops.c +2 -0
@@ -8,6 +8,8 @@#include <rte_errno.h> #include <rte_mbuf_pool_ops.h> +#include "mbuf_log.h" +int rte_mbuf_set_platform_mempool_ops (const char *ops_name) {
Signature · 1 line
2.39.1
PATCH v11 6/22 acl: replace LOGTYPE_ACL with dynamic type
In reply to Stephen HemmingerGet rid of RTE_LOGTYPE_ACL and RTE_LOGTYPE_MALLOC. For ACL library use a dynamic type.
The one message using RTE_LOGTYPE_MALLOC should have been under the ACL logtype anyway.
The test code should not have been using fixed log type so just change that to stderr.
--- app/test/test_acl.c | 3 ++- lib/acl/acl_bld.c | 1 + lib/acl/acl_gen.c | 1 + lib/acl/acl_log.h | 4 ++++ lib/acl/rte_acl.c | 4 ++++ lib/acl/tb_mem.c | 3 ++- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 lib/acl/acl_log.h
app/test/test_acl.c +2 -1
@@ -154,7 +154,8 @@ rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx,for (i =0 ; i != num; i++) { rc =acl_ipv4vlan_check_rule (rules + i);if (rc !=0 ) { -RTE_LOG (ERR ,ACL ,"%s: rule #%u is invalid\n" , +fprintf (stderr, +"%s: rule #%u is invalid\n" , __func__, i +1 );return rc; }
lib/acl/acl_bld.c +1 -0
@@ -5,6 +5,7 @@#include <rte_acl.h> #include "tb_mem.h" #include "acl.h" +#include "acl_log.h" #define ACL_POOL_ALIGN 8#define ACL_POOL_ALLOC_MIN 0x800000
lib/acl/acl_gen.c +1 -0
@@ -4,6 +4,7 @@#include <rte_acl.h> #include "acl.h" +#include "acl_log.h" #define QRANGE_MIN ((uint8_t)INT8_MIN)
lib/acl/acl_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int acl_logtype; +#define RTE_LOGTYPE_ACL acl_logtype
lib/acl/rte_acl.c +4 -0
@@ -6,8 +6,12 @@#include <rte_string_fns.h> #include <rte_acl.h> #include <rte_tailq.h> +#include <rte_log.h> #include "acl.h" +#include "acl_log.h" + +RTE_LOG_REGISTER_DEFAULT (acl_logtype,INFO );TAILQ_HEAD (rte_acl_list, rte_tailq_entry);
lib/acl/tb_mem.c +2 -1
@@ -3,6 +3,7 @@*/ #include "tb_mem.h" +#include "acl_log.h" /* * Memory management routines for temporary memory.
@@ -25,7 +26,7 @@ tb_pool(struct tb_mem_pool *pool, size_t sz) size = sz + pool->alignment -1 ; block =calloc (1 , size +sizeof (*pool->block));if (block ==NULL ) { -RTE_LOG (ERR ,MALLOC ,"%s(%zu)\n failed, currently allocated " +RTE_LOG (ERR ,ACL ,"%s(%zu)\n failed, currently allocated " "by pool: %zu bytes\n" , __func__, sz, pool->alloc);siglongjmp (pool->fail, -ENOMEM );return NULL ;
lib/eal/common/eal_common_log.c +0 -2
@@ -349,14 +349,12 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, - {RTE_LOGTYPE_MALLOC ,"lib.malloc" }, {RTE_LOGTYPE_RING ,"lib.ring" }, {RTE_LOGTYPE_MEMPOOL ,"lib.mempool" }, {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_HASH ,"lib.hash" }, {RTE_LOGTYPE_LPM ,"lib.lpm" }, {RTE_LOGTYPE_KNI ,"lib.kni" }, - {RTE_LOGTYPE_ACL ,"lib.acl" }, {RTE_LOGTYPE_POWER ,"lib.power" }, {RTE_LOGTYPE_METER ,"lib.meter" }, {RTE_LOGTYPE_SCHED ,"lib.sched" },
lib/eal/include/rte_log.h +2 -2
@@ -27,7 +27,7 @@ extern "C" {/* SDK log type */ #define RTE_LOGTYPE_EAL 0/**< Log related to eal. */ -#define RTE_LOGTYPE_MALLOC 1/**< Log related to malloc. */ +/* was RTE_LOGTYPE_MALLOC */ #define RTE_LOGTYPE_RING 2/**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */
@@ -35,7 +35,7 @@ extern "C" {#define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ -#define RTE_LOGTYPE_ACL 9/**< Log related to ACL. */ +/* was RTE_LOGTYPE_ACL */ #define RTE_LOGTYPE_POWER 10/**< Log related to power. */ #define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */
Signature · 1 line
2.39.1
PATCH v11 7/22 examples/power: replace use of RTE_LOGTYPE_POWER
In reply to Stephen HemmingerDon't use static logtype in sample application.
--- examples/distributor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/distributor/main.c +1 -1
@@ -679,7 +679,7 @@ init_power_library(void)/* init power management library */ ret =rte_power_init (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +fprintf (stderr,"Library initialization failed on core %u\n" , lcore_id);/*
Signature · 1 line
2.39.1
PATCH v11 8/22 examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER
In reply to Stephen HemmingerConvert to using a dynamic logtype for the application.
--- examples/l3fwd-power/main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
examples/l3fwd-power/main.c +8 -7
@@ -51,7 +51,8 @@#include "perf_core.h" #include "main.h" -#define RTE_LOGTYPE_L3FWD_POWER RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER (l3fwd_power_logtype, l3fwd.power,INFO ); +#define RTE_LOGTYPE_L3FWD_POWER l3fwd_power_logtype#define MAX_PKT_BURST 32
@@ -2236,7 +2237,7 @@ init_power_library(void)/* init power management library */ ret =rte_power_init (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Library initialization failed on core %u\n" , lcore_id);return ret;
@@ -2245,7 +2246,7 @@ init_power_library(void) env =rte_power_get_env ();if (env !=PM_ENV_ACPI_CPUFREQ && env !=PM_ENV_PSTATE_CPUFREQ ) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Only ACPI and PSTATE mode are supported\n" );return -1 ; }
@@ -2263,7 +2264,7 @@ deinit_power_library(void)/* deinit power management library */ ret =rte_power_exit (lcore_id);if (ret) { -RTE_LOG (ERR ,POWER , +RTE_LOG (ERR ,L3FWD_POWER ,"Library deinitialization failed on core %u\n" , lcore_id);return ret;
@@ -2332,7 +2333,7 @@ update_telemetry(__rte_unused struct rte_timer *tim, ret =rte_metrics_update_values (RTE_METRICS_GLOBAL , telstats_index, values,RTE_DIM (values));if (ret <0 ) -RTE_LOG (WARNING ,POWER ,"failed to update metrics\n" ); +RTE_LOG (WARNING ,L3FWD_POWER ,"failed to update metrics\n" ); } static int
@@ -2381,7 +2382,7 @@ launch_timer(unsigned int lcore_id) rte_get_main_lcore()); } -RTE_LOG (INFO ,POWER ,"Bring up the Timer\n" ); +RTE_LOG (INFO ,L3FWD_POWER ,"Bring up the Timer\n" );telemetry_setup_timer ();
@@ -2397,7 +2398,7 @@ launch_timer(unsigned int lcore_id) } } -RTE_LOG (INFO ,POWER ,"Timer_subsystem is done\n" ); +RTE_LOG (INFO ,L3FWD_POWER ,"Timer_subsystem is done\n" );return 0 ; }
Signature · 1 line
2.39.1
PATCH v11 9/22 power: replace RTE_LOGTYPE_POWER with dynamic type
In reply to Stephen HemmingerUse dynamic log type for power library.
Also replace use of RTE_LOGTYPE_USER1 with lib.power.guest.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 3 ++- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + 7 files changed, 9 insertions(+), 4 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"},
lib/eal/include/rte_log.h +1 -1
@@ -36,7 +36,7 @@ extern "C" {#define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ -#define RTE_LOGTYPE_POWER 10/**< Log related to power. */ +/* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 13/**< Log related to port. */
lib/power/guest_channel.c +2 -1
@@ -17,7 +17,8 @@#include "guest_channel.h" -#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER_SUFFIX (guest_channel_logtype, guest,INFO ); +#define RTE_LOGTYPE_GUEST_CHANNEL guest_channel_logtype/* Timeout for incoming message in milliseconds. */ #define TIMEOUT 10
lib/power/power_common.c +2 -0
@@ -12,6 +12,8 @@#include "power_common.h" +RTE_LOG_REGISTER_DEFAULT (power_logtype,INFO ); +#define POWER_SYSFILE_SCALING_DRIVER \ "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver"#define POWER_SYSFILE_GOVERNOR \
lib/power/power_common.h +2 -1
@@ -5,11 +5,12 @@#ifndef _POWER_COMMON_H_#define _POWER_COMMON_H_ -#include <rte_common.h> #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype#ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \
lib/power/power_kvm_vm.c +1 -0
@@ -8,6 +8,7 @@#include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent"
lib/power/rte_power.c +1 -0
@@ -10,6 +10,7 @@#include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h"
Signature · 1 line
2.39.1
PATCH v11 10/22 ring: replace RTE_LOGTYPE_RING with dynamic type
In reply to Stephen HemmingerThe logtype for ring only used in library.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/ring/rte_ring.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -349,7 +349,6 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, - {RTE_LOGTYPE_RING ,"lib.ring" }, {RTE_LOGTYPE_MEMPOOL ,"lib.mempool" }, {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_HASH ,"lib.hash" },
lib/eal/include/rte_log.h +1 -1
@@ -28,7 +28,7 @@ extern "C" {/* SDK log type */ #define RTE_LOGTYPE_EAL 0/**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ -#define RTE_LOGTYPE_RING 2/**< Log related to ring. */ +/* was RTE_LOGTYPE_RING */ #define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */
lib/ring/rte_ring.c +3 -0
@@ -26,6 +26,9 @@#include "rte_ring.h" #include "rte_ring_elem.h" +RTE_LOG_REGISTER_DEFAULT (ring_logtype,INFO ); +#define RTE_LOGTYPE_RING ring_logtype +TAILQ_HEAD (rte_ring_list, rte_tailq_entry);static struct rte_tailq_elem rte_ring_tailq = {
Signature · 1 line
2.39.1
PATCH v11 11/22 mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type
In reply to Stephen HemmingerConvert from RTE_LOGTYPE_MEMPOOL to logtype_mempool.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mempool/rte_mempool.c | 2 ++ lib/mempool/rte_mempool.h | 8 ++++++++ lib/mempool/version.map | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -349,7 +349,6 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, - {RTE_LOGTYPE_MEMPOOL ,"lib.mempool" }, {RTE_LOGTYPE_PMD ,"pmd" }, {RTE_LOGTYPE_HASH ,"lib.hash" }, {RTE_LOGTYPE_LPM ,"lib.lpm" },
lib/eal/include/rte_log.h +1 -1
@@ -29,7 +29,7 @@ extern "C" {#define RTE_LOGTYPE_EAL 0/**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ /* was RTE_LOGTYPE_RING */ -#define RTE_LOGTYPE_MEMPOOL 3/**< Log related to mempool. */ +/* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */
lib/mempool/rte_mempool.c +2 -0
@@ -31,6 +31,8 @@#include "mempool_trace.h" #include "rte_mempool.h" +RTE_LOG_REGISTER_DEFAULT (rte_mempool_logtype,INFO ); +TAILQ_HEAD (rte_mempool_list, rte_tailq_entry);static struct rte_tailq_elem rte_mempool_tailq = {
lib/mempool/rte_mempool.h +8 -0
@@ -43,6 +43,7 @@#include <rte_spinlock.h> #include <rte_debug.h> #include <rte_lcore.h> +#include <rte_log.h> #include <rte_branch_prediction.h> #include <rte_ring.h> #include <rte_memcpy.h>
@@ -175,6 +176,13 @@ struct rte_mempool_objtlr {#endif + +/** +* @internal Logtype used for mempool related messages. +*/ +extern int rte_mempool_logtype; +#define RTE_LOGTYPE_MEMPOOL rte_mempool_logtype +/** * A list of memory where objects are stored */
lib/mempool/version.map +3 -0
@@ -57,4 +57,7 @@ INTERNAL { # added in 21.11 rte_mempool_event_callback_register; rte_mempool_event_callback_unregister; + + # added in 23.07 + rte_mempool_logtype; };
Signature · 1 line
2.39.1
PATCH v11 12/22 lpm: replace RTE_LOGTYPE_LPM with dynamic types
In reply to Stephen HemmingerSplit lpm and lpm6 into separate log types since they are in different files and user may want to change log levels for IPv4 vs IPv6.
For rib and fib libraries give them own types as well.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/fib/fib_log.h | 4 ++++ lib/fib/rte_fib.c | 3 +++ lib/fib/rte_fib6.c | 2 ++ lib/lpm/lpm_log.h | 4 ++++ lib/lpm/rte_lpm.c | 3 +++ lib/lpm/rte_lpm6.c | 1 + lib/rib/rib_log.h | 4 ++++ lib/rib/rte_rib.c | 3 +++ lib/rib/rte_rib6.c | 3 +++ 11 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 lib/fib/fib_log.h create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/rib/rib_log.h
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"},
lib/eal/include/rte_log.h +1 -1
@@ -33,7 +33,7 @@ extern "C" {/* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ -#define RTE_LOGTYPE_LPM 7/**< Log related to LPM. */ +/* was RTE_LOGTYPE_LPM */ #define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */
lib/fib/fib_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int fib_logtype; +#define RTE_LOGTYPE_LPM fib_logtype
lib/fib/rte_fib.c +3 -0
@@ -16,6 +16,9 @@#include <rte_fib.h> #include "dir24_8.h" +#include "fib_log.h" + +RTE_LOG_REGISTER_DEFAULT (fib_logtype,INFO );TAILQ_HEAD (rte_fib_list, rte_tailq_entry);static struct rte_tailq_elem rte_fib_tailq = {
lib/fib/rte_fib6.c +2 -0
@@ -9,6 +9,7 @@#include <rte_eal_memconfig.h> #include <rte_tailq.h> #include <rte_errno.h> +#include <rte_log.h> #include <rte_malloc.h> #include <rte_string_fns.h>
@@ -16,6 +17,7 @@#include <rte_fib6.h> #include "trie.h" +#include "fib_log.h" TAILQ_HEAD (rte_fib6_list, rte_tailq_entry);static struct rte_tailq_elem rte_fib6_tailq = {
lib/lpm/lpm_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int lpm_logtype; +#define RTE_LOGTYPE_LPM lpm_logtype
lib/lpm/rte_lpm.c +3 -0
@@ -18,6 +18,9 @@#include <rte_tailq.h> #include "rte_lpm.h" +#include "lpm_log.h" + +RTE_LOG_REGISTER_DEFAULT (lpm_logtype,INFO );TAILQ_HEAD (rte_lpm_list, rte_tailq_entry);
lib/lpm/rte_lpm6.c +1 -0
@@ -20,6 +20,7 @@#include <rte_tailq.h> #include "rte_lpm6.h" +#include "lpm_log.h" #define RTE_LPM6_TBL24_NUM_ENTRIES (1 << 24)#define RTE_LPM6_TBL8_GROUP_NUM_ENTRIES 256
lib/rib/rib_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int rib_logtype; +#define RTE_LOGTYPE_LPM rib_logtype
lib/rib/rte_rib.c +3 -0
@@ -15,6 +15,9 @@#include <rte_rib.h> +RTE_LOG_REGISTER_DEFAULT (rib_logtype,INFO ); +#define RTE_LOGTYPE_LPM rib_logtype +TAILQ_HEAD (rte_rib_list, rte_tailq_entry);static struct rte_tailq_elem rte_rib_tailq = { .name ="RTE_RIB" ,
lib/rib/rte_rib6.c +3 -0
@@ -8,6 +8,7 @@#include <rte_eal_memconfig.h> #include <rte_errno.h> +#include <rte_log.h> #include <rte_malloc.h> #include <rte_mempool.h> #include <rte_string_fns.h>
@@ -15,6 +16,8 @@#include <rte_rib6.h> +#include "rib_log.h" +#define RTE_RIB_VALID_NODE 1#define RIB6_MAXDEPTH 128/* Maximum length of a RIB6 name. */
Signature · 1 line
2.39.1
PATCH v11 13/22 kni: replace RTE_LOGTYPE_KNI with dynamic type
In reply to Stephen HemmingerEven though KNI will eventually disappear, fix the logtype now.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/kni/rte_kni.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"},
lib/eal/include/rte_log.h +1 -1
@@ -34,7 +34,7 @@ extern "C" {#define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ /* was RTE_LOGTYPE_LPM */ -#define RTE_LOGTYPE_KNI 8/**< Log related to KNI. */ +/* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */
lib/kni/rte_kni.c +3 -0
@@ -23,6 +23,9 @@#include <rte_kni_common.h> #include "rte_kni_fifo.h" +RTE_LOG_REGISTER_DEFAULT (kni_logtype,INFO ); +#define RTE_LOGTYPE_KNI kni_logtype +#define MAX_MBUF_BURST_NUM 32/* Maximum number of ring entries */
Signature · 1 line
2.39.1
PATCH v11 14/22 sched: replace RTE_LOGTYPE_SCHED with dynamic type
In reply to Stephen HemmingerAlso can remove unused RTE_LOGTYPE_METER
--- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- lib/sched/rte_pie.c | 1 + lib/sched/rte_sched.c | 5 +++++ lib/sched/rte_sched_log.h | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lib/sched/rte_sched_log.h
lib/eal/common/eal_common_log.c +0 -2
@@ -351,8 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_METER, "lib.meter"}, - {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
lib/eal/include/rte_log.h +2 -2
@@ -37,8 +37,8 @@ extern "C" {/* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ -#define RTE_LOGTYPE_METER 11/**< Log related to QoS meter. */ -#define RTE_LOGTYPE_SCHED 12/**< Log related to QoS port scheduler. */ +/* was RTE_LOGTYPE_METER */ +/* was RTE_LOGTYPE_SCHED */ #define RTE_LOGTYPE_PORT 13/**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */
lib/sched/rte_pie.c +1 -0
@@ -6,6 +6,7 @@#include <stdlib.h> #include <string.h> +#include "rte_sched_log.h" #include "rte_pie.h" #ifdef __INTEL_COMPILER
lib/sched/rte_sched.c +5 -0
@@ -16,9 +16,12 @@#include <rte_reciprocal.h> #include "rte_sched.h" +#include "rte_sched_log.h" #include "rte_sched_common.h" +#include "rte_approx.h" +#ifdef __INTEL_COMPILER#pragma warning(disable:2259)/* conversion may lose significant bits */ #endif
@@ -3002,3 +3005,5 @@ rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uintreturn count; } + +RTE_LOG_REGISTER_DEFAULT (sched_logtype,INFO );
lib/sched/rte_sched_log.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int sched_logtype; +#define RTE_LOGTYPE_SCHED sched_logtype
Signature · 1 line
2.39.1
PATCH v11 15/22 examples/ipsecgw: replace RTE_LOGTYPE_PORT
In reply to Stephen HemmingerLooks like some code got copy/paste in to the IPSEC gateway example from another place. Shouldn't be using RTE_LOGTYPE_PORT here.
--- examples/ipsec-secgw/sa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
examples/ipsec-secgw/sa.c +3 -3
@@ -1127,7 +1127,7 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso)if (inbound) {if ((dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_SECURITY ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware RX IPSec offload is not supported\n" );return -EINVAL ; }
@@ -1135,13 +1135,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) }else {/* outbound */ if ((dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_SECURITY ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware TX IPSec offload is not supported\n" );return -EINVAL ; }if (tso && (dev_info.tx_offload_capa &RTE_ETH_TX_OFFLOAD_TCP_TSO ) ==0 ) { -RTE_LOG (WARNING ,PORT , +RTE_LOG (WARNING ,IPSEC ,"hardware TCP TSO offload is not supported\n" );return -EINVAL ; }
Signature · 1 line
2.39.1
PATCH v11 16/22 port: replace RTE_LOGTYPE_PORT with dynamic type
In reply to Stephen HemmingerSplit up the single static RTE_LOGTYPE_PORT into separate sub types for each component: port.ethdev, port.evendev, ...
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/port/rte_port_ethdev.c | 3 +++ lib/port/rte_port_eventdev.c | 4 ++++ lib/port/rte_port_fd.c | 3 +++ lib/port/rte_port_frag.c | 3 +++ lib/port/rte_port_kni.c | 3 +++ lib/port/rte_port_ras.c | 3 +++ lib/port/rte_port_ring.c | 3 +++ lib/port/rte_port_sched.c | 3 +++ lib/port/rte_port_source_sink.c | 3 +++ lib/port/rte_port_sym_crypto.c | 3 +++ 12 files changed, 32 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"},
lib/eal/include/rte_log.h +1 -1
@@ -39,7 +39,7 @@ extern "C" {/* was RTE_LOGTYPE_POWER */ /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ -#define RTE_LOGTYPE_PORT 13/**< Log related to port. */ +/* was RTE_LOGTYPE_PORT */ #define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */
lib/port/rte_port_ethdev.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_ethdev.h" +RTE_LOG_REGISTER_SUFFIX (port_ethdev_logtype, ethdev,INFO ); +#define RTE_LOGTYPE_PORT port_ethdev_logtype +/* * Port ETHDEV Reader */
lib/port/rte_port_eventdev.c +4 -0
@@ -5,11 +5,15 @@#include <string.h> #include <stdint.h> +#include <rte_log.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include "rte_port_eventdev.h" +RTE_LOG_REGISTER_SUFFIX (port_eventdev_logtype, eventdev,INFO ); +#define RTE_LOGTYPE_PORT port_eventdev_logtype +/* * Port EVENTDEV Reader */
lib/port/rte_port_fd.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_fd.h" +RTE_LOG_REGISTER_SUFFIX (port_fd_logtype, fd,INFO ); +#define RTE_LOGTYPE_PORT port_fd_logtype +/* * Port FD Reader */
lib/port/rte_port_frag.c +3 -0
@@ -7,6 +7,9 @@#include "rte_port_frag.h" +RTE_LOG_REGISTER_SUFFIX (port_frag_logtype, frag,INFO ); +#define RTE_LOGTYPE_PORT port_frag_logtype +/* Max number of fragments per packet allowed */ #define RTE_PORT_FRAG_MAX_FRAGS_PER_PACKET 0x80
lib/port/rte_port_kni.c +3 -0
@@ -9,6 +9,9 @@#include "rte_port_kni.h" +RTE_LOG_REGISTER_SUFFIX (port_kni_logtype, kni,INFO ); +#define RTE_LOGTYPE_PORT port_kni_logtype +/* * Port KNI Reader */
lib/port/rte_port_ras.c +3 -0
@@ -9,6 +9,9 @@#include "rte_port_ras.h" +RTE_LOG_REGISTER_SUFFIX (port_ras_logtype, ras,INFO ); +#define RTE_LOGTYPE_PORT port_ras_logtype +#ifndef RTE_PORT_RAS_N_BUCKETS #define RTE_PORT_RAS_N_BUCKETS 4094#endif
lib/port/rte_port_ring.c +3 -0
@@ -10,6 +10,9 @@#include "rte_port_ring.h" +RTE_LOG_REGISTER_SUFFIX (port_ring_logtype, ring,INFO ); +#define RTE_LOGTYPE_PORT port_ring_logtype +/* * Port RING Reader */
lib/port/rte_port_sched.c +3 -0
@@ -7,6 +7,9 @@#include "rte_port_sched.h" +RTE_LOG_REGISTER_SUFFIX (port_sched_logtype, sched,INFO ); +#define RTE_LOGTYPE_PORT port_sched_logtype +/* * Reader */
lib/port/rte_port_source_sink.c +3 -0
@@ -15,6 +15,9 @@#include "rte_port_source_sink.h" +RTE_LOG_REGISTER_SUFFIX (port_source_logtype, source,INFO ); +#define RTE_LOGTYPE_PORT port_source_logtype +/* * Port SOURCE */
lib/port/rte_port_sym_crypto.c +3 -0
@@ -8,6 +8,9 @@#include "rte_port_sym_crypto.h" +RTE_LOG_REGISTER_SUFFIX (port_crypto_logtype, crypto,INFO ); +#define RTE_LOGTYPE_PORT port_crypto_logtype +/* * Port Crypto Reader */
Signature · 1 line
2.39.1
PATCH v11 17/22 table: convert RTE_LOGTYPE_TABLE to dynamic logtype
In reply to Stephen HemmingerUse logtype suffixes for various components of this library.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/table/rte_table_acl.c | 3 +++ lib/table/rte_table_array.c | 3 +++ lib/table/rte_table_hash_cuckoo.c | 3 +++ lib/table/rte_table_hash_ext.c | 3 +++ lib/table/rte_table_hash_key16.c | 3 +++ lib/table/rte_table_hash_key32.c | 5 ++++- lib/table/rte_table_hash_key8.c | 5 ++++- lib/table/rte_table_hash_lru.c | 3 +++ lib/table/rte_table_lpm.c | 3 +++ lib/table/rte_table_lpm_ipv6.c | 3 +++ lib/table/rte_table_stub.c | 3 +++ 13 files changed, 36 insertions(+), 4 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
lib/eal/include/rte_log.h +1 -1
@@ -40,7 +40,7 @@ extern "C" {/* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ -#define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ +/* was RTE_LOGTYPE_TABLE */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */
lib/table/rte_table_acl.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_acl.h" +RTE_LOG_REGISTER_SUFFIX (table_acl_logtype, acl,INFO ); +#define RTE_LOGTYPE_TABLE table_acl_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ACL_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_array.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_array.h" +RTE_LOG_REGISTER_SUFFIX (table_array_logtype, array,INFO ); +#define RTE_LOGTYPE_TABLE table_array_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ARRAY_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_hash_cuckoo.c +3 -0
@@ -10,6 +10,9 @@#include "rte_table_hash_cuckoo.h" +RTE_LOG_REGISTER_SUFFIX (table_hash_logtype, hash,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_CUCKOO_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_hash_ext.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_hash.h" +RTE_LOG_REGISTER_SUFFIX (table_hash_ext_logtype, hash.ext,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_ext_logtype +#define KEYS_PER_BUCKET 4struct bucket {
lib/table/rte_table_hash_key16.c +3 -0
@@ -11,6 +11,9 @@#include "rte_table_hash.h" #include "rte_lru.h" +RTE_LOG_REGISTER_SUFFIX (table_hash16_logtype, hash16,INFO ); +#define RTE_LOGTYPE_TABLE table_hash16_logtype +#define KEY_SIZE 16#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_key32.c +4 -1
@@ -11,7 +11,10 @@#include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 32 +RTE_LOG_REGISTER_SUFFIX (table_hash32_logtype, hash32,INFO ); +#define RTE_LOGTYPE_TABLE table_hash32_logtype + +#define KEY_SIZE 32#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_key8.c +4 -1
@@ -11,7 +11,10 @@#include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 8 +RTE_LOG_REGISTER_SUFFIX (table_hash8_logtype, hash8,INFO ); +#define RTE_LOGTYPE_TABLE table_hash8_logtype + +#define KEY_SIZE 8#define KEYS_PER_BUCKET 4
lib/table/rte_table_hash_lru.c +3 -0
@@ -14,6 +14,9 @@#define KEYS_PER_BUCKET 4 +RTE_LOG_REGISTER_SUFFIX (table_hash_lru_logtype, hash_lru,INFO ); +#define RTE_LOGTYPE_TABLE table_hash_lru_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_LRU_STATS_PKTS_IN_ADD (table, val) \
lib/table/rte_table_lpm.c +3 -0
@@ -13,6 +13,9 @@#include "rte_table_lpm.h" +RTE_LOG_REGISTER_SUFFIX (table_lpm_logtype, lpm,INFO ); +#define RTE_LOGTYPE_TABLE table_lpm_logtype +#ifndef RTE_TABLE_LPM_MAX_NEXT_HOPS #define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536#endif
lib/table/rte_table_lpm_ipv6.c +3 -0
@@ -12,6 +12,9 @@#include "rte_table_lpm_ipv6.h" +RTE_LOG_REGISTER_SUFFIX (table_lpm6_logtype, lpm6,INFO ); +#define RTE_LOGTYPE_TABLE table_lpm6_logtype +#define RTE_TABLE_LPM_MAX_NEXT_HOPS 256#ifdef RTE_TABLE_STATS_COLLECT
lib/table/rte_table_stub.c +3 -0
@@ -8,6 +8,9 @@#include "rte_table_stub.h" +RTE_LOG_REGISTER_SUFFIX (table_stub_logtype, stub,INFO ); +#define RTE_LOGTYPE_TABLE table_stub_logtype +#ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_LPM_STATS_PKTS_IN_ADD (table, val) \
Signature · 1 line
2.39.1
PATCH v11 18/22 app/test: remove use of RTE_LOGTYPE_PIPELINE
In reply to Stephen HemmingerInstead of using static type PIPELINE for logging in test application use stderr instead. If not testing RTE_LOG() better to not use it since log also goes to syslog.
--- app/test/test_table_acl.c | 50 ++++++++++++++++------------------ app/test/test_table_pipeline.c | 40 +++++++++++++-------------- 2 files changed, 43 insertions(+), 47 deletions(-)
app/test/test_table_acl.c +23 -27
@@ -165,7 +165,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRC_FIELD_IPV4 ].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read src address/mask: %s\n" , +fprintf (stderr,"failed to read src address/mask: %s\n" , in[CB_FLD_SRC_ADDR ]);return rc; }
@@ -178,7 +178,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DST_FIELD_IPV4 ].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest address/mask: %s\n" , +fprintf (stderr,"failed to read dest address/mask: %s\n" , in[CB_FLD_DST_ADDR ]);return rc; }
@@ -190,7 +190,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRCP_FIELD_IPV4 ].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read source port range: %s\n" , +fprintf (stderr,"failed to read source port range: %s\n" , in[CB_FLD_SRC_PORT_RANGE ]);return rc; }
@@ -202,7 +202,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DSTP_FIELD_IPV4 ].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest port range: %s\n" , +fprintf (stderr,"failed to read dest port range: %s\n" , in[CB_FLD_DST_PORT_RANGE ]);return rc; }
@@ -254,7 +254,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRC_FIELD_IPV4 ].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read src address/mask: %s\n" , +fprintf (stderr,"failed to read src address/mask: %s\n" , in[CB_FLD_SRC_ADDR ]);return rc; }
@@ -267,7 +267,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DST_FIELD_IPV4 ].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest address/mask: %s\n" , +fprintf (stderr,"failed to read dest address/mask: %s\n" , in[CB_FLD_DST_ADDR ]);return rc; }
@@ -279,7 +279,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRCP_FIELD_IPV4 ].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read source port range: %s\n" , +fprintf (stderr,"failed to read source port range: %s\n" , in[CB_FLD_SRC_PORT_RANGE ]);return rc; }
@@ -291,7 +291,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DSTP_FIELD_IPV4 ].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16);if (rc !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"failed to read dest port range: %s\n" , +fprintf (stderr,"failed to read dest port range: %s\n" , in[CB_FLD_DST_PORT_RANGE ]);return rc; }
@@ -346,7 +346,7 @@ setup_acl_pipeline(void)/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; }
@@ -410,7 +410,7 @@ setup_acl_pipeline(void) table_params.f_action_miss =NULL ; table_params.action_data_size =0 ; -RTE_LOG (INFO ,PIPELINE ,"miss_action=%x\n" , +printf ("miss_action=%x\n" , table_entry_miss_action); printf("RTE_ACL_RULE_SZ(%zu) = %zu\n", DIM(ipv4_defs),
@@ -471,9 +471,8 @@ setup_acl_pipeline(void) ret =parser (line, &keys[n]);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -513,9 +512,8 @@ setup_acl_pipeline(void) ret =parse_cb_ipv4_rule_del (line, &keys[n]);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -549,9 +547,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE , -"line %u: parse_cb_ipv4vlan_rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -575,8 +572,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"line %u: parse rule " -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -602,8 +599,8 @@ setup_acl_pipeline(void) ret =parser (line, &rule_params);if (ret !=0 ) { -RTE_LOG (ERR ,PIPELINE ,"line %u: parse rule" -" failed, error code: %d (%s)\n" , +fprintf (stderr, +"line %u: parse rule failed, error code: %d (%s)\n" , n, ret,strerror (-ret));return ret; }
@@ -667,7 +664,7 @@ test_pipeline_single_filter(int expected_count) memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple, sizeof(struct ipv4_5tuple)); -RTE_LOG (INFO ,PIPELINE ,"%s: Enqueue onto ring %d\n" , +printf ("%s: Enqueue onto ring %d\n" , __func__, i);rte_ring_enqueue (rings_rx[i], mbuf); }
@@ -702,9 +699,8 @@ test_pipeline_single_filter(int expected_count) }if (tx_count != expected_count) { -RTE_LOG (INFO ,PIPELINE , -"%s: Unexpected packets for ACL test, " -"expected %d, got %d\n" , +fprintf (stderr, +"%s: Unexpected packets for ACL test, expected %d, got %d\n" , __func__, expected_count, tx_count); goto fail; }
app/test/test_table_pipeline.c +20 -20
@@ -6,7 +6,6 @@#include <string.h> #include <rte_pipeline.h> -#include <rte_log.h> #include <inttypes.h> #include <rte_hexdump.h> #include "test_table.h"
@@ -173,30 +172,31 @@ check_pipeline_invalid_params(void) p =rte_pipeline_create (NULL );if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE , +fprintf (stderr,"%s: configured pipeline with null params\n" , __func__); goto fail; } p =rte_pipeline_create (&pipeline_params_1);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with NULL " -"name\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with NULL name\n" , __func__); goto fail; } p =rte_pipeline_create (&pipeline_params_2);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with invalid " -"socket\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with invalid socket\n" , __func__); goto fail; }if (rte_eal_has_hugepages ()) { p =rte_pipeline_create (&pipeline_params_3);if (p !=NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Configure pipeline with " -"invalid socket\n" , __func__); +fprintf (stderr, +"%s: Configure pipeline with invalid socket\n" , + __func__); goto fail; } }
@@ -224,20 +224,20 @@ setup_pipeline(int test_type) .socket_id = 0, }; -RTE_LOG (INFO ,PIPELINE ,"%s: **** Setting up %s test\n" , +fprintf (stderr,"%s: **** Setting up %s test\n" , __func__, pipeline_test_names[test_type]);/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; } ret =rte_pipeline_free (p);if (ret !=0 ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to free pipeline\n" , +fprintf (stderr,"%s: Failed to free pipeline\n" , __func__); goto fail; }
@@ -245,7 +245,7 @@ setup_pipeline(int test_type)/* Pipeline configuration */ p =rte_pipeline_create (&pipeline_params);if (p ==NULL ) { -RTE_LOG (INFO ,PIPELINE ,"%s: Failed to configure pipeline\n" , +fprintf (stderr,"%s: Failed to configure pipeline\n" , __func__); goto fail; }
@@ -411,7 +411,7 @@ test_pipeline_single_filter(int test_type, int expected_count)int ret;int tx_count; -RTE_LOG (INFO ,PIPELINE ,"%s: **** Running %s test\n" , +fprintf (stderr,"%s: **** Running %s test\n" , __func__, pipeline_test_names[test_type]);/* Run pipeline once */ for (i =0 ; i <N_PORTS ; i++)
@@ -420,7 +420,7 @@ test_pipeline_single_filter(int test_type, int expected_count) ret =rte_pipeline_flush (NULL );if (ret != -EINVAL ) { -RTE_LOG (INFO ,PIPELINE , +fprintf (stderr,"%s: No pipeline flush error NULL pipeline (%d)\n" , __func__, ret); goto fail;
@@ -445,7 +445,7 @@ test_pipeline_single_filter(int test_type, int expected_count) k32 = (uint32_t *) key; k32[0 ] =0xadadadad >> (j %2 ); -RTE_LOG (INFO ,PIPELINE ,"%s: Enqueue onto ring %d\n" , +fprintf (stderr,"%s: Enqueue onto ring %d\n" , __func__, i);rte_ring_enqueue (rings_rx[i], m); }
@@ -487,9 +487,9 @@ test_pipeline_single_filter(int test_type, int expected_count) }if (tx_count != expected_count) { -RTE_LOG (INFO ,PIPELINE , -"%s: Unexpected packets out for %s test, expected %d, " -"got %d\n" , __func__, pipeline_test_names[test_type], +fprintf (stderr, +"%s: Unexpected packets out for %s test, expected %d, got %d\n" , + __func__, pipeline_test_names[test_type], expected_count, tx_count); goto fail; }
@@ -564,8 +564,8 @@ test_table_pipeline(void) connect_miss_action_to_table =0 ;if (check_pipeline_invalid_params ()) { -RTE_LOG (INFO ,PIPELINE ,"%s: Check pipeline invalid params " -"failed.\n" , __func__); +fprintf (stderr,"%s: Check pipeline invalid params failed.\n" , + __func__);return -1 ; }
Signature · 1 line
2.39.1
PATCH v11 19/22 pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type
In reply to Stephen HemmingerUse a dynamically allocated logtype.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/pipeline/rte_pipeline.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"},
lib/eal/include/rte_log.h +1 -1
@@ -41,7 +41,7 @@ extern "C" {/* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ /* was RTE_LOGTYPE_TABLE */ -#define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ +/* was RTE_LOGTYPE_PIPELINE */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */
lib/pipeline/rte_pipeline.c +3 -0
@@ -12,6 +12,9 @@#include "rte_pipeline.h" +RTE_LOG_REGISTER_DEFAULT (pipeline_logtype,INFO ); +#define RTE_LOGTYPE_PIPELINE pipeline_logtype +#define RTE_TABLE_INVALID UINT32_MAX#ifdef RTE_PIPELINE_STATS_COLLECT
Signature · 1 line
2.39.1
PATCH v11 20/22 hash: move rte_thash_gfni stubs out of header file
In reply to Stephen HemmingerHaving stubs in header file makes it harder to update RTE_LOG(). Also modify to only print warning once.
--- lib/hash/meson.build | 8 ++++++- lib/hash/rte_thash_gfni.c | 47 +++++++++++++++++++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 30 ++++++++----------------- lib/hash/version.map | 4 ++++ 4 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 lib/hash/rte_thash_gfni.c
lib/hash/meson.build +7 -1
@@ -17,7 +17,13 @@ indirect_headers += files( 'rte_thash_x86_gfni.h', ) -sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') +sources = files( + 'rte_cuckoo_hash.c', + 'rte_fbk_hash.c', + 'rte_thash.c', + 'rte_thash_gfni.c' +) + deps += ['net'] deps += ['ring'] deps += ['rcu']
lib/hash/rte_thash_gfni.c new file +47 -0
47 lines not on this page · raw message
lib/hash/rte_thash_gfni.h +9 -21
@@ -9,13 +9,14 @@extern "C" {#endif +#include <stdint.h> +#include <rte_compat.h> -#include <rte_log.h> +#include <rte_common.h> +#include <rte_config.h> #ifdef RTE_ARCH_X86 -#include <rte_thash_x86_gfni.h> -#endif #ifndef RTE_THASH_GFNI_DEFINED
@@ -38,13 +39,8 @@ extern "C" {* Calculated Toeplitz hash value. */ __rte_experimental -static inline uint32_t -rte_thash_gfni(const uint64_t *mtrx __rte_unused, - const uint8_t *key __rte_unused, int len __rte_unused) -{ -RTE_LOG (ERR ,HASH ,"%s is undefined under given arch\n" , __func__); -return 0 ; -} +uint32_t +rte_thash_gfni (const uint64_t *mtrx,const uint8_t *key,int len);/** * Bulk implementation for Toeplitz hash.
@@ -67,17 +63,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused,* Number of tuples to hash. */ __rte_experimental -static inline void -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, - int len __rte_unused, uint8_t *tuple[] __rte_unused, -uint32_t val[],uint32_t num) -{ -unsigned int i; - -RTE_LOG (ERR ,HASH ,"%s is undefined under given arch\n" , __func__); -for (i =0 ; i < num; i++) - val[i] =0 ; -} +void +rte_thash_gfni_bulk (const uint64_t *mtrx,int len,uint8_t *tuple[], +uint32_t val[],uint32_t num);#endif /* RTE_THASH_GFNI_DEFINED */
lib/hash/version.map +4 -0
@@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; };
Signature · 1 line
2.39.1
PATCH v11 21/22 hash: move rte_hash_set_alg out header
In reply to Stephen HemmingerThe code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of RTE_LOG().
Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the same.
--- lib/hash/meson.build | 1 + lib/hash/rte_crc_arm64.h | 8 ++--- lib/hash/rte_crc_x86.h | 10 +++--- lib/hash/rte_hash_crc.c | 68 ++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------------- lib/hash/version.map | 7 +++++ 6 files changed, 88 insertions(+), 54 deletions(-) create mode 100644 lib/hash/rte_hash_crc.c
lib/hash/meson.build +1 -0
@@ -19,6 +19,7 @@ indirect_headers += files( sources = files( 'rte_cuckoo_hash.c', + 'rte_hash_crc.c', 'rte_fbk_hash.c', 'rte_thash.c', 'rte_thash_gfni.c'
lib/hash/rte_crc_arm64.h +4 -4
@@ -53,7 +53,7 @@ crc32c_arm64_u64(uint64_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_1byte (uint8_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u8 (data, init_val);return crc32c_1byte (data, init_val);
@@ -67,7 +67,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_2byte (uint16_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u16 (data, init_val);return crc32c_2bytes (data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u32 (data, init_val);return crc32c_1word (data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_8byte (uint64_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_ARM64 )) +if (likely (rte_hash_crc32_alg &CRC32_ARM64 ))return crc32c_arm64_u64 (data, init_val);return crc32c_2words (data, init_val);
lib/hash/rte_crc_x86.h +5 -5
@@ -67,7 +67,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)static inline uint32_t rte_hash_crc_1byte (uint8_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u8 (data, init_val);return crc32c_1byte (data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_2byte (uint16_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u16 (data, init_val);return crc32c_2bytes (data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)static inline uint32_t rte_hash_crc_4byte (uint32_t data,uint32_t init_val) { -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u32 (data, init_val);return crc32c_1word (data, init_val);
@@ -110,11 +110,11 @@ static inline uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val) {#ifdef RTE_ARCH_X86_64 -if (likely (crc32_alg == CRC32_SSE42_x64)) +if (likely (rte_hash_crc32_alg == CRC32_SSE42_x64))return crc32c_sse42_u64 (data, init_val);#endif -if (likely (crc32_alg &CRC32_SSE42 )) +if (likely (rte_hash_crc32_alg &CRC32_SSE42 ))return crc32c_sse42_u64_mimic (data, init_val);return crc32c_2words (data, init_val);
lib/hash/rte_hash_crc.c new file +68 -0
68 lines not on this page · raw message
lib/hash/rte_hash_crc.h +3 -45
66 lines not on this page · raw message
lib/hash/version.map +7 -0
@@ -9,6 +9,7 @@ DPDK_23 { rte_hash_add_key_with_hash; rte_hash_add_key_with_hash_data; rte_hash_count; + rte_hash_crc_set_alg; rte_hash_create; rte_hash_del_key; rte_hash_del_key_with_hash;
@@ -56,3 +57,9 @@ EXPERIMENTAL { rte_thash_gfni; rte_thash_gfni_bulk; }; + +INTERNAL { + global: + + rte_hash_crc32_alg; +};
Signature · 1 line
2.39.1
RE: [PATCH v11 21/22] hash: move rte_hash_set_alg out header
Quoted 33 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, February 23, 2023 5:56 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Yipeng Wang <[email protected]>; Sameh Gobriel <[email protected]>; Bruce Richardson <[email protected]>; Vladimir Medvedkin <[email protected]>; Ruifeng Wang <[email protected]>
Subject: [PATCH v11 21/22] hash: moverte_hash_set_algout headerThe code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of
RTE_LOG().Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the same.
Signed-off-by Stephen Hemminger <[email protected]>--- lib/hash/meson.build | 1 + lib/hash/rte_crc_arm64.h | 8 ++--- lib/hash/rte_crc_x86.h | 10 +++--- lib/hash/rte_hash_crc.c | 68 ++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------------- lib/hash/version.map | 7 +++++ 6 files changed, 88 insertions(+), 54 deletions(-) create mode 100644
lib/hash/rte_hash_crc.clib/hash/meson.build index e56ee8572564..c345c6f561fc renamed from lib/hash/meson.build +0
-0100644
lib/hash/meson.build indirect_headers += files( · line 22
Quoted 4 lines
lib/hash/meson.build +1
-0@@ -19,6 +19,7 @@ indirect_headers += files( sources = files( 'rte_cuckoo_hash.c', + 'rte_hash_crc.c',
I suppose this list is alphabetically ordered.
Quoted 3 lines
lib/hash/meson.build +0
-0'rte_fbk_hash.c', 'rte_thash.c', 'rte_thash_gfni.c'
<snip>
lib/hash/rte_hash_crc.h extern "C" { · line 23
Quoted 9 lines
lib/hash/rte_hash_crc.h index renamed from lib/hash/rte_hash_crc.h +0
-0
0249ad16c5b6..e8145ee44204100644lib/hash/rte_hash_crc.h +0
-1@@ -20,8 +20,6 @@ extern "C" {#include <rte_branch_prediction.h> #include <rte_common.h> #include <rte_config.h> -#include <rte_cpuflags.h>
A couple of files need update with this change.rte_cpuflags.h should be included in rte_fbk_hash.c (for ARM) and rte_efd.c.
Quoted 4 lines
lib/hash/rte_hash_crc.h +0
-1-#include <rte_log.h> #include "rte_crc_sw.h"
<snip>
RE: [PATCH v11 21/22] hash: move rte_hash_set_alg out header
Quoted 57 lines
-----Original Message-----
From: Ruifeng Wang
Sent: Thursday, February 23, 2023 3:11 PM
To: Stephen Hemminger <[email protected]>; [email protected]
Cc: Yipeng Wang <[email protected]>; Sameh Gobriel <[email protected]>; Bruce Richardson <[email protected]>; Vladimir Medvedkin <[email protected]>; nd <[email protected]>
Subject: RE: [PATCH v11 21/22] hash: moverte_hash_set_algout headerQuoted 10 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, February 23, 2023 5:56 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Yipeng Wang <[email protected]>; Sameh Gobriel <[email protected]>; Bruce Richardson <[email protected]>; Vladimir Medvedkin <[email protected]>; Ruifeng Wang <[email protected]>
Subject: [PATCH v11 21/22] hash: moverte_hash_set_algout headerQuoted 7 lines
The code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of
RTE_LOG().Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the
same.
Quoted 19 lines
Signed-off-by Stephen Hemminger <[email protected]>--- lib/hash/meson.build | 1 + lib/hash/rte_crc_arm64.h | 8 ++--- lib/hash/rte_crc_x86.h | 10 +++--- lib/hash/rte_hash_crc.c | 68 ++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------------- lib/hash/version.map | 7 +++++ 6 files changed, 88 insertions(+), 54 deletions(-) create mode100644
lib/hash/rte_hash_crc.clib/hash/meson.build index renamed from lib/hash/meson.build +0
-0
e56ee8572564..c345c6f561fc
100644lib/hash/meson.build indirect_headers += files( · line 22
Quoted 4 lines
lib/hash/meson.build +1
-0@@ -19,6 +19,7 @@ indirect_headers += files( sources = files( 'rte_cuckoo_hash.c', + 'rte_hash_crc.c',I suppose this list is alphabetically ordered.
Quoted 3 lines
lib/hash/meson.build +0
-0'rte_fbk_hash.c', 'rte_thash.c', 'rte_thash_gfni.c'<snip>
Quoted 12 lines
lib/hash/rte_hash_crc.h extern "C" { · line 23
Quoted 9 lines
lib/hash/rte_hash_crc.h index renamed from lib/hash/rte_hash_crc.h +0
-0
0249ad16c5b6..e8145ee44204100644lib/hash/rte_hash_crc.h +0
-1@@ -20,8 +20,6 @@ extern "C" {#include <rte_branch_prediction.h> #include <rte_common.h> #include <rte_config.h> -#include <rte_cpuflags.h> A couple of files need update with this change.
rte_cpuflags.hshould be included inrte_fbk_hash.c(for ARM) andrte_efd.c.
OK, I see the changes already there in other patches in the same series. Please ignore this comment.
Thanks.
Quoted 6 lines
Quoted 5 lines
lib/hash/rte_hash_crc.h +0
-1-#include <rte_log.h> #include "rte_crc_sw.h" <snip>
RE: [PATCH v11 21/22] hash: move rte_hash_set_alg out header
In reply to Stephen HemmingerQuoted 26 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, February 23, 2023 5:56 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Yipeng Wang <[email protected]>; Sameh Gobriel <[email protected]>; Bruce Richardson <[email protected]>; Vladimir Medvedkin <[email protected]>; Ruifeng Wang <[email protected]>
Subject: [PATCH v11 21/22] hash: moverte_hash_set_algout headerThe code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of
RTE_LOG().Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the same.
Signed-off-by Stephen Hemminger <[email protected]>--- lib/hash/meson.build | 1 + lib/hash/rte_crc_arm64.h | 8 ++--- lib/hash/rte_crc_x86.h | 10 +++--- lib/hash/rte_hash_crc.c | 68 ++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------------- lib/hash/version.map | 7 +++++ 6 files changed, 88 insertions(+), 54 deletions(-) create mode 100644
Quoted 2 lines
lib/hash/rte_hash_crc.c
PATCH v11 22/22 hash: convert RTE_LOGTYPE_HASH to dynamic type
In reply to Stephen HemmingerUse dynamic type for hash and add subtypes for crc and gfni.
--- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/hash/rte_cuckoo_hash.c | 5 +++++ lib/hash/rte_fbk_hash.c | 5 +++++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 6 files changed, 17 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_log.c +0 -1
@@ -350,7 +350,6 @@ struct logtype {static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL ,"lib.eal" }, {RTE_LOGTYPE_PMD ,"pmd" }, - {RTE_LOGTYPE_HASH ,"lib.hash" }, {RTE_LOGTYPE_CRYPTODEV ,"lib.cryptodev" }, {RTE_LOGTYPE_EVENTDEV ,"lib.eventdev" }, {RTE_LOGTYPE_USER1 ,"user1" },
lib/eal/include/rte_log.h +1 -1
@@ -32,7 +32,7 @@ extern "C" {/* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5/**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6/**< Log related to hash table. */ +/* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */
lib/hash/rte_cuckoo_hash.c +5 -0
@@ -24,6 +24,11 @@#include <rte_tailq.h> #include "rte_hash.h" + +/* needs to be before rte_cuckoo_hash.h */ +RTE_LOG_REGISTER_DEFAULT (hash_logtype,INFO ); +#define RTE_LOGTYPE_HASH hash_logtype +#include "rte_cuckoo_hash.h" /* Mask of all flags supported by this version */
lib/hash/rte_fbk_hash.c +5 -0
@@ -8,6 +8,8 @@#include <errno.h> #include <sys/queue.h> + +#include <rte_cpuflags.h> #include <rte_eal_memconfig.h> #include <rte_malloc.h> #include <rte_common.h>
@@ -18,6 +20,9 @@#include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX (fbk_hash_logtype, fbk,INFO ); +#define RTE_LOGTYPE_HASH fbk_hash_logtype +TAILQ_HEAD (rte_fbk_hash_list, rte_tailq_entry);static struct rte_tailq_elem rte_fbk_hash_tailq = {
lib/hash/rte_thash.c +3 -0
@@ -13,6 +13,9 @@#include <rte_log.h> #include <rte_malloc.h> +RTE_LOG_REGISTER_SUFFIX (thash_logtype, thash,INFO ); +#define RTE_LOGTYPE_HASH thash_logtype +#define THASH_NAME_LEN 64#define TOEPLITZ_HASH_LEN 32
lib/hash/rte_thash_gfni.c +3 -0
@@ -10,6 +10,9 @@#ifndef RTE_THASH_GFNI_DEFINED +RTE_LOG_REGISTER_SUFFIX (hash_gfni_logtype, gfni,INFO ); +#define RTE_LOGTYPE_HASH hash_gfni_logtype +uint32_t rte_thash_gfni(const uint64_t *mtrx __rte_unused, const uint8_t *key __rte_unused, int len __rte_unused)
Signature · 1 line
2.39.1