[2/2] net/ena: add support for RX_OFFSET feature

Message ID 20191213133216.23572-3-mk@semihalf.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/ena: add support for Rx offsets |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation fail apply issues

Commit Message

Michal Krawczyk Dec. 13, 2019, 1:32 p.m. UTC
  From: Maciej Bielski <mba@semihalf.com>

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 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit Jan. 10, 2020, 10:32 a.m. UTC | #1
On 12/13/2019 1:32 PM, Michal Krawczyk wrote:
> From: Maciej Bielski <mba@semihalf.com>
> 
> 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>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index f32963558..665afee4f 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -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 */