Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69ae5439 authored by Selvin Xavier's avatar Selvin Xavier Committed by Doug Ledford
Browse files

RDMA: Adding ethertype ETH_P_IBOE



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: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent fa83b793
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -76,10 +76,6 @@ enum {
	MLX4_IB_LSO_HEADER_SPARE	= 128,
	MLX4_IB_LSO_HEADER_SPARE	= 128,
};
};


enum {
	MLX4_IB_IBOE_ETHERTYPE		= 0x8915
};

struct mlx4_ib_sqp {
struct mlx4_ib_sqp {
	struct mlx4_ib_qp	qp;
	struct mlx4_ib_qp	qp;
	int			pkey_index;
	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 ether_type;
		u16 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13;
		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);
			(ip_version == 4 ? ETH_P_IP : ETH_P_IPV6);


		mlx->sched_prio = cpu_to_be16(pcp);
		mlx->sched_prio = cpu_to_be16(pcp);
+2 −2
Original line number Original line Diff line number Diff line
@@ -59,7 +59,7 @@ static u16 ocrdma_hdr_type_to_proto_num(int devid, u8 hdr_type)
{
{
	switch (hdr_type) {
	switch (hdr_type) {
	case OCRDMA_L3_TYPE_IB_GRH:
	case OCRDMA_L3_TYPE_IB_GRH:
		return (u16)0x8915;
		return (u16)ETH_P_IBOE;
	case OCRDMA_L3_TYPE_IPV4:
	case OCRDMA_L3_TYPE_IPV4:
		return (u16)0x0800;
		return (u16)0x0800;
	case OCRDMA_L3_TYPE_IPV6:
	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);
	proto_num = ocrdma_hdr_type_to_proto_num(dev->id, ah->hdr_type);
	if (!proto_num)
	if (!proto_num)
		return -EINVAL;
		return -EINVAL;
	nxthdr = (proto_num == 0x8915) ? 0x1b : 0x11;
	nxthdr = (proto_num == ETH_P_IBOE) ? 0x1b : 0x11;
	/* VLAN */
	/* VLAN */
	if (!vlan_tag || (vlan_tag > 0xFFF))
	if (!vlan_tag || (vlan_tag > 0xFFF))
		vlan_tag = dev->pvid;
		vlan_tag = dev->pvid;
+2 −1
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/log2.h>
#include <linux/log2.h>
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/if_ether.h>


#include <rdma/ib_verbs.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_user_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;
				OCRDMA_APP_PARAM_APP_PROTO_MASK;


		if (
		if (
			valid && proto == OCRDMA_APP_PROTO_ROCE &&
			valid && proto == ETH_P_IBOE &&
			proto_sel == OCRDMA_PROTO_SELECT_L2) {
			proto_sel == OCRDMA_PROTO_SELECT_L2) {
			for (slindx = 0; slindx <
			for (slindx = 0; slindx <
				OCRDMA_MAX_SERVICE_LEVEL_INDEX; slindx++) {
				OCRDMA_MAX_SERVICE_LEVEL_INDEX; slindx++) {
+0 −5
Original line number Original line Diff line number Diff line
@@ -1901,7 +1901,6 @@ struct ocrdma_eth_vlan {
	u8 smac[6];
	u8 smac[6];
	__be16 eth_type;
	__be16 eth_type;
	__be16 vlan_tag;
	__be16 vlan_tag;
#define OCRDMA_ROCE_ETH_TYPE 0x8915
	__be16 roce_eth_type;
	__be16 roce_eth_type;
} __packed;
} __packed;


@@ -2179,10 +2178,6 @@ enum OCRDMA_DCBX_PARAM_TYPE {
	OCRDMA_PARAMETER_TYPE_PEER	= 0x02
	OCRDMA_PARAMETER_TYPE_PEER	= 0x02
};
};


enum OCRDMA_DCBX_APP_PROTO {
	OCRDMA_APP_PROTO_ROCE	= 0x8915
};

enum OCRDMA_DCBX_PROTO {
enum OCRDMA_DCBX_PROTO {
	OCRDMA_PROTO_SELECT_L2	= 0x00,
	OCRDMA_PROTO_SELECT_L2	= 0x00,
	OCRDMA_PROTO_SELECT_L4	= 0x01
	OCRDMA_PROTO_SELECT_L4	= 0x01
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
	has_udp = (sgid_attr.gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP);
	if (!has_udp) {
	if (!has_udp) {
		/* RoCE v1 */
		/* RoCE v1 */
		ether_type = ETH_P_ROCE;
		ether_type = ETH_P_IBOE;
		*roce_mode = ROCE_V1;
		*roce_mode = ROCE_V1;
	} else if (ipv6_addr_v4mapped((struct in6_addr *)&sgid)) {
	} else if (ipv6_addr_v4mapped((struct in6_addr *)&sgid)) {
		/* RoCE v2 IPv4 */
		/* RoCE v2 IPv4 */
Loading