Skip to content

Commit

Permalink
net/ionic: fix RSS query
Browse files Browse the repository at this point in the history
[ upstream commit 1df32bfd0317a3c8aed1e91b51ca2aa8317812e4 ]

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: 22e7171 ("net/ionic: support RSS")

Signed-off-by: Akshay Dorwat <akshay.dorwat@amd.com>
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
  • Loading branch information
Akshay Dorwat authored and bluca committed Mar 7, 2024
1 parent e15d5a0 commit 64baeef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Ajit Khaparde <ajit.khaparde@broadcom.com>
Akash Saxena <akash.saxena@caviumnetworks.com>
Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Akhil Goyal <gakhil@marvell.com> <akhil.goyal@nxp.com>
Akshay Dorwat <akshay.dorwat@amd.com>
Alain Leon <xerebz@gmail.com>
Alan Carew <alan.carew@intel.com>
Alan Dewar <alan.dewar@att.com> <adewar@brocade.com>
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/ionic/ionic_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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++;
}

Expand Down

0 comments on commit 64baeef

Please sign in to comment.