From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Fontenot Subject: Re: [PATCH net v2 2/3] ibmvnic: Revert to previous mtu when unsupported value requested Date: Fri, 19 Jan 2018 13:23:21 -0600 Message-ID: <85327b6c-e8a2-0c6c-9c2d-8f17f8a1a929@linux.vnet.ibm.com> References: <97de0d55-5b81-40f9-c3b8-0d28e4d80539@linux.vnet.ibm.com> <5c982d18-8ca9-5c15-4e35-688797a5658c@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Thomas Falcon To: John Allen , netdev@vger.kernel.org Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58350 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755949AbeASTX0 (ORCPT ); Fri, 19 Jan 2018 14:23:26 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0JJLkIH100568 for ; Fri, 19 Jan 2018 14:23:26 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fkn1pv99u-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 19 Jan 2018 14:23:25 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Jan 2018 14:23:24 -0500 In-Reply-To: <5c982d18-8ca9-5c15-4e35-688797a5658c@linux.vnet.ibm.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/18/2018 04:27 PM, John Allen wrote: > 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 Reviewed-by: Nathan Fontenot > --- > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c > index f8f1396..bb56460 100644 > --- a/drivers/net/ethernet/ibm/ibmvnic.c > +++ b/drivers/net/ethernet/ibm/ibmvnic.c > @@ -3608,7 +3608,17 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, > *req_value, > (long int)be64_to_cpu(crq->request_capability_rsp. > number), name); > - *req_value = be64_to_cpu(crq->request_capability_rsp.number); > + > + if (be16_to_cpu(crq->request_capability_rsp.capability) == > + REQ_MTU) { > + pr_err("mtu of %llu is not supported. Reverting.\n", > + *req_value); > + *req_value = adapter->fallback.mtu; > + } else { > + *req_value = > + be64_to_cpu(crq->request_capability_rsp.number); > + } > + > ibmvnic_send_req_caps(adapter, 1); > return; > default: >