From: Ryan Mallon <rmallon@gmail.com>
To: Lennert Buytenhek <buytenh@wantstofly.org>,
Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Hartley Sweeten <hsweeten@visionengravers.com>,
alexander.sverdlin@gmail.com
Subject: Re: [PATCH v2 net-next 06/12] ep93xx_eth: add GRO support
Date: Tue, 16 May 2017 06:43:20 +1000 [thread overview]
Message-ID: <591A12E8.1050603@gmail.com> (raw)
In-Reply-To: <20170515103132.GA24992@wantstofly.org>
On 15/05/17 20:31, Lennert Buytenhek wrote:
> On Sat, Feb 04, 2017 at 03:24:56PM -0800, Eric Dumazet wrote:
>
>> Use napi_complete_done() instead of __napi_complete() to :
>>
>> 1) Get support of gro_flush_timeout if opt-in
>> 2) Not rearm interrupts for busy-polling users.
>> 3) use standard NAPI API.
>> 4) get rid of baroque code and ease maintenance.
>>
>> [...]
>>
>> @@ -310,35 +311,17 @@ static int ep93xx_rx(struct net_device *dev, int processed, int budget)
>> return processed;
>> }
>>
>> -static int ep93xx_have_more_rx(struct ep93xx_priv *ep)
>> -{
>> - struct ep93xx_rstat *rstat = ep->descs->rstat + ep->rx_pointer;
>> - return !!((rstat->rstat0 & RSTAT0_RFP) && (rstat->rstat1 & RSTAT1_RFP));
>> -}
>> -
>> static int ep93xx_poll(struct napi_struct *napi, int budget)
>> {
>> struct ep93xx_priv *ep = container_of(napi, struct ep93xx_priv, napi);
>> struct net_device *dev = ep->dev;
>> - int rx = 0;
>> -
>> -poll_some_more:
>> - rx = ep93xx_rx(dev, rx, budget);
>> - if (rx < budget) {
>> - int more = 0;
>> + int rx;
>>
>> + rx = ep93xx_rx(dev, budget);
>> + if (rx < budget && napi_complete_done(napi, rx)) {
>> spin_lock_irq(&ep->rx_lock);
>> - __napi_complete(napi);
>> wrl(ep, REG_INTEN, REG_INTEN_TX | REG_INTEN_RX);
>> - if (ep93xx_have_more_rx(ep)) {
>> - wrl(ep, REG_INTEN, REG_INTEN_TX);
>> - wrl(ep, REG_INTSTSP, REG_INTSTS_RX);
>> - more = 1;
>> - }
>> spin_unlock_irq(&ep->rx_lock);
>> -
>> - if (more && napi_reschedule(napi))
>> - goto poll_some_more;
>> }
>>
>> if (rx) {
>
> This code was the way it was because the ep93xx hardware is somewhat
> braindead. If I remember correctly (but it's been a while since I wrote
> this code):
>
> 1. ep93xx netdev IRQs are edge-triggered, so if you re-enable IRQs
> while there was still work to be done, you will not get another IRQ.
>
> 2. Disabling an interrupt source in the interrupt mask register will
> cause its interrupt status bit to always return zero, so you cannot
> check whether an interrupt status is pending without having the
> interrupt source enabled.
>
> (I'll admit that a comment explaining this would have been in order.)
>
> I don't know if we really care about this hardware anymore (I don't),
> but the ep93xx platform is still listed as being maintained in the
> MAINTAINERS file -- adding Ryan and Hartley.
I no longer have any ep93xx hardware to test with, and I never looked at
the Ethernet, so don't know the details. I think there are still a
handful of users. Adding Alexander who sent an ADC support series this
week, who might be able to test this?
~Ryan
next prev parent reply other threads:[~2017-05-15 20:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-04 23:24 [PATCH v2 net-next 00/12] net: get rid of __napi_complete() Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 01/12] 8139too: use napi_complete_done() Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 02/12] 8139cp: " Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 03/12] epic100: " Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 04/12] amd8111e: add GRO support Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 05/12] pcnet32: use napi_complete_done() Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 06/12] ep93xx_eth: add GRO support Eric Dumazet
2017-05-15 10:31 ` Lennert Buytenhek
2017-05-15 20:43 ` Ryan Mallon [this message]
2017-05-15 21:02 ` Alexander Sverdlin
2017-05-16 20:41 ` Alexander Sverdlin
2017-05-16 20:48 ` Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 07/12] skge: use napi_complete_done() Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 08/12] ks8695net: add GRO support Eric Dumazet
2017-02-04 23:24 ` [PATCH v2 net-next 09/12] qla3xxx: " Eric Dumazet
2017-02-04 23:25 ` [PATCH v2 net-next 10/12] ibm/emac: use napi_complete_done() Eric Dumazet
2017-02-04 23:25 ` [PATCH v2 net-next 11/12] aeroflex/greth: " Eric Dumazet
2017-02-04 23:25 ` [PATCH v2 net-next 12/12] net: remove __napi_complete() Eric Dumazet
2017-02-05 22:16 ` [PATCH v2 net-next 00/12] net: get rid of __napi_complete() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=591A12E8.1050603@gmail.com \
--to=rmallon@gmail.com \
--cc=alexander.sverdlin@gmail.com \
--cc=buytenh@wantstofly.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=hsweeten@visionengravers.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).