e509a42
From 77245b944b7d14a4e139984c3773e994c6ef6703 Mon Sep 17 00:00:00 2001
e509a42
From: Eddie Wai <eddie.wai@broadcom.com>
e509a42
Date: Wed, 11 Dec 2013 15:38:12 -0800
e509a42
Subject: [PATCH] ISCSIUIO: Added tx doorbell override mechanism
e509a42
e509a42
Added a new tx doorbell field in the uio path to work with new
e509a42
bnx2x/cnic drivers that supports VF_RSS.
e509a42
e509a42
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
e509a42
---
e509a42
 iscsiuio/src/unix/libs/bnx2x.c | 13 ++++++++++---
e509a42
 iscsiuio/src/unix/libs/bnx2x.h |  9 ++++++++-
e509a42
 2 files changed, 18 insertions(+), 4 deletions(-)
e509a42
e509a42
diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
e509a42
index 36fc48e..748b59d 100644
e509a42
--- a/iscsiuio/src/unix/libs/bnx2x.c
e509a42
+++ b/iscsiuio/src/unix/libs/bnx2x.c
e509a42
@@ -900,8 +900,14 @@ static int bnx2x_open(nic_t *nic)
e509a42
 		struct client_init_general_data *data = bp->bufs;
e509a42
 
e509a42
 		bp->client_id = data->client_id;
e509a42
-		if (data->reserved0)
e509a42
-			bp->cid = data->reserved0;
e509a42
+		if (data->uid.cid)
e509a42
+			bp->cid = data->uid.cid;
e509a42
+		if (bp->version.minor >= 78 && bp->version.sub_minor >= 55 &&
e509a42
+		    data->uid.cid_override_key == UIO_USE_TX_DOORBELL) {
e509a42
+			bp->tx_doorbell = data->uid.tx_db_off;
e509a42
+			LOG_INFO(PFX "%s: tx doorbell override offset = 0x%x",
e509a42
+				 nic->log_name, bp->tx_doorbell);
e509a42
+		}
e509a42
 	}
e509a42
 
e509a42
 	LOG_INFO(PFX "%s: func 0x%x, pfid 0x%x, client_id 0x%x, cid 0x%x",
e509a42
@@ -928,7 +934,8 @@ static int bnx2x_open(nic_t *nic)
e509a42
 		     USTORM_RX_PRODS_E2_OFFSET(cl_qzone_id) :
e509a42
 		     USTORM_RX_PRODS_E1X_OFFSET(bp->port, bp->client_id));
e509a42
 
e509a42
-		bp->tx_doorbell = bp->cid * 0x80 + 0x40;
e509a42
+		if (!bp->tx_doorbell)
e509a42
+			bp->tx_doorbell = bp->cid * 0x80 + 0x40;
e509a42
 
e509a42
 		bp->get_rx_cons = bnx2x_get_rx_60;
e509a42
 		bp->get_tx_cons = bnx2x_get_tx_60;
e509a42
diff --git a/iscsiuio/src/unix/libs/bnx2x.h b/iscsiuio/src/unix/libs/bnx2x.h
e509a42
index 0b74e44..ce55cfc 100644
e509a42
--- a/iscsiuio/src/unix/libs/bnx2x.h
e509a42
+++ b/iscsiuio/src/unix/libs/bnx2x.h
e509a42
@@ -382,6 +382,13 @@ union eth_rx_cqe_70 {
e509a42
 	struct eth_rx_cqe_next_page_70 next_page_cqe_70;
e509a42
 };
e509a42
 
e509a42
+struct uio_init_data {
e509a42
+	__u32 cid;
e509a42
+	__u32 tx_db_off;
e509a42
+	__u32 cid_override_key;
e509a42
+#define UIO_USE_TX_DOORBELL	0x017855DB
e509a42
+};
e509a42
+
e509a42
 struct client_init_general_data {
e509a42
 	__u8 client_id;
e509a42
 	__u8 statistics_counter_id;
e509a42
@@ -394,7 +401,7 @@ struct client_init_general_data {
e509a42
 	__u8 func_id;
e509a42
 	__u8 cos;
e509a42
 	__u8 traffic_type;
e509a42
-	__u32 reserved0;
e509a42
+	struct uio_init_data uid;
e509a42
 };
e509a42
 
e509a42
 /******************************************************************************
e509a42
-- 
e509a42
1.8.3.1
e509a42