Patchwork netxen: reset ring consumer during cleanup

login
register
mail settings
Submitter Dhananjay Phadke
Date July 26, 2009, 6:20 p.m.
Message ID <1248632456-24417-1-git-send-email-dhananjay@netxen.com>
Download mbox | patch
Permalink /patch/30235/
State Accepted
Delegated to: David Miller
Headers show

Comments

Dhananjay Phadke - July 26, 2009, 6:20 p.m.
Reset consumer of status rings to 0 when cleaning
up sw resources. Status rings are not deleted
during suspend since they have napi objects.

This ensures correct rx processing across suspen-resume.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
 drivers/net/netxen/netxen_nic_init.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
David Miller - July 27, 2009, 3:19 a.m.
From: Dhananjay Phadke <dhananjay@netxen.com>
Date: Sun, 26 Jul 2009 11:20:56 -0700

> Reset consumer of status rings to 0 when cleaning
> up sw resources. Status rings are not deleted
> during suspend since they have napi objects.
> 
> This ensures correct rx processing across suspen-resume.
> 
> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 5d3343e..7acf204 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -184,6 +184,13 @@  void netxen_free_sw_resources(struct netxen_adapter *adapter)
 	kfree(recv_ctx->rds_rings);
 
 skip_rds:
+	if (recv_ctx->sds_rings == NULL)
+		goto skip_sds;
+
+	for(ring = 0; ring < adapter->max_sds_rings; ring++)
+		recv_ctx->sds_rings[ring].consumer = 0;
+
+skip_sds:
 	if (adapter->tx_ring == NULL)
 		return;