Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9933433ybi; Wed, 24 Jul 2019 12:35:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhHdm0COMoqdcB4HaPIKFW3XQy708l374DUziqsJib6b4Fi97DIsXmJPPc7pw9g2vCt7TZ X-Received: by 2002:a63:e62:: with SMTP id 34mr81796873pgo.331.1563996910030; Wed, 24 Jul 2019 12:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996910; cv=none; d=google.com; s=arc-20160816; b=d6PQpxS5CIu72Kg7q/9ObU+nNHpujV2nEX2uJvxII3KhnbZM8EY+6veOed5ck+Ajqq xz65gaI+ueePVFWyOKjp9LIHUr1ufBvuPRlj9lBGr+j2fy7GR9y4b+0gw4/wsrndRfm7 4CgOht9XnR/TCy9mZpaBAi0VFlYUdNQ1SueDgdJ/hdzV6PRGlnkjXjxWhWCD02YD0w4a mNAAN/W+lMdB/nD2hBhZCQ0iWe7vxfiVrzqxL4X8bzQCumU25rVMc72JG7TbflK1i6U9 GN2jjHe1bqaIV1EJtxDGVEXr7oj3AMJIrGtn3uMbKc5QrMqFdcMmKYPA0zdtK8/x9Rmt erqw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G/RNtaNXTfJL3QoW1/KtlW3sVFAdw8+4KP00cBs03lk=; b=dSbsnzUn9aDxDlUkS9cPLO3tGdza7PtLb8/1Gj23/EPx3WWImHqcjHSyjISRfXf6NH mlItY/gRB/U01atKR4A6mjg7I7Nz3fJNDwA4GIqjGjApC1tnesIbdDbqEKNNBZH/75sI 4Q+FpkDRh9SRbwKkdlNqz9sVkV1p7eKZOCFKPjsyKnisg8e1t4Szmz1YOCiq8imGw/1h BdUSCVcDpLbJLs1Imtx5cXbjYqpv5QnOpKFMWw9NTF/pQ9J33v3epFeld0KCzSstoiuL RIcAbzi+V5Jgs7NLwYrVNjyeCBkLIt8NpOBqKYKRLPOSvjXF9yY2ndCx5W/toqrn0MJF Ikmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CjT68A3H; 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 y3si16098192pge.429.2019.07.24.12.34.55; Wed, 24 Jul 2019 12:35:10 -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; dkim=pass header.i=@kernel.org header.s=default header.b=CjT68A3H; 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 S2388860AbfGXTde (ORCPT + 99 others); Wed, 24 Jul 2019 15:33:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:55406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388994AbfGXTdc (ORCPT ); Wed, 24 Jul 2019 15:33:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A5F0E20659; Wed, 24 Jul 2019 19:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996812; bh=l4coQT2jWIHS1qadkL5oCvqfcrlXLxCIBIK4OFgmrbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CjT68A3HlNAz78XzPPAB5npvxIasy6ON8Meb2KtO8eobTEX7HMjSVBxLUpxXg7q1Y jQhjt3+mhHTg9oqrfnBnQNWrVST/zvuZWKm/wDv09dIexhns13zXrCYpUb0dNGdk0I jBaJjzG6LXymEt3c3s+q+xt5uu5yjW4PFe6ys+v8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Peng Li , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 226/413] net: hns3: enable broadcast promisc mode when initializing VF Date: Wed, 24 Jul 2019 21:18:37 +0200 Message-Id: <20190724191751.124550889@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2d5066fc175ea77a733d84df9ef414b34f311641 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../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 5d53467ee2d2..3b02745605d4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2512,6 +2512,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; @@ -2591,9 +2597,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.20.1