net: Move the definition of the default Geneve udp port to public header file
authorMoshe Shemesh <moshe@mellanox.com>
Thu, 21 Mar 2019 22:51:36 +0000 (15:51 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 22 Mar 2019 19:09:31 +0000 (12:09 -0700)
Move the definition of the default Geneve udp port from the geneve
source to the header file, so we can re-use it from drivers.
Modify existing drivers to use it.

Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Cc: John Hurley <john.hurley@netronome.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/netronome/nfp/flower/action.c
drivers/net/ethernet/netronome/nfp/flower/main.h
drivers/net/ethernet/netronome/nfp/flower/offload.c
drivers/net/geneve.c
include/net/geneve.h

index eeda4ed98333afbf5671c1fd6d4ad69bc443a9e4..269ddcffa21877ff3f3838b8fdbbed9295106999 100644 (file)
@@ -163,7 +163,7 @@ nfp_fl_get_tun_from_act_l4_port(struct nfp_app *app,
        switch (tun->key.tp_dst) {
        case htons(NFP_FL_VXLAN_PORT):
                return NFP_FL_TUNNEL_VXLAN;
-       case htons(NFP_FL_GENEVE_PORT):
+       case htons(GENEVE_UDP_PORT):
                if (priv->flower_ext_feats & NFP_FL_FEATS_GENEVE)
                        return NFP_FL_TUNNEL_GENEVE;
                /* FALLTHROUGH */
index c0945a5fd1a47b9edc78f05d869bb8b6057e6709..6c27e9b403bc4c31d8e6f374a1f1287ce551844e 100644 (file)
@@ -35,7 +35,6 @@ struct nfp_app;
 #define NFP_FL_MASK_ID_LOCATION                1
 
 #define NFP_FL_VXLAN_PORT              4789
-#define NFP_FL_GENEVE_PORT             6081
 
 /* Extra features bitmap. */
 #define NFP_FL_FEATS_GENEVE            BIT(0)
index 450d7296fd57424e8f2f89305e18afc0d34f1c91..bdd551f36cb7d01b99ab3f3c4d7855085efea12b 100644 (file)
@@ -203,7 +203,7 @@ nfp_flower_calculate_key_layers(struct nfp_app *app,
                        if (enc_op.key)
                                return -EOPNOTSUPP;
                        break;
-               case htons(NFP_FL_GENEVE_PORT):
+               case htons(GENEVE_UDP_PORT):
                        if (!(priv->flower_ext_feats & NFP_FL_FEATS_GENEVE))
                                return -EOPNOTSUPP;
                        *tun_type = NFP_FL_TUNNEL_GENEVE;
index 5583d993480d2c11ed17afa189385627dcbad17b..c05b1207358d7f29d867340c728e6d392a864b92 100644 (file)
@@ -22,8 +22,6 @@
 
 #define GENEVE_NETDEV_VER      "0.6"
 
-#define GENEVE_UDP_PORT                6081
-
 #define GENEVE_N_VID           (1u << 24)
 #define GENEVE_VID_MASK                (GENEVE_N_VID - 1)
 
index fc6a7e0a874a9ff9da0f4eb023b1394723311b09..bced0b1d9fe4f827a32c2038737e9f6264cabd0b 100644 (file)
@@ -4,6 +4,8 @@
 
 #include <net/udp_tunnel.h>
 
+#define GENEVE_UDP_PORT                6081
+
 /* Geneve Header:
  *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  *  |Ver|  Opt Len  |O|C|    Rsvd.  |          Protocol Type        |