Skip to content

Commit

Permalink
net/ncsi: Enable request timer before sending command
Browse files Browse the repository at this point in the history
The response is received upon the sent command before the request's
timer is enabled under extreme situation. The response packet won't
be processed as the corresponding request (request packet and timer)
isn't complete. It leads to NCSI failure - no package detected.

This fixes the issue by enabling the timer before sending the command.
The comments about the timer has been replaced by that in upstream
kernel.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
  • Loading branch information
Gavin Shan authored and Joel Stanley committed Aug 4, 2016
1 parent b1342b2 commit 2e4db6c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions net/ncsi/ncsi-cmd.c
Original file line number Diff line number Diff line change
@@ -351,20 +351,19 @@ int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
eh->h_source[i] = 0xff;
}

/* Start the timer for the request that might not have
* corresponding response. Given NCSI is an internal
* connection a 1 second delay should be sufficient.
*/
mod_timer(&nr->nr_timer, jiffies + 1 * HZ);
nr->nr_timer_enabled = true;

/* Send NCSI packet */
skb_get(nr->nr_cmd);
ret = dev_queue_xmit(nr->nr_cmd);
if (ret)
goto out;

/* Start the timer for the request that might not have
* corresponding response. I'm not sure 1 second delay
* here is enough. Anyway, NCSI is internal network, so
* the responsiveness should be as fast as enough.
*/
nr->nr_timer_enabled = true;
mod_timer(&nr->nr_timer, jiffies + 1 * HZ);

return 0;
out:
ncsi_free_req(nr, false, false);

0 comments on commit 2e4db6c

Please sign in to comment.