lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PAXPR07MB7984CE30212EEEF91004F894A37AA@PAXPR07MB7984.eurprd07.prod.outlook.com>
Date: Thu, 26 Jun 2025 08:45:23 +0000
From: "Chia-Yu Chang (Nokia)" <chia-yu.chang@...ia-bell-labs.com>
To: Eric Dumazet <edumazet@...gle.com>
CC: "pabeni@...hat.com" <pabeni@...hat.com>, "linux-doc@...r.kernel.org"
	<linux-doc@...r.kernel.org>, "corbet@....net" <corbet@....net>,
	"horms@...nel.org" <horms@...nel.org>, "dsahern@...nel.org"
	<dsahern@...nel.org>, "kuniyu@...zon.com" <kuniyu@...zon.com>,
	"bpf@...r.kernel.org" <bpf@...r.kernel.org>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "dave.taht@...il.com" <dave.taht@...il.com>,
	"jhs@...atatu.com" <jhs@...atatu.com>, "kuba@...nel.org" <kuba@...nel.org>,
	"stephen@...workplumber.org" <stephen@...workplumber.org>,
	"xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>, "jiri@...nulli.us"
	<jiri@...nulli.us>, "davem@...emloft.net" <davem@...emloft.net>,
	"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "donald.hunter@...il.com"
	<donald.hunter@...il.com>, "ast@...erby.net" <ast@...erby.net>,
	"liuhangbin@...il.com" <liuhangbin@...il.com>, "shuah@...nel.org"
	<shuah@...nel.org>, "linux-kselftest@...r.kernel.org"
	<linux-kselftest@...r.kernel.org>, "ij@...nel.org" <ij@...nel.org>,
	"ncardwell@...gle.com" <ncardwell@...gle.com>, "Koen De Schepper (Nokia)"
	<koen.de_schepper@...ia-bell-labs.com>, "g.white@...lelabs.com"
	<g.white@...lelabs.com>, "ingemar.s.johansson@...csson.com"
	<ingemar.s.johansson@...csson.com>, "mirja.kuehlewind@...csson.com"
	<mirja.kuehlewind@...csson.com>, "cheshire@...le.com" <cheshire@...le.com>,
	"rs.ietf@....at" <rs.ietf@....at>, "Jason_Livingood@...cast.com"
	<Jason_Livingood@...cast.com>, "vidhi_goel@...le.com" <vidhi_goel@...le.com>
Subject: RE: [PATCH v9 net-next 06/15] tcp: accecn: add AccECN rx byte
 counters

> -----Original Message-----
> From: Eric Dumazet <edumazet@...gle.com> 
> Sent: Wednesday, June 25, 2025 10:05 AM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@...ia-bell-labs.com>
> Cc: pabeni@...hat.com; linux-doc@...r.kernel.org; corbet@....net; horms@...nel.org; dsahern@...nel.org; kuniyu@...zon.com; bpf@...r.kernel.org; netdev@...r.kernel.org; dave.taht@...il.com; jhs@...atatu.com; kuba@...nel.org; stephen@...workplumber.org; xiyou.wangcong@...il.com; jiri@...nulli.us; davem@...emloft.net; andrew+netdev@...n.ch; donald.hunter@...il.com; ast@...erby.net; liuhangbin@...il.com; shuah@...nel.org; linux-kselftest@...r.kernel.org; ij@...nel.org; ncardwell@...gle.com; Koen De Schepper (Nokia) <koen.de_schepper@...ia-bell-labs.com>; g.white@...lelabs.com; ingemar.s.johansson@...csson.com; mirja.kuehlewind@...csson.com; cheshire@...le.com; rs.ietf@....at; Jason_Livingood@...cast.com; vidhi_goel@...le.com
> Subject: Re: [PATCH v9 net-next 06/15] tcp: accecn: add AccECN rx byte counters
> 
> 
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
> 
> 
> 
> On Sat, Jun 21, 2025 at 12:37 PM <chia-yu.chang@...ia-bell-labs.com> wrote:
> >
> > From: Ilpo Järvinen <ij@...nel.org>
> >
[...]
> > --- a/net/ipv4/tcp_input.c
> > +++ b/net/ipv4/tcp_input.c
> > @@ -6013,8 +6013,17 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t
> >         }
> >  }
> >
> > +void tcp_ecn_received_counters_payload(struct sock *sk,
> > +                                      const struct sk_buff *skb) {
> > +       const struct tcphdr *th = (const struct tcphdr *)skb->data;
> > +
> > +       tcp_ecn_received_counters(sk, skb, skb->len - th->doff * 4); }
> > +
> >  /* Updates Accurate ECN received counters from the received IP ECN 
> > field */ -void tcp_ecn_received_counters(struct sock *sk, const struct 
> > sk_buff *skb)
> > +void tcp_ecn_received_counters(struct sock *sk, const struct sk_buff *skb,
> > +                              u32 payload_len)
> >  {
> >         u8 ecnfield = TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK;
> >         u8 is_ce = INET_ECN_is_ce(ecnfield); @@ -6034,6 +6043,9 @@ 
> > void tcp_ecn_received_counters(struct sock *sk, const struct sk_buff *skb)
> >                 tp->received_ce += pcount;
> >                 tp->received_ce_pending = min(tp->received_ce_pending + pcount,
> >                                               0xfU);
> > +
> > +               if (payload_len > 0)
> > +                       tp->received_ecn_bytes[ecnfield - 1] += 
> > + payload_len;
> >         }
> >  }
> >
> > @@ -6307,7 +6319,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb)
> >                                         flag |= __tcp_replace_ts_recent(tp,
> >                                                                         
> > delta);
> >
> > -                               tcp_ecn_received_counters(sk, skb);
> > +                               tcp_ecn_received_counters(sk, skb, 0);
> >
> >                                 /* We know that such packets are checksummed
> >                                  * on entry.
> > @@ -6353,7 +6365,8 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb)
> >                         /* Bulk data transfer: receiver */
> >                         tcp_cleanup_skb(skb);
> >                         __skb_pull(skb, tcp_header_len);
> > -                       tcp_ecn_received_counters(sk, skb);
> > +                       tcp_ecn_received_counters(sk, skb,
> > +                                                 len - 
> > + tcp_header_len);
> >                         eaten = tcp_queue_rcv(sk, skb, &fragstolen);
> >
> >                         tcp_event_data_recv(sk, skb); @@ -6400,7 
> > +6413,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb)
> >                         tcp_accecn_third_ack(sk, skb, tp->syn_ect_snt);
> >                 tcp_fast_path_on(tp);
> >         }
> > -       tcp_ecn_received_counters(sk, skb);
> > +       tcp_ecn_received_counters_payload(sk, skb);
> 
> I missed this from a prior patch, but is it expected to account bytes even if the packet is dropped ?
> 

Hi Eric,

What I know is that packets will be acoounted after validation.

So, if one packet is discarded due to tcp_validate_incoming(), it will NOT be counted in the AccECN counters.

Best regards,
Chia-Yu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ