[v8,04/22] efd: replace RTE_LOGTYPE_EFD with dynamic type
Checks
Commit Message
Replace all uses of the global logtype with a dynamic log type.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
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(-)
Comments
On Tue, Feb 21, 2023 at 12:36 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Replace all uses of the global logtype with a dynamic log type.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> 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(-)
[snip]
> diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
> index 686a13775742..9edb11799c89 100644
> --- a/lib/efd/rte_efd.c
> +++ b/lib/efd/rte_efd.c
> @@ -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>
This is unrelated, isn't it?
On Tue, 21 Feb 2023 15:55:29 +0100
David Marchand <david.marchand@redhat.com> wrote:
> On Tue, Feb 21, 2023 at 12:36 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > Replace all uses of the global logtype with a dynamic log type.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> > 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(-)
>
> [snip]
>
> > diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
> > index 686a13775742..9edb11799c89 100644
> > --- a/lib/efd/rte_efd.c
> > +++ b/lib/efd/rte_efd.c
> > @@ -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>
>
> This is unrelated, isn't it?
Not really, the old code worked only because it would get rte_cpuflags.h
included via rte_hash_crc.h. When rte_hash_crc.h was fixed to not
do per-cpu setup in inline, then the cpu flags did not need to be
included there.
On Tue, 21 Feb 2023 15:55:29 +0100
David Marchand <david.marchand@redhat.com> wrote:
> On Tue, Feb 21, 2023 at 12:36 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > Replace all uses of the global logtype with a dynamic log type.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> > 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(-)
>
> [snip]
>
> > diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
> > index 686a13775742..9edb11799c89 100644
> > --- a/lib/efd/rte_efd.c
> > +++ b/lib/efd/rte_efd.c
> > @@ -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>
>
> This is unrelated, isn't it?
Not really, previously the hash library would cause cpuflags to be included.
But that doesn't happen now that the hash function is not inline there.
@@ -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"},
@@ -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 */
@@ -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) \