On Tue, Feb 2, 2016 at 9:35 PM, Eric Dumazet <[email protected]> wrote: > On Tue, 2016-02-02 at 20:23 +0100, Bendik Rønning Opstad wrote: >> >> o When packets are scheduled for transmission, RDB replaces the SKB to >> be sent with a modified SKB containing the redundant data of >> previously sent data segments from the TCP output queue. > > Really this looks very complicated.
Can you be more specific? > Why not simply append the new skb content to prior one ? It's not clear to me what you mean. At what stage in the output engine do you refer to? We want to avoid modifying the data of the SKBs in the output queue, therefore we allocate a new SKB (This SKB is named rdb_skb in the code). The header and payload of the first SKB containing data we want to redundantly transmit is then copied. Then the payload of the SKBs following next in the output queue is appended onto the rdb_skb. The last payload that is appended is from the first SKB with unsent data, i.e. the sk_send_head. Would you suggest a different approach? > skb_still_in_host_queue(sk, prior_skb) would also tell you if the skb is > really available (ie its clone not sitting/waiting in a qdisc on the > host) Where do you suggest this should be used? > Note : select_size() always allocate skb with SKB_WITH_OVERHEAD(2048 - > MAX_TCP_HEADER) available bytes in skb->data. Sure, rdb_build_skb() could use this instead of the calculated bytes_in_rdb_skb. > Also note that tcp_collapse_retrans() is very similar to your needs. You > might simply expand it. The functionality shared is the copying of data from one SKB to another, as well as adjusting sequence numbers and checksum. Unlinking SKBs from the output queue, modifying the data of SKBs in the output queue, and changing retrans hints is not shared. To reduce code duplication, the function skb_append_data in tcp_rdb.c could be moved to tcp_output.c, and then be called from tcp_collapse_retrans. Is it something like this you had in mind? Bendik
