Skip to content

Commit e0d696d

Browse files
committed
RDMA/rxe: Move the definitions for rxe_av.network_type to uAPI
RXE was wrongly using an internal kernel enum as part of its uAPI, split this out into a dedicated uAPI enum just for RXE. It only uses the IPv4 and IPv6 values. This was exposed by changing the internal kernel enum definition which broke RXE. Fixes: 1c15b4f ("RDMA/core: Modify enum ib_gid_type and enum rdma_network_type") Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent e0477b3 commit e0d696d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

drivers/infiniband/sw/rxe/rxe_net.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ static struct dst_entry *rxe_find_route(struct net_device *ndev,
133133
if (dst)
134134
dst_release(dst);
135135

136-
if (av->network_type == RDMA_NETWORK_IPV4) {
136+
if (av->network_type == RXE_NETWORK_TYPE_IPV4) {
137137
struct in_addr *saddr;
138138
struct in_addr *daddr;
139139

140140
saddr = &av->sgid_addr._sockaddr_in.sin_addr;
141141
daddr = &av->dgid_addr._sockaddr_in.sin_addr;
142142
dst = rxe_find_route4(ndev, saddr, daddr);
143-
} else if (av->network_type == RDMA_NETWORK_IPV6) {
143+
} else if (av->network_type == RXE_NETWORK_TYPE_IPV6) {
144144
struct in6_addr *saddr6;
145145
struct in6_addr *daddr6;
146146

@@ -442,7 +442,7 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
442442
if (IS_ERR(attr))
443443
return NULL;
444444

445-
if (av->network_type == RDMA_NETWORK_IPV4)
445+
if (av->network_type == RXE_NETWORK_TYPE_IPV6)
446446
hdr_len = ETH_HLEN + sizeof(struct udphdr) +
447447
sizeof(struct iphdr);
448448
else
@@ -469,7 +469,7 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
469469
skb->dev = ndev;
470470
rcu_read_unlock();
471471

472-
if (av->network_type == RDMA_NETWORK_IPV4)
472+
if (av->network_type == RXE_NETWORK_TYPE_IPV4)
473473
skb->protocol = htons(ETH_P_IP);
474474
else
475475
skb->protocol = htons(ETH_P_IPV6);

include/uapi/rdma/rdma_user_rxe.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
#include <linux/in.h>
4040
#include <linux/in6.h>
4141

42+
enum {
43+
RXE_NETWORK_TYPE_IPV4 = 1,
44+
RXE_NETWORK_TYPE_IPV6 = 2,
45+
};
46+
4247
union rxe_gid {
4348
__u8 raw[16];
4449
struct {
@@ -57,6 +62,7 @@ struct rxe_global_route {
5762

5863
struct rxe_av {
5964
__u8 port_num;
65+
/* From RXE_NETWORK_TYPE_* */
6066
__u8 network_type;
6167
__u8 dmac[6];
6268
struct rxe_global_route grh;

0 commit comments

Comments
 (0)