netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Steve Lin <steven.lin1@broadcom.com>,
	Michael Chan <michael.chan@broadcom.com>,
	netdev@vger.kernel.org, Paul Greenwalt <paul.greenwalt@intel.com>,
	Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH v2 3/3] ethtool: Add ETHTOOL_RESET support via --reset command
Date: Tue, 5 Dec 2017 16:45:28 -0800	[thread overview]
Message-ID: <ae15c229-1d02-0be1-dc4d-2ab8a5ec915d@broadcom.com> (raw)
In-Reply-To: <20171205222920.3szmrvrhbu72wpf2@unicorn.suse.cz>

Hi Michal,

Thanks - one question below hopefully someone can help with.


On 17-12-05 02:29 PM, Michal Kubecek wrote:
> On Tue, Dec 05, 2017 at 02:06:09PM -0800, Scott Branden wrote:
>> On 17-12-05 01:30 PM, Michal Kubecek wrote:
>>> On Tue, Dec 05, 2017 at 12:53:23PM -0800, Scott Branden wrote:
>>>> Add ETHTOOL_RESET support via --reset command.
>>>>
>>>> ie.  ethtool --reset DEVNAME <flagname(s)>
>>>>
>>>> flagnames currently match the ETH_RESET_xxx names:
>>>> mgmt,irq,dma,filter,offload,mac,phy,ram,dedicated,all
>>>>
>>>> Alternatively, you can specific component bitfield directly using
>>>> ethtool --reset DEVNAME flags %x
>>> IMHO it would be more consistent with e.g. msglvl without the keyword
>>> "flags".
>> I don't see the consistency in ethtool of specifying a number without a
>> keyword in front of it.
>> I can only find --set-dump specify a number?
>> Others have keyword and number.  msglvl is the keyword after specifying -s -
>> same as flags is the keyword I use after specifying --reset.
> What I meant is that you can write
>
>      ethtool -s eth0 msglvl drv on probe off
>      ethtool -s eth0 msglvl 0x7
>
> i.e. either number or names (with on/off in this case) while your patch
> has
>
>      ethtool --reset eth0 mgmg,irq
>      ethtool --reset eth0 flags 0x3
>
> i.e. an extra keyword if a number is used.
>
> But it's not really important, it doesn't seem I would be able to share
> a parser for this with any other subcommand or parameter anyway.
>
>>>    It would be also nice to provide a symbolic way to specify the
>>> shared flags.
>> I'll change to allow -shared to be added to the end of each component
>> specified to use the shared bit.
>>   IE. mgmt-shared, irq-shared, dma-shared ?
> Sounds good to me.
>
>>>> +	resetinfo.cmd = ETHTOOL_RESET;
>>>> +
>>>> +	if (send_ioctl(ctx, &resetinfo)) {
>>>> +		perror("Cannot issue RESET");
>>>> +		return 1;
>>>> +	}
>>>> +	fprintf(stdout, "RESET 0x%x issued\n", resetinfo.data);
>>> According to documentation, driver is supposed to clear the flags
>>> corresponding to components which were reset so that what is left are
>>> those which were _not_ reset.
>> I'll move the print above the send_ioctl.
> It might be even more useful if ethtool informed user what actually
> happened, i.e. either change the message to saying these are bits for
> components not reset (if resetinfo.data is not zero) or save the
> original value of resetinfo.data and show  saved_data & ~resetinfo.data
In making the improvement I found a bug in the bnxt_en kernel driver.
The bnxt_en driver currently doesn't clear any of the component flags on 
success so I need to send in a fix for that.

Although in one case (RESET_ALL) in the driver it doesn't actually 
execute the reset until all necessary drivers are unloaded to prevent 
the PCIe bus from hanging.
So question: should the flags be cleared if the reset is "pending" but 
hasn't actually happened yet, but will reset once all the drivers are 
all properly unloaded?
>
> Michal Kubecek
>

  reply	other threads:[~2017-12-06  0:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 20:53 [PATCH v2 0/3] ethtool: add ETHTOOL_RESET support via --reset command Scott Branden
2017-12-05 20:53 ` [PATCH v2 1/3] Revert "ethtool: Add DMA Coalescing support" Scott Branden
2017-12-05 20:53 ` [PATCH v2 2/3] ethtool-copy.h: sync with net-next Scott Branden
2017-12-05 20:53 ` [PATCH v2 3/3] ethtool: Add ETHTOOL_RESET support via --reset command Scott Branden
2017-12-05 21:30   ` Michal Kubecek
2017-12-05 22:06     ` Scott Branden
2017-12-05 22:29       ` Michal Kubecek
2017-12-06  0:45         ` Scott Branden [this message]
2017-12-05 22:26   ` Andrew Lunn
2017-12-05 22:31     ` Scott Branden

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=ae15c229-1d02-0be1-dc4d-2ab8a5ec915d@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=linville@tuxdriver.com \
    --cc=michael.chan@broadcom.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=paul.greenwalt@intel.com \
    --cc=shemminger@vyatta.com \
    --cc=steven.lin1@broadcom.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).