[openib-general] [PATCH] [kdapl] More minor AT changes

Hal Rosenstock halr at voltaire.com
Tue May 17 14:10:58 PDT 2005


More minor AT changes
Integrate a couple more changes from shahar-ibat branch

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: at.c
===================================================================
--- at.c	(revision 2371)
+++ at.c	(working copy)
@@ -454,8 +454,8 @@
 	struct path_req *pa = container_of(a, struct path_req, pend);
 	struct path_req *pb = container_of(b, struct path_req, pend);
 
-	return !memcmp(&pa->rt.sgid, &pa->rt.sgid, sizeof(pa->rt.sgid)) &&
-	       !memcmp(&pa->rt.sgid, &pa->rt.sgid, sizeof(pa->rt.sgid)) &&
+	return !memcmp(&pa->rt.sgid, &pb->rt.sgid, sizeof(pa->rt.sgid)) &&
+	       !memcmp(&pa->rt.dgid, &pb->rt.dgid, sizeof(pa->rt.dgid)) &&
 	       pa->rt.out_dev == pb->rt.out_dev &&
 	       pa->rt.out_port == pb->rt.out_port &&
 	       pa->rt.attr.pkey == pb->rt.attr.pkey &&
@@ -590,18 +590,18 @@
 		return;
 	}
 
+	req->pend.sa_query = NULL;
+
 	if (status) {
 		DEBUG("status %d - check if should retry", status);
 		if (status == -ETIMEDOUT &&
 		    jiffies - req->pend.start < IB_AT_REQ_TIMEOUT)
 			resolve_path(req);
 		else
-			req_end(&req->pend, -ETIMEDOUT, &pending_reqs);
+			req_end(&req->pend, status, &pending_reqs);
 		return;
 	}
 
-	req->pend.sa_query = NULL;
-
 	req->pend.nelem = path_req_output(req, resp, 1,
 					  req->pend.data, req->pend.nelem);
 
@@ -737,13 +737,13 @@
 
 	arp = (struct ib_arp *)skb->nh.raw;
 
-	DEBUG("Process IB ARP ip <%d.%d.%d.%d> gid <0x%016llx%016llx>",
-	      (arp->src_ip & 0x000000ff),
-	      (arp->src_ip & 0x0000ff00) >> 8,
-	      (arp->src_ip & 0x00ff0000) >> 16,
-	      (arp->src_ip & 0xff000000) >> 24,
-	      be64_to_cpu(arp->src_gid.global.subnet_prefix),
-	      be64_to_cpu(arp->src_gid.global.interface_id));
+	WARN("Process IB ARP ip <%d.%d.%d.%d> gid <0x%016llx%016llx>",
+	     (arp->src_ip & 0x000000ff),
+	     (arp->src_ip & 0x0000ff00) >> 8,
+	     (arp->src_ip & 0x00ff0000) >> 16,
+	     (arp->src_ip & 0xff000000) >> 24,
+	     be64_to_cpu(arp->src_gid.global.subnet_prefix),
+	     be64_to_cpu(arp->src_gid.global.interface_id));
 
 	spin_lock_irqsave(&q->lock, flags);
 	for (a = q->next; a != q; a = a->next) {
@@ -811,6 +811,9 @@
 	struct async *parent;
 	int r;
 
+	if (flags & IB_AT_ROUTE_FORCE_ATS)
+		return -EINVAL; /* for now */
+
 	if (!ib_route || !dst_ip)
 		return -EINVAL;
 
@@ -875,6 +878,7 @@
 
 	/* TODO: cache lookup
 	if (in_cache) {
+		DEBUG("!in_cache free req %p", preq);
 		kmem_cache_free(path_req_cache, preq);
 		return path_req_output(preq, cached_arr, n, path_arr, npath);
 	}
@@ -883,6 +887,7 @@
 	/* TODO: resolve outdev if not given
 	r = resolve_outdev(&preq->rt);
 	if (r < 0) {
+		DEBUG("resolve_outdev r < 0 free req %p", preq);
 		kmem_cache_free(path_req_cache, preq);
 		return r;
 	}
@@ -1029,7 +1034,7 @@
 
 	/*
 	 * install device for receiving ARP packets in parallel to the normal
-	 * Linux ARP, this will be the SDP notifier that an ARP request has
+	 * Linux ARP, this will be the notifier that an ARP request has
 	 * completed.
 	 */
 	dev_add_pack(&ib_at_arp_type);






More information about the general mailing list