DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michal Krawczyk <mk@semihalf.com>
To: dev@dpdk.org
Cc: gtzalik@amazon.com, mw@semihalf.com, matua@amazon.com,
	mba@semihalf.com, igorch@amazon.com,
	Michal Krawczyk <mk@semihalf.com>
Subject: [dpdk-dev] [PATCH 2/2] net/ena: add support for RX_OFFSET feature
Date: Fri, 13 Dec 2019 14:32:16 +0100	[thread overview]
Message-ID: <20191213133216.23572-3-mk@semihalf.com> (raw)
In-Reply-To: <20191213133216.23572-1-mk@semihalf.com>

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(-)

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 */
-- 
2.20.1


  parent reply	other threads:[~2019-12-13 13:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 13:32 [dpdk-dev] [PATCH 0/2] net/ena: add support for Rx offsets Michal Krawczyk
2019-12-13 13:32 ` [dpdk-dev] [PATCH 1/2] net/ena: upgrade HAL for new HW features Michal Krawczyk
2019-12-13 16:34   ` Stephen Hemminger
2019-12-13 20:01     ` Michał Krawczyk
2020-01-09 14:27       ` Ferruh Yigit
2020-01-09 15:26         ` Michał Krawczyk
2020-01-09 14:30   ` Ferruh Yigit
2020-01-09 15:39     ` [dpdk-dev] [PATCH v2 " Michal Krawczyk
2020-01-10  9:04       ` Ferruh Yigit
2020-01-10  9:39         ` Michał Krawczyk
2020-01-10 10:32       ` Ferruh Yigit
2019-12-13 13:32 ` Michal Krawczyk [this message]
2020-01-10 10:32   ` [dpdk-dev] [PATCH 2/2] net/ena: add support for RX_OFFSET feature Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191213133216.23572-3-mk@semihalf.com \
    --to=mk@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=gtzalik@amazon.com \
    --cc=igorch@amazon.com \
    --cc=matua@amazon.com \
    --cc=mba@semihalf.com \
    --cc=mw@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).