[dpdk-dev,1/2] net/bnxt: check current vlan anti spoof value before setting new value

Message ID 20170725033224.90613-2-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ajit Khaparde July 25, 2017, 3:32 a.m. UTC
  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 <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Ferruh Yigit July 31, 2017, 11:25 a.m. UTC | #1
On 7/25/2017 4:32 AM, Ajit Khaparde wrote:
> 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 <ajit.khaparde@broadcom.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

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;