* [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics
@ 2024-09-30 11:02 Minda Chen
2024-09-30 16:46 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Minda Chen @ 2024-09-30 11:02 UTC (permalink / raw)
To: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev
Cc: linux-kernel, linux-stm32, Minda Chen
Add dwmac4 ip payload error statistics, and rename discripter bit macro
because latest version descriptor IPCE bit claims ip checksum error or
l4 segment length error.
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 2 ++
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index e99401bcc1f8..a5fb31eb0192 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -118,6 +118,8 @@ static int dwmac4_wrback_get_rx_status(struct stmmac_extra_stats *x,
x->ipv4_pkt_rcvd++;
if (rdes1 & RDES1_IPV6_HEADER)
x->ipv6_pkt_rcvd++;
+ if (rdes1 & RDES1_IP_PAYLOAD_ERROR)
+ x->ip_payload_err++;
if (message_type == RDES_EXT_NO_PTP)
x->no_ptp_rx_msg_type_ext++;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
index 6da070ccd737..1ce6f43d545a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
@@ -95,7 +95,7 @@
#define RDES1_IPV4_HEADER BIT(4)
#define RDES1_IPV6_HEADER BIT(5)
#define RDES1_IP_CSUM_BYPASSED BIT(6)
-#define RDES1_IP_CSUM_ERROR BIT(7)
+#define RDES1_IP_PAYLOAD_ERROR BIT(7)
#define RDES1_PTP_MSG_TYPE_MASK GENMASK(11, 8)
#define RDES1_PTP_PACKET_TYPE BIT(12)
#define RDES1_PTP_VER BIT(13)
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics
2024-09-30 11:02 [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics Minda Chen
@ 2024-09-30 16:46 ` Simon Horman
2024-10-02 13:58 ` Jakub Kicinski
2024-10-02 18:21 ` Serge Semin
2 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2024-09-30 16:46 UTC (permalink / raw)
To: Minda Chen
Cc: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev,
linux-kernel, linux-stm32
On Mon, Sep 30, 2024 at 07:02:05PM +0800, Minda Chen wrote:
> Add dwmac4 ip payload error statistics, and rename discripter bit macro
> because latest version descriptor IPCE bit claims ip checksum error or
> l4 segment length error.
>
> Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics
2024-09-30 11:02 [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics Minda Chen
2024-09-30 16:46 ` Simon Horman
@ 2024-10-02 13:58 ` Jakub Kicinski
2024-10-02 18:35 ` Serge Semin
2024-10-02 18:21 ` Serge Semin
2 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2024-10-02 13:58 UTC (permalink / raw)
To: Minda Chen
Cc: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Paolo Abeni, Maxime Coquelin, netdev, linux-kernel, linux-stm32
On Mon, 30 Sep 2024 19:02:05 +0800 Minda Chen wrote:
> Add dwmac4 ip payload error statistics, and rename discripter bit macro
descriptor
^
> because latest version descriptor IPCE bit claims ip checksum error or
> l4 segment length error.
What is an L4 segment length error on Rx?
Seems to me that reusing ip_payload_err here will be confusing
--
pw-bot: cr
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics
2024-09-30 11:02 [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics Minda Chen
2024-09-30 16:46 ` Simon Horman
2024-10-02 13:58 ` Jakub Kicinski
@ 2024-10-02 18:21 ` Serge Semin
2 siblings, 0 replies; 7+ messages in thread
From: Serge Semin @ 2024-10-02 18:21 UTC (permalink / raw)
To: Minda Chen
Cc: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev,
linux-kernel, linux-stm32
Hi Minda
On Mon, Sep 30, 2024 at 07:02:05PM GMT, Minda Chen wrote:
Since v3 is going to be required anyway, here are several nitpicks:
> Add dwmac4 ip payload error statistics, and rename discripter bit macro
> because latest version descriptor IPCE bit claims ip checksum error or
> l4 segment length error.
s/dwmac4/DW QoS Eth v4/v5
s/ip/IP
L4-segment is a too broad definition in this case. The doc says about
just three protocols: TCP, UDP, or ICMP, so
s/l4/TCP, UDP, or ICMP
Other than that the change looks good.
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
-Serge(y)
>
> Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 2 ++
> drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> index e99401bcc1f8..a5fb31eb0192 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> @@ -118,6 +118,8 @@ static int dwmac4_wrback_get_rx_status(struct stmmac_extra_stats *x,
> x->ipv4_pkt_rcvd++;
> if (rdes1 & RDES1_IPV6_HEADER)
> x->ipv6_pkt_rcvd++;
> + if (rdes1 & RDES1_IP_PAYLOAD_ERROR)
> + x->ip_payload_err++;
>
> if (message_type == RDES_EXT_NO_PTP)
> x->no_ptp_rx_msg_type_ext++;
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
> index 6da070ccd737..1ce6f43d545a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
> @@ -95,7 +95,7 @@
> #define RDES1_IPV4_HEADER BIT(4)
> #define RDES1_IPV6_HEADER BIT(5)
> #define RDES1_IP_CSUM_BYPASSED BIT(6)
> -#define RDES1_IP_CSUM_ERROR BIT(7)
> +#define RDES1_IP_PAYLOAD_ERROR BIT(7)
> #define RDES1_PTP_MSG_TYPE_MASK GENMASK(11, 8)
> #define RDES1_PTP_PACKET_TYPE BIT(12)
> #define RDES1_PTP_VER BIT(13)
> --
> 2.17.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics
2024-10-02 13:58 ` Jakub Kicinski
@ 2024-10-02 18:35 ` Serge Semin
2024-10-02 18:57 ` Jakub Kicinski
0 siblings, 1 reply; 7+ messages in thread
From: Serge Semin @ 2024-10-02 18:35 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Minda Chen, Alexandre Torgue, Jose Abreu, David S . Miller,
Eric Dumazet, Paolo Abeni, Maxime Coquelin, netdev, linux-kernel,
linux-stm32
Hi Jakub
On Wed, Oct 02, 2024 at 06:58:01AM GMT, Jakub Kicinski wrote:
> On Mon, 30 Sep 2024 19:02:05 +0800 Minda Chen wrote:
> > Add dwmac4 ip payload error statistics, and rename discripter bit macro
>
> descriptor
> ^
>
> > because latest version descriptor IPCE bit claims ip checksum error or
> > l4 segment length error.
>
> What is an L4 segment length error on Rx?
> Seems to me that reusing ip_payload_err here will be confusing
From the current "ip_payload_err" field semantics, Minda is correct to
use it for the Rx IP-payload error statistics. Here is the definition
of the IPCE flag (part of the RDES4 descriptor field) cited from the
Synopsys DW QoS Eth v5 HW-manual:
Bit Name Description
7 IPCE IP Payload Error
When this bit is set, it indicates either of the following:
■ The 16-bit IP payload checksum (that is, the TCP, UDP, or ICMP checksum) calculated by the
MAC does not match the corresponding checksum field in the received segment.
■ The TCP, UDP, or ICMP segment length does not match the payload length value in the IP Header
field.
■ The TCP, UDP, or ICMP segment length is less than minimum allowed segment length for TCP,
UDP, or ICMP.
It almost word-by-word matches to what is defined for the
ERDES4_IP_PAYLOAD_ERR flag (part of the Extended RDES4 descriptor
field) in DW GMAC v3.x HW-manual for which the
stmmac_stats::ip_payload_err field has been added in the first place.
Note the name of the flag in the descriptor matches to what is declared in
the stmmac_stats structure.
So based on that I don't see any problem with the patch except some
minor patch-log issues I mentioned in another message.
-Serge(y)
> --
> pw-bot: cr
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics
2024-10-02 18:35 ` Serge Semin
@ 2024-10-02 18:57 ` Jakub Kicinski
0 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2024-10-02 18:57 UTC (permalink / raw)
To: Serge Semin
Cc: Minda Chen, Alexandre Torgue, Jose Abreu, David S . Miller,
Eric Dumazet, Paolo Abeni, Maxime Coquelin, netdev, linux-kernel,
linux-stm32
On Wed, 2 Oct 2024 21:35:30 +0300 Serge Semin wrote:
> It almost word-by-word matches to what is defined for the
> ERDES4_IP_PAYLOAD_ERR flag (part of the Extended RDES4 descriptor
> field) in DW GMAC v3.x HW-manual for which the
> stmmac_stats::ip_payload_err field has been added in the first place.
> Note the name of the flag in the descriptor matches to what is declared in
> the stmmac_stats structure.
I misread the ERDES4_IP_PAYLOAD_ERR as a Tx flag, somehow. All good
then.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics
@ 2024-10-08 10:22 Minda Chen
0 siblings, 0 replies; 7+ messages in thread
From: Minda Chen @ 2024-10-08 10:22 UTC (permalink / raw)
To: Serge Semin, Jakub Kicinski
Cc: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Paolo Abeni, Maxime Coquelin, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com
>
> Hi Jakub
>
> On Wed, Oct 02, 2024 at 06:58:01AM GMT, Jakub Kicinski wrote:
> > On Mon, 30 Sep 2024 19:02:05 +0800 Minda Chen wrote:
> > > Add dwmac4 ip payload error statistics, and rename discripter bit
> > > macro
> >
> > descriptor
> > ^
> >
> > > because latest version descriptor IPCE bit claims ip checksum error
> > > or
> > > l4 segment length error.
> >
>
I will modify this.
> > What is an L4 segment length error on Rx?
> > Seems to me that reusing ip_payload_err here will be confusing
>
> From the current "ip_payload_err" field semantics, Minda is correct to use it for
> the Rx IP-payload error statistics. Here is the definition of the IPCE flag (part of
> the RDES4 descriptor field) cited from the Synopsys DW QoS Eth v5 HW-manual:
>
> Bit Name Description
> 7 IPCE IP Payload Error
> When this bit is set, it indicates either of the following:
> ■ The 16-bit IP payload checksum (that is, the TCP, UDP, or ICMP
> checksum) calculated by the
> MAC does not match the corresponding checksum field in the
> received segment.
> ■ The TCP, UDP, or ICMP segment length does not match the
> payload length value in the IP Header
> field.
> ■ The TCP, UDP, or ICMP segment length is less than minimum
> allowed segment length for TCP,
> UDP, or ICMP.
>
Thanks for adding description.. I will add the this to commit message.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-08 21:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30 11:02 [PATCH net-next v2] net: stmmac: dwmac4: Add ip payload error statistics Minda Chen
2024-09-30 16:46 ` Simon Horman
2024-10-02 13:58 ` Jakub Kicinski
2024-10-02 18:35 ` Serge Semin
2024-10-02 18:57 ` Jakub Kicinski
2024-10-02 18:21 ` Serge Semin
-- strict thread matches above, loose matches on Subject: below --
2024-10-08 10:22 Minda Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).