patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Andrew Boyer <andrew.boyer@amd.com>
To: <dev@dpdk.org>
Cc: Akshay Dorwat <akshay.dorwat@amd.com>, <cardigliano@ntop.org>,
	<stable@dpdk.org>, Andrew Boyer <andrew.boyer@amd.com>
Subject: [PATCH 07/13] net/ionic: fix RSS query routine
Date: Fri, 2 Feb 2024 11:32:32 -0800	[thread overview]
Message-ID: <20240202193238.62669-8-andrew.boyer@amd.com> (raw)
In-Reply-To: <20240202193238.62669-1-andrew.boyer@amd.com>

From: Akshay Dorwat <akshay.dorwat@amd.com>

The routine that copies out the RSS config can't use memcpy() because
'reta_conf->reta' is an array of uint16_t while 'lif->rss_ind_tbl' is
an array of uint8_t. Instead, copy the values individually.

Fixes: 22e7171bc63b ("net/ionic: support RSS")
Cc: cardigliano@ntop.org
Cc: stable@dpdk.org

Signed-off-by: Akshay Dorwat <akshay.dorwat@amd.com>
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
 drivers/net/ionic/ionic_ethdev.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 340fd0cd59..008e50e0b9 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -561,7 +561,7 @@ ionic_dev_rss_reta_query(struct rte_eth_dev *eth_dev,
 	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
 	struct ionic_adapter *adapter = lif->adapter;
 	struct ionic_identity *ident = &adapter->ident;
-	int i, num;
+	int i, j, num;
 	uint16_t tbl_sz = rte_le_to_cpu_16(ident->lif.eth.rss_ind_tbl_sz);
 
 	IONIC_PRINT_CALL();
@@ -582,9 +582,10 @@ ionic_dev_rss_reta_query(struct rte_eth_dev *eth_dev,
 	num = reta_size / RTE_ETH_RETA_GROUP_SIZE;
 
 	for (i = 0; i < num; i++) {
-		memcpy(reta_conf->reta,
-			&lif->rss_ind_tbl[i * RTE_ETH_RETA_GROUP_SIZE],
-			RTE_ETH_RETA_GROUP_SIZE);
+		for (j = 0; j < RTE_ETH_RETA_GROUP_SIZE; j++) {
+			reta_conf->reta[j] =
+				lif->rss_ind_tbl[(i * RTE_ETH_RETA_GROUP_SIZE) + j];
+		}
 		reta_conf++;
 	}
 
-- 
2.17.1


  parent reply	other threads:[~2024-02-02 19:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240202193238.62669-1-andrew.boyer@amd.com>
2024-02-02 19:32 ` [PATCH 04/13] net/ionic: fix missing volatile type for cqe pointers Andrew Boyer
2024-02-03  4:26   ` Stephen Hemminger
2024-02-05 13:33     ` Boyer, Andrew
2024-02-02 19:32 ` Andrew Boyer [this message]
2024-02-02 19:32 ` [PATCH 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 04/13] net/ionic: fix missing volatile type for cqe pointers Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer
     [not found] ` <20240207031317.32293-1-andrew.boyer@amd.com>
2024-02-07  3:13   ` [PATCH v3 04/13] net/ionic: fix missing volatile type for cqe pointers Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer

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=20240202193238.62669-8-andrew.boyer@amd.com \
    --to=andrew.boyer@amd.com \
    --cc=akshay.dorwat@amd.com \
    --cc=cardigliano@ntop.org \
    --cc=dev@dpdk.org \
    --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).