Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11567260ybi; Thu, 25 Jul 2019 19:23:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+60JGBGbzpPN6Wf9IbepSKCUzy40dsWzuG1F+35cvFDQ1nO8TbD2cIBwXQs3Ma4mHa0ND X-Received: by 2002:a63:66c5:: with SMTP id a188mr88659902pgc.127.1564107820789; Thu, 25 Jul 2019 19:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564107820; cv=none; d=google.com; s=arc-20160816; b=M/PiJ5roQHZzgWrgflhLzHJfkfX3Mh3pou2mrSB3jyh/QLm/q4jCnzyjMrs1pw7q5y cR0ZhrDc7KuNv7xZLqL0XYkhfCUtFxsWMhq4zu1xhvDk6nl2seNti0I1NCmNCHtk3t3M m8JMNBKVueyE0n72KOwWKBvQbplPxUxc5mq2Dbp3Ivgtoik6Hi4d5Y9b/aLZOyk6XGN+ TYursth5VNHEHvWuqoaXdHWWl8qSd46PDMmVEXlirw75OtvQOOwyIAvNBK1cMCSjcI3F K5lTU4JHnjapmK5Nyl+MbhSDvdC40uOHY+9wUgcJwHrgypxmrl8hFnDwag2gk2Bqfm1d ra6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6PfTRbMnTHpLvieAl5ExORCQhh/pHN3gSi8Nvsivb78=; b=fdRruHeSsylJZ9FKo3jNcQ+QUZ9uTqM0GQygWWJKBoGZV0Fy6LWFV2RyLmnFup/kPg gcqYyeklGMhazt9chtMODuwSxY+40iXq1ll01o+QOf3HJpHKuPOXBHJeERrY6I+U1Bp9 Ky7MES/cU8rYrLysbzqe0fhIsyBGE2cec0fPXgF0Cp1mUV5sM6OhsLyTLTsQCGcSCHaf LHg6QJfgg6hvSrTPMBUTwj7HlyR3aAkInW15ssvs+IXgx7xsHlDVjnqNd8D8gC4nwFt+ 41QuuEvcc3pFrqQU4RvaVSKcwCOu8+bD9wc1L1Adg2JRRhB7fMKHvfIN5OHlMTuah4gt S3Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si18135346ple.243.2019.07.25.19.23.26; Thu, 25 Jul 2019 19:23:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726067AbfGZCVd (ORCPT + 99 others); Thu, 25 Jul 2019 22:21:33 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2431 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725808AbfGZCVc (ORCPT ); Thu, 25 Jul 2019 22:21:32 -0400 Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 1352BF589A1FF2D3A17D; Fri, 26 Jul 2019 10:21:30 +0800 (CST) Received: from dggeme760-chm.china.huawei.com (10.3.19.106) by DGGEMM405-HUB.china.huawei.com (10.3.20.213) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 26 Jul 2019 10:21:29 +0800 Received: from [127.0.0.1] (10.57.37.248) by dggeme760-chm.china.huawei.com (10.3.19.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 26 Jul 2019 10:21:29 +0800 Subject: Re: [PATCH net-next 07/11] net: hns3: adds debug messages to identify eth down cause To: Saeed Mahameed , "tanhuazhong@huawei.com" , "davem@davemloft.net" CC: "lipeng321@huawei.com" , "yisen.zhuang@huawei.com" , "salil.mehta@huawei.com" , "linuxarm@huawei.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1563938327-9865-1-git-send-email-tanhuazhong@huawei.com> <1563938327-9865-8-git-send-email-tanhuazhong@huawei.com> <30483e38-5e4a-0111-f431-4742ceb1aa62@huawei.com> <75a02bbe5b3b0f2755cd901a8830d4a3026f9383.camel@mellanox.com> From: liuyonglong Message-ID: <9ae85be2-b958-ecb4-2980-ca7e977606a1@huawei.com> Date: Fri, 26 Jul 2019 10:21:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <75a02bbe5b3b0f2755cd901a8830d4a3026f9383.camel@mellanox.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.57.37.248] X-ClientProxiedBy: dggeme701-chm.china.huawei.com (10.1.199.97) To dggeme760-chm.china.huawei.com (10.3.19.106) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>>> >>>> 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. >