From: Roger Quadros <rogerq@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, shuah@kernel.org, s-vadapalli@ti.com,
r-gunasekaran@ti.com, vigneshr@ti.com, srk@ti.com,
horms@kernel.org, p-varis@ti.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 net-next 11/11] net: ethernet: ti: am65-cpsw: Fix get_eth_mac_stats
Date: Fri, 15 Dec 2023 13:31:17 +0200 [thread overview]
Message-ID: <bfdc924c-ef11-48df-a097-b252bcbe17e1@kernel.org> (raw)
In-Reply-To: <e637fe93-692d-48b1-9cb9-11719f8c90c3@kernel.org>
On 14/12/2023 12:04, Roger Quadros wrote:
>
>
> On 13/12/2023 15:54, Vladimir Oltean wrote:
>> On Wed, Dec 13, 2023 at 01:07:21PM +0200, Roger Quadros wrote:
>>> We do not support individual stats for PMAC and EMAC so
>>> report only aggregate stats.
>>>
>>> Fixes: 67372d7a85fc ("net: ethernet: am65-cpsw: Add standard Ethernet MAC stats to ethtool")
>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>>> ---
>>> drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> Changelog:
>>>
>>> v8: initial commit
>>>
>>> diff --git a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
>>> index d2baffb05d55..35e318458b0c 100644
>>> --- a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
>>> +++ b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
>>> @@ -671,6 +671,9 @@ static void am65_cpsw_get_eth_mac_stats(struct net_device *ndev,
>>>
>>> stats = port->stat_base;
>>>
>>> + if (s->src != ETHTOOL_MAC_STATS_SRC_AGGREGATE)
>>> + return;
>>> +
>>> s->FramesTransmittedOK = readl_relaxed(&stats->tx_good_frames);
>>> s->SingleCollisionFrames = readl_relaxed(&stats->tx_single_coll_frames);
>>> s->MultipleCollisionFrames = readl_relaxed(&stats->tx_mult_coll_frames);
>>> --
>>> 2.34.1
>>>
>>
>> Fixes are only fixes if they address a visible issue. And the blamed
>> commit is the one that made the issue visible - the same one that
>> "git bisect" would lead to - not necessarily the commit that introduced
>> the code being changed.
>>
>> If you look at net/ethtool/stats.c, it will only accept ETHTOOL_MAC_STATS_SRC_AGGREGATE
>> for drivers that don't support the MAC Merge layer.
>>
>> if ((src == ETHTOOL_MAC_STATS_SRC_EMAC ||
>> src == ETHTOOL_MAC_STATS_SRC_PMAC) &&
>> !__ethtool_dev_mm_supported(dev)) {
>> NL_SET_ERR_MSG_MOD(info->extack,
>> "Device does not support MAC merge layer");
>> ethnl_ops_complete(dev);
>> return -EOPNOTSUPP;
>> }
>
> Got it.
>
>>
>> So, there was nothing broken in commit 67372d7a85fc ("net: ethernet:
>> am65-cpsw: Add standard Ethernet MAC stats to ethtool").
>>
>> The first broken commit is when you add support for get_mm(), such that
>> __ethtool_dev_mm_supported() returns true.
>>
>> And because you don't add bugs in the code just to fix them later in the
>> series, you need to order the patches such that all the dependencies for
>> get_mm() are in place before the get_mm() support is added.
>>
>> Translated to your case, this patch must not be 11/11, and it must have
>> the Fixes: tag dropped, and it must explain in the commit message that
>> it is preparatory work.
>
> OK. I take care of this in next spin. Thanks.
Just a heads up. I have decided to merge this patch with mac-merge patch.
One less patch to deal with ;).
--
cheers,
-roger
prev parent reply other threads:[~2023-12-15 11:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-13 11:07 [PATCH v8 net-next 00/11] net: ethernet: am65-cpsw: Add mqprio, frame pre-emption & coalescing Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 01/11] selftests: forwarding: ethtool_mm: support devices with higher rx-min-frag-size Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 02/11] selftests: forwarding: ethtool_mm: fall back to aggregate if device does not report pMAC stats Roger Quadros
2023-12-14 14:16 ` Vladimir Oltean
2023-12-14 17:16 ` Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 03/11] net: ethernet: am65-cpsw: Build am65-cpsw-qos only if required Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 04/11] net: ethernet: am65-cpsw: Rename TI_AM65_CPSW_TAS to TI_AM65_CPSW_QOS Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 05/11] net: ethernet: am65-cpsw: cleanup TAPRIO handling Roger Quadros
2023-12-14 11:23 ` Vladimir Oltean
2023-12-14 13:36 ` Roger Quadros
2023-12-14 13:41 ` Vladimir Oltean
2023-12-14 13:50 ` Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 06/11] net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration Roger Quadros
2023-12-14 11:09 ` Vladimir Oltean
2023-12-13 11:07 ` [PATCH v8 net-next 07/11] net: ethernet: am65-cpsw: Move register definitions to header file Roger Quadros
2023-12-14 11:08 ` Vladimir Oltean
2023-12-13 11:07 ` [PATCH v8 net-next 08/11] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode Roger Quadros
2023-12-14 11:06 ` Vladimir Oltean
2023-12-13 11:07 ` [PATCH v8 net-next 09/11] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support Roger Quadros
2023-12-14 11:04 ` Vladimir Oltean
2023-12-14 13:44 ` Roger Quadros
2023-12-14 13:50 ` Vladimir Oltean
2023-12-14 13:53 ` Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 10/11] net: ethernet: ti: am65-cpsw: add sw tx/rx irq coalescing based on hrtimers Roger Quadros
2023-12-13 11:07 ` [PATCH v8 net-next 11/11] net: ethernet: ti: am65-cpsw: Fix get_eth_mac_stats Roger Quadros
2023-12-13 13:54 ` Vladimir Oltean
2023-12-14 10:04 ` Roger Quadros
2023-12-15 11:31 ` Roger Quadros [this message]
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=bfdc924c-ef11-48df-a097-b252bcbe17e1@kernel.org \
--to=rogerq@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=p-varis@ti.com \
--cc=pabeni@redhat.com \
--cc=r-gunasekaran@ti.com \
--cc=s-vadapalli@ti.com \
--cc=shuah@kernel.org \
--cc=srk@ti.com \
--cc=vigneshr@ti.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 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.