netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jakub.kicinski@netronome.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCHv3 net 5/5] nfp: don't trust netif_running() in debug code
Date: Sat, 20 Feb 2016 00:01:45 -0500 (EST)	[thread overview]
Message-ID: <20160220.000145.1464068847848293405.davem@davemloft.net> (raw)
In-Reply-To: <1455827893-26366-6-git-send-email-jakub.kicinski@netronome.com>

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Thu, 18 Feb 2016 20:38:13 +0000

> Since change_mtu() can fail and leave us with netif_running()
> returning true even though all rings were freed - we should
> look at NFP_NET_CFG_CTRL_ENABLE flag to determine if device
> is really opened.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

This is exactly why I don't like how you are doing your MTU change at
all.

You must not make the device inoperative if you simply cannot perform
the MTU change.  I'm pretty sure I've told you this already, this
whole ->close(), MTU change, ->open() OOPS THAT FAILED sequence is a
non-starter.  You can't do this.

You are leaving the netdev object in an illegal state when this
happens.

You must return from ->change_mtu() with the device in the UP
and running state if you cannot make the MTU change.

I don't care how invasive it is, you must fix this properly if
you want to fix this because as-is this patch series is a cure
worse than the disease.

I'm not applying any of your currently submitted changes, both for net
and net-next, sorry.

  reply	other threads:[~2016-02-20  5:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 20:38 [PATCHv3 net 0/5] nfp: MTU fixes for net Jakub Kicinski
2016-02-18 20:38 ` [PATCHv3 net 1/5] nfp: return error if MTU change fails Jakub Kicinski
2016-02-18 20:38 ` [PATCHv3 net 2/5] nfp: free buffers before changing MTU Jakub Kicinski
2016-02-18 20:38 ` [PATCHv3 net 3/5] nfp: correct RX buffer length calculation Jakub Kicinski
2016-02-18 20:38 ` [PATCHv3 net 4/5] nfp: fix RX buffer length validation Jakub Kicinski
2016-02-18 20:38 ` [PATCHv3 net 5/5] nfp: don't trust netif_running() in debug code Jakub Kicinski
2016-02-20  5:01   ` David Miller [this message]
2016-02-20 10:51     ` Jakub Kicinski

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=20160220.000145.1464068847848293405.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    /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).