netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/7] cxgb3 - fix netpoll hanlder
@ 2007-05-26 22:59 divy
  2007-05-28 22:35 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: divy @ 2007-05-26 22:59 UTC (permalink / raw)
  To: jeff; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>

Fix netpoll handler to work with line interrupt, msi and msi-x.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
---

 drivers/net/cxgb3/cxgb3_main.c |   12 +++++++++---
 drivers/net/cxgb3/sge.c        |    1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 67b4b21..e0ef724 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2076,10 +2076,16 @@ static void vlan_rx_kill_vid(struct net_
 static void cxgb_netpoll(struct net_device *dev)
 {
 	struct adapter *adapter = dev->priv;
-	struct sge_qset *qs = dev2qset(dev);
+	struct port_info *pi = netdev_priv(dev);
+	int qidx;
 
-	t3_intr_handler(adapter, qs->rspq.polling) (adapter->pdev->irq,
-						    adapter);
+	for (qidx = pi->first_qset; qidx < pi->first_qset + pi->nqsets; qidx++) {
+		struct sge_qset *qs = &adapter->sge.qs[qidx];
+		
+		t3_intr_handler(adapter, qs->rspq.polling) (0, 
+					(adapter->flags & USING_MSIX) ?
+					(void *)qs : (void *)adapter);
+	}
 }
 #endif
 
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 8dd5b1e..a2cfd68 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2228,7 +2228,6 @@ irqreturn_t t3_sge_intr_msix_napi(int ir
 	struct sge_rspq *q = &qs->rspq;
 
 	spin_lock(&q->lock);
-	BUG_ON(napi_is_scheduled(qs->netdev));
 
 	if (handle_responses(adap, q) < 0)
 		q->unhandled_irqs++;

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

* Re: [PATCH 2/7] cxgb3 - fix netpoll hanlder
  2007-05-26 22:59 [PATCH 2/7] cxgb3 - fix netpoll hanlder divy
@ 2007-05-28 22:35 ` Jeff Garzik
  2007-05-29 23:59   ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2007-05-28 22:35 UTC (permalink / raw)
  To: divy; +Cc: netdev, linux-kernel, swise

divy@chelsio.com wrote:
> From: Divy Le Ray <divy@chelsio.com>
> 
> Fix netpoll handler to work with line interrupt, msi and msi-x.
> 
> Signed-off-by: Divy Le Ray <divy@chelsio.com>
> ---
> 
>  drivers/net/cxgb3/cxgb3_main.c |   12 +++++++++---
>  drivers/net/cxgb3/sge.c        |    1 -
>  2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
> index 67b4b21..e0ef724 100644
> --- a/drivers/net/cxgb3/cxgb3_main.c
> +++ b/drivers/net/cxgb3/cxgb3_main.c
> @@ -2076,10 +2076,16 @@ static void vlan_rx_kill_vid(struct net_
>  static void cxgb_netpoll(struct net_device *dev)
>  {
>  	struct adapter *adapter = dev->priv;
> -	struct sge_qset *qs = dev2qset(dev);
> +	struct port_info *pi = netdev_priv(dev);
> +	int qidx;
>  
> -	t3_intr_handler(adapter, qs->rspq.polling) (adapter->pdev->irq,
> -						    adapter);
> +	for (qidx = pi->first_qset; qidx < pi->first_qset + pi->nqsets; qidx++) {
> +		struct sge_qset *qs = &adapter->sge.qs[qidx];
> +		
> +		t3_intr_handler(adapter, qs->rspq.polling) (0, 
> +					(adapter->flags & USING_MSIX) ?
> +					(void *)qs : (void *)adapter);

Remove needless casts to void*



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

* Re: [PATCH 2/7] cxgb3 - fix netpoll hanlder
  2007-05-28 22:35 ` Jeff Garzik
@ 2007-05-29 23:59   ` Jeremy Fitzhardinge
  2007-05-30  0:42     ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2007-05-29 23:59 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: divy, netdev, linux-kernel, swise

Jeff Garzik wrote:
>>
>> +        t3_intr_handler(adapter, qs->rspq.polling) (0,
>> +                    (adapter->flags & USING_MSIX) ?
>> +                    (void *)qs : (void *)adapter);
>
> Remove needless casts to void*
The two branches of ?: need to have the same type; without the casts
they'd be "struct sge_qset" and "struct adapter".  Seems a bit cruddy to
have two types passed to one function depending on the MSI state, but
maybe that's OK.

    J

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

* Re: [PATCH 2/7] cxgb3 - fix netpoll hanlder
  2007-05-29 23:59   ` Jeremy Fitzhardinge
@ 2007-05-30  0:42     ` Jeff Garzik
  2007-05-30 16:06       ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2007-05-30  0:42 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: divy, netdev, linux-kernel, swise

Jeremy Fitzhardinge wrote:
> Jeff Garzik wrote:
>>> +        t3_intr_handler(adapter, qs->rspq.polling) (0,
>>> +                    (adapter->flags & USING_MSIX) ?
>>> +                    (void *)qs : (void *)adapter);
>> Remove needless casts to void*
> The two branches of ?: need to have the same type; without the casts
> they'd be "struct sge_qset" and "struct adapter".  Seems a bit cruddy to
> have two types passed to one function depending on the MSI state, but
> maybe that's OK.

Look at the function argument...

	Jeff




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

* Re: [PATCH 2/7] cxgb3 - fix netpoll hanlder
  2007-05-30  0:42     ` Jeff Garzik
@ 2007-05-30 16:06       ` Jeremy Fitzhardinge
  0 siblings, 0 replies; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2007-05-30 16:06 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: divy, netdev, linux-kernel, swise

Jeff Garzik wrote:
> Look at the function argument... 

Yes, it's void *.  But my point is that C requires the ?: to evaluate to
some specific type, so if you have different types on each side of the :
the compiler can be legitimately upset.  The fact that the whole thing
gets cast to void * is somewhat irrelevant.

    J

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

end of thread, other threads:[~2007-05-30 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-26 22:59 [PATCH 2/7] cxgb3 - fix netpoll hanlder divy
2007-05-28 22:35 ` Jeff Garzik
2007-05-29 23:59   ` Jeremy Fitzhardinge
2007-05-30  0:42     ` Jeff Garzik
2007-05-30 16:06       ` Jeremy Fitzhardinge

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