net/cnxk: fix inline device RQ tag mask
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Tue, 22 Feb 2022 19:35:03 +0000 (01:05 +0530)
committerJerin Jacob <jerinj@marvell.com>
Wed, 23 Feb 2022 16:36:45 +0000 (17:36 +0100)
Fix inline device RQ  tagmask to get packets with receive errors
as type ETHDEV packets to callback handler so that packet buffers
can get freed. Currently only IPsec denied packets get the right
tag mask.

Fixes: ee48f711f3b0 ("common/cnxk: support NIX inline inbound and outbound setup")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_nix_inl.c
drivers/net/cnxk/cnxk_ethdev.c

index 003f972..11a1691 100644 (file)
@@ -584,7 +584,7 @@ roc_nix_inl_dev_rq_get(struct roc_nix_rq *rq)
 
        inl_rq->flow_tag_width = 20;
        /* Special tag mask */
-       inl_rq->tag_mask = 0xFFF00000;
+       inl_rq->tag_mask = rq->tag_mask;
        inl_rq->tt = SSO_TT_ORDERED;
        inl_rq->hwgrp = 0;
        inl_rq->wqe_skip = inl_dev->wqe_skip;
index 0558bc3..a2b2679 100644 (file)
@@ -3,6 +3,8 @@
  */
 #include <cnxk_ethdev.h>
 
+#include <rte_eventdev.h>
+
 static inline uint64_t
 nix_get_rx_offload_capa(struct cnxk_eth_dev *dev)
 {
@@ -597,6 +599,13 @@ cnxk_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,
        rxq_sp->qconf.mp = mp;
 
        if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
+               /* Pass a tagmask used to handle error packets in inline device.
+                * Ethdev rq's tag_mask field will be overwritten later
+                * when sso is setup.
+                */
+               rq->tag_mask =
+                       0x0FF00000 | ((uint32_t)RTE_EVENT_TYPE_ETHDEV << 28);
+
                /* Setup rq reference for inline dev if present */
                rc = roc_nix_inl_dev_rq_get(rq);
                if (rc)