From: Paolo Abeni <pabeni@redhat.com>
To: chia-yu.chang@nokia-bell-labs.com, edumazet@google.com,
parav@nvidia.com, linux-doc@vger.kernel.org, corbet@lwn.net,
horms@kernel.org, dsahern@kernel.org, kuniyu@google.com,
bpf@vger.kernel.org, netdev@vger.kernel.org, dave.taht@gmail.com,
jhs@mojatatu.com, kuba@kernel.org, stephen@networkplumber.org,
xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net,
andrew+netdev@lunn.ch, donald.hunter@gmail.com, ast@fiberby.net,
liuhangbin@gmail.com, shuah@kernel.org,
linux-kselftest@vger.kernel.org, ij@kernel.org,
ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com,
g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
mirja.kuehlewind@ericsson.com, cheshire@apple.com,
rs.ietf@gmx.at, Jason_Livingood@comcast.com,
vidhi_goel@apple.com
Subject: Re: [PATCH v6 net-next 04/14] selftests/net: gro: add self-test for TCP CWR flag
Date: Tue, 18 Nov 2025 13:14:13 +0100 [thread overview]
Message-ID: <92c77477-9945-49c2-90bd-6e05761e2a3e@redhat.com> (raw)
In-Reply-To: <20251114071345.10769-5-chia-yu.chang@nokia-bell-labs.com>
On 11/14/25 8:13 AM, chia-yu.chang@nokia-bell-labs.com wrote:
> +/* send extra flags of the (NUM_PACKETS / 2) and (NUM_PACKETS / 2 - 1)
> + * pkts, not first and not last pkt
> + */
> +static void send_flags(int fd, struct sockaddr_ll *daddr, int psh, int syn,
> + int rst, int urg, int cwr)
> +{
> + static char flag_buf[2][MAX_HDR_LEN + PAYLOAD_LEN];
> + static char buf[MAX_HDR_LEN + PAYLOAD_LEN];
> + int payload_len, pkt_size, i;
> + struct tcphdr *tcph;
> + int flag[2];
> +
> + payload_len = PAYLOAD_LEN * (psh || cwr);
> + pkt_size = total_hdr_len + payload_len;
> + flag[0] = NUM_PACKETS / 2;
> + flag[1] = NUM_PACKETS / 2 - 1;
> +
> + // Create and configure packets with flags
Please use /* */ for comments.
Other than that:
Acked-by: Paolo Abeni <pabeni@redhat.com>
> + for (i = 0; i < 2; i++) {
> + if (flag[i] > 0) {
> + create_packet(flag_buf[i], flag[i] * payload_len, 0,
> + payload_len, 0);
> + tcph = (struct tcphdr *)(flag_buf[i] + tcp_offset);
> + set_flags(tcph, payload_len, psh, syn, rst, urg, cwr);
> + }
> + }
>
> for (i = 0; i < NUM_PACKETS + 1; i++) {
> - if (i == flag) {
> - write_packet(fd, flag_buf, pkt_size, daddr);
> + if (i == flag[0]) {
> + write_packet(fd, flag_buf[0], pkt_size, daddr);
> + continue;
> + } else if (i == flag[1] && cwr) {
> + write_packet(fd, flag_buf[1], pkt_size, daddr);
> continue;
> }
> create_packet(buf, i * PAYLOAD_LEN, 0, PAYLOAD_LEN, 0);
> @@ -1020,16 +1045,19 @@ static void gro_sender(void)
> send_ack(txfd, &daddr);
> write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
> } else if (strcmp(testname, "flags") == 0) {
> - send_flags(txfd, &daddr, 1, 0, 0, 0);
> + send_flags(txfd, &daddr, 1, 0, 0, 0, 0);
> write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
>
> - send_flags(txfd, &daddr, 0, 1, 0, 0);
> + send_flags(txfd, &daddr, 0, 1, 0, 0, 0);
> write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
>
> - send_flags(txfd, &daddr, 0, 0, 1, 0);
> + send_flags(txfd, &daddr, 0, 0, 1, 0, 0);
> write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
>
> - send_flags(txfd, &daddr, 0, 0, 0, 1);
> + send_flags(txfd, &daddr, 0, 0, 0, 1, 0);
> + write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
> +
> + send_flags(txfd, &daddr, 0, 0, 0, 0, 1);
> write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
> } else if (strcmp(testname, "tcp") == 0) {
> send_changed_checksum(txfd, &daddr);
> @@ -1163,6 +1191,12 @@ static void gro_receiver(void)
>
> printf("urg flag ends coalescing: ");
> check_recv_pkts(rxfd, correct_payload, 3);
> +
> + correct_payload[0] = PAYLOAD_LEN;
> + correct_payload[1] = PAYLOAD_LEN * 2;
> + correct_payload[2] = PAYLOAD_LEN * 2;
> + printf("cwr flag ends coalescing: ");
> + check_recv_pkts(rxfd, correct_payload, 3);
> } else if (strcmp(testname, "tcp") == 0) {
> correct_payload[0] = PAYLOAD_LEN;
> correct_payload[1] = PAYLOAD_LEN;
next prev parent reply other threads:[~2025-11-18 12:14 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 7:13 [PATCH v6 net-next 00/14] AccECN protocol case handling series chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 01/14] tcp: try to avoid safer when ACKs are thinned chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 02/14] gro: flushing when CWR is set negatively affects AccECN chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 03/14] net: update commnets for SKB_GSO_TCP_ECN and SKB_GSO_TCP_ACCECN chia-yu.chang
2025-11-18 12:02 ` Paolo Abeni
2025-11-19 10:24 ` Chia-Yu Chang (Nokia)
2025-11-19 10:40 ` Paolo Abeni
2025-11-19 10:43 ` Paolo Abeni
2025-11-19 11:22 ` Chia-Yu Chang (Nokia)
2025-11-26 8:48 ` Chia-Yu Chang (Nokia)
2025-11-14 7:13 ` [PATCH v6 net-next 04/14] selftests/net: gro: add self-test for TCP CWR flag chia-yu.chang
2025-11-18 12:14 ` Paolo Abeni [this message]
2025-11-14 7:13 ` [PATCH v6 net-next 05/14] tcp: ECT_1_NEGOTIATION and NEEDS_ACCECN identifiers chia-yu.chang
2025-11-18 12:30 ` Paolo Abeni
2025-11-14 7:13 ` [PATCH v6 net-next 06/14] tcp: disable RFC3168 fallback identifier for CC modules chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 07/14] tcp: accecn: handle unexpected AccECN negotiation feedback chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 08/14] tcp: accecn: retransmit downgraded SYN in AccECN negotiation chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 09/14] tcp: add TCP_SYNACK_RETRANS synack_type chia-yu.chang
2025-11-18 12:32 ` Paolo Abeni
2025-11-14 7:13 ` [PATCH v6 net-next 10/14] tcp: accecn: retransmit SYN/ACK without AccECN option or non-AccECN SYN/ACK chia-yu.chang
2025-11-18 13:58 ` Paolo Abeni
2025-11-19 10:32 ` Chia-Yu Chang (Nokia)
2025-11-14 7:13 ` [PATCH v6 net-next 11/14] tcp: accecn: unset ECT if receive or send ACE=0 in AccECN negotiaion chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 12/14] tcp: accecn: fallback outgoing half link to non-AccECN chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 13/14] tcp: accecn: detect loss ACK w/ AccECN option and add TCP_ACCECN_OPTION_PERSIST chia-yu.chang
2025-11-14 7:13 ` [PATCH v6 net-next 14/14] tcp: accecn: enable AccECN chia-yu.chang
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=92c77477-9945-49c2-90bd-6e05761e2a3e@redhat.com \
--to=pabeni@redhat.com \
--cc=Jason_Livingood@comcast.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@fiberby.net \
--cc=bpf@vger.kernel.org \
--cc=cheshire@apple.com \
--cc=chia-yu.chang@nokia-bell-labs.com \
--cc=corbet@lwn.net \
--cc=dave.taht@gmail.com \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=g.white@cablelabs.com \
--cc=horms@kernel.org \
--cc=ij@kernel.org \
--cc=ingemar.s.johansson@ericsson.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=koen.de_schepper@nokia-bell-labs.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=mirja.kuehlewind@ericsson.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=parav@nvidia.com \
--cc=rs.ietf@gmx.at \
--cc=shuah@kernel.org \
--cc=stephen@networkplumber.org \
--cc=vidhi_goel@apple.com \
--cc=xiyou.wangcong@gmail.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.