From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 3/6] cnic: Fix ring setup/shutdown code
Date: Wed, 13 Jul 2011 20:24:19 -0700 [thread overview]
Message-ID: <1310613862-27497-3-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1310613862-27497-2-git-send-email-mchan@broadcom.com>
Latest bnx2x driver uses different CID for the iSCSI rings, so
we need to pass it in the ring init data. The rx ring is also
zeroed out to prevent stale DMA addresses from being used after
shutdown.
The same cp local variable redefined inside the else branch is
also eliminated.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
---
drivers/net/cnic.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index a881e42..bdfe155 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -4923,7 +4923,7 @@ static void cnic_init_rings(struct cnic_dev *dev)
struct client_init_ramrod_data *data;
union l5cm_specific_data l5_data;
struct ustorm_eth_rx_producers rx_prods = {0};
- u32 off, i;
+ u32 off, i, *cid_ptr;
rx_prods.bd_prod = 0;
rx_prods.cqe_prod = BNX2X_MAX_RCQ_DESC_CNT;
@@ -4942,6 +4942,7 @@ static void cnic_init_rings(struct cnic_dev *dev)
set_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags);
data = udev->l2_buf;
+ cid_ptr = udev->l2_buf + 12;
memset(data, 0, sizeof(*data));
@@ -4966,12 +4967,15 @@ static void cnic_init_rings(struct cnic_dev *dev)
"iSCSI CLIENT_SETUP did not complete\n");
cnic_spq_completion(dev, DRV_CTL_RET_L2_SPQ_CREDIT_CMD, 1);
cnic_ring_ctl(dev, cid, cli, 1);
+ *cid_ptr = cid;
}
}
static void cnic_shutdown_rings(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_uio_dev *udev = cp->udev;
+ void *rx_ring;
if (!test_bit(CNIC_LCL_FL_RINGS_INITED, &cp->cnic_local_flags))
return;
@@ -4979,7 +4983,6 @@ static void cnic_shutdown_rings(struct cnic_dev *dev)
if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
cnic_shutdown_bnx2_rx_ring(dev);
} else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) {
- struct cnic_local *cp = dev->cnic_priv;
u32 cli = cp->ethdev->iscsi_l2_client_id;
u32 cid = cp->ethdev->iscsi_l2_cid;
union l5cm_specific_data l5_data;
@@ -5009,6 +5012,8 @@ static void cnic_shutdown_rings(struct cnic_dev *dev)
msleep(10);
}
clear_bit(CNIC_LCL_FL_RINGS_INITED, &cp->cnic_local_flags);
+ rx_ring = udev->l2_ring + BCM_PAGE_SIZE;
+ memset(rx_ring, 0, BCM_PAGE_SIZE);
}
static int cnic_register_netdev(struct cnic_dev *dev)
--
1.6.4.GIT
next prev parent reply other threads:[~2011-07-14 4:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 3:24 [PATCH net-next 1/6] cnic: Replace get_random_bytes() with random32() Michael Chan
2011-07-14 3:24 ` [PATCH net-next 2/6] cnic: Fix port_mode setting Michael Chan
2011-07-14 3:24 ` Michael Chan [this message]
2011-07-14 3:24 ` [PATCH net-next 4/6] cnic: Return proper error code if we fail to send netlink message Michael Chan
2011-07-14 3:24 ` [PATCH net-next 5/6] bnx2: Add MCP dump Michael Chan
2011-07-14 3:24 ` [PATCH net-next 6/6] bnx2: Read iSCSI config from shared memory during ->probe() Michael Chan
2011-07-14 15:46 ` David Miller
2011-07-14 15:46 ` [PATCH net-next 5/6] bnx2: Add MCP dump David Miller
2011-07-14 15:46 ` [PATCH net-next 4/6] cnic: Return proper error code if we fail to send netlink message David Miller
2011-07-14 15:46 ` [PATCH net-next 3/6] cnic: Fix ring setup/shutdown code David Miller
2011-07-14 15:46 ` [PATCH net-next 2/6] cnic: Fix port_mode setting David Miller
2011-07-14 15:46 ` [PATCH net-next 1/6] cnic: Replace get_random_bytes() with random32() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310613862-27497-3-git-send-email-mchan@broadcom.com \
--to=mchan@broadcom.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).