iPXE
ipoib.h File Reference

IP over Infiniband. More...

#include <ipxe/if_arp.h>
#include <ipxe/infiniband.h>

Go to the source code of this file.

Data Structures

struct  ipoib_mac
 An IPoIB MAC address. More...
struct  ipoib_hdr
 IPoIB link-layer header. More...
struct  ipoib_remac
 eIPoIB Remote Ethernet MAC address More...

Macros

#define IPOIB_ALEN   20
 IPoIB MAC address length.
#define IPOIB_HLEN   4
 IPoIB link-layer header length.
#define IPOIB_GUID_MASK   0xe7
 GUID mask used for constructing eIPoIB Local Ethernet MAC address (LEMAC)
#define EIPOIB_QPN_LA   0x02000000UL
 eIPoIB REMAC locally-assigned address indicator

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
const char * ipoib_ntoa (const void *ll_addr)
struct net_devicealloc_ipoibdev (size_t priv_size)
 Allocate IPoIB device.
struct net_deviceipoib_netdev (struct ib_device *ibdev)
 Find IPoIB network device.

Detailed Description

IP over Infiniband.

Definition in file ipoib.h.

Macro Definition Documentation

◆ IPOIB_ALEN

#define IPOIB_ALEN   20

IPoIB MAC address length.

Definition at line 15 of file ipoib.h.

◆ IPOIB_HLEN

#define IPOIB_HLEN   4

IPoIB link-layer header length.

Definition at line 30 of file ipoib.h.

◆ IPOIB_GUID_MASK

#define IPOIB_GUID_MASK   0xe7

GUID mask used for constructing eIPoIB Local Ethernet MAC address (LEMAC)

Definition at line 41 of file ipoib.h.

Referenced by ipoib_init_addr().

◆ EIPOIB_QPN_LA

#define EIPOIB_QPN_LA   0x02000000UL

eIPoIB REMAC locally-assigned address indicator

Definition at line 61 of file ipoib.h.

Referenced by ipoib_complete_recv().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ ipoib_ntoa()

const char * ipoib_ntoa ( const void * ll_addr)
extern

◆ alloc_ipoibdev()

struct net_device * alloc_ipoibdev ( size_t priv_size)
extern

Allocate IPoIB device.

Parameters
priv_sizeSize of driver private data
Return values
netdevNetwork device, or NULL

Definition at line 315 of file ipoib.c.

315 {
316 struct net_device *netdev;
317
318 netdev = alloc_netdev ( priv_size );
319 if ( netdev ) {
320 netdev->ll_protocol = &ipoib_protocol;
321 netdev->ll_broadcast = eth_broadcast;
322 netdev->max_pkt_len = IB_MAX_PAYLOAD_SIZE;
323 }
324 return netdev;
325}
uint8_t eth_broadcast[ETH_ALEN]
Ethernet broadcast MAC address.
Definition ethernet.c:48
static struct net_device * netdev
Definition gdbudp.c:53
#define IB_MAX_PAYLOAD_SIZE
Maximum payload size.
Definition infiniband.h:51
struct net_device * alloc_netdev(size_t priv_len)
Allocate network device.
Definition netdevice.c:722
A network device.
Definition netdevice.h:353

References alloc_netdev(), eth_broadcast, IB_MAX_PAYLOAD_SIZE, and netdev.

Referenced by ipoib_probe().

◆ ipoib_netdev()

struct net_device * ipoib_netdev ( struct ib_device * ibdev)
extern

Find IPoIB network device.

Parameters
ibdevInfiniband device
Return values
netdevIPoIB network device, or NULL if not found

Definition at line 1036 of file ipoib.c.

1036 {
1037 struct ipoib_device *ipoib;
1038
1039 /* Find matching IPoIB device */
1040 list_for_each_entry ( ipoib, &ipoib_devices, list ) {
1041 if ( ipoib->ibdev != ibdev )
1042 continue;
1043 return ipoib->netdev;
1044 }
1045 return NULL;
1046}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition list.h:432
An IPoIB device.
Definition ipoib.c:87
struct net_device * netdev
Network device.
Definition ipoib.c:89
struct ib_device * ibdev
Underlying Infiniband device.
Definition ipoib.c:91
struct list_head list
List of IPoIB devices.
Definition ipoib.c:93

References ipoib_device::ibdev, ipoib_device::list, list_for_each_entry, ipoib_device::netdev, and NULL.

Referenced by golan_register_ibdev().