check whether ip_id continuity needs to be checked when two TCP packets are merged.
Hi jiayu.hu
It cannot be guaranteed that 16bit identification field of ip packets in the same tcp stream will be continuous. Please help check whether ip_id continuity needs to be checked when two TCP packets are merged? Seems to modify the following code, gro will aggregate better, and work better:
lib/gro/gro_tcp4.h +2 -4
@@ -291,12 +291,10 @@ check_seq_option(struct gro_tcp4_item *item,/* check if the two packets are neighbors */ len = pkt_orig->pkt_len - l2_offset - pkt_orig->l2_len - pkt_orig->l3_len - tcp_hl_orig; -if ((sent_seq == item->sent_seq + len) && (is_atomic || - (ip_id == item->ip_id +1 ))) +if (sent_seq == item->sent_seq + len)/* append the new packet */ return 1 ; -else if ((sent_seq + tcp_dl == item->sent_seq) && (is_atomic || - (ip_id + item->nb_merged == item->ip_id))) +else if (sent_seq + tcp_dl == item->sent_seq)/* pre-pend the new packet */ return -1 ;
Hi Cheng,
Quoted 21 lines
-----Original Message-----
From: jiangheng (G) <[email protected]>
Sent: Saturday, April 15, 2023 10:46 PM
To: [email protected]; Hu, Jiayu <[email protected]>; [email protected]
Subject: [GRO] check whetherip_idcontinuity needs to be checked when two TCP packets are merged.Hi jiayu.hu
It cannot be guaranteed that 16bit identification field of ip packets in the same tcp stream will be continuous.
Please help check whetherip_idcontinuity needs to be checked when two TCP packets are merged?
Seems to modify the following code, gro will aggregate better, and work better:lib/gro/gro_tcp4.h index renamed from lib/gro/gro_tcp4.h +0
-0
212f97a042..06faead7b5100644
lib/gro/gro_tcp4.h check_seq_option(struct gro_tcp4_item *item, · line 294
Quoted 6 lines
lib/gro/gro_tcp4.h +1
-2@@ -291,12 +291,10 @@ check_seq_option(struct gro_tcp4_item *item,/* check if the two packets are neighbors */ len = pkt_orig->pkt_len - l2_offset - pkt_orig->l2_len - pkt_orig->l3_len - tcp_hl_orig; -if ((sent_seq == item->sent_seq + len) && (is_atomic || - (ip_id == item->ip_id +1 ))) +if (sent_seq == item->sent_seq + len)
For atomic packets, the IP ID field is ignored, as it can be set in various ways. For non-atomic packets, it follows Linux kernel tcp_gro_receive().
Is this change specific to your case? Can you give more details on why it helps?
Thanks,
Jiayu
Quoted 7 lines
lib/gro/gro_tcp4.h +1
-2/* append the new packet */ return 1 ; - else if ((sent_seq + tcp_dl == item->sent_seq) && (is_atomic || - (ip_id + item->nb_merged == item->ip_id))) + else if (sent_seq + tcp_dl == item->sent_seq)/* pre-pend the new packet */ return -1 ;
Quoted 33 lines · Jiayu
Hi Cheng,
Quoted 21 lines
-----Original Message-----
From: jiangheng (G) <[email protected]>
Sent: Saturday, April 15, 2023 10:46 PM
To: [email protected]; Hu, Jiayu <[email protected]>; [email protected]
Subject: [GRO] check whetherip_idcontinuity needs to be checked when two TCP packets are merged.Hi jiayu.hu
It cannot be guaranteed that 16bit identification field of ip packets in the same tcp stream will be continuous.
Please help check whetherip_idcontinuity needs to be checked when two TCP packets are merged?
Seems to modify the following code, gro will aggregate better, and work better:lib/gro/gro_tcp4.h index renamed from lib/gro/gro_tcp4.h +0
-0
212f97a042..06faead7b5100644lib/gro/gro_tcp4.h check_seq_option(struct gro_tcp4_item *item, · line 294
Quoted 6 lines
lib/gro/gro_tcp4.h +1
-2@@ -291,12 +291,10 @@ check_seq_option(struct gro_tcp4_item *item,/* check if the two packets are neighbors */ len = pkt_orig->pkt_len - l2_offset - pkt_orig->l2_len - pkt_orig->l3_len - tcp_hl_orig; -if ((sent_seq == item->sent_seq + len) && (is_atomic || - (ip_id == item->ip_id +1 ))) +if (sent_seq == item->sent_seq + len)For atomic packets, the IP ID field is ignored, as it can be set in various ways. For non-atomic packets, it follows Linux kernel
tcp_gro_receive().
Quoted 1 line
Is this change specific to your case? Can you give more details on why it helps?
Many OS's don't change IP ID if DF bit is set.
See RFC 6864 for details
Quoted 1 line
Quoted 1 line
The IPv4 ID field MUST NOT be used for purposes other than
fragmentation and reassembly.
Quoted 33 lines · Jiayu
Hi Cheng,
Quoted 21 lines
-----Original Message-----
From: jiangheng (G) <[email protected]>
Sent: Saturday, April 15, 2023 10:46 PM
To: [email protected]; Hu, Jiayu <[email protected]>; [email protected]
Subject: [GRO] check whetherip_idcontinuity needs to be checked when two TCP packets are merged.Hi jiayu.hu
It cannot be guaranteed that 16bit identification field of ip packets in the same tcp stream will be continuous.
Please help check whetherip_idcontinuity needs to be checked when two TCP packets are merged?
Seems to modify the following code, gro will aggregate better, and work better:lib/gro/gro_tcp4.h index renamed from lib/gro/gro_tcp4.h +0
-0
212f97a042..06faead7b5100644lib/gro/gro_tcp4.h check_seq_option(struct gro_tcp4_item *item, · line 294
Quoted 6 lines
lib/gro/gro_tcp4.h +1
-2@@ -291,12 +291,10 @@ check_seq_option(struct gro_tcp4_item *item,/* check if the two packets are neighbors */ len = pkt_orig->pkt_len - l2_offset - pkt_orig->l2_len - pkt_orig->l3_len - tcp_hl_orig; -if ((sent_seq == item->sent_seq + len) && (is_atomic || - (ip_id == item->ip_id +1 ))) +if (sent_seq == item->sent_seq + len)For atomic packets, the IP ID field is ignored, as it can be set in various ways. For non-atomic packets, it follows Linux kernel
tcp_gro_receive().
Quoted 4 lines
Is this change specific to your case? Can you give more details on why it helps?
Thanks,
Jiayu
Agreed, DPDK GRO should follow Linux to avoid bugs.