Re: [PATCH 2/2] cxgbi: get rid of gl_skb in cxgbi_ddp_info

2011-01-10 Thread Mike Christie

On 01/10/2011 11:52 AM, Karen Xie wrote:

Hi, Mike,

What I mean is even if cxgb3i maintains a pool of skbs (equivalent of
gl_skbs). Once they are handed down to the network layer cxgb3 they will
still be freed by the network driver (on the tx path).



So hows does it work now? It seems ddp_alloc_gl_skb is called at device 
setup time, then when IO is queued/xmited we run ddp_set_map which 
allocates from gl_skbs. If when you transmit the IO, the driver frees 
the skb, how does gl_skb get replenished?


--
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



RE: [PATCH 2/2] cxgbi: get rid of gl_skb in cxgbi_ddp_info

2011-01-10 Thread Karen Xie
Yes, that's bug this patch is fixing too. The current implementation
does not replenish the gl_skb after the initial allocation.

I am working on an update which utilizing a pool of skbs, and those skbs
would be used not only for the ddp setups (like the current gl_skb) but
also for the connection management like the rx credit returns. So this
skb pool will not reside in cxgbi_ddp_info, so still need to get rid of
gl_skb. I guess this patch can be viewed as an interim fix.

-Original Message-
From: Mike Christie [mailto:micha...@cs.wisc.edu] 
Sent: Monday, January 10, 2011 11:57 AM
To: Karen Xie
Cc: open-iscsi@googlegroups.com; linux-s...@vger.kernel.org;
james.bottom...@hansenpartnership.com
Subject: Re: [PATCH 2/2] cxgbi: get rid of gl_skb in cxgbi_ddp_info

On 01/10/2011 11:52 AM, Karen Xie wrote:
 Hi, Mike,

 What I mean is even if cxgb3i maintains a pool of skbs (equivalent of
 gl_skbs). Once they are handed down to the network layer cxgb3 they
will
 still be freed by the network driver (on the tx path).


So hows does it work now? It seems ddp_alloc_gl_skb is called at device 
setup time, then when IO is queued/xmited we run ddp_set_map which 
allocates from gl_skbs. If when you transmit the IO, the driver frees 
the skb, how does gl_skb get replenished?

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



[PATCH] cxgb3i: fixed connection problem with iscsi private ip

2011-01-10 Thread kxie
[PATCH] cxgb3i: fixed connection problem with iscsi private ip

From: Karen Xie k...@chelsio.com

fixed the connection problem when the private iscsi ipv4 address is provisioned 
on the interface.

Signed-off-by: Karen Xie k...@chelsio.com
---
 drivers/scsi/cxgbi/cxgb3i/cxgb3i.h |   18 ++
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h 
b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
index 5f5e339..bed14db 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
@@ -24,10 +24,20 @@
 
 extern cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS];
 
-#define cxgb3i_get_private_ipv4addr(ndev) \
-   (((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr)
-#define cxgb3i_set_private_ipv4addr(ndev, addr) \
-   (((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr) = addr
+static inline unsigned int cxgb3i_get_private_ipv4addr(struct net_device *ndev)
+{
+   return ((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr;
+}
+
+static inline void cxgb3i_set_private_ipv4addr(struct net_device *ndev,
+   unsigned int addr)
+{
+   struct port_info *pi =  (struct port_info *)netdev_priv(ndev);
+
+   pi-iscsic.flags = addr ? 1 : 0;
+   pi-iscsi_ipv4addr = addr;
+   if (addr)
+   memcpy(pi-iscsic.mac_addr, ndev-dev_addr, ETH_ALEN);
+}
 
 struct cpl_iscsi_hdr_norss {
union opcode_tid ot;

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



[PATCH v2] cxgb3i: fixed connection problem with iscsi private ip

2011-01-10 Thread kxie
[PATCH v2] cxgb3i: fixed connection problem with iscsi private ip

From: Karen Xie k...@chelsio.com

The last one seems to have some formatting problem. Regenerated the patch.

fixed the connection problem when the private iscsi ipv4 address is provisioned 
on the interface.

Signed-off-by: Karen Xie k...@chelsio.com
---
 drivers/scsi/cxgbi/cxgb3i/cxgb3i.h |   19 +++
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h 
b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
index 5f5e339..20593fd 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
@@ -24,10 +24,21 @@
 
 extern cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS];
 
-#define cxgb3i_get_private_ipv4addr(ndev) \
-   (((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr)
-#define cxgb3i_set_private_ipv4addr(ndev, addr) \
-   (((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr) = addr
+static inline unsigned int cxgb3i_get_private_ipv4addr(struct net_device *ndev)
+{
+   return ((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr;
+}
+
+static inline void cxgb3i_set_private_ipv4addr(struct net_device *ndev,
+   unsigned int addr)
+{
+   struct port_info *pi =  (struct port_info *)netdev_priv(ndev);
+
+   pi-iscsic.flags = addr ? 1 : 0;
+   pi-iscsi_ipv4addr = addr;
+   if (addr)
+   memcpy(pi-iscsic.mac_addr, ndev-dev_addr, ETH_ALEN);
+}
 
 struct cpl_iscsi_hdr_norss {
union opcode_tid ot;

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: [PATCH v2] cxgb3i: fixed connection problem with iscsi private ip

2011-01-10 Thread Mike Christie

On 01/10/2011 06:45 PM, k...@chelsio.com wrote:

[PATCH v2] cxgb3i: fixed connection problem with iscsi private ip

From: Karen Xiek...@chelsio.com

The last one seems to have some formatting problem. Regenerated the patch.

fixed the connection problem when the private iscsi ipv4 address is provisioned 
on the interface.

Signed-off-by: Karen Xiek...@chelsio.com
---
  drivers/scsi/cxgbi/cxgb3i/cxgb3i.h |   19 +++
  1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h 
b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
index 5f5e339..20593fd 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.h
@@ -24,10 +24,21 @@

  extern cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS];

-#define cxgb3i_get_private_ipv4addr(ndev) \
-   (((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr)
-#define cxgb3i_set_private_ipv4addr(ndev, addr) \
-   (((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr) = addr
+static inline unsigned int cxgb3i_get_private_ipv4addr(struct net_device *ndev)
+{
+   return ((struct port_info *)(netdev_priv(ndev)))-iscsi_ipv4addr;
+}
+
+static inline void cxgb3i_set_private_ipv4addr(struct net_device *ndev,
+   unsigned int addr)
+{
+   struct port_info *pi =  (struct port_info *)netdev_priv(ndev);
+
+   pi-iscsic.flags = addr ? 1 : 0;
+   pi-iscsi_ipv4addr = addr;
+   if (addr)
+   memcpy(pi-iscsic.mac_addr, ndev-dev_addr, ETH_ALEN);
+}

  struct cpl_iscsi_hdr_norss {
union opcode_tid ot;



Looks ok to me, and it fixes my setup here. Thanks.

Reviewed-by: Mike Christie micha...@cs.wisc.edu

--
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: [PATCH 06/16] BNX2I: Added code to handle the binding of an existing connection

2011-01-10 Thread Or Gerlitz
Mike Christie micha...@cs.wisc.edu wrote:

 +       ep-conn = cls_conn;
 +       cls_conn-ep = ep;

 if not, it doesn't look like ep can be null here...

 Will fix. Tested offload and did not test software iscsi.

Mike, are you pushing this to 2.6.38? if yes, could you send it to
review @ open-iscsi before?

Or.

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: [PATCH 06/16] BNX2I: Added code to handle the binding of an existing connection

2011-01-10 Thread Mike Christie

On 01/11/2011 12:25 AM, Or Gerlitz wrote:

Mike Christiemicha...@cs.wisc.edu  wrote:


+   ep-conn = cls_conn;
+   cls_conn-ep = ep;


if not, it doesn't look like ep can be null here...


Will fix. Tested offload and did not test software iscsi.


Mike, are you pushing this to 2.6.38? if yes, could you send it to
review @ open-iscsi before?



Not sure when I am going to send it. Too late for this feature window, 
and I am not sure it counts as a critical bug fix.


I attached the current version of the patch. It just adds some checks 
for the bug you spotted above.


--
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

commit 9a2c1b712b82301ea93928bfcb2ceba814114d67
Author: Mike Christie micha...@cs.wisc.edu
Date:   Tue Jan 11 16:31:22 2011 -0500

iscsi: fix iscsi_endpoint leak

When iscsid restarts it does not know the connection's
endpoint, so it is getting leaked. This fixes the problem
by having the iscsi class force a disconnect before a
new connection is bound.

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c 
b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 7b2fc98..921c2cb 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -331,8 +331,7 @@ iscsi_iser_conn_destroy(struct iscsi_cls_conn *cls_conn)
 
 static int
 iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
-struct iscsi_cls_conn *cls_conn, uint64_t transport_eph,
-int is_leading)
+struct iscsi_cls_conn *cls_conn, uint64_t transport_eph)
 {
struct iscsi_conn *conn = cls_conn-dd_data;
struct iscsi_iser_conn *iser_conn;
@@ -340,10 +339,6 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
struct iscsi_endpoint *ep;
int error;
 
-   error = iscsi_conn_bind(cls_session, cls_conn, is_leading);
-   if (error)
-   return error;
-
/* the transport ep handle comes from user space so it must be
 * verified against the global ib connections list */
ep = iscsi_lookup_endpoint(transport_eph);
@@ -352,6 +347,11 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
 (unsigned long long)transport_eph);
return -EINVAL;
}
+
+   error = iscsi_conn_bind(cls_session, cls_conn, ep);
+   if (error)
+   return error;
+
ib_conn = ep-dd_data;
 
/* binds the iSER connection retrieved from the previously
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index eaaa881..97533e7 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -174,7 +174,7 @@ static int beiscsi_bindconn_cid(struct beiscsi_hba *phba,
  */
 int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
  struct iscsi_cls_conn *cls_conn,
- u64 transport_fd, int is_leading)
+ u64 transport_fd)
 {
struct iscsi_conn *conn = cls_conn-dd_data;
struct beiscsi_conn *beiscsi_conn = conn-dd_data;
@@ -191,7 +191,7 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
 
beiscsi_ep = ep-dd_data;
 
-   if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
+   if (iscsi_conn_bind(cls_session, cls_conn, ep))
return -EINVAL;
 
if (beiscsi_ep-phba != phba) {
diff --git a/drivers/scsi/be2iscsi/be_iscsi.h b/drivers/scsi/be2iscsi/be_iscsi.h
index 8950a70..4047ec1 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.h
+++ b/drivers/scsi/be2iscsi/be_iscsi.h
@@ -46,7 +46,7 @@ struct iscsi_cls_conn *beiscsi_conn_create(struct 
iscsi_cls_session
 
 int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
  struct iscsi_cls_conn *cls_conn,
- uint64_t transport_fd, int is_leading);
+ uint64_t transport_fd);
 
 int beiscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
   enum iscsi_param param, char *buf);
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index fb50efb..ec41503 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -1370,7 +1370,7 @@ free_conn:
  */
 static int bnx2i_conn_bind(struct iscsi_cls_session *cls_session,
   struct iscsi_cls_conn *cls_conn,
-  uint64_t transport_fd, int is_leading)
+  uint64_t transport_fd)
 {
struct iscsi_conn *conn = cls_conn-dd_data;
struct bnx2i_conn *bnx2i_conn = conn-dd_data;
@@ -1390,7 +1390,7 @@ static int bnx2i_conn_bind(struct iscsi_cls_session