[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <92c77477-9945-49c2-90bd-6e05761e2a3e@redhat.com>
Date: Tue, 18 Nov 2025 13:14:13 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: chia-yu.chang@...ia-bell-labs.com, edumazet@...gle.com, parav@...dia.com,
linux-doc@...r.kernel.org, corbet@....net, horms@...nel.org,
dsahern@...nel.org, kuniyu@...gle.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@...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 v6 net-next 04/14] selftests/net: gro: add self-test for
TCP CWR flag
On 11/14/25 8:13 AM, chia-yu.chang@...ia-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@...hat.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;
Powered by blists - more mailing lists