Skip to content

Commit e791380

Browse files
jallen93davem330
authored andcommitted
ibmvnic: Revert to previous mtu when unsupported value requested
If we request an unsupported mtu value, the vnic server will suggest a different value. Currently we take the suggested value without question and login with that value. However, the behavior doesn't seem completely sane as attempting to change the mtu to some specific value will change the mtu to some completely different value most of the time. This patch fixes the issue by logging in with the previously used mtu value and printing an error message saying that the given mtu is unsupported. Signed-off-by: John Allen <[email protected]> Reviewed-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 896d869 commit e791380

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3623,7 +3623,17 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq,
36233623
*req_value,
36243624
(long int)be64_to_cpu(crq->request_capability_rsp.
36253625
number), name);
3626-
*req_value = be64_to_cpu(crq->request_capability_rsp.number);
3626+
3627+
if (be16_to_cpu(crq->request_capability_rsp.capability) ==
3628+
REQ_MTU) {
3629+
pr_err("mtu of %llu is not supported. Reverting.\n",
3630+
*req_value);
3631+
*req_value = adapter->fallback.mtu;
3632+
} else {
3633+
*req_value =
3634+
be64_to_cpu(crq->request_capability_rsp.number);
3635+
}
3636+
36273637
ibmvnic_send_req_caps(adapter, 1);
36283638
return;
36293639
default:

0 commit comments

Comments
 (0)