From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 04256A04F1; Fri, 13 Dec 2019 14:33:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D54951BF72; Fri, 13 Dec 2019 14:32:56 +0100 (CET) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id A6F031BF6D for ; Fri, 13 Dec 2019 14:32:53 +0100 (CET) Received: by mail-lj1-f195.google.com with SMTP id e28so2634817ljo.9 for ; Fri, 13 Dec 2019 05:32:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8/IWSXeRZhV1ukzto+IA3JkUVnRFBQg9Ktt0L6Uab5s=; b=XP68TzdlKPTWYioLULzfLdfb6QcindPhkYF2c5oA6YabHU1c2q9NC5gTx6uOAehGja jHqMqg57nUNL90FTRoOV+JjYLCnmxDIlWFPt6UsPo0GeIdplIXucHLCUqGjQxzDhDCTs RopHtBoGsBLYWcDoq04/F0P0BSRSqS1ILImziaCcU03qxRZBdFElLCr2cPl/SZsiuX/P Sd1FdmLv4ak34LiY0Dcvm1uroiQEDJIHND75rvfP+sD7u58CJHeAyOfBuIR90pPk/HIT K77l9WiVimtNTF1o6FOAUSWZqvw1CK8KjPIS5Qv/hCaRSQS246MqR/j5w2Cft4bBGrRB TL0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8/IWSXeRZhV1ukzto+IA3JkUVnRFBQg9Ktt0L6Uab5s=; b=bWK29JADOsGOYCgJ/EF4hK7RrSOTXjNfFj/2nj0FOyXVUJFritq3QUys+gPSMVSh+6 MLxIDu0PW+wXgZ/GoHPvIvsdHkA2GmMFWB/gqR98KiNPL4g4iJAzzC0afeJ45E3a9jfv ZKpQJdICFdFwc8RsXTMB4NxFTiVFbwHuhg9dR38R8tgeu9EpvnB40Q02f9WZWJIhJIV2 A9IPiVG6zen01EFQUDQjtPBGaSIfZgS0B45C7zTu/h/TfxA1fmMqejZgFrE5qPq6tXOI EBAIS0GHsdYq9VqyLC93Vnr0M9B5vfOSi/90acIpy+RXbzJXFa62w0TEgHOhlwewCU78 sEog== X-Gm-Message-State: APjAAAXB1tYXbYLfpcjQkbjZzjluI9cHHuIUNuoA4Nq03DN1uef35bsV 5H7h8tYhVmN6QPiDmadPiZuc/bSOuWM= X-Google-Smtp-Source: APXvYqxG6ra4J915pUkZfCGQh7lRQeG6thsjtebrlib1wP3vyoWDqPZ0VAoks+k54hefUVON+uRKEA== X-Received: by 2002:a2e:2a01:: with SMTP id q1mr9404864ljq.171.1576243973037; Fri, 13 Dec 2019 05:32:53 -0800 (PST) Received: from mkPC.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id 204sm3154411lfj.47.2019.12.13.05.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2019 05:32:52 -0800 (PST) From: Michal Krawczyk To: dev@dpdk.org Cc: gtzalik@amazon.com, mw@semihalf.com, matua@amazon.com, mba@semihalf.com, igorch@amazon.com, Michal Krawczyk Date: Fri, 13 Dec 2019 14:32:16 +0100 Message-Id: <20191213133216.23572-3-mk@semihalf.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191213133216.23572-1-mk@semihalf.com> References: <20191213133216.23572-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] net/ena: add support for RX_OFFSET feature X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Maciej Bielski 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 Acked-by: Michal Krawczyk --- 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