]> git.droids-corp.org - dpdk.git/commitdiff
cxgbe: fix allocated size for RSS table
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Tue, 19 Jan 2016 10:17:07 +0000 (15:47 +0530)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 15:51:19 +0000 (16:51 +0100)
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_16_04.rst
drivers/net/cxgbe/cxgbe_main.c

index 6ecfd3f4e30b4a656aef1df4c1aae9c423bedf46..4abe246d805b95924154346027125588afe15c4d 100644 (file)
@@ -156,6 +156,12 @@ Drivers
   Fixed issue in ethdev library that the structure for setting
   fdir's mask and flow entry was not consistent in byte ordering.
 
+* **cxgbe: Fixed crash 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.
+
 * **aesni_mb: Fixed wrong return value when creating a device.**
 
   cryptodev_aesni_mb_init() was returning the device id of the device created,
index 649b941cbfe312bbbc6ce1352c3578211a43eef4..552b11f2290ece1c78a17e564dce4a76cf925cbb 100644 (file)
@@ -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;
        }