All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	UNGLinuxDriver@microchip.com,
	Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/7] net: mscc: ocelot: optimize ocelot_mm_irq()
Date: Mon, 17 Apr 2023 14:55:57 +0200	[thread overview]
Message-ID: <ZD1B3XjvIKxq50dd@corigine.com> (raw)
In-Reply-To: <20230415170551.3939607-4-vladimir.oltean@nxp.com>

On Sat, Apr 15, 2023 at 08:05:47PM +0300, Vladimir Oltean wrote:
> The MAC Merge IRQ of all ports is shared with the PTP TX timestamp IRQ
> of all ports, which means that currently, when a PTP TX timestamp is
> generated, felix_irq_handler() also polls for the MAC Merge layer status
> of all ports, looking for changes. This makes the kernel do more work,
> and under certain circumstances may make ptp4l require a
> tx_timestamp_timeout argument higher than before.
> 
> Changes to the MAC Merge layer status are only to be expected under
> certain conditions - its TX direction needs to be enabled - so we can
> check early if that is the case, and omit register access otherwise.
> 
> Make ocelot_mm_update_port_status() skip register access if
> mm->tx_enabled is unset, and also call it once more, outside IRQ
> context, from ocelot_port_set_mm(), when mm->tx_enabled transitions from
> true to false, because an IRQ is also expected in that case.
> 
> Also, a port may have its MAC Merge layer enabled but it may not have
> generated the interrupt. In that case, there's no point in writing to
> DEV_MM_STATUS to acknowledge that IRQ. We can reduce the number of
> register writes per port with MM enabled by keeping an "ack" variable
> which writes the "write-one-to-clear" bits. Those are 3 in number:
> PRMPT_ACTIVE_STICKY, UNEXP_RX_PFRM_STICKY and UNEXP_TX_PFRM_STICKY.
> The other fields in DEV_MM_STATUS are read-only and it doesn't matter
> what is written to them, so writing zero is just fine.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>

No need to respin on my account.
However, I do observe that this patch is doing several things,
and I do wonder if it could have been more than one patch.

  reply	other threads:[~2023-04-17 12:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-15 17:05 [PATCH net-next 0/7] Ocelot/Felix driver support for preemptible traffic classes Vladimir Oltean
2023-04-15 17:05 ` [PATCH net-next 1/7] net: mscc: ocelot: export a single ocelot_mm_irq() Vladimir Oltean
2023-04-17 12:51   ` Simon Horman
2023-04-17 12:56   ` Florian Fainelli
2023-04-15 17:05 ` [PATCH net-next 2/7] net: mscc: ocelot: remove struct ocelot_mm_state :: lock Vladimir Oltean
2023-04-17 12:53   ` Simon Horman
2023-04-17 12:56   ` Florian Fainelli
2023-04-15 17:05 ` [PATCH net-next 3/7] net: mscc: ocelot: optimize ocelot_mm_irq() Vladimir Oltean
2023-04-17 12:55   ` Simon Horman [this message]
2023-04-17 12:59   ` Florian Fainelli
2023-04-15 17:05 ` [PATCH net-next 4/7] net: mscc: ocelot: don't rely on cached verify_status in ocelot_port_get_mm() Vladimir Oltean
2023-04-17 12:59   ` Florian Fainelli
2023-04-17 13:01   ` Simon Horman
2023-04-15 17:05 ` [PATCH net-next 5/7] net: mscc: ocelot: add support for mqprio offload Vladimir Oltean
2023-04-17 13:00   ` Florian Fainelli
2023-04-15 17:05 ` [PATCH net-next 6/7] net: dsa: felix: act upon the mqprio qopt in taprio offload Vladimir Oltean
2023-04-17 13:01   ` Florian Fainelli
2023-04-15 17:05 ` [PATCH net-next 7/7] net: mscc: ocelot: add support for preemptible traffic classes Vladimir Oltean
2023-04-18  2:10 ` [PATCH net-next 0/7] Ocelot/Felix driver " patchwork-bot+netdevbpf

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=ZD1B3XjvIKxq50dd@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiaoliang.yang_1@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.