mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Huazhong Tan <tanhuazhong@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<linuxarm@huawei.com>, Jian Shen <shenjian15@huawei.com>,
	Peng Li <lipeng321@huawei.com>,
	"Huazhong Tan" <tanhuazhong@huawei.com>
Subject: [PATCH net-next 1/9] net: hns3: enable broadcast promisc mode when initializing VF
Date: Thu, 4 Jul 2019 22:04:20 +0800	[thread overview]
Message-ID: <1562249068-40176-2-git-send-email-tanhuazhong@huawei.com> (raw)
In-Reply-To: <1562249068-40176-1-git-send-email-tanhuazhong@huawei.com>

From: Jian Shen <shenjian15@huawei.com>

For revision 0x20, the broadcast promisc is enabled by firmware,
it's unnecessary to enable it when initializing VF.

For revision 0x21, it's necessary to enable broadcast promisc mode
when initializing or re-initializing VF, otherwise, it will be
unable to send and receive promisc packets.

Fixes: f01f5559cac8 ("net: hns3: don't allow vf to enable promisc mode")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 42006cc..ff7e8cb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2589,6 +2589,12 @@ static int hclgevf_reset_hdev(struct hclgevf_dev *hdev)
 		return ret;
 	}
 
+	if (pdev->revision >= 0x21) {
+		ret = hclgevf_set_promisc_mode(hdev, true);
+		if (ret)
+			return ret;
+	}
+
 	dev_info(&hdev->pdev->dev, "Reset done\n");
 
 	return 0;
@@ -2668,9 +2674,11 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
 	 * firmware makes sure broadcast packets can be accepted.
 	 * For revision 0x21, default to enable broadcast promisc mode.
 	 */
-	ret = hclgevf_set_promisc_mode(hdev, true);
-	if (ret)
-		goto err_config;
+	if (pdev->revision >= 0x21) {
+		ret = hclgevf_set_promisc_mode(hdev, true);
+		if (ret)
+			goto err_config;
+	}
 
 	/* Initialize RSS for this VF */
 	ret = hclgevf_rss_init_hw(hdev);
-- 
2.7.4


  reply	other threads:[~2019-07-04 14:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04 14:04 [PATCH net-next 0/9] net: hns3: some cleanups & bugfixes Huazhong Tan
2019-07-04 14:04 ` Huazhong Tan [this message]
2019-07-04 14:04 ` [PATCH net-next 2/9] net: hns3: fix flow control configure issue for fibre port Huazhong Tan
2019-07-04 14:04 ` [PATCH net-next 3/9] net: hns3: fix port capbility updating issue Huazhong Tan
2019-07-04 14:04 ` [PATCH net-next 4/9] net: hns3: add all IMP return code Huazhong Tan
2019-07-04 14:04 ` [PATCH net-next 5/9] net: hns3: set default value for param "type" in hclgevf_bind_ring_to_vector Huazhong Tan
2019-07-04 14:04 ` [PATCH net-next 6/9] net: hns3: check msg_data before memcpy in hclgevf_send_mbx_msg Huazhong Tan
2019-07-04 14:04 ` [PATCH net-next 7/9] net: hns3: add default value for tc_size and tc_offset Huazhong Tan
2019-07-04 14:04 ` [PATCH net-next 8/9] net: hns3: bitwise operator should use unsigned type Huazhong Tan
2019-07-04 14:04 ` [PATCH net-next 9/9] net: hns3: set maximum length to resp_data_len for exceptional case Huazhong Tan
2019-07-04 22:13 ` [PATCH net-next 0/9] net: hns3: some cleanups & bugfixes Jakub Kicinski
2019-07-05 22:39 ` 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=1562249068-40176-2-git-send-email-tanhuazhong@huawei.com \
    --to=tanhuazhong@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=salil.mehta@huawei.com \
    --cc=shenjian15@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®