RDMA: Adding ethertype ETH_P_IBOE
authorSelvin Xavier <selvin.xavier@broadcom.com>
Mon, 19 Dec 2016 19:28:46 +0000 (11:28 -0800)
committerDoug Ledford <dledford@redhat.com>
Tue, 10 Jan 2017 19:05:11 +0000 (14:05 -0500)
Update the if_ether.h with the  ethertype for Infiniband over
Ethernet packets. Also, removing the occurances of 0x8915
from infiniband vendor drivers.

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx4/qp.c
drivers/infiniband/hw/ocrdma/ocrdma_ah.c
drivers/infiniband/hw/ocrdma/ocrdma_hw.c
drivers/infiniband/hw/ocrdma/ocrdma_sli.h
drivers/infiniband/hw/qedr/qedr_cm.c
drivers/infiniband/hw/qedr/qedr_cm.h
drivers/infiniband/hw/usnic/usnic_common_pkt_hdr.h
drivers/infiniband/hw/usnic/usnic_fwd.h
include/uapi/linux/if_ether.h

index c068add8838bfb0e4626e257fa507c5b84c641b0..7d76f769233cfb5a58a2ce78717e758e8492363e 100644 (file)
@@ -76,10 +76,6 @@ enum {
        MLX4_IB_LSO_HEADER_SPARE        = 128,
 };
 
-enum {
-       MLX4_IB_IBOE_ETHERTYPE          = 0x8915
-};
-
 struct mlx4_ib_sqp {
        struct mlx4_ib_qp       qp;
        int                     pkey_index;
@@ -2588,7 +2584,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr,
                u16 ether_type;
                u16 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13;
 
-               ether_type = (!is_udp) ? MLX4_IB_IBOE_ETHERTYPE :
+               ether_type = (!is_udp) ? ETH_P_IBOE:
                        (ip_version == 4 ? ETH_P_IP : ETH_P_IPV6);
 
                mlx->sched_prio = cpu_to_be16(pcp);
index 14d33b0f39500ec06f818605d6506df83ec21a56..cd66e1e45dd7c00beb6ce5bf50b7f400f07639d0 100644 (file)
@@ -59,7 +59,7 @@ static u16 ocrdma_hdr_type_to_proto_num(int devid, u8 hdr_type)
 {
        switch (hdr_type) {
        case OCRDMA_L3_TYPE_IB_GRH:
-               return (u16)0x8915;
+               return (u16)ETH_P_IBOE;
        case OCRDMA_L3_TYPE_IPV4:
                return (u16)0x0800;
        case OCRDMA_L3_TYPE_IPV6:
@@ -94,7 +94,7 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
        proto_num = ocrdma_hdr_type_to_proto_num(dev->id, ah->hdr_type);
        if (!proto_num)
                return -EINVAL;
-       nxthdr = (proto_num == 0x8915) ? 0x1b : 0x11;
+       nxthdr = (proto_num == ETH_P_IBOE) ? 0x1b : 0x11;
        /* VLAN */
        if (!vlan_tag || (vlan_tag > 0xFFF))
                vlan_tag = dev->pvid;
index 9a305201545ec9eaf5abee05f0c81b004de311f4..aa6967197620285f5e1143e15d704143de4224c3 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/interrupt.h>
 #include <linux/log2.h>
 #include <linux/dma-mapping.h>
+#include <linux/if_ether.h>
 
 #include <rdma/ib_verbs.h>
 #include <rdma/ib_user_verbs.h>
@@ -2984,7 +2985,7 @@ static int ocrdma_parse_dcbxcfg_rsp(struct ocrdma_dev *dev, int ptype,
                                OCRDMA_APP_PARAM_APP_PROTO_MASK;
 
                if (
-                       valid && proto == OCRDMA_APP_PROTO_ROCE &&
+                       valid && proto == ETH_P_IBOE &&
                        proto_sel == OCRDMA_PROTO_SELECT_L2) {
                        for (slindx = 0; slindx <
                                OCRDMA_MAX_SERVICE_LEVEL_INDEX; slindx++) {
index 37df4481bb8fe6d403fde89327216668a258825a..6ef89c226ad8815157a7ce5267beb3bd748c46c7 100644 (file)
@@ -1901,7 +1901,6 @@ struct ocrdma_eth_vlan {
        u8 smac[6];
        __be16 eth_type;
        __be16 vlan_tag;
-#define OCRDMA_ROCE_ETH_TYPE 0x8915
        __be16 roce_eth_type;
 } __packed;
 
@@ -2179,10 +2178,6 @@ enum OCRDMA_DCBX_PARAM_TYPE {
        OCRDMA_PARAMETER_TYPE_PEER      = 0x02
 };
 
-enum OCRDMA_DCBX_APP_PROTO {
-       OCRDMA_APP_PROTO_ROCE   = 0x8915
-};
-
 enum OCRDMA_DCBX_PROTO {
        OCRDMA_PROTO_SELECT_L2  = 0x00,
        OCRDMA_PROTO_SELECT_L4  = 0x01
index 63890ebb72bdff1c525e87786f59b124b2ea8d3f..c6aee0333f30d6d22f607aecedeb57e273b95c61 100644 (file)
@@ -293,7 +293,7 @@ static inline int qedr_gsi_build_header(struct qedr_dev *dev,
        has_udp = (sgid_attr.gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP);
        if (!has_udp) {
                /* RoCE v1 */
-               ether_type = ETH_P_ROCE;
+               ether_type = ETH_P_IBOE;
                *roce_mode = ROCE_V1;
        } else if (ipv6_addr_v4mapped((struct in6_addr *)&sgid)) {
                /* RoCE v2 IPv4 */
index 9ba6e15cd93f84b20897825e1bdf4f405cc9868f..78efb1b056d10d4818a7e8911a763e98a14819a9 100644 (file)
@@ -37,7 +37,6 @@
 
 #define QEDR_GSI_MAX_RECV_SGE  (1)     /* LL2 FW limitation */
 
-#define ETH_P_ROCE             (0x8915)
 #define QEDR_ROCE_V2_UDP_SPORT (0000)
 
 static inline u32 qedr_get_ipv4_from_gid(u8 *gid)
index 596e0ed49a8e2a066097b5612da723535fdcccbc..bf7d197a9f42c48e25a4e53ae2934a12e2165649 100644 (file)
@@ -34,7 +34,6 @@
 #ifndef USNIC_CMN_PKT_HDR_H
 #define USNIC_CMN_PKT_HDR_H
 
-#define USNIC_ROCE_ETHERTYPE           (0x8915)
 #define USNIC_ROCE_GRH_VER              (8)
 #define USNIC_PROTO_VER                 (1)
 #define USNIC_ROCE_GRH_VER_SHIFT        (4)
index 3a8add9ddf4611f89272ee21a0a17dc70fe5028f..b2ac22be073179d26b818cbb33389f91b3ed7dc0 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <linux/if.h>
 #include <linux/netdevice.h>
+#include <linux/if_ether.h>
 #include <linux/pci.h>
 #include <linux/in.h>
 
@@ -97,7 +98,7 @@ static inline void usnic_fwd_init_usnic_filter(struct filter *filter,
                                                uint32_t usnic_id)
 {
        filter->type = FILTER_USNIC_ID;
-       filter->u.usnic.ethtype = USNIC_ROCE_ETHERTYPE;
+       filter->u.usnic.ethtype = ETH_P_IBOE;
        filter->u.usnic.flags = FILTER_FIELD_USNIC_ETHTYPE |
                                FILTER_FIELD_USNIC_ID |
                                FILTER_FIELD_USNIC_PROTO;
index 3e5185e9ef03d612a971cd0a6e7577d58648a20d..5bc9bfd816b7b72185b9a3ee149563a5ebf74a80 100644 (file)
@@ -93,6 +93,7 @@
 #define ETH_P_NCSI     0x88F8          /* NCSI protocol                */
 #define ETH_P_PRP      0x88FB          /* IEC 62439-3 PRP/HSRv0        */
 #define ETH_P_FCOE     0x8906          /* Fibre Channel over Ethernet  */
+#define ETH_P_IBOE     0x8915          /* Infiniband over Ethernet     */
 #define ETH_P_TDLS     0x890D          /* TDLS */
 #define ETH_P_FIP      0x8914          /* FCoE Initialization Protocol */
 #define ETH_P_80221    0x8917          /* IEEE 802.21 Media Independent Handover Protocol */