Browse Source

[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>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
114a2f19a6
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      src/net/infiniband/ib_pathrec.c

+ 6
- 7
src/net/infiniband/ib_pathrec.c View File

75
 	       "%d\n", ibdev->name, IB_GID_ARGS ( dgid ), path->av.lid,
75
 	       "%d\n", ibdev->name, IB_GID_ARGS ( dgid ), path->av.lid,
76
 	       path->av.sl, path->av.rate );
76
 	       path->av.sl, path->av.rate );
77
 
77
 
78
+	/* Use only the LID if no GRH is needed for this path */
79
+	if ( memcmp ( &path->av.gid.s.prefix, &ibdev->gid.s.prefix,
80
+		      sizeof ( path->av.gid.s.prefix ) ) == 0 ) {
81
+		path->av.gid_present = 0;
82
+	}
83
+
78
  out:
84
  out:
79
 	/* Destroy the completed transaction */
85
 	/* Destroy the completed transaction */
80
 	ib_destroy_madx ( ibdev, mi, madx );
86
 	ib_destroy_madx ( ibdev, mi, madx );
245
 	struct ib_cached_path *cached;
251
 	struct ib_cached_path *cached;
246
 	unsigned int cache_idx;
252
 	unsigned int cache_idx;
247
 
253
 
248
-	/* Sanity check */
249
-	if ( ! av->gid_present ) {
250
-		DBGC ( ibdev, "IBDEV %s attempt to look up path without GID\n",
251
-		       ibdev->name );
252
-		return -EINVAL;
253
-	}
254
-
255
 	/* Look in cache for a matching entry */
254
 	/* Look in cache for a matching entry */
256
 	cached = ib_find_path_cache_entry ( ibdev, gid );
255
 	cached = ib_find_path_cache_entry ( ibdev, gid );
257
 	if ( cached && cached->path->av.lid ) {
256
 	if ( cached && cached->path->av.lid ) {

Loading…
Cancel
Save