On 2024-06-04 17:30, Stefano Brivio wrote:On Tue, 4 Jun 2024 14:29:08 -0400 Jon Maloy <jmaloy(a)redhat.com> wrote:My point is, again, that in the next patch in the series I do static void tcp_revert_seq(struct tcp_tap_conn **conns, struct iovec (*frames)[T continue; conn->seq_to_tap = seq; + tcp_set_peek_offset(conn->sock, seq - conn->seq_ack_from_tap); } } So, this still makes sense. ///jon+/** + * tcp_revert_seq() - Revert affected conn->seq_to_tap after failed transmission + * @conns: Array of connection pointers corresponding to queued frames + * @frames: Two-dimensional array containing queued frames with sub-iovs + * @num_frames: Number of entries in the two arrays to be compared + */ +static void tcp_revert_seq(struct tcp_tap_conn **conns, struct iovec (*frames)[TCP_NUM_IOVS], + int num_frames) +{ + int i; + + for (i = 0; i < num_frames; i++) { + struct tcp_tap_conn *conn = conns[i]; + struct tcphdr *th = frames[i][TCP_IOV_PAYLOAD].iov_base; + uint32_t seq = ntohl(th->seq); + + if (SEQ_LE(conn->seq_to_tap, seq)) + continue;See: https://archives.passt.top/passt-dev/Zkr_4LkjDImgFqSi@zatzit https://archives.passt.top/passt-dev/ZlkrBFkxliCCT3st@zatzit about this if (SEQ_LE) ... continue;