From: Alexander Lobakin <alexandr.lobakin@intel.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>,
netdev@vger.kernel.org, "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>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: enetc: preserve TX ring priority across reconfiguration
Date: Wed, 23 Nov 2022 16:51:16 +0100 [thread overview]
Message-ID: <20221123155116.484163-1-alexandr.lobakin@intel.com> (raw)
In-Reply-To: <20221122130936.1704151-1-vladimir.oltean@nxp.com>
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: Tue, 22 Nov 2022 15:09:36 +0200
> In the blamed commit, a rudimentary reallocation procedure for RX buffer
> descriptors was implemented, for the situation when their format changes
> between normal (no PTP) and extended (PTP).
>
> enetc_hwtstamp_set() calls enetc_close() and enetc_open() in a sequence,
> and this sequence loses information which was previously configured in
> the TX BDR Mode Register, specifically via the enetc_set_bdr_prio() call.
> The TX ring priority is configured by tc-mqprio and tc-taprio, and
> affects important things for TSN such as the TX time of packets. The
> issue manifests itself most visibly by the fact that isochron --txtime
> reports premature packet transmissions when PTP is first enabled on an
> enetc interface.
>
> Save the TX ring priority in a new field in struct enetc_bdr (occupies a
> 2 byte hole on arm64) in order to make this survive a ring reconfiguration.
>
> Fixes: 434cebabd3a2 ("enetc: Add dynamic allocation of extended Rx BD rings")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> drivers/net/ethernet/freescale/enetc/enetc.c | 8 ++++---
> drivers/net/ethernet/freescale/enetc/enetc.h | 1 +
> .../net/ethernet/freescale/enetc/enetc_qos.c | 21 ++++++++++++-------
> 3 files changed, 19 insertions(+), 11 deletions(-)
[...]
> err = enetc_setup_taprio(ndev, taprio);
> -
> - if (err)
> - for (i = 0; i < priv->num_tx_rings; i++)
> - enetc_set_bdr_prio(hw, priv->tx_ring[i]->index,
> - taprio->enable ? 0 : i);
> + if (err) {
> + for (i = 0; i < priv->num_tx_rings; i++) {
> + tx_ring = priv->tx_ring[i];
> + tx_ring->prio = taprio->enable ? 0 : i;
Side note: is that `taprio ? 0 : i` correct? It's an error path
IIUC, why not just unconditional 0?
I guess it is, so
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> + enetc_set_bdr_prio(hw, tx_ring->index, tx_ring->prio);
> + }
> + }
>
> return err;
> }
> --
> 2.34.1
Thanks,
Olek
next prev parent reply other threads:[~2022-11-23 15:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 13:09 [PATCH net] net: enetc: preserve TX ring priority across reconfiguration Vladimir Oltean
2022-11-23 15:51 ` Alexander Lobakin [this message]
2022-11-23 16:00 ` Vladimir Oltean
2022-11-24 4:30 ` 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=20221123155116.484163-1-alexandr.lobakin@intel.com \
--to=alexandr.lobakin@intel.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.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 \
/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