cxgbe: fix setting wrong MTU

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: 4b2eff452d ("cxgbe: enable jumbo frames")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
This commit is contained in:
Rahul Lakkireddy 2016-01-19 15:47:08 +05:30 committed by Thomas Monjalon
parent 8dca8cc5c6
commit 5a9e303a38
2 changed files with 9 additions and 1 deletions

View File

@ -162,6 +162,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: Fixed setting wrong device MTU.**
Fixed an incorrect device MTU being set due to ethernet header and
CRC lengths being added twice.
* **aesni_mb: Fixed wrong return value when creating a device.**
cryptodev_aesni_mb_init() was returning the device id of the device created,

View File

@ -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