[dpdk-dev,1/2] cxgbe: fix segfault due to incorrect size allocated for rss table
Commit Message
The size of each entry in the port's rss table is actually 2 bytes
and not 1 byte. A segfault occurs when accessing part of port 0's rss
table because it gets overwritten by subsequent port 1's part of the
rss table. Fix by setting the size of each entry appropriately.
Fixes: 92c8a63223e5 ("cxgbe: add device configuration and Rx support")
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
---
doc/guides/rel_notes/release_2_3.rst | 6 ++++++
drivers/net/cxgbe/cxgbe_main.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
@@ -15,6 +15,12 @@ EAL
Drivers
~~~~~~~
+* **cxgbe: fix segfault due to incorrect size allocated for rss table**
+
+ Fixed a segfault that occurs when accessing part of port 0's rss
+ table that gets overwritten by subsequent port 1's part of the rss
+ table due to incorrect size allocated for each entry in the table.
+
Libraries
~~~~~~~~~
@@ -355,7 +355,7 @@ static int init_rss(struct adapter *adap)
for_each_port(adap, i) {
struct port_info *pi = adap2pinfo(adap, i);
- pi->rss = rte_zmalloc(NULL, pi->rss_size, 0);
+ pi->rss = rte_zmalloc(NULL, pi->rss_size * sizeof(u16), 0);
if (!pi->rss)
return -ENOMEM;
}