Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2223305ybi; Thu, 4 Jul 2019 07:08:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1eQzkcP2lS8FhwZ/yQYVbvwAVWCcOjDxEzEL89Hac0qA2GTZxaTgm6wpR/8zQaC1CqA3i X-Received: by 2002:a63:34c3:: with SMTP id b186mr43530915pga.294.1562249300702; Thu, 04 Jul 2019 07:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562249300; cv=none; d=google.com; s=arc-20160816; b=RsBqVL2hFMfCK2TAbzvQmsUimM0V2VzRcIF74z6NMqqmoeQb4KIxXFHXMpvrlLGceG C8Sm5sxXTetf5kigXmUgf6ZdgFMRwQOOp34fbwMXCCKDM/Ocor4zQ40iw7aXAebEJka6 asi/3OJrarQyAWwU5Kte89OashBkw3PI8pbGIc/K/BAngt3Cr7HLNeitgqW7q6XnDq9K /Yk2sNqadjEdu/aK/jBXi3BFV8mfdn1j11lE53UCksRh4NGpOQj0o//EOufW0xs5Cu5+ 2VFWLQsdEOsmmMkxoKD7q4e26wWG7Rpms+yAYcGZaSmGETsNfi4JEAAIZ8y98AUHPl6o ac0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=2K2nNd/WcltrieCmczjFLjWrbe1BNumzAo2oetMdJaU=; b=zWRAIjeNT8ZcrzHV9eNgdbfnSRbYb8m0NCpMmbtLU+lFt0SNayaKDDm8e2ItYjkpzQ k5eQylzgPJ4DJN5qXcZ7jBHsZUplbxJOZpzvCPZbX2Yz5fovRjf/BVNpH6Xn2nLv6Gp+ 0UPkr1KzwXol0waeecfNWPJwekqEsdrQlmuhLCuM2FdHQakMtDCtf28DUpAikrgeXhbT Oz7D7CS5RNDAH/mdrRnxmZr0aMAb2MPDnXvVrLweh8syMeF7VqIE2hO92gaGAordovXB sgwKWeWY1jkmGIhoMXFBa6hC0ooCybLzYVsgkZ7jPzToVl/xzVYC88oxxFuflS670MDe avfQ== 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 n8si5826497pfa.223.2019.07.04.07.08.05; Thu, 04 Jul 2019 07:08:20 -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 S1727278AbfGDOGZ (ORCPT + 99 others); Thu, 4 Jul 2019 10:06:25 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:47472 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726817AbfGDOGY (ORCPT ); Thu, 4 Jul 2019 10:06:24 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id DC89B1B48A6223FCA715; Thu, 4 Jul 2019 22:06:21 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Thu, 4 Jul 2019 22:06:15 +0800 From: Huazhong Tan To: CC: , , , , , Jian Shen , Peng Li , "Huazhong Tan" Subject: [PATCH net-next 1/9] net: hns3: enable broadcast promisc mode when initializing VF Date: Thu, 4 Jul 2019 22:04:20 +0800 Message-ID: <1562249068-40176-2-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1562249068-40176-1-git-send-email-tanhuazhong@huawei.com> References: <1562249068-40176-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen 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 Signed-off-by: Peng Li Signed-off-by: Huazhong Tan --- 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