From: Salil Mehta <salil.mehta@huawei.com>
To: <davem@davemloft.net>
Cc: <salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
<lipeng321@huawei.com>, <mehta.salil@opnsrc.net>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, Yunsheng Lin <linyunsheng@huawei.com>
Subject: [PATCH net-next 07/10] net: hns3: Fix warning bug when doing lp selftest
Date: Fri, 6 Jul 2018 11:28:01 +0100 [thread overview]
Message-ID: <20180706102804.196-8-salil.mehta@huawei.com> (raw)
In-Reply-To: <20180706102804.196-1-salil.mehta@huawei.com>
From: Yunsheng Lin <linyunsheng@huawei.com>
The napi_alloc_skb is excepted to be called under the
non-preemptible code path when it is called by hns3_clean_rx_ring
during loopback selftest, otherwise the below warning will be
logged:
[ 92.420780] BUG: using smp_processor_id() in preemptible
[00000000] code: ethtool/1873
<SNIP>
[ 92.463202] check_preemption_disabled+0xf8/0x100
[ 92.467893] debug_smp_processor_id+0x1c/0x28
[ 92.472239] __napi_alloc_skb+0x30/0x130
[ 92.476158] hns3_clean_rx_ring+0x118/0x5f0 [hns3]
[ 92.480941] hns3_self_test+0x32c/0x4d0 [hns3]
[ 92.485375] ethtool_self_test+0xdc/0x1e8
[ 92.489372] dev_ethtool+0x1020/0x1da8
[ 92.493109] dev_ioctl+0x188/0x3a0
[ 92.496499] sock_do_ioctl+0xf4/0x208
[ 92.500148] sock_ioctl+0x228/0x3e8
[ 92.503626] do_vfs_ioctl+0xc4/0x880
[ 92.507189] SyS_ioctl+0x94/0xa8
[ 92.510404] el0_svc_naked+0x30/0x34
This patch fix it by disabling preemption when calling
hns3_clean_rx_ring during loopback selftest.
Fixes: c39c4d98dc65 ("net: hns3: Add mac loopback selftest support in hns3 driver")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index 40c0425..11620e0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -201,7 +201,9 @@ static u32 hns3_lb_check_rx_ring(struct hns3_nic_priv *priv, u32 budget)
rx_group = &ring->tqp_vector->rx_group;
pre_rx_pkt = rx_group->total_packets;
+ preempt_disable();
hns3_clean_rx_ring(ring, budget, hns3_lb_check_skb_data);
+ preempt_enable();
rcv_good_pkt_total += (rx_group->total_packets - pre_rx_pkt);
rx_group->total_packets = pre_rx_pkt;
--
2.7.4
next prev parent reply other threads:[~2018-07-06 10:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-06 10:27 [PATCH net-next 00/10] Misc. bug fixes & cleanups for HNS3 driver Salil Mehta
2018-07-06 10:27 ` [PATCH net-next 01/10] net: hns3: Fix tc setup when netdev is first up Salil Mehta
2018-07-06 10:27 ` [PATCH net-next 02/10] net: hns3: Fix for mac pause not disable in pfc mode Salil Mehta
2018-07-06 10:27 ` [PATCH net-next 03/10] net: hns3: Fix for waterline not setting correctly Salil Mehta
2018-07-06 10:27 ` [PATCH net-next 04/10] net: hns3: Fix for l4 checksum offload bug Salil Mehta
2018-07-06 10:27 ` [PATCH net-next 05/10] net: hns3: Fix for mailbox message truncated problem Salil Mehta
2018-07-06 10:28 ` [PATCH net-next 06/10] net: hns3: Add configure for mac minimal frame size Salil Mehta
2018-07-06 10:28 ` Salil Mehta [this message]
2018-07-06 10:28 ` [PATCH net-next 08/10] net: hns3: Fix get_vector ops in hclgevf_main module Salil Mehta
2018-07-06 10:28 ` [PATCH net-next 09/10] net: hns3: Remove the warning when clear reset cause Salil Mehta
2018-07-06 10:28 ` [PATCH net-next 10/10] net: hns3: Prevent sending command during global or core reset Salil Mehta
2018-07-07 2:13 ` [PATCH net-next 00/10] Misc. bug fixes & cleanups for HNS3 driver 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=20180706102804.196-8-salil.mehta@huawei.com \
--to=salil.mehta@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=linyunsheng@huawei.com \
--cc=lipeng321@huawei.com \
--cc=mehta.salil@opnsrc.net \
--cc=netdev@vger.kernel.org \
--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®