netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: John Allen <jallen@linux.vnet.ibm.com>, netdev@vger.kernel.org
Cc: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
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	[thread overview]
Message-ID: <85327b6c-e8a2-0c6c-9c2d-8f17f8a1a929@linux.vnet.ibm.com> (raw)
In-Reply-To: <5c982d18-8ca9-5c15-4e35-688797a5658c@linux.vnet.ibm.com>



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 <jallen@linux.vnet.ibm.com>

Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

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

  reply	other threads:[~2018-01-19 19:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 22:25 [PATCH net v2 0/3] ibmvnic: Reset behavior fixes John Allen
2018-01-18 22:26 ` [PATCH net v2 1/3] ibmvnic: Modify buffer size and number of queues on failover John Allen
2018-01-19 19:22   ` Nathan Fontenot
2018-01-18 22:27 ` [PATCH net v2 2/3] ibmvnic: Revert to previous mtu when unsupported value requested John Allen
2018-01-19 19:23   ` Nathan Fontenot [this message]
2018-01-18 22:27 ` [PATCH net v2 3/3] ibmvnic: Allocate and request vpd in init_resources John Allen
2018-01-19 19:24   ` Nathan Fontenot
2018-01-22 20:47 ` [PATCH net v2 0/3] ibmvnic: Reset behavior fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85327b6c-e8a2-0c6c-9c2d-8f17f8a1a929@linux.vnet.ibm.com \
    --to=nfont@linux.vnet.ibm.com \
    --cc=jallen@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=tlfalcon@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).