From: "Abdul Rahim, Faizal" <faizal.abdul.rahim@linux.intel.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Vinicius Costa Gomes <vinicius.gomes@intel.com>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH iwl-next 9/9] igc: Add support to get frame preemption statistics via ethtool
Date: Mon, 23 Dec 2024 17:52:37 +0800 [thread overview]
Message-ID: <57139951-daf7-42c3-b7a6-e4870a3f71fa@linux.intel.com> (raw)
In-Reply-To: <20241216160513.24i4ehroff47iwzi@skbuf>
On 17/12/2024 12:05 am, Vladimir Oltean wrote:
> On Mon, Dec 16, 2024 at 01:47:20AM -0500, Faizal Rahim wrote:
>> Implemented "ethtool --include-statistics --show-mm" callback for IGC.
>>
>> Tested preemption scenario to check preemption statistics:
>> 1) Trigger verification handshake on both boards:
>> $ sudo ethtool --set-mm enp1s0 pmac-enabled on
>> $ sudo ethtool --set-mm enp1s0 tx-enabled on
>> $ sudo ethtool --set-mm enp1s0 verify-enabled on
>> 2) Set preemptible or express queue in taprio for tx board:
>> $ sudo tc qdisc replace dev enp1s0 parent root handle 100 taprio \
>> num_tc 4 map 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 \
>> queues 1@0 1@1 1@2 1@3 base-time 0 sched-entry S F 100000 \
>> fp E E P P
>
> Hmm, the prio_tc_map pattern changed since the last time I looked at igc
> examples? It was in decreasing order before? How do you handle backwards
> compatibility with the Tx ring strict priority default configuration?
> I haven't downloaded the entire set locally, will do so later.
>
I tested like this for i226:
CMD=(
"tc qdisc replace dev $IFACE parent root handle 100 taprio "
"num_tc 4 "
"map 3 2 1 0 3 3 3 3 3 3 3 3 3 3 3 3 "
"queues 1@0 1@1 1@2 1@3 "
"base-time $BASE "
"${SCHED_ENTRY[*]} "
"flags 0x1 "
"txtime-delay $TXTIME_DELAY "
"clockid CLOCK_TAI "
But I mistakenly copied the mapping from a different scenario where socket
priority -> tc -> hw_queue mapping is not important to my test objective in
that scenario.
I'll update the description to use decreasing order then.
>> +
>> + return ooo_smdc + ooo_frame_cnt + ooo_frag_cnt + miss_frame_frag_cnt;
>> +}
>> +
>> +static void igc_ethtool_get_mm_stats(struct net_device *dev,
>> + struct ethtool_mm_stats *stats)
>> +{
>> + struct igc_adapter *adapter = netdev_priv(dev);
>> + struct igc_hw *hw = &adapter->hw;
>> +
>> + stats->MACMergeFrameAssErrorCount = igc_ethtool_get_frame_ass_error(dev);
>> + stats->MACMergeFrameSmdErrorCount = 0; /* Not available in IGC */
>> + stats->MACMergeFrameAssOkCount = rd32(IGC_PRMPTDRCNT);
>> + stats->MACMergeFragCountRx = rd32(IGC_PRMEVNTRCNT);
>> + stats->MACMergeFragCountTx = rd32(IGC_PRMEVNTTCNT);
>> + stats->MACMergeHoldCount = 0; /* Not available in IGC */
>
> Don't report counters as zero when in reality you don't know.
>
> Just don't assign values to these. mm_prepare_data() -> ethtool_stats_init()
> presets them to 0xffffffffffffffff (ETHTOOL_STAT_NOT_SET), and
> mm_put_stats() -> mm_put_stat() detects whether they are still equal to
> this value, and if they are, does not report netlink attributes for them.
>
Got it.
>> diff --git a/drivers/net/ethernet/intel/igc/igc_regs.h b/drivers/net/ethernet/intel/igc/igc_regs.h
>> index 12ddc5793651..f40946cce35a 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_regs.h
>> +++ b/drivers/net/ethernet/intel/igc/igc_regs.h
>> @@ -222,6 +222,25 @@
>>
>> #define IGC_FTQF(_n) (0x059E0 + (4 * (_n))) /* 5-tuple Queue Fltr */
>>
>> +/* Time sync registers - preemption statistics */
>> +#define IGC_PRMEVNTTCNT 0x04298 /* TX Preemption event counter */
>> +#define IGC_PRMEVNTRCNT 0x0429C /* RX Preemption event counter */
>> +#define IGC_PRMPTDRCNT 0x04284 /* Good RX Preempted Packets */
>> +
>> + /* Preemption Exception Counter */
>> +#define IGC_PRMEXPRCNT 0x042A0
>> +/* Received out of order packets with SMD-C and NOT ReumeRx */
>> +#define IGC_PRMEXPRCNT_OOO_SMDC 0x000000FF
>> +/* Received out of order packets with SMD-C and wrong Frame CNT */
>> +#define IGC_PRMEXPRCNT_OOO_FRAME_CNT 0x0000FF00
>> +#define IGC_PRMEXPRCNT_OOO_FRAME_CNT_SHIFT 8
>> +/* Received out of order packets with SMD-C and wrong Frag CNT */
>> +#define IGC_PRMEXPRCNT_OOO_FRAG_CNT 0x00FF0000
>> +#define IGC_PRMEXPRCNT_OOO_FRAG_CNT_SHIFT 16
>> +/* Received packets with SMD-S and ReumeRx */
>
> What is ReumeRx?
Resume receive. It’s a typo in the i226 documentation that I (shamelessly)
copied into the code without checking properly. It's meant to indicate that
an RX flag in the i226 firmware is set. I’ll remove the 'ResumeRX' part
since it adds confusion.
prev parent reply other threads:[~2024-12-23 9:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 6:47 [PATCH iwl-next 0/9] igc: Add support for Frame Preemption feature in IGC Faizal Rahim
2024-12-16 6:47 ` [PATCH iwl-next 1/9] igc: Rename xdp_get_tx_ring() for non-xdp usage Faizal Rahim
2024-12-16 6:47 ` [PATCH iwl-next 2/9] igc: Optimize the TX packet buffer utilization Faizal Rahim
2024-12-16 6:47 ` [PATCH iwl-next 3/9] igc: Set the RX packet buffer size for TSN mode Faizal Rahim
2024-12-16 6:47 ` [PATCH iwl-next 4/9] igc: Add support for receiving frames with all zeroes address Faizal Rahim
2024-12-16 17:26 ` Vladimir Oltean
2024-12-16 6:47 ` [PATCH iwl-next 5/9] igc: Add support to set MAC Merge data via ethtool Faizal Rahim
2024-12-16 18:13 ` Vladimir Oltean
2024-12-17 0:39 ` Vladimir Oltean
2024-12-23 9:23 ` Abdul Rahim, Faizal
2024-12-23 21:43 ` Vladimir Oltean
2024-12-16 6:47 ` [PATCH iwl-next 6/9] igc: Add support for frame preemption verification Faizal Rahim
2024-12-17 0:22 ` Vladimir Oltean
2024-12-17 8:46 ` Vladimir Oltean
2024-12-17 9:47 ` Abdul Rahim, Faizal
2024-12-17 12:09 ` Furong Xu
2024-12-19 7:24 ` Choong Yong Liang
2024-12-23 9:32 ` Abdul Rahim, Faizal
2024-12-16 6:47 ` [PATCH iwl-next 7/9] igc: Add support for preemptible traffic class in taprio Faizal Rahim
2024-12-16 6:47 ` [PATCH iwl-next 8/9] igc: Add support to get MAC Merge data via ethtool Faizal Rahim
2024-12-17 0:35 ` Vladimir Oltean
2024-12-23 9:39 ` Abdul Rahim, Faizal
2024-12-16 6:47 ` [PATCH iwl-next 9/9] igc: Add support to get frame preemption statistics " Faizal Rahim
2024-12-16 16:05 ` Vladimir Oltean
2024-12-23 9:52 ` Abdul Rahim, Faizal [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=57139951-daf7-42c3-b7a6-e4870a3f71fa@linux.intel.com \
--to=faizal.abdul.rahim@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=vinicius.gomes@intel.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