[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <92d5f50d-efc0-462b-8cd2-e73ba77222e5@quicinc.com>
Date: Tue, 18 Feb 2025 19:16:24 +0800
From: Jie Luo <quic_luoj@...cinc.com>
To: Andrew Lunn <andrew@...n.ch>
CC: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller"
<davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Rob Herring
<robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley
<conor+dt@...nel.org>, Lei Wei <quic_leiwei@...cinc.com>,
Suruchi Agarwal
<quic_suruchia@...cinc.com>,
Pavithra R <quic_pavir@...cinc.com>,
"Simon
Horman" <horms@...nel.org>, Jonathan Corbet <corbet@....net>,
Kees Cook
<kees@...nel.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
"Philipp
Zabel" <p.zabel@...gutronix.de>,
<linux-arm-msm@...r.kernel.org>, <netdev@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <linux-hardening@...r.kernel.org>,
<quic_kkumarcs@...cinc.com>, <quic_linchen@...cinc.com>,
<srinivas.kandagatla@...aro.org>, <bartosz.golaszewski@...aro.org>,
<john@...ozen.org>
Subject: Re: [PATCH net-next v3 13/14] net: ethernet: qualcomm: Add PPE
debugfs support for PPE counters
On 2/14/2025 10:02 PM, Andrew Lunn wrote:
>>>> +/* The number of packets dropped because of no buffer available, no PPE
>>>> + * buffer assigned to these packets.
>>>> + */
>>>> +static void ppe_port_rx_drop_counter_get(struct ppe_device *ppe_dev,
>>>> + struct seq_file *seq)
>>>> +{
>>>> + u32 reg, drop_cnt = 0;
>>>> + int ret, i, tag = 0;
>>>> +
>>>> + PRINT_COUNTER_PREFIX("PRX_DROP_CNT", "SILENT_DROP:");
>>>> + for (i = 0; i < PPE_DROP_CNT_TBL_ENTRIES; i++) {
>>>> + reg = PPE_DROP_CNT_TBL_ADDR + i * PPE_DROP_CNT_TBL_INC;
>>>> + ret = ppe_pkt_cnt_get(ppe_dev, reg, PPE_PKT_CNT_SIZE_1WORD,
>>>> + &drop_cnt, NULL);
>>>> + if (ret) {
>>>> + seq_printf(seq, "ERROR %d\n", ret);
>>>> + return;
>>>> + }
>>>
>>> This is an error getting the value from the hardware? You should not
>>> put that into the debugfs itself, you want the read() call to return
>>> it.
>>>
>>
>> Yes, this error code is returned by regmap read functions in
>> ppe_pkt_cnt_get() when the hardware counter read fails. I will
>> remove it from debugfs file and instead log the error to the
>> console (dev_info).
>
> and return it to user space via the read() call. These functions
> normally return the number of bytes put into the buffer. But you can
> also return a negative error code which gets passed back to user space
> instead.
>
> Andrew
OK, I will return the negative error code returned by the read() to the
user space, thanks.
Powered by blists - more mailing lists