DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: skoteshwar@marvell.com
Cc: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	 Sunil Kumar Kori <skori@marvell.com>,
	dev@dpdk.org
Subject: Re: [PATCH v4] net/cnxk: support Tx queue descriptor count
Date: Fri, 1 Mar 2024 19:21:05 +0530	[thread overview]
Message-ID: <CALBAE1OVkZ-4rwZ9Ym12HFRt=SNwWbXB4kR-HAJEjzODx9-1ig@mail.gmail.com> (raw)
In-Reply-To: <1709286509-18322-1-git-send-email-skoteshwar@marvell.com>

On Fri, Mar 1, 2024 at 3:19 PM <skoteshwar@marvell.com> wrote:
>
> From: Satha Rao <skoteshwar@marvell.com>
>
> Added CNXK APIs to get used txq descriptor count.
>
> Signed-off-by: Satha Rao <skoteshwar@marvell.com>
> ---
>
> Depends-on: series-30833 ("ethdev: support Tx queue used count")


Following build issue clang


[1734/2932] Generating drivers/rte_net_ice.sym_chk with a custom
command (wrapped by meson to capture output)
[1735/2932] Compiling C object
drivers/libtmp_rte_net_cnxk.a.p/net_cnxk_cn10k_ethdev_sec.c.o
FAILED: drivers/libtmp_rte_net_cnxk.a.p/net_cnxk_cn10k_ethdev_sec.c.o
ccache clang -Idrivers/libtmp_rte_net_cnxk.a.p -Idrivers -I../drivers
-Idrivers/net/cnxk -I../drivers/net/cnxk -Ilib/ethdev -I../lib/ethdev
-I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include
-Ilib/eal/linux/include -I../lib/eal/linux/include
-Ilib/eal/x86/include -I../lib/eal/x86/include -Ilib/eal/common
-I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs
-I../lib/kvargs -Ilib/log -I../lib/log -Ilib/metrics -I../lib/metrics
-Ilib/telemetry -I../lib/telemetry -Ilib/net -I../lib/net -Ilib/mbuf
-I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring
-Ilib/meter -I../lib/meter -Idrivers/bus/pci -I../drivers/bus/pci
-I../drivers/bus/pci/linux -Ilib/pci -I../lib/pci -Idrivers/bus/vdev
-I../drivers/bus/vdev -Ilib/cryptodev -I../lib/cryptodev -Ilib/rcu
-I../lib/rcu -Ilib/eventdev -I../lib/eventdev -Ilib/hash -I../lib/hash
-Ilib/timer -I../lib/timer -Ilib/dmadev -I../lib/dmadev -Ilib/security
-I../lib/security -Idrivers/common/cnxk -I../drivers/common/cnxk
-Idrivers/mempool/cnxk -I../drivers/mempool/cnxk
-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
-Wextra -Werror -std=c11 -O2 -g -include rte_config.h -Wcast-qual
-Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wold-style-definition -Wpointer-arith -Wsign-compare
-Wstrict-prototypes -Wundef -Wwrite-strings
-Wno-address-of-packed-member -Wno-missing-field-initializers
-D_GNU_SOURCE -fPIC -march=native -mrtm -DALLOW_EXPERIMENTAL_API
-DALLOW_INTERNAL_API -flax-vector-conversions -Wno-strict-aliasing
-Wno-asm-operand-widths -DRTE_LOG_DEFAULT_LOGTYPE=pmd.net.cnxk -MD -MQ
drivers/libtmp_rte_net_cnxk.a.p/net_cnxk_cn10k_ethdev_sec.c.o -MF
drivers/libtmp_rte_net_cnxk.a.p/net_cnxk_cn10k_ethdev_sec.c.o.d -o
drivers/libtmp_rte_net_cnxk.a.p/net_cnxk_cn10k_ethdev_sec.c.o -c
../drivers/net/cnxk/cn10k_ethdev_sec.c
In file included from ../drivers/net/cnxk/cn10k_ethdev_sec.c:11:
In file included from ../drivers/net/cnxk/cn10k_ethdev.h:7:
../drivers/net/cnxk/cnxk_ethdev.h:469:33: error: used type
'_Atomic(uint64_t *)' where arithmetic or pointer type is required
        val = rte_atomic_load_explicit((RTE_ATOMIC(uint64_t *))mem,
rte_memory_order_relaxed);
                                       ^                       ~~~
../lib/eal/include/rte_stdatomic.h:73:23: note: expanded from macro
'rte_atomic_load_explicit'
        atomic_load_explicit(ptr, memorder)
                             ^~~
In file included from ../drivers/net/cnxk/cn10k_ethdev_sec.c:11:
In file included from ../drivers/net/cnxk/cn10k_ethdev.h:7:
../drivers/net/cnxk/cnxk_ethdev.h:480:36: error: used type
'_Atomic(uint64_t *)' where arithmetic or pointer type is required
        sq_cnt = rte_atomic_load_explicit((RTE_ATOMIC(uint64_t *))mem,
rte_memory_order_relaxed);
                                          ^                       ~~~
../lib/eal/include/rte_stdatomic.h:73:23: note: expanded from macro
'rte_atomic_load_explicit'
        atomic_load_explicit(ptr, memorder)
                             ^~~
In file included from ../drivers/net/cnxk/cn10k_ethdev_sec.c:11:
In file included from ../drivers/net/cnxk/cn10k_ethdev.h:7:
../drivers/net/cnxk/cnxk_ethdev.h:482:37: error: used type
'_Atomic(uint64_t *)' where arithmetic or pointer type is required
        sec_cnt = rte_atomic_load_explicit((RTE_ATOMIC(uint64_t *))sec_fc,
                                           ^                       ~~~~~~
../lib/eal/include/rte_stdatomic.h:73:23: note: expanded from macro
'rte_atomic_load_explicit'
        atomic_load_explicit(ptr, memorder)

[for-main]dell[dpdk-next-net-mrvl] $ clang -v
clang version 16.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.1
Found candidate GCC installation:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
>
> v2:
>   Updated release notes and fixed API for CPT queues.
> v3:
>   Addressed review comments
>
>  doc/guides/nics/features/cnxk.ini      |  1 +
>  doc/guides/rel_notes/release_24_03.rst |  1 +
>  drivers/net/cnxk/cn10k_tx_select.c     | 22 ++++++++++++++++++++++
>  drivers/net/cnxk/cn9k_tx_select.c      | 23 +++++++++++++++++++++++
>  drivers/net/cnxk/cnxk_ethdev.h         | 25 +++++++++++++++++++++++++
>  5 files changed, 72 insertions(+)
>
> diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
> index 94e7a6a..ab18f38 100644
> --- a/doc/guides/nics/features/cnxk.ini
> +++ b/doc/guides/nics/features/cnxk.ini
> @@ -40,6 +40,7 @@ Timesync             = Y
>  Timestamp offload    = Y
>  Rx descriptor status = Y
>  Tx descriptor status = Y
> +Tx queue count       = Y
>  Basic stats          = Y
>  Stats per queue      = Y
>  Extended stats       = Y
> diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
> index 8d440d5..1f85cda 100644
> --- a/doc/guides/rel_notes/release_24_03.rst
> +++ b/doc/guides/rel_notes/release_24_03.rst
> @@ -111,6 +111,7 @@ New Features
>    * Added support for ``RTE_FLOW_ITEM_TYPE_PPPOES`` flow item.
>    * Added support for ``RTE_FLOW_ACTION_TYPE_SAMPLE`` flow item.
>    * Added support for Rx inject.
> +  * Added support for ``rte_eth_tx_queue_count``.
>
>  * **Updated Marvell OCTEON EP driver.**
>
> diff --git a/drivers/net/cnxk/cn10k_tx_select.c b/drivers/net/cnxk/cn10k_tx_select.c
> index 404f5ba..aa0620e 100644
> --- a/drivers/net/cnxk/cn10k_tx_select.c
> +++ b/drivers/net/cnxk/cn10k_tx_select.c
> @@ -20,6 +20,24 @@
>                         eth_dev->tx_pkt_burst;
>  }
>
> +#if defined(RTE_ARCH_ARM64)
> +static int
> +cn10k_nix_tx_queue_count(void *tx_queue)
> +{
> +       struct cn10k_eth_txq *txq = (struct cn10k_eth_txq *)tx_queue;
> +
> +       return cnxk_nix_tx_queue_count(txq->fc_mem, txq->sqes_per_sqb_log2);
> +}
> +
> +static int
> +cn10k_nix_tx_queue_sec_count(void *tx_queue)
> +{
> +       struct cn10k_eth_txq *txq = (struct cn10k_eth_txq *)tx_queue;
> +
> +       return cnxk_nix_tx_queue_sec_count(txq->fc_mem, txq->sqes_per_sqb_log2, txq->cpt_fc);
> +}
> +#endif
> +
>  void
>  cn10k_eth_set_tx_function(struct rte_eth_dev *eth_dev)
>  {
> @@ -63,6 +81,10 @@
>                 if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
>                         pick_tx_func(eth_dev, nix_eth_tx_vec_burst_mseg);
>         }
> +       if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY)
> +               eth_dev->tx_queue_count = cn10k_nix_tx_queue_sec_count;
> +       else
> +               eth_dev->tx_queue_count = cn10k_nix_tx_queue_count;
>
>         rte_mb();
>  #else
> diff --git a/drivers/net/cnxk/cn9k_tx_select.c b/drivers/net/cnxk/cn9k_tx_select.c
> index e08883f..5ecf919 100644
> --- a/drivers/net/cnxk/cn9k_tx_select.c
> +++ b/drivers/net/cnxk/cn9k_tx_select.c
> @@ -20,6 +20,24 @@
>                         eth_dev->tx_pkt_burst;
>  }
>
> +#if defined(RTE_ARCH_ARM64)
> +static int
> +cn9k_nix_tx_queue_count(void *tx_queue)
> +{
> +       struct cn9k_eth_txq *txq = (struct cn9k_eth_txq *)tx_queue;
> +
> +       return cnxk_nix_tx_queue_count(txq->fc_mem, txq->sqes_per_sqb_log2);
> +}
> +
> +static int
> +cn9k_nix_tx_queue_sec_count(void *tx_queue)
> +{
> +       struct cn9k_eth_txq *txq = (struct cn9k_eth_txq *)tx_queue;
> +
> +       return cnxk_nix_tx_queue_sec_count(txq->fc_mem, txq->sqes_per_sqb_log2, txq->cpt_fc);
> +}
> +#endif
> +
>  void
>  cn9k_eth_set_tx_function(struct rte_eth_dev *eth_dev)
>  {
> @@ -59,6 +77,11 @@
>                 if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
>                         pick_tx_func(eth_dev, nix_eth_tx_vec_burst_mseg);
>         }
> +       if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY)
> +               eth_dev->tx_queue_count = cn9k_nix_tx_queue_sec_count;
> +       else
> +               eth_dev->tx_queue_count = cn9k_nix_tx_queue_count;
> +
>
>         rte_mb();
>  #else
> diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
> index 80a9dc8..a5670a0 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.h
> +++ b/drivers/net/cnxk/cnxk_ethdev.h
> @@ -461,6 +461,31 @@ struct cnxk_eth_txq_sp {
>         return ((struct cnxk_eth_txq_sp *)__txq) - 1;
>  }
>
> +static inline int
> +cnxk_nix_tx_queue_count(uint64_t *mem, uint16_t sqes_per_sqb_log2)
> +{
> +       uint64_t val;
> +
> +       val = rte_atomic_load_explicit((RTE_ATOMIC(uint64_t *))mem, rte_memory_order_relaxed);
> +       val = (val << sqes_per_sqb_log2) - val;
> +
> +       return (val & 0xFFFF);
> +}
> +
> +static inline int
> +cnxk_nix_tx_queue_sec_count(uint64_t *mem, uint16_t sqes_per_sqb_log2, uint64_t *sec_fc)
> +{
> +       uint64_t sq_cnt, sec_cnt, val;
> +
> +       sq_cnt = rte_atomic_load_explicit((RTE_ATOMIC(uint64_t *))mem, rte_memory_order_relaxed);
> +       sq_cnt = (sq_cnt << sqes_per_sqb_log2) - sq_cnt;
> +       sec_cnt = rte_atomic_load_explicit((RTE_ATOMIC(uint64_t *))sec_fc,
> +                                          rte_memory_order_relaxed);
> +       val = RTE_MAX(sq_cnt, sec_cnt);
> +
> +       return (val & 0xFFFF);
> +}
> +
>  /* Common ethdev ops */
>  extern struct eth_dev_ops cnxk_eth_dev_ops;
>
> --
> 1.8.3.1
>

  reply	other threads:[~2024-03-01 13:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 12:39 [PATCH] " skoteshwar
2024-02-22 11:33 ` Jerin Jacob
2024-02-23 15:33 ` [PATCH v2] " skoteshwar
2024-02-25 15:33   ` Jerin Jacob
2024-03-01  6:48   ` [PATCH v3] " skoteshwar
2024-03-01  9:48     ` [PATCH v4] " skoteshwar
2024-03-01 13:51       ` Jerin Jacob [this message]
2024-03-04  9:40       ` [PATCH v5] " skoteshwar
2024-03-04  9:52       ` [PATCH v6] " skoteshwar
2024-03-04 11:44         ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALBAE1OVkZ-4rwZ9Ym12HFRt=SNwWbXB4kR-HAJEjzODx9-1ig@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).