194b285447
This BTL accesses the Cisco usNIC Linux device via the Linux verbs API via Unreliable Datagram queue pairs. A few noteworthy points: * This BTL does most of its own fragmentation; it tells the PML that it has a very high max_send_size (much higher than the network MTU). * Since UD fragments are, by definition, unreliable, the usnic BTL handles all of its own reliability via a sliding window approach using the opal_hotel construct and many tricks stolen from the corpus of knowledge surrounding efficient TCP. * There is a fun PML latency-metric based optimization for NUMA awareness of short messages. * Note that this is ''not'' a generic UD verbs BTL; it is specific to the Cisco usNIC device. This commit was SVN r28879.
67 строки
1.4 KiB
C
67 строки
1.4 KiB
C
/*
|
|
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#ifndef BTL_USNIC_UTIL_H
|
|
#define BTL_USNIC_UTIL_H
|
|
|
|
#include "btl_usnic.h"
|
|
#include "btl_usnic_module.h"
|
|
|
|
/* Linux kernel fls() */
|
|
static __always_inline int fls(int x)
|
|
{
|
|
int r = 32;
|
|
|
|
if (!x)
|
|
return 0;
|
|
if (!(x & 0xffff0000u)) {
|
|
x <<= 16;
|
|
r -= 16;
|
|
}
|
|
if (!(x & 0xff000000u)) {
|
|
x <<= 8;
|
|
r -= 8;
|
|
}
|
|
if (!(x & 0xf0000000u)) {
|
|
x <<= 4;
|
|
r -= 4;
|
|
}
|
|
if (!(x & 0xc0000000u)) {
|
|
x <<= 2;
|
|
r -= 2;
|
|
}
|
|
if (!(x & 0x80000000u)) {
|
|
r -= 1;
|
|
}
|
|
return r;
|
|
}
|
|
|
|
/*
|
|
* Safely (but abnornmally) exit this process without abort()'ing (and
|
|
* leaving a corefile).
|
|
*/
|
|
void ompi_btl_usnic_exit(void);
|
|
|
|
void ompi_btl_usnic_sprintf_mac(char *out, const uint8_t mac[6]);
|
|
|
|
void ompi_btl_usnic_sprintf_gid_mac(char *out, union ibv_gid *gid);
|
|
|
|
int ompi_btl_usnic_find_ip(ompi_btl_usnic_module_t *module, uint8_t mac[6]);
|
|
|
|
void ompi_btl_usnic_gid_to_mac(union ibv_gid *gid, uint8_t mac[6]);
|
|
|
|
void ompi_btl_usnic_dump_hex(uint8_t *addr, int len);
|
|
|
|
uint32_t ompi_btl_usnic_get_ipv4_subnet(uint32_t addrn, uint32_t cidr_len);
|
|
|
|
void ompi_btl_usnic_util_abort(const char *msg, const char *file, int line,
|
|
int ret);
|
|
|
|
#endif /* BTL_USNIC_UTIL_H */
|