From: Felix Fietkau <nbd@openwrt•org>
To: "Rafał Miłecki" <zajec5@gmail•com>
Cc: Network Development <netdev@vger•kernel.org>,
Hauke Mehrtens <hauke@hauke-m•de>
Subject: Re: [PATCH v4 2/9] bgmac: leave interrupts disabled as long as there is work to do
Date: Mon, 13 Apr 2015 17:03:41 +0200 [thread overview]
Message-ID: <552BDACD.1050306@openwrt.org> (raw)
In-Reply-To: <CACna6rxgjUPdMsnhgvoRQLaOZ+T1epyvj3cDbZnYRtOeG0irtA@mail.gmail.com>
On 2015-04-13 16:34, Rafał Miłecki wrote:
> On 13 April 2015 at 15:52, Felix Fietkau <nbd@openwrt•org> wrote:
>> Always poll rx and tx during NAPI poll instead of relying on the status
>> of the first interrupt. This prevents bgmac_poll from leaving unfinished
>> work around until the next IRQ.
>> In my tests this makes bridging/routing throughput under heavy load more
>> stable and ensures that no new IRQs arrive as long as bgmac_poll uses up
>> the entire budget.
>
> What do you think about keeping u32 int_status; and just updating it
> at the end of bgmac_poll? In case you decide to implement multiple TX
> queues, it may be cheaper to just check a single bit in memory instead
> reading DMA ring status.
Events might arrive in the mean time. I ran some tests, and not checking
the irq status for processing rx/tx gave me fewer total IRQs under load.
>> @@ -1237,25 +1234,17 @@ static irqreturn_t bgmac_interrupt(int irq, void *dev_id)
>> static int bgmac_poll(struct napi_struct *napi, int weight)
>> {
>> struct bgmac *bgmac = container_of(napi, struct bgmac, napi);
>> - struct bgmac_dma_ring *ring;
>> int handled = 0;
>>
>> - if (bgmac->int_status & BGMAC_IS_TX0) {
>> - ring = &bgmac->tx_ring[0];
>> - bgmac_dma_tx_free(bgmac, ring);
>> - bgmac->int_status &= ~BGMAC_IS_TX0;
>> - }
>> + /* Ack */
>> + bgmac_write(bgmac, BGMAC_INT_STATUS, ~0);
>
> Is this OK to ack every IRQ, even un handled ones?
Yes. The only IRQ types that matter are the ones handled by the poll
function.
>> + /* poll again if more events arrived in the mean time */
>> + if (bgmac_read(bgmac, BGMAC_INT_STATUS) & (BGMAC_IS_TX0 | BGMAC_IS_RX))
>> + return handled;
>
> s/mean time/meantime/ (or meanwhile)
> And if you care to keep one type of comments:
> s/poll/Poll/
Will do.
- Felix
next prev parent reply other threads:[~2015-04-13 15:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 13:52 [PATCH v4 1/9] bgmac: simplify tx ring index handling Felix Fietkau
2015-04-13 13:52 ` [PATCH v4 2/9] bgmac: leave interrupts disabled as long as there is work to do Felix Fietkau
2015-04-13 14:34 ` Rafał Miłecki
2015-04-13 15:03 ` Felix Fietkau [this message]
2015-04-13 15:06 ` Rafał Miłecki
2015-04-13 15:44 ` Felix Fietkau
2015-04-13 16:35 ` Rafał Miłecki
2015-04-13 13:52 ` [PATCH v4 3/9] bgmac: set received skb headroom to NET_SKB_PAD Felix Fietkau
2015-04-13 13:52 ` [PATCH v4 4/9] bgmac: simplify rx DMA error handling Felix Fietkau
2015-04-13 14:53 ` Rafał Miłecki
2015-04-13 15:05 ` Felix Fietkau
2015-04-13 13:52 ` [PATCH v4 5/9] bgmac: add check for oversized packets Felix Fietkau
2015-04-13 13:52 ` [PATCH v4 6/9] bgmac: increase rx ring size from 511 to 512 Felix Fietkau
2015-04-13 13:52 ` [PATCH v4 7/9] bgmac: simplify dma init/cleanup Felix Fietkau
2015-04-13 13:52 ` [PATCH v4 8/9] bgmac: fix DMA rx corruption Felix Fietkau
2015-04-13 13:52 ` [PATCH v4 9/9] bgmac: drop ring->num_slots Felix Fietkau
2015-04-13 14:21 ` [PATCH v4 1/9] bgmac: simplify tx ring index handling Rafał Miłecki
2015-04-13 15:01 ` Felix Fietkau
2015-04-13 18:05 ` Rafał Miłecki
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=552BDACD.1050306@openwrt.org \
--to=nbd@openwrt$(echo .)org \
--cc=hauke@hauke-m$(echo .)de \
--cc=netdev@vger$(echo .)kernel.org \
--cc=zajec5@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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