• Kui-Feng Lee's avatar
    net: Update an existing TCP congestion control algorithm. · 8fb1a76a
    Kui-Feng Lee authored
    This feature lets you immediately transition to another congestion
    control algorithm or implementation with the same name.  Once a name
    is updated, new connections will apply this new algorithm.
    
    The purpose is to update a customized algorithm implemented in BPF
    struct_ops with a new version on the flight.  The following is an
    example of using the userspace API implemented in later BPF patches.
    
       link = bpf_map__attach_struct_ops(skel->maps.ca_update_1);
       .......
       err = bpf_link__update_map(link, skel->maps.ca_update_2);
    
    We first load and register an algorithm implemented in BPF struct_ops,
    then swap it out with a new one using the same name. After that, newly
    created connections will apply the updated algorithm, while older ones
    retain the previous version already applied.
    
    This patch also takes this chance to refactor the ca validation into
    the new tcp_validate_congestion_control() function.
    
    Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarKui-Feng Lee <kuifeng@meta.com>
    Link: https://lore.kernel.org/r/20230323032405.3735486-3-kuifeng@meta.comSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
    8fb1a76a
tcp.h 75.5 KB