From: liuyonglong <liuyonglong@huawei.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
"tanhuazhong@huawei.com" <tanhuazhong@huawei.com>,
"davem@davemloft.net" <davem@davemloft.net>
Cc: "lipeng321@huawei.com" <lipeng321@huawei.com>,
"yisen.zhuang@huawei.com" <yisen.zhuang@huawei.com>,
"salil.mehta@huawei.com" <salil.mehta@huawei.com>,
"linuxarm@huawei.com" <linuxarm@huawei.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 07/11] net: hns3: adds debug messages to identify eth down cause
Date: Fri, 26 Jul 2019 10:21:27 +0800 [thread overview]
Message-ID: <9ae85be2-b958-ecb4-2980-ca7e977606a1@huawei.com> (raw)
In-Reply-To: <75a02bbe5b3b0f2755cd901a8830d4a3026f9383.camel@mellanox.com>
We will change all of them to netif_msg_drv() which is default off
Thanks for your reply!
On 2019/7/26 5:59, Saeed Mahameed wrote:
> On Thu, 2019-07-25 at 20:28 +0800, liuyonglong wrote:
>>
>> On 2019/7/25 3:12, Saeed Mahameed wrote:
>>> On Wed, 2019-07-24 at 11:18 +0800, Huazhong Tan wrote:
>>>> From: Yonglong Liu <liuyonglong@huawei.com>
>>>>
>>>> Some times just see the eth interface have been down/up via
>>>> dmesg, but can not know why the eth down. So adds some debug
>>>> messages to identify the cause for this.
>>>>
>>>
>>> I really don't like this. your default msg lvl has NETIF_MSG_IFDOWN
>>> turned on .. dumping every single operation that happens on your
>>> device
>>> by default to kernel log is too much !
>>>
>>> We should really consider using trace buffers with well defined
>>> structures for vendor specific events. so we can use bpf filters
>>> and
>>> state of the art tools for netdev debugging.
>>>
>>
>> We do this because we can just see a link down message in dmesg, and
>> had
>> take a long time to found the cause of link down, just because
>> another
>> user changed the settings.
>>
>> We can change the net_open/net_stop/dcbnl_ops to msg_drv (not default
>> turned on), and want to keep the others default print to kernel log,
>> is it acceptable?
>>
>
> acceptable as long as debug information are kept off by default and
> your driver doens't spam the kernel log.
>
> you should use dynamic debug [1] and/or "off by default" msg lvls for
> debugging information..
>
> I couldn't find any rules regarding what to put in kernel log, Maybe
> someone can share ?. but i vaguely remember that the recommendation
> for device drivers is to put nothing, only error/warning messages.
>
> [1]
> https://www.kernel.org/doc/html/v4.15/admin-guide/dynamic-debug-howto.html
>
>>>> @@ -1593,6 +1603,11 @@ static int hns3_ndo_set_vf_vlan(struct
>>>> net_device *netdev, int vf, u16 vlan,
>>>> struct hnae3_handle *h = hns3_get_handle(netdev);
>>>> int ret = -EIO;
>>>>
>>>> + if (netif_msg_ifdown(h))
>>>
>>> why msg_ifdown ? looks like netif_msg_drv is more appropriate, for
>>> many
>>> of the cases in this patch.
>>>
>>
>> This operation may cause link down, so we use msg_ifdown.
>>
>
> ifdown isn't link down..
>
> to be honest, I couldn't find any documentation explaining how/when to
> use msg lvls, (i didn't look too deep though), by looking at other
> drivers, my interpretations is:
>
> ifdup (open/boot up flow)
> ifdwon (close/teardown flow)
> drv (driver based or dynamic flows)
> etc ..
>
> -Saeed.
>
next prev parent reply other threads:[~2019-07-26 2:21 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 3:18 [PATCH net-next 00/11] net: hns3: some code optimizations & bugfixes & features Huazhong Tan
2019-07-24 3:18 ` [PATCH net-next 01/11] net: hns3: add reset checking before set channels Huazhong Tan
2019-07-24 3:18 ` [PATCH net-next 02/11] net: hns3: add a check for get_reset_level Huazhong Tan
2019-07-24 3:18 ` [PATCH net-next 03/11] net: hns3: remove upgrade reset level when reset fail Huazhong Tan
2019-07-24 3:18 ` [PATCH net-next 04/11] net: hns3: fix mis-counting IRQ vector numbers issue Huazhong Tan
2019-07-24 18:28 ` Saeed Mahameed
2019-07-25 2:04 ` tanhuazhong
2019-07-24 3:18 ` [PATCH net-next 05/11] net: hns3: change GFP flag during lock period Huazhong Tan
2019-07-24 3:18 ` [PATCH net-next 06/11] net: hns3: modify firmware version display format Huazhong Tan
2019-07-24 18:34 ` Saeed Mahameed
2019-07-25 2:34 ` tanhuazhong
2019-07-25 21:32 ` Saeed Mahameed
2019-07-26 1:50 ` tanhuazhong
2019-07-24 3:18 ` [PATCH net-next 07/11] net: hns3: adds debug messages to identify eth down cause Huazhong Tan
2019-07-24 19:12 ` Saeed Mahameed
2019-07-25 12:28 ` liuyonglong
2019-07-25 21:59 ` Saeed Mahameed
2019-07-26 1:28 ` Jakub Kicinski
2019-07-26 2:33 ` liuyonglong
2019-07-26 2:21 ` liuyonglong [this message]
2019-07-24 3:18 ` [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt Huazhong Tan
2019-07-24 19:24 ` Saeed Mahameed
2019-07-25 2:05 ` Yunsheng Lin
2019-07-26 23:18 ` Saeed Mahameed
2019-07-29 10:17 ` Yunsheng Lin
2019-07-29 9:18 ` Salil Mehta
2019-07-29 10:37 ` Yunsheng Lin
2019-07-24 3:18 ` [PATCH net-next 09/11] net: hns3: make hclge_service use delayed workqueue Huazhong Tan
2019-07-24 3:18 ` [PATCH net-next 10/11] net: hns3: Add support for using order 1 pages with a 4K buffer Huazhong Tan
2019-07-24 3:18 ` [PATCH net-next 11/11] net: hns3: add support for handling IMP error Huazhong Tan
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=9ae85be2-b958-ecb4-2980-ca7e977606a1@huawei.com \
--to=liuyonglong@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lipeng321@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=salil.mehta@huawei.com \
--cc=tanhuazhong@huawei.com \
--cc=yisen.zhuang@huawei.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
all inboxes | Powered by JetHome®