patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Michal Krawczyk <mk@semihalf.com>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org, upstream@semihalf.com, shaibran@amazon.com,
	ndagan@amazon.com, igorch@amazon.com,
	Michal Krawczyk <mk@semihalf.com>,
	stable@dpdk.org
Subject: [dpdk-stable] [PATCH v3 4/7] net/ena: indicate missing scattered Rx capability
Date: Tue, 19 Oct 2021 12:56:26 +0200	[thread overview]
Message-ID: <20211019105629.11731-5-mk@semihalf.com> (raw)
In-Reply-To: <20211019105629.11731-1-mk@semihalf.com>

ENA can't be forced to always pass single descriptor for the Rx packet.
Even if the passed buffer size is big enough to hold the data, we can't
make assumption that the HW won't use extra descriptor because of
internal optimizations. This assumption may be true, but only for some
of the FW revisions, which may differ depending on the used AWS instance
type.

As the scattered Rx support on the Rx path already exists, the driver
just needs to announce DEV_RX_OFFLOAD_SCATTER capability by turning on
the rte_eth_dev_data::scattered_rx option.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
---
 drivers/net/ena/ena_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 655c53b525..94dbb3164e 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1917,8 +1917,14 @@ static int ena_dev_configure(struct rte_eth_dev *dev)
 		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 	dev->data->dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
+	/* Scattered Rx cannot be turned off in the HW, so this capability must
+	 * be forced.
+	 */
+	dev->data->scattered_rx = 1;
+
 	adapter->tx_selected_offloads = dev->data->dev_conf.txmode.offloads;
 	adapter->rx_selected_offloads = dev->data->dev_conf.rxmode.offloads;
+
 	return 0;
 }
 
@@ -1966,6 +1972,8 @@ static uint64_t ena_get_rx_port_offloads(struct ena_adapter *adapter)
 	if (adapter->offloads.rx_offloads & ENA_RX_RSS_HASH)
 		port_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
+	port_offloads |= DEV_RX_OFFLOAD_SCATTER;
+
 	return port_offloads;
 }
 
-- 
2.25.1


      parent reply	other threads:[~2021-10-19 10:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211014201858.9571-1-mk@semihalf.com>
2021-10-14 20:18 ` [dpdk-stable] [PATCH 1/7] net/ena: fix verification of the offload capabilities Michal Krawczyk
2021-10-14 20:18 ` [dpdk-stable] [PATCH 3/7] net/ena: fix per-queue " Michal Krawczyk
2021-10-14 20:18 ` [dpdk-stable] [PATCH 4/7] net/ena: indicate missing scattered Rx capability Michal Krawczyk
     [not found] ` <20211015162701.16324-1-mk@semihalf.com>
2021-10-15 16:26   ` [dpdk-stable] [PATCH v2 1/7] net/ena: fix verification of the offload capabilities Michal Krawczyk
2021-10-15 16:26   ` [dpdk-stable] [PATCH v2 3/7] net/ena: fix per-queue " Michal Krawczyk
2021-10-15 16:26   ` [dpdk-stable] [PATCH v2 4/7] net/ena: indicate missing scattered Rx capability Michal Krawczyk
     [not found]   ` <20211019105629.11731-1-mk@semihalf.com>
2021-10-19 10:56     ` [dpdk-stable] [PATCH v3 1/7] net/ena: fix verification of the offload capabilities Michal Krawczyk
2021-10-19 10:56     ` [dpdk-stable] [PATCH v3 3/7] net/ena: fix per-queue " Michal Krawczyk
2021-10-19 12:25       ` Ferruh Yigit
2021-10-19 10:56     ` Michal Krawczyk [this message]

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=20211019105629.11731-5-mk@semihalf.com \
    --to=mk@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=igorch@amazon.com \
    --cc=ndagan@amazon.com \
    --cc=shaibran@amazon.com \
    --cc=stable@dpdk.org \
    --cc=upstream@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).