]> git.droids-corp.org - dpdk.git/commitdiff
common/cnxk: use computed value for WQE skip
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Thu, 16 Jun 2022 09:24:09 +0000 (14:54 +0530)
committerJerin Jacob <jerinj@marvell.com>
Mon, 20 Jun 2022 17:15:15 +0000 (19:15 +0200)
Use computed value for WQE skip instead of a hard-coded value.
WQE skip needs to be number of 128B lines to accommodate rte_mbuf.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
drivers/common/cnxk/roc_nix_inl.h
drivers/common/cnxk/roc_nix_inl_priv.h
drivers/event/cnxk/cnxk_eventdev_adptr.c
drivers/net/cnxk/cnxk_ethdev_sec.c

index b1b4c5b471aff70067fa95b825ab4b38d530fcac..c7b1817d7bed51ed61d222906c17602df8ddb2b3 100644 (file)
@@ -131,7 +131,7 @@ struct roc_nix_inl_dev {
        uint16_t channel;
        uint16_t chan_mask;
        bool attach_cptlf;
-       bool wqe_skip;
+       uint16_t wqe_skip;
        uint8_t spb_drop_pc;
        uint8_t lpb_drop_pc;
        bool set_soft_exp_poll;
index d61c7b2ecd46801b331c1406c4658868bf487deb..a775efc637bc36160d0bc72308816249cdc6d707 100644 (file)
@@ -84,7 +84,7 @@ struct nix_inl_dev {
        uint32_t ipsec_in_max_spi;
        uint32_t inb_spi_mask;
        bool attach_cptlf;
-       bool wqe_skip;
+       uint16_t wqe_skip;
        bool ts_ena;
 };
 
index 586a7751e24caa4612b15127b5366fb5d361c703..ef711f7407bd36139ee360aeabf99e1c4b7fd9eb 100644 (file)
@@ -125,6 +125,7 @@ cnxk_sso_rxq_enable(struct cnxk_eth_dev *cnxk_eth_dev, uint16_t rq_id,
 {
        struct roc_nix *nix = &cnxk_eth_dev->nix;
        struct roc_nix_rq *rq;
+       uint16_t wqe_skip;
        int rc;
 
        rq = &cnxk_eth_dev->rqs[rq_id];
@@ -132,7 +133,9 @@ cnxk_sso_rxq_enable(struct cnxk_eth_dev *cnxk_eth_dev, uint16_t rq_id,
        rq->tt = ev->sched_type;
        rq->hwgrp = ev->queue_id;
        rq->flow_tag_width = 20;
-       rq->wqe_skip = 1;
+       wqe_skip = RTE_ALIGN_CEIL(sizeof(struct rte_mbuf), ROC_CACHE_LINE_SZ);
+       wqe_skip = wqe_skip / ROC_CACHE_LINE_SZ;
+       rq->wqe_skip = wqe_skip;
        rq->tag_mask = (port_id & 0xF) << 20;
        rq->tag_mask |= (((port_id >> 4) & 0xF) | (RTE_EVENT_TYPE_ETHDEV << 4))
                        << 24;
index d01ebb4c96fa98faf44ee4b68876c31240ff326d..1de345439843c15948fd3cc841eff961b630488a 100644 (file)
@@ -264,6 +264,7 @@ cnxk_nix_inl_dev_probe(struct rte_pci_driver *pci_drv,
        char name[CNXK_NIX_INL_DEV_NAME_LEN];
        struct roc_nix_inl_dev *inl_dev;
        const struct rte_memzone *mz;
+       uint16_t wqe_skip;
        int rc = -ENOMEM;
 
        RTE_SET_USED(pci_drv);
@@ -295,7 +296,9 @@ cnxk_nix_inl_dev_probe(struct rte_pci_driver *pci_drv,
 
        inl_dev->attach_cptlf = true;
        /* WQE skip is one for DPDK */
-       inl_dev->wqe_skip = true;
+       wqe_skip = RTE_ALIGN_CEIL(sizeof(struct rte_mbuf), ROC_CACHE_LINE_SZ);
+       wqe_skip = wqe_skip / ROC_CACHE_LINE_SZ;
+       inl_dev->wqe_skip = wqe_skip;
        inl_dev->set_soft_exp_poll = true;
        rc = roc_nix_inl_dev_init(inl_dev);
        if (rc) {