diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2016-11-22 00:14:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-23 20:18:36 -0500 |
commit | 57aac71b3e9ed890cf2219dd980c36f859b43d6a (patch) | |
tree | 794d60735c989bae712b7a3dc8e92d43457bb30a /drivers/net/ethernet/broadcom | |
parent | 920c1cd36642ac21a7b2fdc47ab44b9634d570f9 (diff) |
bnxt_en: Fix a VXLAN vs GENEVE issue
Knowing that:
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN (0x1UL << 0)
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE (0x5UL << 0)
and that 'bnxt_hwrm_tunnel_dst_port_alloc()' is only called with one of
these 2 constants, the TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE can not
trigger.
Replace the bit test that overlap by an equality test, just as in
'bnxt_hwrm_tunnel_dst_port_free()' above.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index e18635b2a002..e41d8bd094ae 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -3210,11 +3210,17 @@ static int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, __be16 port, | |||
3210 | goto err_out; | 3210 | goto err_out; |
3211 | } | 3211 | } |
3212 | 3212 | ||
3213 | if (tunnel_type & TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN) | 3213 | switch (tunnel_type) { |
3214 | case TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN: | ||
3214 | bp->vxlan_fw_dst_port_id = resp->tunnel_dst_port_id; | 3215 | bp->vxlan_fw_dst_port_id = resp->tunnel_dst_port_id; |
3215 | 3216 | break; | |
3216 | else if (tunnel_type & TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE) | 3217 | case TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE: |
3217 | bp->nge_fw_dst_port_id = resp->tunnel_dst_port_id; | 3218 | bp->nge_fw_dst_port_id = resp->tunnel_dst_port_id; |
3219 | break; | ||
3220 | default: | ||
3221 | break; | ||
3222 | } | ||
3223 | |||
3218 | err_out: | 3224 | err_out: |
3219 | mutex_unlock(&bp->hwrm_cmd_lock); | 3225 | mutex_unlock(&bp->hwrm_cmd_lock); |
3220 | return rc; | 3226 | return rc; |