net/ena: support Rx offset
authorMaciej Bielski <mba@semihalf.com>
Fri, 13 Dec 2019 13:32:16 +0000 (14:32 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:01 +0000 (19:46 +0100)
Allow the data in the first buffer to be shifted by `pkt_offset` after
the header room. The offset value is provided by `ena_rx_ctx`.

As part of this update, the version of the ENA was upgraded to v2.0.3.

Signed-off-by: Maciej Bielski <mba@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
drivers/net/ena/ena_ethdev.c

index f329635..665afee 100644 (file)
@@ -27,7 +27,7 @@
 
 #define DRV_MODULE_VER_MAJOR   2
 #define DRV_MODULE_VER_MINOR   0
-#define DRV_MODULE_VER_SUBMINOR        2
+#define DRV_MODULE_VER_SUBMINOR        3
 
 #define ENA_IO_TXQ_IDX(q)      (2 * (q))
 #define ENA_IO_RXQ_IDX(q)      (2 * (q) + 1)
@@ -409,6 +409,9 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev)
                        ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT);
        host_info->num_cpus = rte_lcore_count();
 
+       host_info->driver_supported_features =
+               ENA_ADMIN_HOST_INFO_RX_OFFSET_MASK;
+
        rc = ena_com_set_host_attributes(ena_dev);
        if (rc) {
                if (rc == -ENA_COM_UNSUPPORTED)
@@ -2013,6 +2016,7 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                ena_rx_ctx.max_bufs = rx_ring->sgl_size;
                ena_rx_ctx.ena_bufs = rx_ring->ena_bufs;
                ena_rx_ctx.descs = 0;
+               ena_rx_ctx.pkt_offset = 0;
                /* receive packet context */
                rc = ena_com_rx_pkt(rx_ring->ena_com_io_cq,
                                    rx_ring->ena_com_io_sq,
@@ -2048,6 +2052,7 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                                mbuf->nb_segs = ena_rx_ctx.descs;
                                mbuf->port = rx_ring->port_id;
                                mbuf->pkt_len = 0;
+                               mbuf->data_off += ena_rx_ctx.pkt_offset;
                                mbuf_head = mbuf;
                        } else {
                                /* for multi-segment pkts create mbuf chain */