Commit f39f0d1e authored by Thomas Falcon's avatar Thomas Falcon Committed by David S. Miller

ibmvnic: Fix initial MTU settings

In the current driver, the MTU is set to the maximum value
capable for the backing device. This decision turned out to
be a mistake as it led to confusion among users. The expected
initial MTU value used for other IBM vNIC capable operating
systems is 1500, with the maximum value (9000) reserved for
when Jumbo frames are enabled. This patch sets the MTU to
the default value for a net device.

It also corrects a discrepancy between MTU values received from
firmware, which includes the ethernet header length, and net
device MTU values.

Finally, it removes redundant min/max MTU assignments after device
initialization.
Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a60ced99
...@@ -1497,7 +1497,7 @@ static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry) ...@@ -1497,7 +1497,7 @@ static void init_sub_crqs(struct ibmvnic_adapter *adapter, int retry)
adapter->req_rx_queues = adapter->opt_rx_comp_queues; adapter->req_rx_queues = adapter->opt_rx_comp_queues;
adapter->req_rx_add_queues = adapter->max_rx_add_queues; adapter->req_rx_add_queues = adapter->max_rx_add_queues;
adapter->req_mtu = adapter->max_mtu; adapter->req_mtu = adapter->netdev->mtu + ETH_HLEN;
} }
total_queues = adapter->req_tx_queues + adapter->req_rx_queues; total_queues = adapter->req_tx_queues + adapter->req_rx_queues;
...@@ -2627,12 +2627,12 @@ static void handle_query_cap_rsp(union ibmvnic_crq *crq, ...@@ -2627,12 +2627,12 @@ static void handle_query_cap_rsp(union ibmvnic_crq *crq,
break; break;
case MIN_MTU: case MIN_MTU:
adapter->min_mtu = be64_to_cpu(crq->query_capability.number); adapter->min_mtu = be64_to_cpu(crq->query_capability.number);
netdev->min_mtu = adapter->min_mtu; netdev->min_mtu = adapter->min_mtu - ETH_HLEN;
netdev_dbg(netdev, "min_mtu = %lld\n", adapter->min_mtu); netdev_dbg(netdev, "min_mtu = %lld\n", adapter->min_mtu);
break; break;
case MAX_MTU: case MAX_MTU:
adapter->max_mtu = be64_to_cpu(crq->query_capability.number); adapter->max_mtu = be64_to_cpu(crq->query_capability.number);
netdev->max_mtu = adapter->max_mtu; netdev->max_mtu = adapter->max_mtu - ETH_HLEN;
netdev_dbg(netdev, "max_mtu = %lld\n", adapter->max_mtu); netdev_dbg(netdev, "max_mtu = %lld\n", adapter->max_mtu);
break; break;
case MAX_MULTICAST_FILTERS: case MAX_MULTICAST_FILTERS:
...@@ -3657,9 +3657,7 @@ static void handle_crq_init_rsp(struct work_struct *work) ...@@ -3657,9 +3657,7 @@ static void handle_crq_init_rsp(struct work_struct *work)
goto task_failed; goto task_failed;
netdev->real_num_tx_queues = adapter->req_tx_queues; netdev->real_num_tx_queues = adapter->req_tx_queues;
netdev->mtu = adapter->req_mtu; netdev->mtu = adapter->req_mtu - ETH_HLEN;
netdev->min_mtu = adapter->min_mtu;
netdev->max_mtu = adapter->max_mtu;
if (adapter->failover) { if (adapter->failover) {
adapter->failover = false; adapter->failover = false;
...@@ -3799,7 +3797,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -3799,7 +3797,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
} }
netdev->real_num_tx_queues = adapter->req_tx_queues; netdev->real_num_tx_queues = adapter->req_tx_queues;
netdev->mtu = adapter->req_mtu; netdev->mtu = adapter->req_mtu - ETH_HLEN;
rc = register_netdev(netdev); rc = register_netdev(netdev);
if (rc) { if (rc) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment