From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rnd-relay.smtp.broadcom.com (lpdvrndsmtp01.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id A8CD62B89 for ; Tue, 25 Jul 2017 05:32:30 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 6FE5030C054; Mon, 24 Jul 2017 20:32:29 -0700 (PDT) Received: from C02PT1RBG8WP.vpn.broadcom.net (unknown [10.10.118.247]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 06D8E81EB1; Mon, 24 Jul 2017 20:32:28 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Mon, 24 Jul 2017 22:32:23 -0500 Message-Id: <20170725033224.90613-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20170725033224.90613-1-ajit.khaparde@broadcom.com> References: <20170725033224.90613-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH 1/2] net/bnxt: check current vlan anti spoof value before setting new value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2017 03:32:31 -0000 If the current VLAN anti spoof setting is same as the new value, the firmware can return an error. Call the HWRM command to update the new setting if it is different from the current value. Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof") Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/rte_pmd_bnxt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c1876f8..dd7e5b8 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -321,6 +321,9 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) if (vf >= dev_info.max_vfs) return -EINVAL; + if (on == bp->pf.vf_info[vf].vlan_spoof_en) + return 0; + rc = bnxt_hwrm_func_cfg_vf_set_vlan_anti_spoof(bp, vf, on); if (!rc) { bp->pf.vf_info[vf].vlan_spoof_en = on; -- 2.10.1 (Apple Git-78)