From patchwork Fri May 25 18:42:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 136987 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3945845lji; Fri, 25 May 2018 11:48:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqGBJ66wNVOxKp1YSUkxMfccdprUWWKFHeeUuR8kC0OE5yrZEe/NSHufcHq3DUTv8xAFf9A X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr3722596plo.278.1527274080339; Fri, 25 May 2018 11:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527274080; cv=none; d=google.com; s=arc-20160816; b=uiNdFcavZRNnSsPowV4OFiM7QNZKflc9DkkA90qJAkmuOWX7PHNya5tKUaQ6kpqdUw cITsu2AoUojRbJhd5qpk/edRwqqGfObI5YGrFk0CbtwfGcQ7M4NezL+K9GHJ6ZC0COQL Za1pOS4Y4yneZTmdhsbK/udyD5mfdNbREQuGI/0vfVKQINl6/2ahfUYwpl2grdCLQE+z dlNfhN3fUXduWbMqqY/BnBPbDQZmwHc1EkzbyYi3YLLbQq4hWZm29UGgbHvTQT5NG7AH 67/N2tzv2IrhraDz4+jeuO5qh433j1Nk9rk1bJmQVEKwL0etr4vK0J4rkx5JDox8i8Cy qCyQ== 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 e7-v6si10293792pgc.78.2018.05.25.11.48.00; Fri, 25 May 2018 11:48:00 -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 S967887AbeEYSos (ORCPT + 30 others); Fri, 25 May 2018 14:44:48 -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 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(-) -- 2.7.4 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) {