net/bnxt: fix RSS action
[dpdk.git] / drivers / net / ena / ena_ethdev.c
index 0ca4269..68768ca 100644 (file)
@@ -21,7 +21,7 @@
 #include <ena_eth_io_defs.h>
 
 #define DRV_MODULE_VER_MAJOR   2
-#define DRV_MODULE_VER_MINOR   5
+#define DRV_MODULE_VER_MINOR   6
 #define DRV_MODULE_VER_SUBMINOR        0
 
 #define __MERGE_64B_H_L(h, l) (((uint64_t)h << 32) | l)
@@ -583,7 +583,13 @@ static inline void ena_rx_mbuf_prepare(struct ena_ring *rx_ring,
        } else {
                if (unlikely(ena_rx_ctx->l4_csum_err)) {
                        ++rx_stats->l4_csum_bad;
-                       ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
+                       /*
+                        * For the L4 Rx checksum offload the HW may indicate
+                        * bad checksum although it's valid. Because of that,
+                        * we're setting the UNKNOWN flag to let the app
+                        * re-verify the checksum.
+                        */
+                       ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
                } else {
                        ++rx_stats->l4_csum_good;
                        ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
@@ -624,6 +630,8 @@ static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,
 
                if (mbuf->ol_flags & RTE_MBUF_F_TX_IPV6) {
                        ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV6;
+                       /* For the IPv6 packets, DF always needs to be true. */
+                       ena_tx_ctx->df = 1;
                } else {
                        ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV4;
 
@@ -631,7 +639,7 @@ static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,
                        if (mbuf->packet_type &
                                (RTE_PTYPE_L4_NONFRAG
                                 | RTE_PTYPE_INNER_L4_NONFRAG))
-                               ena_tx_ctx->df = true;
+                               ena_tx_ctx->df = 1;
                }
 
                /* check if L4 checksum is needed */
@@ -673,9 +681,11 @@ static int validate_tx_req_id(struct ena_ring *tx_ring, u16 req_id)
        }
 
        if (tx_info)
-               PMD_TX_LOG(ERR, "tx_info doesn't have valid mbuf\n");
+               PMD_TX_LOG(ERR, "tx_info doesn't have valid mbuf. queue %d:%d req_id %u\n",
+                       tx_ring->port_id, tx_ring->id, req_id);
        else
-               PMD_TX_LOG(ERR, "Invalid req_id: %hu\n", req_id);
+               PMD_TX_LOG(ERR, "Invalid req_id: %hu in queue %d:%d\n",
+                       req_id, tx_ring->port_id, tx_ring->id);
 
        /* Trigger device reset */
        ++tx_ring->tx_stats.bad_req_id;
@@ -1949,6 +1959,13 @@ ena_set_queues_placement_policy(struct ena_adapter *adapter,
                return 0;
        }
 
+       if (adapter->dev_mem_base == NULL) {
+               PMD_DRV_LOG(ERR,
+                       "LLQ is advertised as supported, but device doesn't expose mem bar\n");
+               ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
+               return 0;
+       }
+
        rc = ena_com_config_dev_mode(ena_dev, llq, llq_default_configurations);
        if (unlikely(rc)) {
                PMD_INIT_LOG(WARNING,
@@ -1961,13 +1978,6 @@ ena_set_queues_placement_policy(struct ena_adapter *adapter,
        if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST)
                return 0;
 
-       if (!adapter->dev_mem_base) {
-               PMD_DRV_LOG(ERR,
-                       "Unable to access LLQ BAR resource. Fallback to host mode policy.\n");
-               ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
-               return 0;
-       }
-
        ena_dev->mem_bar = adapter->dev_mem_base;
 
        return 0;