|
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) |
|
static | LIST_HEAD (ipoib_devices) |
| List of all IPoIB devices. More...
|
|
static struct ipoib_mac * | ipoib_find_remac (struct ipoib_device *ipoib, const struct ipoib_remac *remac) |
| Find IPoIB MAC from REMAC. More...
|
|
static int | ipoib_map_remac (struct ipoib_device *ipoib, const struct ipoib_remac *remac, const struct ipoib_mac *mac) |
| Add IPoIB MAC to REMAC cache. More...
|
|
static void | ipoib_flush_remac (struct ipoib_device *ipoib) |
| Flush REMAC cache. More...
|
|
static unsigned int | ipoib_discard_remac (void) |
| Discard some entries from the REMAC cache. More...
|
|
struct cache_discarder ipoib_discarder | __cache_discarder (CACHE_EXPENSIVE) |
| IPoIB cache discarder. More...
|
|
static void | ipoib_init_addr (const void *hw_addr, void *ll_addr) |
| Initialise IPoIB link-layer address. More...
|
|
struct net_device * | alloc_ipoibdev (size_t priv_size) |
| Allocate IPoIB device. More...
|
|
static int | ipoib_translate_tx_arp (struct net_device *netdev, struct io_buffer *iobuf) |
| Translate transmitted ARP packet. More...
|
|
static int | ipoib_translate_tx (struct net_device *netdev, struct io_buffer *iobuf, uint16_t net_proto) |
| Translate transmitted packet. More...
|
|
static int | ipoib_translate_rx_arp (struct net_device *netdev, struct io_buffer *iobuf, struct ipoib_remac *remac) |
| Translate received ARP packet. More...
|
|
static int | ipoib_translate_rx (struct net_device *netdev, struct io_buffer *iobuf, struct ipoib_remac *remac, uint16_t net_proto) |
| Translate received packet. More...
|
|
static int | ipoib_transmit (struct net_device *netdev, struct io_buffer *iobuf) |
| Transmit packet via IPoIB network device. More...
|
|
static void | ipoib_complete_send (struct ib_device *ibdev __unused, struct ib_queue_pair *qp, struct io_buffer *iobuf, int rc) |
| Handle IPoIB send completion. More...
|
|
static void | ipoib_complete_recv (struct ib_device *ibdev __unused, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct ib_address_vector *source, struct io_buffer *iobuf, int rc) |
| Handle IPoIB receive completion. More...
|
|
static struct io_buffer * | ipoib_alloc_iob (size_t len) |
| Allocate IPoIB receive I/O buffer. More...
|
|
static void | ipoib_poll (struct net_device *netdev) |
| Poll IPoIB network device. More...
|
|
void | ipoib_join_complete (struct ib_mc_membership *membership, int rc) |
| Handle IPv4 broadcast multicast group join completion. More...
|
|
static int | ipoib_join_broadcast_group (struct ipoib_device *ipoib) |
| Join IPv4 broadcast multicast group. More...
|
|
static void | ipoib_leave_broadcast_group (struct ipoib_device *ipoib) |
| Leave IPv4 broadcast multicast group. More...
|
|
static void | ipoib_link_state_changed (struct ipoib_device *ipoib) |
| Handle link status change. More...
|
|
static int | ipoib_open (struct net_device *netdev) |
| Open IPoIB network device. More...
|
|
static void | ipoib_close (struct net_device *netdev) |
| Close IPoIB network device. More...
|
|
static int | ipoib_probe (struct ib_device *ibdev) |
| Probe IPoIB device. More...
|
|
static void | ipoib_notify (struct ib_device *ibdev) |
| Handle device or link status change. More...
|
|
static void | ipoib_remove (struct ib_device *ibdev) |
| Remove IPoIB device. More...
|
|
struct net_device * | ipoib_netdev (struct ib_device *ibdev) |
| Find IPoIB network device. More...
|
|
IP over Infiniband.
Definition in file ipoib.c.
Find IPoIB MAC from REMAC.
- Parameters
-
ipoib | IPoIB device |
remac | Remote Ethernet MAC |
- Return values
-
mac | IPoIB MAC (or NULL if not found) |
Definition at line 152 of file ipoib.c.
165 sizeof (
peer->remac ) ) == 0 ) {
173 DBGC ( ipoib,
"IPoIB %p unknown REMAC %s\n",
#define list_add(new, head)
Add a new entry to the head of a list.
An IPoIB REMAC cache entry.
#define list_del(list)
Delete an entry from a list.
struct list_head peers
REMAC cache.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
struct list_head list
List of REMAC cache entries.
static int is_multicast_ether_addr(const void *addr)
Check if Ethernet address is a multicast address.
struct ipoib_mac mac
MAC address.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
struct ipoib_remac remac
Remote Ethermet MAC.
struct ipoib_broadcast broadcast
Broadcast address.
struct mschapv2_challenge peer
Peer challenge.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
References ipoib_device::broadcast, DBGC, eth_ntoa(), is_multicast_ether_addr(), ipoib_peer::list, list_add, list_del, list_for_each_entry, ipoib_broadcast::mac, memcmp(), NULL, peer, ipoib_device::peers, and ipoib_peer::remac.
Referenced by ipoib_translate_tx_arp(), and ipoib_transmit().
Add IPoIB MAC to REMAC cache.
- Parameters
-
ipoib | IPoIB device |
remac | Remote Ethernet MAC |
mac | IPoIB MAC |
- Return values
-
Definition at line 186 of file ipoib.c.
194 sizeof (
peer->remac ) ) == 0 ) {
#define list_add(new, head)
Add a new entry to the head of a list.
An IPoIB REMAC cache entry.
uint8_t mac[ETH_ALEN]
MAC address.
#define list_del(list)
Delete an entry from a list.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct list_head peers
REMAC cache.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
struct list_head list
List of REMAC cache entries.
struct ipoib_remac remac
Remote Ethermet MAC.
void * malloc(size_t size)
Allocate memory.
struct mschapv2_challenge peer
Peer challenge.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
References ENOMEM, ipoib_peer::list, list_add, list_del, list_for_each_entry, mac, malloc(), memcmp(), memcpy(), peer, ipoib_device::peers, and ipoib_peer::remac.
Referenced by ipoib_translate_rx_arp().
Translate transmitted ARP packet.
- Parameters
-
netdev | Network device |
iobuf | Packet to be transmitted (with no link-layer headers) |
- Return values
-
Definition at line 341 of file ipoib.c.
356 DBGC ( ipoib,
"IPoIB %p insufficient space in TX ARP\n",
365 DBGC ( ipoib,
"IPoIB %p no REMAC for %s ARP reply\n",
383 sizeof ( *target_ha ) );
static void * arp_sender_pa(struct arphdr *arphdr)
ARP packet sender protocol address.
#define iob_put(iobuf, len)
static void * arp_target_ha(struct arphdr *arphdr)
ARP packet target hardware address.
static void * arp_target_pa(struct arphdr *arphdr)
ARP packet target protocol address.
uint8_t ar_hln
Link-layer address length.
uint16_t ar_hrd
Link-layer protocol.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * priv
Driver private data.
static struct net_device * netdev
#define ARPHRD_INFINIBAND
InfiniBand.
uint16_t ar_op
ARP opcode.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
static size_t iob_tailroom(struct io_buffer *iobuf)
Calculate available space at end of an I/O buffer.
#define ARPOP_REPLY
ARP reply.
static void * arp_sender_ha(struct arphdr *arphdr)
ARP packet sender hardware address.
#define ENOBUFS
No buffer space available.
void * data
Start of data.
uint8_t ar_pln
Network-layer address length.
static struct ipoib_mac * ipoib_find_remac(struct ipoib_device *ipoib, const struct ipoib_remac *remac)
Find IPoIB MAC from REMAC.
#define NULL
NULL pointer (VOID *)
struct ipoib_mac mac
Local MAC.
void * memset(void *dest, int character, size_t len) __nonnull
References arphdr::ar_hln, arphdr::ar_hrd, arphdr::ar_op, arphdr::ar_pln, arp_sender_ha(), arp_sender_pa(), arp_target_ha(), arp_target_pa(), ARPHRD_INFINIBAND, ARPOP_REPLY, io_buffer::data, DBGC, ENOBUFS, ENXIO_ARP_REPLY, ETH_ALEN, eth_ntoa(), htons, iob_put, iob_tailroom(), ipoib_find_remac(), ipoib_device::mac, memcpy(), memset(), netdev, NULL, and net_device::priv.
Referenced by ipoib_translate_tx().
Translate received ARP packet.
- Parameters
-
netdev | Network device |
iobuf | Received packet (with no link-layer headers) |
remac | Constructed Remote Ethernet MAC |
- Return values
-
Definition at line 420 of file ipoib.c.
436 DBGC ( ipoib,
"IPoIB %p could not map REMAC: %s\n",
static void * arp_sender_pa(struct arphdr *arphdr)
ARP packet sender protocol address.
struct arbelprm_rc_send_wqe rc
static void * arp_target_ha(struct arphdr *arphdr)
ARP packet target hardware address.
static void * arp_target_pa(struct arphdr *arphdr)
ARP packet target protocol address.
uint8_t ar_hln
Link-layer address length.
uint16_t ar_hrd
Link-layer protocol.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * priv
Driver private data.
static struct net_device * netdev
#define iob_unput(iobuf, len)
char * strerror(int errno)
Retrieve string representation of error number.
uint16_t ar_op
ARP opcode.
#define ARPOP_REPLY
ARP reply.
static void * arp_sender_ha(struct arphdr *arphdr)
ARP packet sender hardware address.
void * data
Start of data.
uint8_t ar_pln
Network-layer address length.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
#define ARPHRD_ETHER
Ethernet 10Mbps.
static int ipoib_map_remac(struct ipoib_device *ipoib, const struct ipoib_remac *remac, const struct ipoib_mac *mac)
Add IPoIB MAC to REMAC cache.
struct ipoib_mac mac
Local MAC.
void * memset(void *dest, int character, size_t len) __nonnull
References arphdr::ar_hln, arphdr::ar_hrd, arphdr::ar_op, arphdr::ar_pln, arp_sender_ha(), arp_sender_pa(), arp_target_ha(), arp_target_pa(), ARPHRD_ETHER, ARPOP_REPLY, io_buffer::data, DBGC, ETH_ALEN, htons, iob_unput, ipoib_map_remac(), net_device::ll_addr, ipoib_device::mac, memcpy(), memset(), netdev, net_device::priv, rc, and strerror().
Referenced by ipoib_translate_rx().
Transmit packet via IPoIB network device.
- Parameters
-
netdev | Network device |
iobuf | I/O buffer |
- Return values
-
Definition at line 499 of file ipoib.c.
515 DBGC ( ipoib,
"IPoIB %p buffer too short\n", ipoib );
544 dest->gid_present = 1;
558 DBGC ( ipoib,
"IPoIB %p no REMAC for %s non-IPv4 " 559 "packet type %04x\n", ipoib,
561 ntohs ( net_proto ) );
567 DBGC ( ipoib,
"IPoIB %p could not ARP for %s/%s/",
574 DBGC ( ipoib,
"IPoIB %p no REMAC for %s/%s/", ipoib,
uint16_t h_protocol
Protocol ID.
#define iob_pull(iobuf, len)
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
static __always_inline int ib_link_ok(struct ib_device *ibdev)
Check link state of Infiniband device.
struct ib_device * ibdev
Underlying Infiniband device.
#define iob_push(iobuf, len)
struct ib_queue_pair * qp
Queue pair.
uint8_t mac[ETH_ALEN]
MAC address.
uint8_t h_dest[ETH_ALEN]
Destination MAC address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
unsigned long qkey
Queue key.
uint16_t reserved
Reserved, must be zero.
void * priv
Driver private data.
static struct net_device * netdev
static int is_multicast_ether_addr(const void *addr)
Check if Ethernet address is a multicast address.
int arp_tx_request(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *net_source)
Transmit ARP request.
char * strerror(int errno)
Retrieve string representation of error number.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
char * inet_ntoa(struct in_addr in)
Convert IPv4 address to dotted-quad notation.
int ib_resolve_path(struct ib_device *ibdev, struct ib_address_vector *av)
Resolve path.
uint16_t proto
Network-layer protocol.
int ib_post_send(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct io_buffer *iobuf)
Post send work queue entry.
struct ipoib_broadcast broadcast
Broadcast address.
void * data
Start of data.
eIPoIB Remote Ethernet MAC address
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
An Infiniband Address Vector.
static struct ipoib_mac * ipoib_find_remac(struct ipoib_device *ipoib, const struct ipoib_remac *remac)
Find IPoIB MAC from REMAC.
static int ipoib_translate_tx(struct net_device *netdev, struct io_buffer *iobuf, uint16_t net_proto)
Translate transmitted packet.
#define ENETUNREACH
Network unreachable.
An Ethernet link-layer header.
struct ib_address_vector av
Address vector.
#define IB_QPN_MASK
QPN mask.
void * memset(void *dest, int character, size_t len) __nonnull
References arp_tx_request(), ipoib_broadcast::av, ipoib_device::broadcast, io_buffer::data, DBGC, iphdr::dest, dest, EINVAL, ENETUNREACH, ENXIO_ARP_SENT, ENXIO_NON_IPV4, eth_ntoa(), ETH_P_IP, ethhdr::h_dest, ethhdr::h_protocol, htons, ib_link_ok(), ib_post_send(), IB_QPN_MASK, ib_resolve_path(), ipoib_device::ibdev, inet_ntoa(), iob_len(), iob_pull, iob_push, ipoib_find_remac(), ipoib_translate_tx(), is_multicast_ether_addr(), mac, memcpy(), memset(), netdev, ntohl, ntohs, net_device::priv, ipoib_hdr::proto, ib_address_vector::qkey, ipoib_device::qp, rc, ipoib_hdr::reserved, iphdr::src, and strerror().
Handle IPoIB receive completion.
- Parameters
-
ibdev | Infiniband device |
qp | Queue pair |
dest | Destination address vector, or NULL |
source | Source address vector, or NULL |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 619 of file ipoib.c.
639 DBGC ( ipoib,
"IPoIB %p received packet too short to " 640 "contain IPoIB header\n", ipoib );
646 DBGC ( ipoib,
"IPoIB %p received packet without address " 663 net_proto ) ) != 0 ) {
uint16_t h_protocol
Protocol ID.
#define iob_pull(iobuf, len)
struct arbelprm_rc_send_wqe rc
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
#define iob_push(iobuf, len)
uint8_t eth_broadcast[ETH_ALEN]
Ethernet broadcast MAC address.
#define EIPOIB_QPN_LA
eIPoIB REMAC locally-assigned address indicator
uint8_t h_dest[ETH_ALEN]
Destination MAC address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static struct net_device * netdev
#define IB_GID_MULTICAST(gid)
Test for multicast GID.
static __always_inline void * ib_qp_get_ownerdata(struct ib_queue_pair *qp)
Get Infiniband queue pair owner-private data.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
uint8_t h_source[ETH_ALEN]
Source MAC address.
unsigned long qpn
Queue Pair Number.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
uint16_t proto
Network-layer protocol.
struct arbelprm_qp_db_record qp
#define ENOTTY
Inappropriate I/O control operation.
void * data
Start of data.
eIPoIB Remote Ethernet MAC address
#define EIO
Input/output error.
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
unsigned int lid
Local ID.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static int ipoib_translate_rx(struct net_device *netdev, struct io_buffer *iobuf, struct ipoib_remac *remac, uint16_t net_proto)
Translate received packet.
An Ethernet link-layer header.
struct net_device * netdev
Network device.
References io_buffer::data, DBGC, DBGC_HD, dest, EIO, EIPOIB_QPN_LA, ENOTTY, eth_broadcast, ethhdr::h_dest, ethhdr::h_protocol, ethhdr::h_source, htonl, htons, IB_GID_MULTICAST, ib_qp_get_ownerdata(), iob_len(), iob_pull, iob_push, ipoib_translate_rx(), ipoib_remac::lid, ib_address_vector::lid, net_device::ll_addr, memcpy(), netdev, ipoib_device::netdev, netdev_rx(), netdev_rx_err(), ipoib_hdr::proto, qp, ipoib_remac::qpn, ib_address_vector::qpn, and rc.
Allocate IPoIB receive I/O buffer.
- Parameters
-
- Return values
-
Some Infiniband hardware requires 2kB alignment of receive buffers and provides no way to disable header separation. The result is that there are only four bytes of link-layer header (the real IPoIB header) before the payload. This is not sufficient space to insert an eIPoIB link-layer pseudo-header.
We therefore allocate I/O buffers offset to start slightly before the natural alignment boundary, in order to allow sufficient space.
Definition at line 709 of file ipoib.c.
714 reserve_len = (
sizeof (
struct ethhdr ) -
struct io_buffer * alloc_iob_raw(size_t len, size_t align, size_t offset)
Allocate I/O buffer with specified alignment and offset.
#define iob_reserve(iobuf, len)
An Ethernet link-layer header.
References alloc_iob_raw(), iob_reserve, and len.
static int ipoib_join_broadcast_group |
( |
struct ipoib_device * |
ipoib | ) |
|
|
static |
Join IPv4 broadcast multicast group.
- Parameters
-
- Return values
-
Definition at line 767 of file ipoib.c.
775 DBGC ( ipoib,
"IPoIB %p could not join broadcast group: %s\n",
struct arbelprm_rc_send_wqe rc
void ipoib_join_complete(struct ib_mc_membership *membership, int rc)
Handle IPv4 broadcast multicast group join completion.
struct ib_device * ibdev
Underlying Infiniband device.
int ib_mcast_join(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_mc_membership *membership, struct ib_address_vector *av, unsigned int mask, void(*complete)(struct ib_mc_membership *membership, int rc))
Join multicast group.
struct ib_queue_pair * qp
Queue pair.
char * strerror(int errno)
Retrieve string representation of error number.
struct ib_mc_membership membership
Multicast group membership.
struct ipoib_broadcast broadcast
Broadcast address.
struct ib_address_vector av
Address vector.
References ipoib_broadcast::av, ipoib_device::broadcast, DBGC, ib_mcast_join(), ipoib_device::ibdev, ipoib_join_complete(), ipoib_broadcast::membership, ipoib_device::qp, rc, and strerror().
Referenced by ipoib_link_state_changed().
static void ipoib_link_state_changed |
( |
struct ipoib_device * |
ipoib | ) |
|
|
static |
Handle link status change.
- Parameters
-
Definition at line 800 of file ipoib.c.
831 DBGC ( ipoib,
"IPoIB %p could not rejoin broadcast group: " int ib_link_rc(struct ib_device *ibdev)
Get link state.
struct arbelprm_rc_send_wqe rc
static __always_inline int ib_link_ok(struct ib_device *ibdev)
Check link state of Infiniband device.
union ib_gid gid
Port GID (comprising GID prefix and port GUID)
static int ib_is_open(struct ib_device *ibdev)
Check whether or not Infiniband device is open.
struct ib_device * ibdev
Underlying Infiniband device.
#define IB_PKEY_FULL
Infiniband partition key full membership flag.
struct ib_queue_pair * qp
Queue pair.
unsigned int gid_present
GID is present.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static struct net_device * netdev
struct ipoib_mac mac
MAC address.
static void ipoib_leave_broadcast_group(struct ipoib_device *ipoib)
Leave IPv4 broadcast multicast group.
#define IB_QPN_BROADCAST
Broadcast QPN.
char * strerror(int errno)
Retrieve string representation of error number.
void netdev_link_err(struct net_device *netdev, int rc)
Mark network device as having a specific link state.
unsigned long qpn
Queue Pair Number.
#define EINPROGRESS_JOINING
Link status for "broadcast join in progress".
struct ipoib_broadcast broadcast
Broadcast address.
static int ipoib_join_broadcast_group(struct ipoib_device *ipoib)
Join IPv4 broadcast multicast group.
union ib_gid gid
GID, if present.
uint16_t pkey
Partition key.
struct ipoib_mac mac
Local MAC.
struct ib_address_vector av
Address vector.
union ib_gid gid
Port GID.
void * memset(void *dest, int character, size_t len) __nonnull
struct net_device * netdev
Network device.
References ipoib_broadcast::av, ipoib_device::broadcast, DBGC, EINPROGRESS_JOINING, ipoib_mac::gid, ib_address_vector::gid, ib_device::gid, ib_address_vector::gid_present, htons, ib_is_open(), ib_link_ok(), ib_link_rc(), IB_PKEY_FULL, IB_QPN_BROADCAST, ipoib_device::ibdev, ipoib_join_broadcast_group(), ipoib_leave_broadcast_group(), ipoib_device::mac, ipoib_broadcast::mac, memcpy(), memset(), netdev, ipoib_device::netdev, netdev_link_err(), ib_device::pkey, ib_gid::prefix, ipoib_device::qp, ib_address_vector::qpn, rc, ib_gid::s, strerror(), and ib_gid::words.
Referenced by ipoib_notify(), and ipoib_open().
static int ipoib_open |
( |
struct net_device * |
netdev | ) |
|
|
static |
Open IPoIB network device.
- Parameters
-
- Return values
-
Definition at line 844 of file ipoib.c.
851 DBGC ( ipoib,
"IPoIB %p could not open device: %s\n",
858 &ipoib->
cq ) ) != 0 ) {
859 DBGC ( ipoib,
"IPoIB %p could not create completion queue: " 868 &ipoib->
qp ) ) != 0 ) {
869 DBGC ( ipoib,
"IPoIB %p could not create queue pair: %s\n",
struct arbelprm_rc_send_wqe rc
struct ib_device * ibdev
Underlying Infiniband device.
static void ipoib_link_state_changed(struct ipoib_device *ipoib)
Handle link status change.
#define IPOIB_NUM_RECV_WQES
Number of IPoIB receive work queue entries.
struct ib_queue_pair * qp
Queue pair.
int ib_create_cq(struct ib_device *ibdev, unsigned int num_cqes, struct ib_completion_queue_operations *op, struct ib_completion_queue **new_cq)
Create completion queue.
void ib_refill_recv(struct ib_device *ibdev, struct ib_queue_pair *qp)
Refill receive work queue.
int ib_open(struct ib_device *ibdev)
Open port.
void ib_close(struct ib_device *ibdev)
Close port.
void ib_destroy_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
void * priv
Driver private data.
unsigned long qpn
Queue pair number.
static struct net_device * netdev
char * strerror(int errno)
Retrieve string representation of error number.
void ib_destroy_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
uint32_t flags__qpn
Queue pair number.
static struct ib_completion_queue_operations ipoib_cq_op
IPoIB completion operations.
#define IPOIB_NUM_CQES
Number of IPoIB completion entries.
#define IPOIB_NUM_SEND_WQES
Number of IPoIB send work queue entries.
char name[NETDEV_NAME_LEN]
Name of this network device.
int ib_create_qp(struct ib_device *ibdev, enum ib_queue_pair_type type, unsigned int num_send_wqes, struct ib_completion_queue *send_cq, unsigned int num_recv_wqes, struct ib_completion_queue *recv_cq, struct ib_queue_pair_operations *op, const char *name, struct ib_queue_pair **new_qp)
Create queue pair.
static struct ib_queue_pair_operations ipoib_qp_op
IPoIB queue pair operations.
static __always_inline void ib_qp_set_ownerdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair owner-private data.
struct ipoib_mac mac
Local MAC.
struct ib_completion_queue * cq
Completion queue.
References ipoib_device::cq, DBGC, ipoib_mac::flags__qpn, htonl, ib_close(), ib_create_cq(), ib_create_qp(), ib_destroy_cq(), ib_destroy_qp(), ib_open(), ib_qp_set_ownerdata(), IB_QPT_UD, ib_refill_recv(), ipoib_device::ibdev, ipoib_cq_op, ipoib_link_state_changed(), IPOIB_NUM_CQES, IPOIB_NUM_RECV_WQES, IPOIB_NUM_SEND_WQES, ipoib_qp_op, ipoib_device::mac, net_device::name, netdev, net_device::priv, ipoib_device::qp, ib_queue_pair::qpn, rc, and strerror().
static int ipoib_probe |
( |
struct ib_device * |
ibdev | ) |
|
|
static |
Probe IPoIB device.
- Parameters
-
- Return values
-
Definition at line 937 of file ipoib.c.
949 memset ( ipoib, 0,
sizeof ( *ipoib ) );
972 goto err_register_netdev;
struct arbelprm_rc_send_wqe rc
union ib_gid gid
Port GID (comprising GID prefix and port GUID)
struct ib_device * ibdev
Underlying Infiniband device.
struct device * dev
Underlying device.
struct net_device * alloc_ipoibdev(size_t priv_size)
Allocate IPoIB device.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
#define list_del(list)
Delete an entry from a list.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct list_head peers
REMAC cache.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
void * priv
Driver private data.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
static struct net_device * netdev
struct ipoib_mac mac
MAC address.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
int register_netdev(struct net_device *netdev)
Register network device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
struct device * dev
Underlying hardware device.
#define INIT_LIST_HEAD(list)
Initialise a list head.
struct ipoib_broadcast broadcast
Broadcast address.
struct list_head list
List of IPoIB devices.
static struct net_device_operations ipoib_operations
IPoIB network device operations.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
uint8_t lemac[ETH_ALEN]
IPoIB LEMAC (if non-default)
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
struct ipoib_mac mac
Local MAC.
An IPoIB broadcast address.
union ib_gid gid
Port GID.
void * memset(void *dest, int character, size_t len) __nonnull
struct net_device * netdev
Network device.
References alloc_ipoibdev(), ipoib_device::broadcast, net_device::dev, ib_device::dev, ENOMEM, ETH_ALEN, ipoib_mac::gid, ib_device::gid, ib_gid::guid, net_device::hw_addr, ipoib_device::ibdev, INIT_LIST_HEAD, ipoib_operations, ib_device::lemac, ipoib_device::list, list_add_tail, list_del, net_device::ll_addr, ipoib_device::mac, ipoib_broadcast::mac, memcpy(), memset(), netdev, ipoib_device::netdev, netdev_init(), netdev_nullify(), netdev_put(), ipoib_device::peers, net_device::priv, rc, register_netdev(), ib_gid::s, and unregister_netdev().