]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt: Move GENEVE support from hard-coded port to using port notifier
authorAlexander Duyck <aduyck@mirantis.com>
Thu, 16 Jun 2016 19:21:36 +0000 (12:21 -0700)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 17:57:08 +0000 (12:57 -0500)
Orabug: 24567991

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>
(cherry picked from commit 7cdd5fc376a51cdf191895c23badd699eddbc901)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/broadcom/bnxt/bnxt.c

Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index d7a8848c79db9015b6f72bd4a0edf44c38157d7e..09c5babf456948087663bc3eac1c9b6e951fb900 100644 (file)
@@ -5273,13 +5273,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);
@@ -5897,6 +5892,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);
 
index 04cc69bb9e6a5d65e0726aa0187a259787bcb237..927ece9c408a1563416282ab9d024e06c7fb4369 100644 (file)
@@ -1049,6 +1049,7 @@ struct bnxt {
        __be16                  vxlan_port;
        u8                      vxlan_port_cnt;
        __le16                  vxlan_fw_dst_port_id;
+       __be16                  nge_port;
        u8                      nge_port_cnt;
        __le16                  nge_fw_dst_port_id;
        u8                      port_partition_type;
@@ -1078,6 +1079,8 @@ struct bnxt {
 #define BNXT_PERIODIC_STATS_SP_EVENT   9
 #define BNXT_HWRM_PORT_MODULE_SP_EVENT 10
 #define BNXT_RESET_TASK_SILENT_SP_EVENT        11
+#define BNXT_GENEVE_ADD_PORT_SP_EVENT  12
+#define BNXT_GENEVE_DEL_PORT_SP_EVENT  13
 
        struct bnxt_pf_info     pf;
 #ifdef CONFIG_BNXT_SRIOV