[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7866DA1F8D2D4541B87FEE88E633ABAA2B72081FE6@MNEXMB1.qlogic.org>
Date: Thu, 5 Aug 2010 11:36:26 -0500
From: Usha Srinivasan <usha.srinivasan@...gic.com>
To: Stephen Hemminger <shemminger@...tta.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: Receive processing stops when dev->poll returns 1
I have compared the code in my driver to code in other drivers and they are quite similar. Here is my code:
int vnic_napi_poll(struct napi_struct *napi, int budget)
{
done = 0;
poll_more:
while (done < budget) {
int max = (budget - done);
t = min(<max-supported-by-driver>, max);
n = get-completions(comp_list);
for (i = 0; i < n; i++, done++)
handle_completions(<complist[i]);
if (n != t)
break;
}
if (done < budget) {
netif_rx_complete(dev, napi);
/* check again just to be sure */
if (more-completions()) {
If netif_rx_reschedule(dev, napi))
goto poll_more;
}
}
return done;
}
***********************
BACKPORTED version:
***********************
int vnic_poll(struct net_device *dev, int *budget)
{
int max = min(*budget, dev->quota);
done = 0;
poll_more:
while (max) {
t = min(<max-supported-by-driver>, max);
n = get-completions(comp_list);
for (i = 0; i < n; i++, --max, done++)
handle_completions(<complist[i]);
if (n != t)
break;
}
if (max) {
netif_rx_complete(dev);
/* check again just to be sure */
if (more-completions()) {
If netif_rx_reschedule(dev, napi))
goto poll_more;
}
ret = 0;
} else
ret = 1;
dev->quota -= done;
*budget -= done;
return ret;
}
***********************
-----Original Message-----
From: Stephen Hemminger [mailto:shemminger@...tta.com]
Sent: Thursday, August 05, 2010 12:23 PM
To: Usha Srinivasan
Cc: netdev@...r.kernel.org
Subject: Re: Receive processing stops when dev->poll returns 1
On Thu, 5 Aug 2010 11:11:51 -0500
Usha Srinivasan <usha.srinivasan@...gic.com> wrote:
> Thanks for your response. What you said is exactly what my driver is doing:
>
>
> <= 2.6.23
> Calls netif_rx_complete if done < budget; decrements quota & *budget by done; returns 0 if done < budget and 1 otherwise.
>
> When 1 is returned, I encounter the problem I described)
>
> > 2.6.23
> Calls napi-complete if done < budget; returns done.
>
> When done==budget, I encounter the problem I described.
>
> Any ideas?
Ignore last mail...
If you done == budget, the poll will be recalled (after other drivers).
If quantum exhausts, then it gets called it gets deferred to ksoftirq
thread.
One possibility is that the driver is looking at wrong parameter
for budget and is exceeding the requested value. Please post your code.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists