diff options
author | Alexander Duyck <aduyck@mirantis.com> | 2016-06-16 12:21:36 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-17 20:23:30 -0700 |
commit | 7cdd5fc376a51cdf191895c23badd699eddbc901 (patch) | |
tree | 8bbad80acf14e5b62718dd15fc0a0d12675c6df2 /drivers/net/ethernet/broadcom/bnxt/bnxt.c | |
parent | ad51b8e9f9f4f8172eb7a6219d3005861bfb9a57 (diff) | |
download | lwn-7cdd5fc376a51cdf191895c23badd699eddbc901.tar.gz lwn-7cdd5fc376a51cdf191895c23badd699eddbc901.zip |
bnxt: Move GENEVE support from hard-coded port to using port notifier
The port number for GENEVE is hard coded into the bnxt driver. This is the
kind of thing we want to avoid going forward. For now I will integrate
this back into the port notifier so that we can change the GENEVE port
number if we need to in the future.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 03a5d84198ee..673f4d62e73e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -5253,13 +5253,8 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init) netdev_warn(bp->dev, "failed to update phy settings\n"); } - if (irq_re_init) { + if (irq_re_init) udp_tunnel_get_rx_info(bp->dev); - if (!bnxt_hwrm_tunnel_dst_port_alloc( - bp, htons(0x17c1), - TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE)) - bp->nge_port_cnt = 1; - } set_bit(BNXT_STATE_OPEN, &bp->state); bnxt_enable_int(bp); @@ -5877,6 +5872,15 @@ static void bnxt_sp_task(struct work_struct *work) bnxt_hwrm_tunnel_dst_port_free( bp, TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN); } + if (test_and_clear_bit(BNXT_GENEVE_ADD_PORT_SP_EVENT, &bp->sp_event)) { + bnxt_hwrm_tunnel_dst_port_alloc( + bp, bp->nge_port, + TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE); + } + if (test_and_clear_bit(BNXT_GENEVE_DEL_PORT_SP_EVENT, &bp->sp_event)) { + bnxt_hwrm_tunnel_dst_port_free( + bp, TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE); + } if (test_and_clear_bit(BNXT_RESET_TASK_SP_EVENT, &bp->sp_event)) bnxt_reset(bp, false); @@ -6269,6 +6273,16 @@ static void bnxt_udp_tunnel_add(struct net_device *dev, schedule_work(&bp->sp_task); } break; + case UDP_TUNNEL_TYPE_GENEVE: + if (bp->nge_port_cnt && bp->nge_port != ti->port) + return; + + bp->nge_port_cnt++; + if (bp->nge_port_cnt == 1) { + bp->nge_port = ti->port; + set_bit(BNXT_GENEVE_ADD_PORT_SP_EVENT, &bp->sp_event); + } + break; default: return; } @@ -6298,6 +6312,16 @@ static void bnxt_udp_tunnel_del(struct net_device *dev, set_bit(BNXT_VXLAN_DEL_PORT_SP_EVENT, &bp->sp_event); break; + case UDP_TUNNEL_TYPE_GENEVE: + if (!bp->nge_port_cnt || bp->nge_port != ti->port) + return; + bp->nge_port_cnt--; + + if (bp->nge_port_cnt != 0) + return; + + set_bit(BNXT_GENEVE_DEL_PORT_SP_EVENT, &bp->sp_event); + break; default: return; } |