RDMA/CMA: Implement rdma_resolve_ip retry enhancement.
Subsystems (3)
PATCH 1/1 RDMA/CMA: Implement rdma_resolve_ip retry enhancement.
RDMA/CMA: Implement rdma_resolve_ip retry enhancement.
If an application is calling rdma_resolve_ip() and a status of -ENODATA is returned from addr_resolve_local/remote(), the timeout mechanism waits until the application's timeout occurs before rechecking the address resolution status; the application will wait until it's full timeout occurs. This case is seen when the work thread call to process_req() is made before the arp packet is processed.
This patch is in addition to Steve Wise's neigh_event_send patch to initiate neighbour discovery sent on 9/12/2007.
--- drivers/infiniband/core/addr.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
drivers/infiniband/core/addr.c +9 -2
@@ -55,6 +55,7 @@ struct addr_req {int status; }; +#define MIN_ADDR_TIMEOUT_MS 500static void process_req (struct work_struct *work);static DEFINE_MUTEX (lock);
@@ -136,6 +137,7 @@ static void set_timeout(unsigned long tistatic void queue_req (struct addr_req *req) {struct addr_req *temp_req; +unsigned long req_timeout =msecs_to_jiffies (MIN_ADDR_TIMEOUT_MS ) + jiffies;mutex_lock (&lock);list_for_each_entry_reverse (temp_req, &req_list, list) {
@@ -145,8 +147,10 @@ static void queue_req(struct addr_req *rlist_add (&req->list, &temp_req->list); -if (req_list.next == &req->list) +if (req_list.next == &req->list) { + req_timeout =min (req_timeout, req->timeout);set_timeout (req->timeout); + }mutex_unlock (&lock); }
@@ -220,6 +224,7 @@ static void process_req(struct work_strustruct addr_req *req, *temp_req;struct sockaddr_in *src_in, *dst_in;struct list_head done_list; +unsigned long req_timeout;INIT_LIST_HEAD (&done_list);
@@ -238,9 +243,11 @@ static void process_req(struct work_strulist_move_tail (&req->list, &done_list); } + req_timeout =msecs_to_jiffies (MIN_ADDR_TIMEOUT_MS ) + jiffies;if (!list_empty (&req_list)) { req = list_entry(req_list.next, struct addr_req, list); -set_timeout (req->timeout); + req_timeout =min (req_timeout, req->timeout); +set_timeout (req_timeout); }mutex_unlock (&lock);
Thanks for the patch...
Quoted 1 line
If an application is calling
rdma_resolve_ip()and a status of-ENODATAis returned from addr_resolve_local/remote(), the timeout mechanism waits until the application's timeout occurs before rechecking the address resolution status; the application will wait until it's full timeout occurs. This case is seen when the work thread call toprocess_req()is made before the arp packet is processed.
I'm having a hard time understanding this changelog. Could you please resend with a description that lets me understand:
- What the current behavior is and what is wrong with that;
- What the behavior should be;
- And how your patch changes the behavior to be correct.
Quoted 1 line
This patch is in addition to Steve Wise's
neigh_event_sendpatch to initiate neighbour discovery sent on 9/12/2007.
Does this mean it depends on Steve's patch being applied first?
Also please try to keep lines in the changelog to 72 characters or so...
Quoted 9 lines
drivers/infiniband/core/addr.c +1
-0@@ -136,6 +137,7 @@ static void set_timeout(unsigned long tistatic void queue_req (struct addr_req *req) {struct addr_req *temp_req; +unsigned long req_timeout =msecs_to_jiffies (MIN_ADDR_TIMEOUT_MS ) + jiffies;mutex_lock (&lock);list_for_each_entry_reverse (temp_req, &req_list, list) {
drivers/infiniband/core/addr.c static void queue_req(struct addr_req *r · line 155
Quoted 10 lines
drivers/infiniband/core/addr.c +3
-1@@ -145,8 +147,10 @@ static void queue_req(struct addr_req *rlist_add (&req->list, &temp_req->list); -if (req_list.next == &req->list) +if (req_list.next == &req->list) { + req_timeout =min (req_timeout, req->timeout);set_timeout (req->timeout); + }mutex_unlock (&lock); }
I don't understand this code. It seems you keep track of the minimum timeout, and then ignore the value you computed. What am I missing?
Thanks,
Roland
Quoted 1 line
If an application is calling
rdma_resolve_ip()and a status of-ENODATAis returned from addr_resolve_local/remote(), the timeout mechanism waits until the application's timeout occurs before rechecking the address resolution status; the application will wait until it's full timeout occurs. This case is seen when the work thread call toprocess_req()is made before the arp packet is processed.
I don't understand the issue. process_req() is invoked whenever a network event occurs, which rechecks all pending requests.
Quoted 1 line
This patch is in addition to Steve Wise's
neigh_event_sendpatch to initiate neighbour discovery sent on 9/12/2007.
This patch looks unrelated to Steve's patch. Can you clarify the relationship?
- Sean
Quoted 10 lines
Quoted 1 line
If an application is calling
rdma_resolve_ip()and a statusof
-ENODATAis returned from addr_resolve_local/remote(), the timeout mechanism waits until the application's timeout occurs before rechecking the address resolution status; the application will wait until it's full timeout occurs. This case is seen when the work thread call toprocess_req()is made before the arp packet is processed.I don't understand the issue.
process_req()is invoked whenever a network event occurs, which rechecks all pending requests.
Yes, I see the netevent_callback(). I now agree that this patch is not necessary.
Roland, please disregard.
Glenn.
Quoted 9 lines
Quoted 2 lines
This patch is in addition to Steve Wise's
neigh_event_sendpatch to initiate neighbour discovery sent on 9/12/2007.
This patch looks unrelated to Steve's patch. Can you clarify the relationship?
- Sean