netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harini Katakam <harinik@xilinx.com>
To: Robert Hancock <robert.hancock@calian.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"tomas.melin@vaisala.com" <tomas.melin@vaisala.com>,
	"nicolas.ferre@microchip.com" <nicolas.ferre@microchip.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"claudiu.beznea@microchip.com" <claudiu.beznea@microchip.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>
Subject: Re: [PATCH net-next 2/2] net: macb: use NAPI for TX completion path
Date: Mon, 9 May 2022 14:44:22 +0530	[thread overview]
Message-ID: <CAFcVECJL0PSTUxCh3LERxT1465vzdL7vAb+GxGHqL+FtmyQJgA@mail.gmail.com> (raw)
In-Reply-To: <96fbf2e7f08912b1f80426aca981f52a4a7e7b97.camel@calian.com>

Hi Robert,

Thanks for the patch.

<snip>
>
> Originally I thought there might be a correctness issue with calling it
> unconditionally, but looking at it further I don't think there really is. The
> FreeBSD driver for this hardware also seems to always do the TX restart in the
> interrupt handler if there are packets in the TX queue.
>
> I think the only real issue is whether it's better performance wise to do it
> all the time rather than only after the hardware asserts a TXUBR interrupt. I
> expect it would be worse to do it all the time, as that would mean an extra
> MMIO read, spinlock, MMIO read and MMIO write, versus just a read barrier and
> checking a flag in memory.
>

I agree that doing TX restart only on UBR is better.

> >
> > But should there anyways be some condition for the tx side handling, as
> > I suppose macb_poll() runs when there is rx interrupt even if tx side
> > has nothing to process?
>
> I opted not to do that for this case, as it should be pretty harmless and cheap
> to just check the TX ring to see if any packets have been completed yet, rather
> than actually tracking if a TX completion was pending. That seems to be the
> standard practice in some other drivers (r8169, etc.)

In this implementation the TX interrupt bit is being cleared and TX
processing is
scheduled when there is an RX interrupt as well as vice versa. Could you please
consider using the check "status & MACB_BIT(TCOMP)" for TX interrupt and NAPI?
If I understand your reply above right, you mention that the above check is more
expensive than parsing the TX ring for new data. In unbalanced traffic
scenarios i.e.
server only or client only, will this be efficient?

Regards,
Harini

  reply	other threads:[~2022-05-09  9:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 22:31 [PATCH net-next 0/2] MACB NAPI improvements Robert Hancock
2022-04-29 22:31 ` [PATCH net-next 1/2] net: macb: simplify/cleanup NAPI reschedule checking Robert Hancock
2022-04-29 22:31 ` [PATCH net-next 2/2] net: macb: use NAPI for TX completion path Robert Hancock
2022-04-29 23:09   ` Robert Hancock
2022-05-03  7:22     ` Paolo Abeni
2022-05-03 18:34       ` Robert Hancock
2022-05-03  9:34     ` Tomas Melin
2022-05-03 17:01       ` Robert Hancock
2022-05-09  9:14         ` Harini Katakam [this message]
2022-05-09 19:46           ` Robert Hancock
2022-05-03  9:57   ` Tomas Melin
2022-05-03 17:07     ` Robert Hancock
2022-05-09  5:49       ` Tomas Melin
2022-05-09 18:00         ` Robert Hancock
2022-05-06 19:04   ` Robert Hancock
2022-05-05 17:56 ` [PATCH net-next 0/2] MACB NAPI improvements Robert Hancock

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=CAFcVECJL0PSTUxCh3LERxT1465vzdL7vAb+GxGHqL+FtmyQJgA@mail.gmail.com \
    --to=harinik@xilinx.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    --cc=robert.hancock@calian.com \
    --cc=tomas.melin@vaisala.com \
    /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).