Просмотр исходного кода

[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 лет назад
Родитель
Сommit
114a2f19a6
1 измененных файлов: 6 добавлений и 7 удалений
  1. 6
    7
      src/net/infiniband/ib_pathrec.c

+ 6
- 7
src/net/infiniband/ib_pathrec.c Просмотреть файл

@@ -75,6 +75,12 @@ static void ib_path_complete ( struct ib_device *ibdev,
75 75
 	       "%d\n", ibdev->name, IB_GID_ARGS ( dgid ), path->av.lid,
76 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 84
  out:
79 85
 	/* Destroy the completed transaction */
80 86
 	ib_destroy_madx ( ibdev, mi, madx );
@@ -245,13 +251,6 @@ int ib_resolve_path ( struct ib_device *ibdev, struct ib_address_vector *av ) {
245 251
 	struct ib_cached_path *cached;
246 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 254
 	/* Look in cache for a matching entry */
256 255
 	cached = ib_find_path_cache_entry ( ibdev, gid );
257 256
 	if ( cached && cached->path->av.lid ) {

Загрузка…
Отмена
Сохранить