RE: [RFC] eal: use same atomic intrinsics for gcc and clang

2023-02-11 Thread Morten Brørup
> From: Honnappa Nagarahalli [mailto:honnappa.nagaraha...@arm.com]
> Sent: Saturday, 11 February 2023 02.56
> 
> The size generic atomic intrinsics generate the same
> code as the size specific intrinsics for gcc. Use size
> generic intrinsics for both gcc and clang.
> 
> Fixes: 7bdccb93078e ("eal: fix ARM build with clang")
> Cc: sta...@dpdk.org
> Cc: pbhagavat...@marvell.com
> 
> Signed-off-by: Honnappa Nagarahalli 
> ---

Acked-by: Morten Brørup 



Re: [dpdk-dev] [PATCH v2 3/3] common/cnxk: fix inline IPsec rule creation

2023-02-11 Thread Jerin Jacob
On Fri, Feb 10, 2023 at 1:56 PM  wrote:
>
> From: Satheesh Paul 
>
> Use inline IPsec device to create IPsec rules irrespective
> of RTE_ETH_RX_OFFLOAD_SECURITY offload flag.
>
> Fixes: 1aa86a170e27 ("drivers: support IPsec rule reservation scheme")
> Cc: sta...@dpdk.org
>
> Signed-off-by: Satheesh Paul 
> Reviewed-by: Nithin Dabilpuram 
> Reviewed-by: Kiran Kumar K 


Series applied to dpdk-next-net-eventdev/for-main. Thanks


> ---
>  drivers/common/cnxk/roc_npc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
> index 579b3dce9a..d3efebe663 100644
> --- a/drivers/common/cnxk/roc_npc.c
> +++ b/drivers/common/cnxk/roc_npc.c
> @@ -562,8 +562,10 @@ npc_parse_actions(struct roc_npc *roc_npc, const struct 
> roc_npc_attr *attr,
> }
> rq = inl_rq->qid;
> pf_func = nix_inl_dev_pffunc_get();
> -   flow->is_inline_dev = 1;
> }
> +
> +   if (roc_nix_inl_dev_is_probed())
> +   flow->is_inline_dev = 1;
> sec_action = actions;
> break;
> case ROC_NPC_ACTION_TYPE_VLAN_STRIP:
> --
> 2.35.3
>


[PATCH 0/6] net/hns3: some code optimization for Rx/Tx function

2023-02-11 Thread Dongdong Liu
This patchset is to do some code optimization for Rx/Tx function.

Huisong Li (6):
  net/hns3: fix querying dummy function failed
  net/hns3: add debug info for Rx/Tx dummy function
  net/hns3: remove debug condition for Tx prepare
  net/hns3: separate tx prepare from getting Tx function
  net/hns3: remove getting Tx function from head file
  net/hns3: extract common functions to set Rx/Tx

 drivers/net/hns3/hns3_ethdev.c|  20 ++
 drivers/net/hns3/hns3_ethdev_vf.c |  19 ++
 drivers/net/hns3/hns3_mp.c|   4 +-
 drivers/net/hns3/hns3_rxtx.c  | 108 ++
 drivers/net/hns3/hns3_rxtx.h  |   5 +-
 5 files changed, 79 insertions(+), 77 deletions(-)

--
2.22.0



[PATCH 1/6] net/hns3: fix querying dummy function failed

2023-02-11 Thread Dongdong Liu
From: Huisong Li 

The rte_eth_rx/tx_burst_mode_get API will fail when Rx/Tx
function is dummy.

Fixes: 7ef933908f04 ("net/hns3: add simple Tx path")
Fixes: 521ab3e93361 ("net/hns3: add simple Rx path")
Cc: sta...@dpdk.org

Signed-off-by: Huisong Li 
Signed-off-by: Dongdong Liu 
---
 drivers/net/hns3/hns3_rxtx.c | 38 ++--
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index f1163ce8a9..feef9e1c7b 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2786,6 +2786,7 @@ hns3_rx_burst_mode_get(struct rte_eth_dev *dev, 
__rte_unused uint16_t queue_id,
{ hns3_recv_scattered_pkts, "Scalar Scattered" },
{ hns3_recv_pkts_vec,   "Vector Neon"   },
{ hns3_recv_pkts_vec_sve,   "Vector Sve"},
+   { rte_eth_pkt_burst_dummy,  "Dummy" },
};
 
eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
@@ -4272,24 +4273,31 @@ int
 hns3_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
   struct rte_eth_burst_mode *mode)
 {
+   static const struct {
+   eth_tx_burst_t pkt_burst;
+   const char *info;
+   } burst_infos[] = {
+   { hns3_xmit_pkts_simple,"Scalar Simple" },
+   { hns3_xmit_pkts,   "Scalar"},
+   { hns3_xmit_pkts_vec,   "Vector Neon"   },
+   { hns3_xmit_pkts_vec_sve,   "Vector Sve"},
+   { rte_eth_pkt_burst_dummy,  "Dummy" },
+   };
+
eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
-   const char *info = NULL;
-
-   if (pkt_burst == hns3_xmit_pkts_simple)
-   info = "Scalar Simple";
-   else if (pkt_burst == hns3_xmit_pkts)
-   info = "Scalar";
-   else if (pkt_burst == hns3_xmit_pkts_vec)
-   info = "Vector Neon";
-   else if (pkt_burst == hns3_xmit_pkts_vec_sve)
-   info = "Vector Sve";
-
-   if (info == NULL)
-   return -EINVAL;
+   int ret = -EINVAL;
+   unsigned int i;
 
-   snprintf(mode->info, sizeof(mode->info), "%s", info);
+   for (i = 0; i < RTE_DIM(burst_infos); i++) {
+   if (pkt_burst == burst_infos[i].pkt_burst) {
+   snprintf(mode->info, sizeof(mode->info), "%s",
+burst_infos[i].info);
+   ret = 0;
+   break;
+   }
+   }
 
-   return 0;
+   return ret;
 }
 
 static bool
-- 
2.22.0



[PATCH 2/6] net/hns3: add debug info for Rx/Tx dummy function

2023-02-11 Thread Dongdong Liu
From: Huisong Li 

Now dummy function can be report by rte_eth_rx/tx_burst_mode_get.
So this patch adds debug info for Rx/Tx dummy function.

Fixes: 7feb2aee0e2c ("net/hns3: log selected datapath")
Cc: sta...@dpdk.org

Signed-off-by: Huisong Li 
Signed-off-by: Dongdong Liu 
---
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index feef9e1c7b..2524f4c3c2 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4420,13 +4420,13 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
hns3_get_tx_function(eth_dev, &prep);
eth_dev->tx_pkt_prepare = prep;
eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
-   hns3_trace_rxtx_function(eth_dev);
} else {
eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
eth_dev->tx_pkt_prepare = NULL;
}
 
+   hns3_trace_rxtx_function(eth_dev);
hns3_eth_dev_fp_ops_config(eth_dev);
 }
 
-- 
2.22.0



[PATCH 3/6] net/hns3: remove debug condition for Tx prepare

2023-02-11 Thread Dongdong Liu
From: Huisong Li 

The Tx prepare in driver is always needed if RTE_LIBRTE_ETHDEV_DEBUG
is defined. But it doesn't matter with this macro. Let's remove it.

Fixes: d7ec2c076579 ("net/hns3: select Tx prepare based on Tx offload")
Cc: sta...@dpdk.org

Signed-off-by: Huisong Li 
Signed-off-by: Dongdong Liu 
---
 drivers/net/hns3/hns3_rxtx.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 2524f4c3c2..921d72d69d 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4311,11 +4311,6 @@ hns3_tx_check_simple_support(struct rte_eth_dev *dev)
 static bool
 hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
 {
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
-   RTE_SET_USED(dev);
-   /* always perform tx_prepare when debug */
-   return true;
-#else
 #define HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK (\
RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | \
RTE_ETH_TX_OFFLOAD_TCP_CKSUM | \
@@ -4333,7 +4328,6 @@ hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
return true;
 
return false;
-#endif
 }
 
 eth_tx_burst_t
-- 
2.22.0



[PATCH 4/6] net/hns3: separate tx prepare from getting Tx function

2023-02-11 Thread Dongdong Liu
From: Huisong Li 

Separate getting tx prepare from hns3_get_tx_function by extracting
an independent function.

Fixes: d7ec2c076579 ("net/hns3: select Tx prepare based on Tx offload")
Cc: sta...@dpdk.org

Signed-off-by: Huisong Li 
Signed-off-by: Dongdong Liu 
---
 drivers/net/hns3/hns3_rxtx.c | 32 ++--
 drivers/net/hns3/hns3_rxtx.h |  3 +--
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 921d72d69d..9b2bd02857 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4324,26 +4324,30 @@ hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO)
 
uint64_t tx_offload = dev->data->dev_conf.txmode.offloads;
+
if (tx_offload & HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK)
return true;
 
return false;
 }
 
+static eth_tx_prep_t
+hns3_get_tx_prepare(struct rte_eth_dev *dev)
+{
+   return hns3_get_tx_prep_needed(dev) ? hns3_prep_pkts : NULL;
+}
+
 eth_tx_burst_t
-hns3_get_tx_function(struct rte_eth_dev *dev, eth_tx_prep_t *prep)
+hns3_get_tx_function(struct rte_eth_dev *dev)
 {
struct hns3_adapter *hns = dev->data->dev_private;
bool vec_allowed, sve_allowed, simple_allowed;
-   bool vec_support, tx_prepare_needed;
+   bool vec_support;
 
vec_support = hns3_tx_check_vec_support(dev) == 0;
vec_allowed = vec_support && hns3_get_default_vec_support();
sve_allowed = vec_support && hns3_get_sve_support();
simple_allowed = hns3_tx_check_simple_support(dev);
-   tx_prepare_needed = hns3_get_tx_prep_needed(dev);
-
-   *prep = NULL;
 
if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_VEC && vec_allowed)
return hns3_xmit_pkts_vec;
@@ -4351,19 +4355,14 @@ hns3_get_tx_function(struct rte_eth_dev *dev, 
eth_tx_prep_t *prep)
return hns3_xmit_pkts_vec_sve;
if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_SIMPLE && simple_allowed)
return hns3_xmit_pkts_simple;
-   if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_COMMON) {
-   if (tx_prepare_needed)
-   *prep = hns3_prep_pkts;
+   if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_COMMON)
return hns3_xmit_pkts;
-   }
 
if (vec_allowed)
return hns3_xmit_pkts_vec;
if (simple_allowed)
return hns3_xmit_pkts_simple;
 
-   if (tx_prepare_needed)
-   *prep = hns3_prep_pkts;
return hns3_xmit_pkts;
 }
 
@@ -4403,7 +4402,6 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 {
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
struct hns3_adapter *hns = eth_dev->data->dev_private;
-   eth_tx_prep_t prep = NULL;
 
if (hns->hw.adapter_state == HNS3_NIC_STARTED &&
__atomic_load_n(&hns->hw.reset.resetting, __ATOMIC_RELAXED) == 0) {
@@ -4411,8 +4409,8 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
eth_dev->rx_descriptor_status = hns3_dev_rx_descriptor_status;
eth_dev->tx_pkt_burst = hw->set_link_down ?
rte_eth_pkt_burst_dummy :
-   hns3_get_tx_function(eth_dev, &prep);
-   eth_dev->tx_pkt_prepare = prep;
+   hns3_get_tx_function(eth_dev);
+   eth_dev->tx_pkt_prepare = hns3_get_tx_prepare(eth_dev);
eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
} else {
eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
@@ -4758,10 +4756,8 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev)
 void
 hns3_start_tx_datapath(struct rte_eth_dev *dev)
 {
-   eth_tx_prep_t prep = NULL;
-
-   dev->tx_pkt_burst = hns3_get_tx_function(dev, &prep);
-   dev->tx_pkt_prepare = prep;
+   dev->tx_pkt_burst = hns3_get_tx_function(dev);
+   dev->tx_pkt_prepare = hns3_get_tx_prepare(dev);
hns3_eth_dev_fp_ops_config(dev);
 
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index ea1a805491..38c3581312 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -740,8 +740,7 @@ int hns3_tx_burst_mode_get(struct rte_eth_dev *dev,
 const uint32_t *hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 void hns3_init_rx_ptype_tble(struct rte_eth_dev *dev);
 void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev);
-eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev,
-   eth_tx_prep_t *prep);
+eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev);
 
 uint32_t hns3_get_tqp_intr_reg_offset(uint16_t tqp_intr_id);
 void hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
-- 
2.22.0



[PATCH 5/6] net/hns3: remove getting Tx function from head file

2023-02-11 Thread Dongdong Liu
From: Huisong Li 

The hns3_get_tx_function() is an intrinsic function now and should
not be open to other files.

Fixes: 96c33cfb06cf ("net/hns3: fix Rx/Tx functions update")
Cc: sta...@dpdk.org

Signed-off-by: Huisong Li 
Signed-off-by: Dongdong Liu 
---
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 drivers/net/hns3/hns3_rxtx.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 9b2bd02857..def22bcd30 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4337,7 +4337,7 @@ hns3_get_tx_prepare(struct rte_eth_dev *dev)
return hns3_get_tx_prep_needed(dev) ? hns3_prep_pkts : NULL;
 }
 
-eth_tx_burst_t
+static eth_tx_burst_t
 hns3_get_tx_function(struct rte_eth_dev *dev)
 {
struct hns3_adapter *hns = dev->data->dev_private;
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index 38c3581312..1bdc124b7b 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -740,8 +740,6 @@ int hns3_tx_burst_mode_get(struct rte_eth_dev *dev,
 const uint32_t *hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 void hns3_init_rx_ptype_tble(struct rte_eth_dev *dev);
 void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev);
-eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev);
-
 uint32_t hns3_get_tqp_intr_reg_offset(uint16_t tqp_intr_id);
 void hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
uint8_t gl_idx, uint16_t gl_value);
-- 
2.22.0



[PATCH 6/6] net/hns3: extract common functions to set Rx/Tx

2023-02-11 Thread Dongdong Liu
From: Huisong Li 

Extract two common functions to set Rx/Tx function in order to
reduce duplicate codes.

Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
Cc: sta...@dpdk.org

Signed-off-by: Huisong Li 
Signed-off-by: Dongdong Liu 
---
 drivers/net/hns3/hns3_ethdev.c| 20 
 drivers/net/hns3/hns3_ethdev_vf.c | 19 ---
 drivers/net/hns3/hns3_mp.c|  4 ++--
 drivers/net/hns3/hns3_rxtx.c  | 28 
 drivers/net/hns3/hns3_rxtx.h  |  2 ++
 5 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index ab565ce128..6babf67fce 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5052,8 +5052,7 @@ hns3_dev_start(struct rte_eth_dev *dev)
rte_spinlock_unlock(&hw->lock);
 
hns3_rx_scattered_calc(dev);
-   hns3_set_rxtx_function(dev);
-   hns3_mp_req_start_rxtx(dev);
+   hns3_start_rxtx_datapath(dev);
 
/* Enable interrupt of all rx queues before enabling queues */
hns3_dev_all_rx_queue_intr_enable(hw, true);
@@ -5131,12 +5130,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
dev->data->dev_started = 0;
 
hw->adapter_state = HNS3_NIC_STOPPING;
-   hns3_set_rxtx_function(dev);
-   rte_wmb();
-   /* Disable datapath on secondary process. */
-   hns3_mp_req_stop_rxtx(dev);
-   /* Prevent crashes when queues are still in use. */
-   rte_delay_ms(hw->cfg_max_queues);
+   hns3_stop_rxtx_datapath(dev);
 
rte_spinlock_lock(&hw->lock);
if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
@@ -5752,12 +5746,7 @@ hns3_stop_service(struct hns3_adapter *hns)
rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
hns3_update_linkstatus_and_event(hw, false);
}
-
-   hns3_set_rxtx_function(eth_dev);
-   rte_wmb();
-   /* Disable datapath on secondary process. */
-   hns3_mp_req_stop_rxtx(eth_dev);
-   rte_delay_ms(hw->cfg_max_queues);
+   hns3_stop_rxtx_datapath(eth_dev);
 
rte_spinlock_lock(&hw->lock);
if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
@@ -5790,8 +5779,7 @@ hns3_start_service(struct hns3_adapter *hns)
hw->reset.level == HNS3_GLOBAL_RESET)
hns3_set_rst_done(hw);
eth_dev = &rte_eth_devices[hw->data->port_id];
-   hns3_set_rxtx_function(eth_dev);
-   hns3_mp_req_start_rxtx(eth_dev);
+   hns3_start_rxtx_datapath(eth_dev);
if (hw->adapter_state == HNS3_NIC_STARTED) {
/*
 * This API parent function already hold the hns3_hw.lock, the
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c 
b/drivers/net/hns3/hns3_ethdev_vf.c
index d3c1bdf2c5..d051a1357b 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1572,12 +1572,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
dev->data->dev_started = 0;
 
hw->adapter_state = HNS3_NIC_STOPPING;
-   hns3_set_rxtx_function(dev);
-   rte_wmb();
-   /* Disable datapath on secondary process. */
-   hns3_mp_req_stop_rxtx(dev);
-   /* Prevent crashes when queues are still in use. */
-   rte_delay_ms(hw->cfg_max_queues);
+   hns3_stop_rxtx_datapath(dev);
 
rte_spinlock_lock(&hw->lock);
if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
@@ -1731,8 +1726,7 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
rte_spinlock_unlock(&hw->lock);
 
hns3_rx_scattered_calc(dev);
-   hns3_set_rxtx_function(dev);
-   hns3_mp_req_start_rxtx(dev);
+   hns3_start_rxtx_datapath(dev);
 
/* Enable interrupt of all rx queues before enabling queues */
hns3_dev_all_rx_queue_intr_enable(hw, true);
@@ -1902,11 +1896,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
}
hw->mac.link_status = RTE_ETH_LINK_DOWN;
 
-   hns3_set_rxtx_function(eth_dev);
-   rte_wmb();
-   /* Disable datapath on secondary process. */
-   hns3_mp_req_stop_rxtx(eth_dev);
-   rte_delay_ms(hw->cfg_max_queues);
+   hns3_stop_rxtx_datapath(eth_dev);
 
rte_spinlock_lock(&hw->lock);
if (hw->adapter_state == HNS3_NIC_STARTED ||
@@ -1938,8 +1928,7 @@ hns3vf_start_service(struct hns3_adapter *hns)
struct rte_eth_dev *eth_dev;
 
eth_dev = &rte_eth_devices[hw->data->port_id];
-   hns3_set_rxtx_function(eth_dev);
-   hns3_mp_req_start_rxtx(eth_dev);
+   hns3_start_rxtx_datapath(eth_dev);
 
rte_eal_alarm_set(HNS3VF_KEEP_ALIVE_INTERVAL, hns3vf_keep_alive_handler,
  eth_dev);
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
index 7184f9ad58..556f1941c6 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -89,12 +89,12 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const 
void *peer)
case H

Re: [PATCH v2] common/cnxk: remove unnecessary locks

2023-02-11 Thread Jerin Jacob
On Wed, Feb 8, 2023 at 1:58 AM  wrote:
>
> From: Pavan Nikhilesh 
>
> Remove unnecessary locks as locking is now taken care by
> mbox_get and mbox_put.
>
> Signed-off-by: Pavan Nikhilesh 

Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks

common/cnxk: remove redundant locks

Remove redundant locks as locking is now taken care by
mbox_get() and mbox_put().

Signed-off-by: Pavan Nikhilesh 
> ---
>  v2 Changes:
>  - Rebase on main
>
>  drivers/common/cnxk/roc_sso.c  | 25 -
>  drivers/common/cnxk/roc_sso_priv.h |  1 -
>  2 files changed, 26 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c
> index a422e37be6..9e466f09ef 100644
> --- a/drivers/common/cnxk/roc_sso.c
> +++ b/drivers/common/cnxk/roc_sso.c
> @@ -327,7 +327,6 @@ roc_sso_hws_stats_get(struct roc_sso *roc_sso, uint8_t 
> hws,
> struct mbox *mbox;
> int rc;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> mbox = mbox_get(dev->mbox);
> req_rsp = (struct sso_hws_stats *)mbox_alloc_msg_sso_hws_get_stats(
> mbox);
> @@ -354,7 +353,6 @@ roc_sso_hws_stats_get(struct roc_sso *roc_sso, uint8_t 
> hws,
> stats->arbitration = req_rsp->arbitration;
>  fail:
> mbox_put(mbox);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -368,7 +366,6 @@ roc_sso_hwgrp_stats_get(struct roc_sso *roc_sso, uint8_t 
> hwgrp,
> struct mbox *mbox;
> int rc;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> mbox = mbox_get(dev->mbox);
> req_rsp = (struct sso_grp_stats *)mbox_alloc_msg_sso_grp_get_stats(
> mbox);
> @@ -403,7 +400,6 @@ roc_sso_hwgrp_stats_get(struct roc_sso *roc_sso, uint8_t 
> hwgrp,
>
>  fail:
> mbox_put(mbox);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -427,7 +423,6 @@ roc_sso_hwgrp_qos_config(struct roc_sso *roc_sso, struct 
> roc_sso_hwgrp_qos *qos,
> struct mbox *mbox;
> int i, rc;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> mbox = mbox_get(dev->mbox);
> for (i = 0; i < nb_qos; i++) {
> uint8_t iaq_prcnt = qos[i].iaq_prcnt;
> @@ -461,7 +456,6 @@ roc_sso_hwgrp_qos_config(struct roc_sso *roc_sso, struct 
> roc_sso_hwgrp_qos *qos,
> rc = -EIO;
>  fail:
> mbox_put(mbox);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -562,11 +556,9 @@ roc_sso_hwgrp_init_xaq_aura(struct roc_sso *roc_sso, 
> uint32_t nb_xae)
> struct dev *dev = &sso->dev;
> int rc;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> rc = sso_hwgrp_init_xaq_aura(dev, &roc_sso->xaq, nb_xae,
>  roc_sso->xae_waes, roc_sso->xaq_buf_size,
>  roc_sso->nb_hwgrp);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -600,9 +592,7 @@ roc_sso_hwgrp_free_xaq_aura(struct roc_sso *roc_sso, 
> uint16_t nb_hwgrp)
> struct dev *dev = &sso->dev;
> int rc;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> rc = sso_hwgrp_free_xaq_aura(dev, &roc_sso->xaq, nb_hwgrp);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -639,9 +629,7 @@ roc_sso_hwgrp_alloc_xaq(struct roc_sso *roc_sso, uint32_t 
> npa_aura_id,
> struct dev *dev = &sso->dev;
> int rc;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> rc = sso_hwgrp_alloc_xaq(dev, npa_aura_id, hwgrps);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -677,9 +665,7 @@ roc_sso_hwgrp_release_xaq(struct roc_sso *roc_sso, 
> uint16_t hwgrps)
> struct dev *dev = &sso->dev;
> int rc;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> rc = sso_hwgrp_release_xaq(dev, hwgrps);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -693,7 +679,6 @@ roc_sso_hwgrp_set_priority(struct roc_sso *roc_sso, 
> uint16_t hwgrp,
> struct mbox *mbox;
> int rc = -ENOSPC;
>
> -   plt_spinlock_lock(&sso->mbox_lock);
> mbox = mbox_get(dev->mbox);
> req = mbox_alloc_msg_sso_grp_set_priority(mbox);
> if (req == NULL)
> @@ -709,14 +694,12 @@ roc_sso_hwgrp_set_priority(struct roc_sso *roc_sso, 
> uint16_t hwgrp,
> goto fail;
> }
> mbox_put(mbox);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> plt_sso_dbg("HWGRP %d weight %d affinity %d priority %d", hwgrp, 
> weight,
> affinity, priority);
>
> return 0;
>  fail:
> mbox_put(mbox);
> -   plt_spinlock_unlock(&sso->mbox_lock);
> return rc;
>  }
>
> @@ -778,7 +761,6 @@ roc_sso_rsrc_init(struct roc_sso *roc_sso, uint8_t 
> nb_hws, uint16_t nb_hwgrp, ui
> if (!nb_hws || roc_sso->max_hws < nb_hws)
> return -ENOENT;
>

[Bug 1159] lib/vhost build failure with clang 3.4.2

2023-02-11 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=1159

Bug ID: 1159
   Summary: lib/vhost build failure with clang 3.4.2
   Product: DPDK
   Version: 23.03
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: Normal
 Component: vhost/virtio
  Assignee: dev@dpdk.org
  Reporter: alia...@nvidia.com
  Target Milestone: ---

```
FAILED: lib/librte_vhost.a.p/vhost_iotlb.c.o
clang -Ilib/librte_vhost.a.p -Ilib -I../../root/dpdk/lib -Ilib/vhost
-I../../root/dpdk/lib/vhost -I. -I../../root/dpdk -Iconfig
-I../../root/dpdk/config -Ilib/eal/include -I../../root/dpdk/lib/eal/include
-Ilib/eal/linux/include -I../../root/dpdk/lib/eal/linux/include
-Ilib/eal/x86/include -I../../root/dpdk/lib/eal/x86/include -Ilib/eal/common
-I../../root/dpdk/lib/eal/common -Ilib/eal -I../../root/dpdk/lib/eal
-Ilib/kvargs -I../../root/dpdk/lib/kvargs -Ilib/metrics
-I../../root/dpdk/lib/metrics -Ilib/telemetry -I../../root/dpdk/lib/telemetry
-Ilib/ethdev -I../../root/dpdk/lib/ethdev -Ilib/net -I../../root/dpdk/lib/net
-Ilib/mbuf -I../../root/dpdk/lib/mbuf -Ilib/mempool
-I../../root/dpdk/lib/mempool -Ilib/ring -I../../root/dpdk/lib/ring -Ilib/meter
-I../../root/dpdk/lib/meter -Ilib/cryptodev -I../../root/dpdk/lib/cryptodev
-Ilib/rcu -I../../root/dpdk/lib/rcu -Ilib/hash -I../../root/dpdk/lib/hash
-Ilib/pci -I../../root/dpdk/lib/pci -Ilib/dmadev -I../../root/dpdk/lib/dmadev
-Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
-Wextra -Werror -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-missing-field-initializers -D_GNU_SOURCE -fPIC -march=native -mno-avx512f
-mno-avx512f -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -fno-strict-aliasing
-DRTE_LOG_DEFAULT_LOGTYPE=lib.vhost -DRTE_ANNOTATE_LOCKS -Wthread-safety -MD
-MQ lib/librte_vhost.a.p/vhost_iotlb.c.o -MF
lib/librte_vhost.a.p/vhost_iotlb.c.o.d -o lib/librte_vhost.a.p/vhost_iotlb.c.o
-c ../../root/dpdk/lib/vhost/iotlb.c
In file included from ../../root/dpdk/lib/vhost/iotlb.c:11:
In file included from ../../root/dpdk/lib/vhost/iotlb.h:10:
../../root/dpdk/lib/vhost/vhost.h:518:2: error: GCC does not allow
assert_exclusive_lock attribute in this position on a function definition
[-Werror,-Wgcc-compat]
__rte_assert_exclusive_lock(&vq->access_lock)
^
../../root/dpdk/lib/eal/include/rte_lock_annotations.h:29:38: note: expanded
from macro '__rte_assert_exclusive_lock'
__attribute__((assert_exclusive_lock(__VA_ARGS__)))
^
1 error generated.
```

OS: CentOS Linux 7
clang: 3.4.2

-- 
You are receiving this mail because:
You are the assignee for the bug.

[PATCH] doc: clarify the existing net/ark guide

2023-02-11 Thread Shepard Siegel
Add detail for the existing Arkville configurations FX0 and FX1.
Corrected minor errors of omission.

Signed-off-by: Shepard Siegel 
---
 doc/guides/nics/ark.rst | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index ba00f14e80..edaa02dc96 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -52,6 +52,10 @@ board. While specific capabilities such as number of physical
 hardware queue-pairs are negotiated; the driver is designed to
 remain constant over a broad and extendable feature set.
 
+* FPGA Vendors Supported: AMD/Xilinx and Intel
+* Number of RX/TX Queue-Pairs: up to 128
+* PCIe Endpoint Technology: Gen3, Gen4, Gen5
+
 Intentionally, Arkville by itself DOES NOT provide common NIC
 capabilities such as offload or receive-side scaling (RSS).
 These capabilities would be viewed as a gate-level "tax" on
@@ -303,6 +307,18 @@ ARK PMD supports the following Arkville RTL PCIe instances 
including:
 * ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
 * ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
 
+Arkville RTL Core Configurations
+-
+
+Arkville's RTL core may be configured by the user with different
+datapath widths to balance throughput against FPGA logic area. The ARK PMD
+has introspection on the RTL core configuration and acts accordingly.
+All Arkville configurations present identical RTL user-facing AXI stream
+interfaces for both AMD/Xilinx and Intel FPGAs.
+
+* ARK-FX0 - 256-bit 32B datapath (PCIe Gen3, Gen4)
+* ARK-FX1 - 512-bit 64B datapath (PCIe Gen3, Gen4, Gen5)
+
 DPDK and Arkville Firmware Versioning
 -
 
@@ -334,6 +350,8 @@ Supported Features
 --
 
 * Dynamic ARK PMD extensions
+* Dynamic per-queue MBUF (re)sizing up to 32KB
+* SR-IOV, VF-based queue-segregation
 * Multiple receive and transmit queues
 * Jumbo frames up to 9K
 * Hardware Statistics
-- 
2.25.1



[PATCH 1/2] net/ark: add new device to PCIe allowlist

2023-02-11 Thread Shepard Siegel
This patch adds the Arkville FX2 device to the PCIe allowlist.

Signed-off-by: Shepard Siegel 
---
 drivers/net/ark/ark_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c654a229f7..b2995427c8 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -99,6 +99,7 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
+   {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1022)},
{.vendor_id = 0, /* sentinel */ },
 };
 
-- 
2.25.1



[PATCH 2/2] doc: update ark guide to include new PCIe device

2023-02-11 Thread Shepard Siegel
Add descriptions of the new FX2 device to the existing devices.

Signed-off-by: Shepard Siegel 
---
 doc/guides/nics/ark.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index edaa02dc96..bbd7419d99 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -306,6 +306,7 @@ ARK PMD supports the following Arkville RTL PCIe instances 
including:
 * ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
 * ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
 * ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
+* ``1d6c:1022`` - AR-ARKA-FX2 [Arkville 128B DPDK Data Mover for Agilex]
 
 Arkville RTL Core Configurations
 -
@@ -318,6 +319,7 @@ interfaces for both AMD/Xilinx and Intel FPGAs.
 
 * ARK-FX0 - 256-bit 32B datapath (PCIe Gen3, Gen4)
 * ARK-FX1 - 512-bit 64B datapath (PCIe Gen3, Gen4, Gen5)
+* ARK-FX2 - 1024-bit 128B datapath (PCIe Gen5x16 Only)
 
 DPDK and Arkville Firmware Versioning
 -
-- 
2.25.1