summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorMichael Brown2016-03-04 14:55:50 +0100
committerMichael Brown2016-03-08 13:23:24 +0100
commit114a2f19a638bb92fb39e901d802f68a7276dca1 (patch)
tree328e3165ace9d9ebdbdf25d0985241b1f5a481f5 /src/net
parent[infiniband] Use correct transaction identifier in CM responses (diff)
downloadipxe-114a2f19a638bb92fb39e901d802f68a7276dca1.tar.gz
ipxe-114a2f19a638bb92fb39e901d802f68a7276dca1.tar.xz
ipxe-114a2f19a638bb92fb39e901d802f68a7276dca1.zip
[infiniband] Do not use GRH for local paths
Avoid including an unnecessary GRH in packets sent to unicast destinations within the local subnet. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/infiniband/ib_pathrec.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/net/infiniband/ib_pathrec.c b/src/net/infiniband/ib_pathrec.c
index 113b90bd..4b00f3b9 100644
--- a/src/net/infiniband/ib_pathrec.c
+++ b/src/net/infiniband/ib_pathrec.c
@@ -75,6 +75,12 @@ static void ib_path_complete ( struct ib_device *ibdev,
"%d\n", ibdev->name, IB_GID_ARGS ( dgid ), path->av.lid,
path->av.sl, path->av.rate );
+ /* Use only the LID if no GRH is needed for this path */
+ if ( memcmp ( &path->av.gid.s.prefix, &ibdev->gid.s.prefix,
+ sizeof ( path->av.gid.s.prefix ) ) == 0 ) {
+ path->av.gid_present = 0;
+ }
+
out:
/* Destroy the completed transaction */
ib_destroy_madx ( ibdev, mi, madx );
@@ -245,13 +251,6 @@ int ib_resolve_path ( struct ib_device *ibdev, struct ib_address_vector *av ) {
struct ib_cached_path *cached;
unsigned int cache_idx;
- /* Sanity check */
- if ( ! av->gid_present ) {
- DBGC ( ibdev, "IBDEV %s attempt to look up path without GID\n",
- ibdev->name );
- return -EINVAL;
- }
-
/* Look in cache for a matching entry */
cached = ib_find_path_cache_entry ( ibdev, gid );
if ( cached && cached->path->av.lid ) {