* [dpdk-dev] [PATCH 1/2] cxgbe: fix segfault due to incorrect size allocated for rss table
2016-01-19 10:17 [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD Rahul Lakkireddy
@ 2016-01-19 10:17 ` Rahul Lakkireddy
2016-01-19 10:17 ` [dpdk-dev] [PATCH 2/2] cxgbe: fix setting wrong device mtu Rahul Lakkireddy
2016-02-12 11:55 ` [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD Bruce Richardson
2 siblings, 0 replies; 4+ messages in thread
From: Rahul Lakkireddy @ 2016-01-19 10:17 UTC (permalink / raw)
To: dev; +Cc: Felix Marti, Kumar Sanghvi, Nirranjan Kirubaharan
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(-)
diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst
index 99de186..4c5843d 100644
--- a/doc/guides/rel_notes/release_2_3.rst
+++ b/doc/guides/rel_notes/release_2_3.rst
@@ -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
~~~~~~~~~
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index aff23d0..632abc2 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -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;
}
--
2.5.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] cxgbe: fix setting wrong device mtu
2016-01-19 10:17 [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD Rahul Lakkireddy
2016-01-19 10:17 ` [dpdk-dev] [PATCH 1/2] cxgbe: fix segfault due to incorrect size allocated for rss table Rahul Lakkireddy
@ 2016-01-19 10:17 ` Rahul Lakkireddy
2016-02-12 11:55 ` [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD Bruce Richardson
2 siblings, 0 replies; 4+ messages in thread
From: Rahul Lakkireddy @ 2016-01-19 10:17 UTC (permalink / raw)
To: dev; +Cc: Felix Marti, Kumar Sanghvi, Nirranjan Kirubaharan
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")
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 | 5 +++++
drivers/net/cxgbe/cxgbe_main.c | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst
index 4c5843d..15cc572 100644
--- a/doc/guides/rel_notes/release_2_3.rst
+++ b/doc/guides/rel_notes/release_2_3.rst
@@ -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
~~~~~~~~~
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 632abc2..1683ca5 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -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
--
2.5.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD
2016-01-19 10:17 [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD Rahul Lakkireddy
2016-01-19 10:17 ` [dpdk-dev] [PATCH 1/2] cxgbe: fix segfault due to incorrect size allocated for rss table Rahul Lakkireddy
2016-01-19 10:17 ` [dpdk-dev] [PATCH 2/2] cxgbe: fix setting wrong device mtu Rahul Lakkireddy
@ 2016-02-12 11:55 ` Bruce Richardson
2 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2016-02-12 11:55 UTC (permalink / raw)
To: Rahul Lakkireddy; +Cc: dev, Felix Marti, Nirranjan Kirubaharan, Kumar Sanghvi
On Tue, Jan 19, 2016 at 03:47:06PM +0530, Rahul Lakkireddy wrote:
> 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(-)
>
> --
> 2.5.3
>
Applied to dpdk-next-net/rel_16_04
Thanks,
/Bruce
^ permalink raw reply [flat|nested] 4+ messages in thread