[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.