Skip to contentSkip to conversation

cxgbe: Bug fixes for CXGBE PMD

PATCH Applied Rahul Lakkireddy 2 participants 4 messages Jan 19, 2016 – Feb 12, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

cover cxgbe: Bug fixes for CXGBE PMD

Patch 1 fixes a segfault due to an incorrect size allocated for each entry in the rss table.

Patch 2 fixes an issue with setting wrong device mtu.

Rahul Lakkireddy (2):
cxgbe: fix segfault due to incorrect size allocated for rss table
cxgbe: fix setting wrong device mtu

 doc/guides/rel_notes/release_2_3.rst | 11 +++++++++++
 drivers/net/cxgbe/cxgbe_main.c       |  7 +++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
Signature · 1 line
2.5.3
#1 lore raw

PATCH 1/2 cxgbe: fix segfault due to incorrect size allocated for rss table

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")
---
 doc/guides/rel_notes/release_2_3.rst | 6 ++++++
 drivers/net/cxgbe/cxgbe_main.c       | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_2_3.rst +6 -0
index 99de186..4c5843d 100644
@@ -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
 ~~~~~~~~~
drivers/net/cxgbe/cxgbe_main.c +1 -1
index aff23d0..632abc2 100644
@@ -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;
 	}
Signature · 1 line
2.5.3
#2 lore raw

PATCH 2/2 cxgbe: fix setting wrong device mtu

In reply to Rahul Lakkireddy

max_rx_pkt_len already includes ETHER_HDR_LEN and ETHER_CRC_LEN for the mtu. But, the firmware also adds ETHER_HDR_LEN and ETHER_CRC_LEN to the mtu specified. Fix by subtracting these values from the mtu before passing it to firmware.

Fixes 4b2eff452d2e ("cxgbe: enable jumbo frames")
---
 doc/guides/rel_notes/release_2_3.rst | 5 +++++
 drivers/net/cxgbe/cxgbe_main.c       | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_2_3.rst +5 -0
index 4c5843d..15cc572 100644
@@ -21,6 +21,11 @@ Drivers
   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.
 
+* **cxgbe: fix setting wrong device mtu**
+
+  Fixed an incorrect device mtu being set due to ethernet header and
+  crc lengths being added twice.
+
 
 Libraries
 ~~~~~~~~~
drivers/net/cxgbe/cxgbe_main.c +4 -1
index 632abc2..1683ca5 100644
@@ -855,7 +855,10 @@ int link_start(struct port_info *pi)
 {
 	struct adapter *adapter = pi->adapter;
 	int ret;
-	unsigned int mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len;
+	unsigned int mtu;
+
+	mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
+	      (ETHER_HDR_LEN + ETHER_CRC_LEN);
 
 	/*
 	 * We do not set address filters and promiscuity here, the stack does
Signature · 1 line
2.5.3
#3 lore raw
In reply to Rahul Lakkireddy
Quoted 5 lines · Rahul Lakkireddy

Patch 1 fixes a segfault due to an incorrect size allocated for each entry in the rss table.

Patch 2 fixes an issue with setting wrong device mtu.

Quoted 11 lines

Rahul Lakkireddy (2):
cxgbe: fix segfault due to incorrect size allocated for rss table
cxgbe: fix setting wrong device mtu

 doc/guides/rel_notes/release_2_3.rst | 11 +++++++++++
 drivers/net/cxgbe/cxgbe_main.c       |  7 +++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
Signature · 1 line
2.5.3

Applied to dpdk-next-net/rel_16_04

Thanks,
/Bruce