iPXE
Data Structures | Macros | Functions
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. More...
 
#define IPOIB_HLEN   4
 IPoIB link-layer header length. More...
 
#define IPOIB_GUID_MASK   0xe7
 GUID mask used for constructing eIPoIB Local Ethernet MAC address (LEMAC) More...
 
#define EIPOIB_QPN_LA   0x02000000UL
 eIPoIB REMAC locally-assigned address indicator More...
 

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. More...
 
struct net_deviceipoib_netdev (struct ib_device *ibdev)
 Find IPoIB network device. More...
 

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.

◆ EIPOIB_QPN_LA

#define EIPOIB_QPN_LA   0x02000000UL

eIPoIB REMAC locally-assigned address indicator

Definition at line 61 of file ipoib.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ ipoib_ntoa()

const char* ipoib_ntoa ( const void *  ll_addr)

◆ alloc_ipoibdev()

struct net_device* alloc_ipoibdev ( size_t  priv_size)

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;
323  }
324  return netdev;
325 }
uint8_t eth_broadcast[ETH_ALEN]
Ethernet broadcast MAC address.
Definition: ethernet.c:47
const uint8_t * ll_broadcast
Link-layer broadcast address.
Definition: netdevice.h:389
struct net_device * alloc_netdev(size_t priv_len)
Allocate network device.
Definition: netdevice.c:721
static struct net_device * netdev
Definition: gdbudp.c:52
A network device.
Definition: netdevice.h:352
size_t max_pkt_len
Maximum packet length.
Definition: netdevice.h:409
struct ll_protocol * ll_protocol
Link-layer protocol.
Definition: netdevice.h:372
#define IB_MAX_PAYLOAD_SIZE
Maximum payload size.
Definition: infiniband.h:50

References alloc_netdev(), eth_broadcast, IB_MAX_PAYLOAD_SIZE, net_device::ll_broadcast, net_device::ll_protocol, net_device::max_pkt_len, and netdev.

Referenced by ipoib_probe().

◆ ipoib_netdev()

struct net_device* ipoib_netdev ( struct ib_device ibdev)

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 }
struct ib_device * ibdev
Underlying Infiniband device.
Definition: ipoib.c:91
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:431
An IPoIB device.
Definition: ipoib.c:87
struct list_head list
List of IPoIB devices.
Definition: ipoib.c:93
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
struct net_device * netdev
Network device.
Definition: ipoib.c:89

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

Referenced by golan_register_ibdev().