Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 /*
0003  * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
0004  * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
0005  */
0006 
0007 #ifndef RXE_H
0008 #define RXE_H
0009 
0010 #ifdef pr_fmt
0011 #undef pr_fmt
0012 #endif
0013 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
0014 
0015 #include <linux/skbuff.h>
0016 
0017 #include <rdma/ib_verbs.h>
0018 #include <rdma/ib_user_verbs.h>
0019 #include <rdma/ib_pack.h>
0020 #include <rdma/ib_smi.h>
0021 #include <rdma/ib_umem.h>
0022 #include <rdma/ib_cache.h>
0023 #include <rdma/ib_addr.h>
0024 #include <crypto/hash.h>
0025 
0026 #include "rxe_net.h"
0027 #include "rxe_opcode.h"
0028 #include "rxe_hdr.h"
0029 #include "rxe_param.h"
0030 #include "rxe_verbs.h"
0031 #include "rxe_loc.h"
0032 
0033 /*
0034  * Version 1 and Version 2 are identical on 64 bit machines, but on 32 bit
0035  * machines Version 2 has a different struct layout.
0036  */
0037 #define RXE_UVERBS_ABI_VERSION      2
0038 
0039 #define RXE_ROCE_V2_SPORT       (0xc000)
0040 
0041 void rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
0042 
0043 int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name);
0044 
0045 void rxe_rcv(struct sk_buff *skb);
0046 
0047 /* The caller must do a matching ib_device_put(&dev->ib_dev) */
0048 static inline struct rxe_dev *rxe_get_dev_from_net(struct net_device *ndev)
0049 {
0050     struct ib_device *ibdev =
0051         ib_device_get_by_netdev(ndev, RDMA_DRIVER_RXE);
0052 
0053     if (!ibdev)
0054         return NULL;
0055     return container_of(ibdev, struct rxe_dev, ib_dev);
0056 }
0057 
0058 void rxe_port_up(struct rxe_dev *rxe);
0059 void rxe_port_down(struct rxe_dev *rxe);
0060 void rxe_set_port_state(struct rxe_dev *rxe);
0061 
0062 #endif /* RXE_H */