This source file includes following definitions.
- rxe_crc32
- rxe_get_dev_from_net
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #ifndef RXE_H
35 #define RXE_H
36
37 #ifdef pr_fmt
38 #undef pr_fmt
39 #endif
40 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
41
42 #include <linux/module.h>
43 #include <linux/skbuff.h>
44 #include <linux/crc32.h>
45
46 #include <rdma/ib_verbs.h>
47 #include <rdma/ib_user_verbs.h>
48 #include <rdma/ib_pack.h>
49 #include <rdma/ib_smi.h>
50 #include <rdma/ib_umem.h>
51 #include <rdma/ib_cache.h>
52 #include <rdma/ib_addr.h>
53 #include <crypto/hash.h>
54
55 #include "rxe_net.h"
56 #include "rxe_opcode.h"
57 #include "rxe_hdr.h"
58 #include "rxe_param.h"
59 #include "rxe_verbs.h"
60 #include "rxe_loc.h"
61
62
63
64
65
66 #define RXE_UVERBS_ABI_VERSION 2
67
68 #define RXE_ROCE_V2_SPORT (0xc000)
69
70 static inline u32 rxe_crc32(struct rxe_dev *rxe,
71 u32 crc, void *next, size_t len)
72 {
73 u32 retval;
74 int err;
75
76 SHASH_DESC_ON_STACK(shash, rxe->tfm);
77
78 shash->tfm = rxe->tfm;
79 *(u32 *)shash_desc_ctx(shash) = crc;
80 err = crypto_shash_update(shash, next, len);
81 if (unlikely(err)) {
82 pr_warn_ratelimited("failed crc calculation, err: %d\n", err);
83 return crc32_le(crc, next, len);
84 }
85
86 retval = *(u32 *)shash_desc_ctx(shash);
87 barrier_data(shash_desc_ctx(shash));
88 return retval;
89 }
90
91 void rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
92
93 int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name);
94
95 void rxe_rcv(struct sk_buff *skb);
96
97
98 static inline struct rxe_dev *rxe_get_dev_from_net(struct net_device *ndev)
99 {
100 struct ib_device *ibdev =
101 ib_device_get_by_netdev(ndev, RDMA_DRIVER_RXE);
102
103 if (!ibdev)
104 return NULL;
105 return container_of(ibdev, struct rxe_dev, ib_dev);
106 }
107
108 void rxe_port_up(struct rxe_dev *rxe);
109 void rxe_port_down(struct rxe_dev *rxe);
110 void rxe_set_port_state(struct rxe_dev *rxe);
111
112 #endif