Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
@ 2009-06-26 22:17 kxie
  2009-06-27 17:52 ` Mike Christie
  0 siblings, 1 reply; 4+ messages in thread
From: kxie @ 2009-06-26 22:17 UTC (permalink / raw)
  To: linux-scsi, open-iscsi; +Cc: kxie, James.Bottomley, michaelc

[PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled

From: Karen Xie <kxie@chelsio.com>

There is a bug when VLAN is configured on the cxgb3 interface, the iscsi
conn. would be denied with message "cxgb3i: NOT going through cxgbi device."

This patch added code to get the real egress net_device when vlan is configured.

Signed-off-by: Karen Xie <kxie@chelsio.com>
---

 drivers/scsi/cxgb3i/cxgb3i_iscsi.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
index 04a4374..60013a4 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
@@ -13,6 +13,7 @@
 
 #include <linux/inet.h>
 #include <linux/crypto.h>
+#include <linux/if_vlan.h>
 #include <net/tcp.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
@@ -183,6 +184,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
 	struct cxgb3i_adapter *snic;
 	int i;
 
+	if (ndev->priv_flags & IFF_802_1Q_VLAN)
+		ndev = vlan_dev_real_dev(ndev);
+
 	read_lock(&cxgb3i_snic_rwlock);
 	list_for_each_entry(snic, &cxgb3i_snic_list, list_head) {
 		for (i = 0; i < snic->hba_cnt; i++) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
  2009-06-26 22:17 [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled kxie
@ 2009-06-27 17:52 ` Mike Christie
  2009-06-27 17:55   ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Christie @ 2009-06-27 17:52 UTC (permalink / raw)
  To: open-iscsi; +Cc: linux-scsi, kxie, James.Bottomley

On 06/26/2009 05:17 PM, kxie@chelsio.com wrote:
> [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
>
> From: Karen Xie<kxie@chelsio.com>
>
> There is a bug when VLAN is configured on the cxgb3 interface, the iscsi
> conn. would be denied with message "cxgb3i: NOT going through cxgbi device."
>
> This patch added code to get the real egress net_device when vlan is configured.
>
> Signed-off-by: Karen Xie<kxie@chelsio.com>
> ---
>
>   drivers/scsi/cxgb3i/cxgb3i_iscsi.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
>
> diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> index 04a4374..60013a4 100644
> --- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> +++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> @@ -13,6 +13,7 @@
>
>   #include<linux/inet.h>
>   #include<linux/crypto.h>
> +#include<linux/if_vlan.h>
>   #include<net/tcp.h>
>   #include<scsi/scsi_cmnd.h>
>   #include<scsi/scsi_device.h>
> @@ -183,6 +184,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
>   	struct cxgb3i_adapter *snic;
>   	int i;
>
> +	if (ndev->priv_flags&  IFF_802_1Q_VLAN)
> +		ndev = vlan_dev_real_dev(ndev);
> +
>   	read_lock(&cxgb3i_snic_rwlock);
>   	list_for_each_entry(snic,&cxgb3i_snic_list, list_head) {
>   		for (i = 0; i<  snic->hba_cnt; i++) {
>

It looks ok, but when touching network stuff you might want to cc the 
netdev list in the future. Well, maybe for non-trivial stuff at least. 
This might be fine.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
  2009-06-27 17:52 ` Mike Christie
@ 2009-06-27 17:55   ` James Bottomley
  2009-06-27 18:13     ` Karen Xie
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2009-06-27 17:55 UTC (permalink / raw)
  To: Mike Christie; +Cc: open-iscsi, linux-scsi, kxie

On Sat, 2009-06-27 at 12:52 -0500, Mike Christie wrote:
> On 06/26/2009 05:17 PM, kxie@chelsio.com wrote:
> > [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
> >
> > From: Karen Xie<kxie@chelsio.com>
> >
> > There is a bug when VLAN is configured on the cxgb3 interface, the iscsi
> > conn. would be denied with message "cxgb3i: NOT going through cxgbi device."
> >
> > This patch added code to get the real egress net_device when vlan is configured.
> >
> > Signed-off-by: Karen Xie<kxie@chelsio.com>
> > ---
> >
> >   drivers/scsi/cxgb3i/cxgb3i_iscsi.c |    4 ++++
> >   1 files changed, 4 insertions(+), 0 deletions(-)
> >
> >
> > diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> > index 04a4374..60013a4 100644
> > --- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> > +++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> > @@ -13,6 +13,7 @@
> >
> >   #include<linux/inet.h>
> >   #include<linux/crypto.h>
> > +#include<linux/if_vlan.h>
> >   #include<net/tcp.h>
> >   #include<scsi/scsi_cmnd.h>
> >   #include<scsi/scsi_device.h>
> > @@ -183,6 +184,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
> >   	struct cxgb3i_adapter *snic;
> >   	int i;
> >
> > +	if (ndev->priv_flags&  IFF_802_1Q_VLAN)
> > +		ndev = vlan_dev_real_dev(ndev);
> > +
> >   	read_lock(&cxgb3i_snic_rwlock);
> >   	list_for_each_entry(snic,&cxgb3i_snic_list, list_head) {
> >   		for (i = 0; i<  snic->hba_cnt; i++) {
> >
> 
> It looks ok, but when touching network stuff you might want to cc the 
> netdev list in the future. Well, maybe for non-trivial stuff at least. 
> This might be fine.
> 
> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

Thanks, but actually this patch gives a rejection here because of a
commit made by Herbert Xu which is already in mainline:

commit f00a3328bf9ecff46abd68a421693ba71cd16fc8
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Sat May 30 13:40:04 2009 +1000

    [SCSI] cxgb3i: Include net/dst.h for struct dst_cache

It's simple enough to fix up, so I did it, but next time could you
(Karen) check your patches against the relevant trees to make sure
they're up to date.

James



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
  2009-06-27 17:55   ` James Bottomley
@ 2009-06-27 18:13     ` Karen Xie
  0 siblings, 0 replies; 4+ messages in thread
From: Karen Xie @ 2009-06-27 18:13 UTC (permalink / raw)
  To: James Bottomley, Mike Christie; +Cc: open-iscsi, linux-scsi

James & Mike,

Yes, I will cc netdev list next time if there is anything related to the networking.

James, thanks for fixing up the patch. I was using a older tree sorry about it.

Thanks,
Karen


-----Original Message-----
From: James Bottomley [mailto:James.Bottomley@HansenPartnership.com]
Sent: Sat 6/27/2009 10:55 AM
To: Mike Christie
Cc: open-iscsi@googlegroups.com; linux-scsi@vger.kernel.org; Karen Xie
Subject: Re: [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
 
On Sat, 2009-06-27 at 12:52 -0500, Mike Christie wrote:
> On 06/26/2009 05:17 PM, kxie@chelsio.com wrote:
> > [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled
> >
> > From: Karen Xie<kxie@chelsio.com>
> >
> > There is a bug when VLAN is configured on the cxgb3 interface, the iscsi
> > conn. would be denied with message "cxgb3i: NOT going through cxgbi device."
> >
> > This patch added code to get the real egress net_device when vlan is configured.
> >
> > Signed-off-by: Karen Xie<kxie@chelsio.com>
> > ---
> >
> >   drivers/scsi/cxgb3i/cxgb3i_iscsi.c |    4 ++++
> >   1 files changed, 4 insertions(+), 0 deletions(-)
> >
> >
> > diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> > index 04a4374..60013a4 100644
> > --- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> > +++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
> > @@ -13,6 +13,7 @@
> >
> >   #include<linux/inet.h>
> >   #include<linux/crypto.h>
> > +#include<linux/if_vlan.h>
> >   #include<net/tcp.h>
> >   #include<scsi/scsi_cmnd.h>
> >   #include<scsi/scsi_device.h>
> > @@ -183,6 +184,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
> >   	struct cxgb3i_adapter *snic;
> >   	int i;
> >
> > +	if (ndev->priv_flags&  IFF_802_1Q_VLAN)
> > +		ndev = vlan_dev_real_dev(ndev);
> > +
> >   	read_lock(&cxgb3i_snic_rwlock);
> >   	list_for_each_entry(snic,&cxgb3i_snic_list, list_head) {
> >   		for (i = 0; i<  snic->hba_cnt; i++) {
> >
> 
> It looks ok, but when touching network stuff you might want to cc the 
> netdev list in the future. Well, maybe for non-trivial stuff at least. 
> This might be fine.
> 
> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

Thanks, but actually this patch gives a rejection here because of a
commit made by Herbert Xu which is already in mainline:

commit f00a3328bf9ecff46abd68a421693ba71cd16fc8
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Sat May 30 13:40:04 2009 +1000

    [SCSI] cxgb3i: Include net/dst.h for struct dst_cache

It's simple enough to fix up, so I did it, but next time could you
(Karen) check your patches against the relevant trees to make sure
they're up to date.

James




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-27 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-26 22:17 [PATCH 2.6.30-rc] cxgb3i -- fixed connection error when vlan is enabled kxie
2009-06-27 17:52 ` Mike Christie
2009-06-27 17:55   ` James Bottomley
2009-06-27 18:13     ` Karen Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox