netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
@ 2008-08-22 18:39 Karen Xie
  2008-08-22 19:12 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Karen Xie @ 2008-08-22 18:39 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA, open-iscsi-/JYPxA39Uh5TLH3MbocFFw,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: jgarzik-e+AXbWqSrlAAvxtiuMwx3w, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	michaelc-hcNo3dDEHLuVc3sceRu5cw,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	rdreier-FYB4Gu1CFyUAvxtiuMwx3w, daisyc-r/Jw6+rmf7HQT0dZR+AlfA,
	wenxiong-r/Jw6+rmf7HQT0dZR+AlfA, bhua-r/Jw6+rmf7HQT0dZR+AlfA,
	divy-ut6Up61K2wZBDgjK7y7TUQ, dm-ut6Up61K2wZBDgjK7y7TUQ,
	leedom-ut6Up61K2wZBDgjK7y7TUQ, kxie-ut6Up61K2wZBDgjK7y7TUQ


[PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address

From: Karen Xie <kxie-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>

stg can be tricky ...
[adding @adapter in cxgb3_arp_process doxygen header]
The accelerated iSCSI traffic uses a private IP address unknown to the OS.
The driver has to reply to ARP requests dedicated to the private IP address.

Signed-off-by: Divy Le Ray <divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
---

 drivers/net/cxgb3/sge.c |   71 ++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 1b0861d..d2a9285 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -36,6 +36,7 @@
 #include <linux/ip.h>
 #include <linux/tcp.h>
 #include <linux/dma-mapping.h>
+#include <net/arp.h>
 #include "common.h"
 #include "regs.h"
 #include "sge_defs.h"
@@ -1859,6 +1860,54 @@ static void restart_tx(struct sge_qset *qs)
 }
 
 /**
+ *	cxgb3_arp_process - process an ARP request probing a private IP address
+ *	@adapter: the adapter
+ *	@skb: the skbuff containing the ARP request
+ *
+ *	Check if the ARP request is probing the private IP address
+ *	dedicated to iSCSI, generate an ARP reply if so.
+ */
+static void cxgb3_arp_process(struct adapter *adapter, struct sk_buff *skb)
+{
+	struct net_device *dev = skb->dev;
+	struct port_info *pi;
+	struct arphdr *arp;
+	unsigned char *arp_ptr;
+	unsigned char *sha;
+	u32 sip, tip;
+
+	if (!dev)
+		return;
+
+	skb_reset_network_header(skb);
+	arp = arp_hdr(skb);
+
+	if (arp->ar_op != htons(ARPOP_REQUEST))
+		return;
+
+	arp_ptr = (unsigned char *)(arp + 1);
+	sha = arp_ptr;
+	arp_ptr += dev->addr_len;
+	memcpy(&sip, arp_ptr, 4);
+	arp_ptr += 4;
+	arp_ptr += dev->addr_len;
+	memcpy(&tip, arp_ptr, 4);
+
+	pi = netdev_priv(dev);
+	if (ntohl(tip) != pi->iscsi_ipaddr)
+		return;
+
+	arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
+		 dev->dev_addr, sha);
+
+}
+
+static inline int is_arp(struct sk_buff *skb)
+{
+	return skb->protocol == htons(ETH_P_ARP);
+}
+
+/**
  *	rx_eth - process an ingress ethernet packet
  *	@adap: the adapter
  *	@rq: the response queue that received the packet
@@ -1882,7 +1931,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
 	pi = netdev_priv(skb->dev);
 	if (pi->rx_csum_offload && p->csum_valid && p->csum == htons(0xffff) &&
 	    !p->fragment) {
-		rspq_to_qset(rq)->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
+		qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 	} else
 		skb->ip_summed = CHECKSUM_NONE;
@@ -1891,22 +1940,34 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
 		struct vlan_group *grp = pi->vlan_grp;
 
 		qs->port_stats[SGE_PSTAT_VLANEX]++;
-		if (likely(grp))
+
+		if (likely(grp)) {
 			if (lro)
 				lro_vlan_hwaccel_receive_skb(&qs->lro_mgr, skb,
 							     grp,
 							     ntohs(p->vlan),
 							     p);
-			else
+			else {
+				if (unlikely(pi->iscsi_ipaddr && is_arp(skb))) {
+					unsigned short vtag = ntohs(p->vlan) &
+							      VLAN_VID_MASK;
+					skb->dev = vlan_group_get_device(grp,
+									 vtag);
+					cxgb3_arp_process(adap, skb);
+				}
 				__vlan_hwaccel_rx(skb, grp, ntohs(p->vlan),
 					  	  rq->polling);
-		else
+			}
+		} else
 			dev_kfree_skb_any(skb);
 	} else if (rq->polling) {
 		if (lro)
 			lro_receive_skb(&qs->lro_mgr, skb, p);
-		else
+		else {
+			if (unlikely(pi->iscsi_ipaddr && is_arp(skb)))
+				cxgb3_arp_process(adap, skb);
 			netif_receive_skb(skb);
+		}
 	} else
 		netif_rx(skb);
 }

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

* Re: [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
  2008-08-22 18:39 [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address Karen Xie
@ 2008-08-22 19:12 ` Andrew Morton
  2008-08-22 19:32   ` Steve Wise
  2008-08-25 13:45   ` Stephen Hemminger
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2008-08-22 19:12 UTC (permalink / raw)
  To: Karen Xie
  Cc: netdev, open-iscsi, linux-scsi, linux-kernel, jgarzik, davem,
	michaelc, swise, rdreier, daisyc, wenxiong, bhua, divy, dm,
	leedom, kxie

On Fri, 22 Aug 2008 11:39:08 -0700
Karen Xie <kxie@chelsio.com> wrote:

> [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
> 
> From: Karen Xie <kxie@chelsio.com>
> 
> stg can be tricky ...
> [adding @adapter in cxgb3_arp_process doxygen header]
> The accelerated iSCSI traffic uses a private IP address unknown to the OS.
> The driver has to reply to ARP requests dedicated to the private IP address.
> 
> Signed-off-by: Divy Le Ray <divy@chelsio.com>
> ---
> 
>  drivers/net/cxgb3/sge.c |   71 ++++++++++++++++++++++++++++++++++++++++++++---
>  1 files changed, 66 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
> index 1b0861d..d2a9285 100644
> --- a/drivers/net/cxgb3/sge.c
> +++ b/drivers/net/cxgb3/sge.c
> @@ -36,6 +36,7 @@
>  #include <linux/ip.h>
>  #include <linux/tcp.h>
>  #include <linux/dma-mapping.h>
> +#include <net/arp.h>
>  #include "common.h"
>  #include "regs.h"
>  #include "sge_defs.h"
> @@ -1859,6 +1860,54 @@ static void restart_tx(struct sge_qset *qs)
>  }
>  
>  /**
> + *	cxgb3_arp_process - process an ARP request probing a private IP address
> + *	@adapter: the adapter
> + *	@skb: the skbuff containing the ARP request
> + *
> + *	Check if the ARP request is probing the private IP address
> + *	dedicated to iSCSI, generate an ARP reply if so.
> + */
> +static void cxgb3_arp_process(struct adapter *adapter, struct sk_buff *skb)
> +{
> +	struct net_device *dev = skb->dev;
> +	struct port_info *pi;
> +	struct arphdr *arp;
> +	unsigned char *arp_ptr;
> +	unsigned char *sha;
> +	u32 sip, tip;
> +
> +	if (!dev)
> +		return;

Can this happen?

> +	skb_reset_network_header(skb);
> +	arp = arp_hdr(skb);
> +
> +	if (arp->ar_op != htons(ARPOP_REQUEST))
> +		return;
> +
> +	arp_ptr = (unsigned char *)(arp + 1);
> +	sha = arp_ptr;
> +	arp_ptr += dev->addr_len;
> +	memcpy(&sip, arp_ptr, 4);
> +	arp_ptr += 4;
> +	arp_ptr += dev->addr_len;
> +	memcpy(&tip, arp_ptr, 4);

Should arp_hdr_len() be used here?

> +	pi = netdev_priv(dev);
> +	if (ntohl(tip) != pi->iscsi_ipaddr)
> +		return;
> +
> +	arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
> +		 dev->dev_addr, sha);
> +
> +}
> +
> +static inline int is_arp(struct sk_buff *skb)
> +{
> +	return skb->protocol == htons(ETH_P_ARP);

Other net code uses __constant_htons() for this.

(Dunno why - if it makes a difference, htons() is broken?)



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

* Re: [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
  2008-08-22 19:12 ` Andrew Morton
@ 2008-08-22 19:32   ` Steve Wise
  2008-08-25 13:45   ` Stephen Hemminger
  1 sibling, 0 replies; 6+ messages in thread
From: Steve Wise @ 2008-08-22 19:32 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Karen Xie, netdev, open-iscsi, linux-scsi, linux-kernel, jgarzik,
	davem, michaelc, rdreier, daisyc, wenxiong, bhua, divy, dm,
	leedom

Andrew Morton wrote:
> On Fri, 22 Aug 2008 11:39:08 -0700
> Karen Xie <kxie@chelsio.com> wrote:
>
>   
>> [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
>>
>> From: Karen Xie <kxie@chelsio.com>
>>
>> stg can be tricky ...
>> [adding @adapter in cxgb3_arp_process doxygen header]
>> The accelerated iSCSI traffic uses a private IP address unknown to the OS.
>> The driver has to reply to ARP requests dedicated to the private IP address.
>>
>> Signed-off-by: Divy Le Ray <divy@chelsio.com>
>> ---
>>
>>  drivers/net/cxgb3/sge.c |   71 ++++++++++++++++++++++++++++++++++++++++++++---
>>  1 files changed, 66 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
>> index 1b0861d..d2a9285 100644
>> --- a/drivers/net/cxgb3/sge.c
>> +++ b/drivers/net/cxgb3/sge.c
>> @@ -36,6 +36,7 @@
>>  #include <linux/ip.h>
>>  #include <linux/tcp.h>
>>  #include <linux/dma-mapping.h>
>> +#include <net/arp.h>
>>  #include "common.h"
>>  #include "regs.h"
>>  #include "sge_defs.h"
>> @@ -1859,6 +1860,54 @@ static void restart_tx(struct sge_qset *qs)
>>  }
>>  
>>  /**
>> + *	cxgb3_arp_process - process an ARP request probing a private IP address
>> + *	@adapter: the adapter
>> + *	@skb: the skbuff containing the ARP request
>> + *
>> + *	Check if the ARP request is probing the private IP address
>> + *	dedicated to iSCSI, generate an ARP reply if so.
>> + */
>> +static void cxgb3_arp_process(struct adapter *adapter, struct sk_buff *skb)
>> +{
>> +	struct net_device *dev = skb->dev;
>> +	struct port_info *pi;
>> +	struct arphdr *arp;
>> +	unsigned char *arp_ptr;
>> +	unsigned char *sha;
>> +	u32 sip, tip;
>> +
>> +	if (!dev)
>> +		return;
>>     
>
> Can this happen?
>
>   
>> +	skb_reset_network_header(skb);
>> +	arp = arp_hdr(skb);
>> +
>> +	if (arp->ar_op != htons(ARPOP_REQUEST))
>> +		return;
>> +
>> +	arp_ptr = (unsigned char *)(arp + 1);
>> +	sha = arp_ptr;
>> +	arp_ptr += dev->addr_len;
>> +	memcpy(&sip, arp_ptr, 4);
>> +	arp_ptr += 4;
>> +	arp_ptr += dev->addr_len;
>> +	memcpy(&tip, arp_ptr, 4);
>>     
>
> Should arp_hdr_len() be used here?
>
>   
>> +	pi = netdev_priv(dev);
>> +	if (ntohl(tip) != pi->iscsi_ipaddr)
>> +		return;
>> +
>> +	arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
>> +		 dev->dev_addr, sha);
>> +
>> +}
>> +
>> +static inline int is_arp(struct sk_buff *skb)
>> +{
>> +	return skb->protocol == htons(ETH_P_ARP);
>>     
>
> Other net code uses __constant_htons() for this.
>
> (Dunno why - if it makes a difference, htons() is broken?)
>
>
>   
Doesn't this avoid complaints from sparse endian checking?



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

* Re: [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
  2008-08-22 19:12 ` Andrew Morton
  2008-08-22 19:32   ` Steve Wise
@ 2008-08-25 13:45   ` Stephen Hemminger
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2008-08-25 13:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Karen Xie, netdev, open-iscsi, linux-scsi, linux-kernel, jgarzik,
	davem, michaelc, swise, rdreier, daisyc, wenxiong, bhua, divy, dm,
	leedom

On Fri, 22 Aug 2008 12:12:50 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Fri, 22 Aug 2008 11:39:08 -0700
> Karen Xie <kxie@chelsio.com> wrote:
> 
> > [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
> > 
> > From: Karen Xie <kxie@chelsio.com>
> > 
> > stg can be tricky ...
> > [adding @adapter in cxgb3_arp_process doxygen header]
> > The accelerated iSCSI traffic uses a private IP address unknown to the OS.
> > The driver has to reply to ARP requests dedicated to the private IP address.
> > 
> > Signed-off-by: Divy Le Ray <divy@chelsio.com>
> > ---
> > 
> >  drivers/net/cxgb3/sge.c |   71 ++++++++++++++++++++++++++++++++++++++++++++---
> >  1 files changed, 66 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
> > index 1b0861d..d2a9285 100644
> > --- a/drivers/net/cxgb3/sge.c
> > +++ b/drivers/net/cxgb3/sge.c
> > @@ -36,6 +36,7 @@
> >  #include <linux/ip.h>
> >  #include <linux/tcp.h>
> >  #include <linux/dma-mapping.h>
> > +#include <net/arp.h>
> >  #include "common.h"
> >  #include "regs.h"
> >  #include "sge_defs.h"
> > @@ -1859,6 +1860,54 @@ static void restart_tx(struct sge_qset *qs)
> >  }
> >  
> >  /**
> > + *	cxgb3_arp_process - process an ARP request probing a private IP address
> > + *	@adapter: the adapter
> > + *	@skb: the skbuff containing the ARP request
> > + *
> > + *	Check if the ARP request is probing the private IP address
> > + *	dedicated to iSCSI, generate an ARP reply if so.
> > + */
> > +static void cxgb3_arp_process(struct adapter *adapter, struct sk_buff *skb)
> > +{
> > +	struct net_device *dev = skb->dev;
> > +	struct port_info *pi;
> > +	struct arphdr *arp;
> > +	unsigned char *arp_ptr;
> > +	unsigned char *sha;
> > +	u32 sip, tip;
> > +
> > +	if (!dev)
> > +		return;
> 
> Can this happen?
> 
> > +	skb_reset_network_header(skb);
> > +	arp = arp_hdr(skb);
> > +
> > +	if (arp->ar_op != htons(ARPOP_REQUEST))
> > +		return;
> > +
> > +	arp_ptr = (unsigned char *)(arp + 1);
> > +	sha = arp_ptr;
> > +	arp_ptr += dev->addr_len;
> > +	memcpy(&sip, arp_ptr, 4);
> > +	arp_ptr += 4;
> > +	arp_ptr += dev->addr_len;
> > +	memcpy(&tip, arp_ptr, 4);
> 
> Should arp_hdr_len() be used here?
> 
> > +	pi = netdev_priv(dev);
> > +	if (ntohl(tip) != pi->iscsi_ipaddr)
> > +		return;
> > +
> > +	arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
> > +		 dev->dev_addr, sha);
> > +
> > +}
> > +
> > +static inline int is_arp(struct sk_buff *skb)
> > +{
> > +	return skb->protocol == htons(ETH_P_ARP);
> 
> Other net code uses __constant_htons() for this.

htons() goes through several levels of indirection to make sure
that if argument is constant, no code is necessary. The practice is
reserve __constant_htons() only for those cases like initialization and case
statements where C won't allow it.

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

* [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
@ 2008-08-28  4:21 Karen Xie
  2008-09-13 19:31 ` Jeff Garzik
  0 siblings, 1 reply; 6+ messages in thread
From: Karen Xie @ 2008-08-28  4:21 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA, open-iscsi-/JYPxA39Uh5TLH3MbocFFw,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: jgarzik-e+AXbWqSrlAAvxtiuMwx3w, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	michaelc-hcNo3dDEHLuVc3sceRu5cw,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	rdreier-FYB4Gu1CFyUAvxtiuMwx3w, daisyc-r/Jw6+rmf7HQT0dZR+AlfA,
	wenxiong-r/Jw6+rmf7HQT0dZR+AlfA, bhua-r/Jw6+rmf7HQT0dZR+AlfA,
	divy-ut6Up61K2wZBDgjK7y7TUQ, dm-ut6Up61K2wZBDgjK7y7TUQ,
	leedom-ut6Up61K2wZBDgjK7y7TUQ, kxie-ut6Up61K2wZBDgjK7y7TUQ


[PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address

From: Karen Xie <kxie-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>

The accelerated iSCSI traffic uses a private IP address unknown to the OS.
The driver has to reply to ARP requests dedicated to the private IP address.

Signed-off-by: Divy Le Ray <divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
---

 drivers/net/cxgb3/sge.c |   72 ++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 67 insertions(+), 5 deletions(-)


diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 1b0861d..2f17cf3 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -36,6 +36,7 @@
 #include <linux/ip.h>
 #include <linux/tcp.h>
 #include <linux/dma-mapping.h>
+#include <net/arp.h>
 #include "common.h"
 #include "regs.h"
 #include "sge_defs.h"
@@ -1859,6 +1860,54 @@ static void restart_tx(struct sge_qset *qs)
 }
 
 /**
+ *	cxgb3_arp_process - process an ARP request probing a private IP address
+ *	@adapter: the adapter
+ *	@skb: the skbuff containing the ARP request
+ *
+ *	Check if the ARP request is probing the private IP address
+ *	dedicated to iSCSI, generate an ARP reply if so.
+ */
+static void cxgb3_arp_process(struct adapter *adapter, struct sk_buff *skb)
+{
+	struct net_device *dev = skb->dev;
+	struct port_info *pi;
+	struct arphdr *arp;
+	unsigned char *arp_ptr;
+	unsigned char *sha;
+	__be32 sip, tip;
+
+	if (!dev)
+		return;
+
+	skb_reset_network_header(skb);
+	arp = arp_hdr(skb);
+
+	if (arp->ar_op != htons(ARPOP_REQUEST))
+		return;
+
+	arp_ptr = (unsigned char *)(arp + 1);
+	sha = arp_ptr;
+	arp_ptr += dev->addr_len;
+	memcpy(&sip, arp_ptr, sizeof(sip));
+	arp_ptr += sizeof(sip);
+	arp_ptr += dev->addr_len;
+	memcpy(&tip, arp_ptr, sizeof(tip));
+
+	pi = netdev_priv(dev);
+	if (tip != pi->iscsi_ipv4addr)
+		return;
+
+	arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
+		 dev->dev_addr, sha);
+
+}
+
+static inline int is_arp(struct sk_buff *skb)
+{
+	return skb->protocol == htons(ETH_P_ARP);
+}
+
+/**
  *	rx_eth - process an ingress ethernet packet
  *	@adap: the adapter
  *	@rq: the response queue that received the packet
@@ -1882,7 +1931,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
 	pi = netdev_priv(skb->dev);
 	if (pi->rx_csum_offload && p->csum_valid && p->csum == htons(0xffff) &&
 	    !p->fragment) {
-		rspq_to_qset(rq)->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
+		qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 	} else
 		skb->ip_summed = CHECKSUM_NONE;
@@ -1891,22 +1940,35 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
 		struct vlan_group *grp = pi->vlan_grp;
 
 		qs->port_stats[SGE_PSTAT_VLANEX]++;
-		if (likely(grp))
+
+		if (likely(grp)) {
 			if (lro)
 				lro_vlan_hwaccel_receive_skb(&qs->lro_mgr, skb,
 							     grp,
 							     ntohs(p->vlan),
 							     p);
-			else
+			else {
+				if (unlikely(pi->iscsi_ipv4addr &&
+					     is_arp(skb))) {
+					unsigned short vtag = ntohs(p->vlan) &
+							VLAN_VID_MASK;
+					skb->dev = vlan_group_get_device(grp,
+									 vtag);
+					cxgb3_arp_process(adap, skb);
+				}
 				__vlan_hwaccel_rx(skb, grp, ntohs(p->vlan),
 					  	  rq->polling);
-		else
+			}
+		} else
 			dev_kfree_skb_any(skb);
 	} else if (rq->polling) {
 		if (lro)
 			lro_receive_skb(&qs->lro_mgr, skb, p);
-		else
+		else {
+			if (unlikely(pi->iscsi_ipv4addr && is_arp(skb)))
+				cxgb3_arp_process(adap, skb);
 			netif_receive_skb(skb);
+		}
 	} else
 		netif_rx(skb);
 }

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

* Re: [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
  2008-08-28  4:21 Karen Xie
@ 2008-09-13 19:31 ` Jeff Garzik
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2008-09-13 19:31 UTC (permalink / raw)
  To: Karen Xie
  Cc: netdev, open-iscsi, linux-scsi, linux-kernel, davem, michaelc,
	swise, rdreier, daisyc, wenxiong, bhua, divy, dm, leedom

Karen Xie wrote:
> [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address
> 
> From: Karen Xie <kxie@chelsio.com>
> 
> The accelerated iSCSI traffic uses a private IP address unknown to the OS.
> The driver has to reply to ARP requests dedicated to the private IP address.
> 
> Signed-off-by: Divy Le Ray <divy@chelsio.com>

Acked-by: Jeff Garzik <jgarzik@redhat.com>



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

end of thread, other threads:[~2008-09-13 19:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-22 18:39 [PATCH 2/4 2.6.28] cxgb3 - handle ARP replies for private iSCSI IP address Karen Xie
2008-08-22 19:12 ` Andrew Morton
2008-08-22 19:32   ` Steve Wise
2008-08-25 13:45   ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2008-08-28  4:21 Karen Xie
2008-09-13 19:31 ` Jeff Garzik

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