patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Michal Krawczyk <mk@semihalf.com>
To: stable@dpdk.org
Cc: christian.ehrhardt@canonical.com,
	Michal Krawczyk <mk@semihalf.com>,
	Igor Chauskin <igorch@amazon.com>,
	Shai Brandes <shaibran@amazon.com>
Subject: [PATCH 19.11 3/4] net/ena: advertise scattered Rx capability
Date: Fri,  3 Dec 2021 16:08:58 +0100	[thread overview]
Message-ID: <20211203150859.3933-3-mk@semihalf.com> (raw)
In-Reply-To: <20211203150859.3933-1-mk@semihalf.com>

[ upstream commit e2a6d08bef489215ebb77b1d3033875ada757cfa ]

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

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 5f15d55d4..62c15f3c9 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1937,8 +1937,14 @@ static int ena_dev_configure(struct rte_eth_dev *dev)
 
 	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;
 }
 
@@ -1985,6 +1991,7 @@ static uint64_t ena_get_rx_port_offloads(struct ena_adapter *adapter)
 		port_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
 	port_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+	port_offloads |= DEV_RX_OFFLOAD_SCATTER;
 
 	return port_offloads;
 }
-- 
2.25.1


  parent reply	other threads:[~2021-12-03 15:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 15:08 [PATCH 19.11 1/4] net/ena: fix offload capabilities verification Michal Krawczyk
2021-12-03 15:08 ` [PATCH 19.11 2/4] net/ena: fix per-queue offload capabilities Michal Krawczyk
2021-12-03 15:08 ` Michal Krawczyk [this message]
2021-12-03 15:08 ` [PATCH 19.11 4/4] Revert "net/ena: trigger reset on Tx prepare failure" Michal Krawczyk
2021-12-06  8:31   ` Christian Ehrhardt

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=20211203150859.3933-3-mk@semihalf.com \
    --to=mk@semihalf.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=igorch@amazon.com \
    --cc=shaibran@amazon.com \
    --cc=stable@dpdk.org \
    /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).