Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3797936imm; Fri, 25 May 2018 11:50:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp+u+BeO6ya5HkoR/sxluHysPFLq0CYQ/chajX2GInNpG8qg7UULPoldW+lEeXKxQRLpRyW X-Received: by 2002:a62:e903:: with SMTP id j3-v6mr3757430pfh.196.1527274201478; Fri, 25 May 2018 11:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527274201; cv=none; d=google.com; s=arc-20160816; b=oj2/JU96PL3DyTKc/Ic+iBQvO9GTR+bWTQo45v9wx/Eve503vYv3I0SFRuy2Tb0ySp FgvCsaEJ1Guk0kYv05yHAWnUCsRNXQrlFUyqfnSoGaEgQnYQxbvJVkjl/jeRFH6hj0Zf 0/TyVqE+DncKcY0D5yuacvsao7dMecg+tafALtoKtXYp8fgfgVxGx7ck+0l+rNsyQmUl OtpBhvqGmgzjoIqneMK9PdbmZRRTfBAo8oiP2C33QCJD6khMCYQu5J4I3AbKtf5O+98/ GAnlrWIkSpM8w7C/U0tYIdYJNBiichGeJBRiC7RFlQ5L3uSdEeK8vOM7NF1ztKVnCVEO faDg== 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:arc-authentication-results; bh=uIzjB3iqGdDMgZbTzUqnCXHilHN2OyxbasM3dSHAdD0=; b=SIk5FUwqGLjYzX2t+usuNsLYi4GlDtOP4Q4neXRPwyo2TzIJTUpbmo0FWtSKO3EwC9 2vqV/M0SCdh7kRkN4JQ/0wwfreUP0e3Jtzt900PvQ7ILvrXKGc0CN0++KhyoQxHtiOsx xSoR8gSmZ6eG862JxTr6NCz+pmlK0o6QCkfSugHR5oqPooSa0oM+mABZue3zNS8JPEzL YnnaouPPR+AGYkxJSWYuG6IIpvhAdCC664H3h/QDvBV5GxX3X99oxloHji+epPLZJtjb oqyPhe7xpSZuJWeypTCay5QhxumSluAVDV7HQCFXnfrFsV4J+5xF6Sa3iTvRa4uHhrCP 8OTA== 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 h4-v6si23321243pls.490.2018.05.25.11.49.47; Fri, 25 May 2018 11:50:01 -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 S967874AbeEYSor (ORCPT + 99 others); Fri, 25 May 2018 14:44:47 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:60871 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S967830AbeEYSop (ORCPT ); Fri, 25 May 2018 14:44:45 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A1BED2941338; Sat, 26 May 2018 02:44:41 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.382.0; Sat, 26 May 2018 02:44:33 +0800 From: Salil Mehta To: CC: , , , , , , Subject: [PATCH net-next 04/12] net: hns3: Add support to enable TX/RX promisc mode for H/W rev(0x21) Date: Fri, 25 May 2018 19:42:59 +0100 Message-ID: <20180525184307.36288-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180525184307.36288-1-salil.mehta@huawei.com> References: <20180525184307.36288-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Li HCLGE_PROMISC_TX_EN_B and HCLGE_PROMISC_RX_EN_B are not supported on pdev revision(0x20), new revision(0x21) supports them. Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 3fa08f7..e9be6aa 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -484,6 +484,8 @@ struct hclge_promisc_param { u8 enable; }; +#define HCLGE_PROMISC_TX_EN_B BIT(4) +#define HCLGE_PROMISC_RX_EN_B BIT(5) #define HCLGE_PROMISC_EN_B 1 #define HCLGE_PROMISC_EN_ALL 0x7 #define HCLGE_PROMISC_EN_UC 0x1 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index c0b8d5a..8ad8f62 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3586,7 +3586,14 @@ int hclge_cmd_set_promisc_mode(struct hclge_dev *hdev, req = (struct hclge_promisc_cfg_cmd *)desc.data; req->vf_id = param->vf_id; - req->flag = (param->enable << HCLGE_PROMISC_EN_B); + + /* HCLGE_PROMISC_TX_EN_B and HCLGE_PROMISC_RX_EN_B are not supported on + * pdev revision(0x20), new revision support them. The + * value of this two fields will not return error when driver + * send command to fireware in revision(0x20). + */ + req->flag = (param->enable << HCLGE_PROMISC_EN_B) | + HCLGE_PROMISC_TX_EN_B | HCLGE_PROMISC_RX_EN_B; ret = hclge_cmd_send(&hdev->hw, &desc, 1); if (ret) { -- 2.7.4