net/octeontx2: fix packet type parsing disabled by default
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Sat, 23 Nov 2019 08:58:31 +0000 (14:28 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 26 Nov 2019 17:05:15 +0000 (18:05 +0100)
Enable packet type parsing by default, only disable when
`rte_eth_dev_set_ptypes()` is called with ptype_mask as 0.
This would enable applications that are dependent on packet type parsing
like l3fwd.

Also this patch preserves configuration set by `rte_eth_dev_set_ptypes`
across multiple calls of `rte_eth_dev_configure()`

Fixes: d2706e15e6fb ("net/octeontx2: support reduced set of packet types")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/net/octeontx2/otx2_ethdev.c
drivers/net/octeontx2/otx2_ethdev.h
drivers/net/octeontx2/otx2_lookup.c

index ddab3aa..eaf7ba9 100644 (file)
@@ -622,6 +622,9 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
        if ((dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP))
                flags |= NIX_RX_OFFLOAD_TSTAMP_F;
 
+       if (!dev->ptype_disable)
+               flags |= NIX_RX_OFFLOAD_PTYPE_F;
+
        return flags;
 }
 
@@ -2168,6 +2171,7 @@ otx2_eth_dev_init(struct rte_eth_dev *eth_dev)
 
        dev->configured = 0;
        dev->drv_inited = true;
+       dev->ptype_disable = 0;
        dev->base = dev->bar2 + (RVU_BLOCK_ADDR_NIX0 << 20);
        dev->lmt_addr = dev->bar2 + (RVU_BLOCK_ADDR_LMT << 20);
 
index eb16263..987e760 100644 (file)
@@ -276,6 +276,7 @@ struct otx2_eth_dev {
        uint8_t configured_cints;
        uint8_t configured_nb_rx_qs;
        uint8_t configured_nb_tx_qs;
+       uint8_t ptype_disable;
        uint16_t nix_msixoff;
        uintptr_t base;
        uintptr_t lmt_addr;
index 17c44e2..bcf2ff4 100644 (file)
@@ -67,10 +67,13 @@ otx2_nix_ptypes_set(struct rte_eth_dev *eth_dev, uint32_t ptype_mask)
 {
        struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
 
-       if (ptype_mask)
+       if (ptype_mask) {
                dev->rx_offload_flags |= NIX_RX_OFFLOAD_PTYPE_F;
-       else
+               dev->ptype_disable = 0;
+       } else {
                dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_PTYPE_F;
+               dev->ptype_disable = 1;
+       }
 
        otx2_eth_set_rx_function(eth_dev);