Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • net
  • core
  • dev.c
Find file BlameHistoryPermalink
  • Toke Høiland-Jørgensen's avatar
    xdp: Support specifying expected existing program when attaching XDP · 92234c8f
    Toke Høiland-Jørgensen authored Mar 25, 2020
    
    
    While it is currently possible for userspace to specify that an existing
    XDP program should not be replaced when attaching to an interface, there is
    no mechanism to safely replace a specific XDP program with another.
    
    This patch adds a new netlink attribute, IFLA_XDP_EXPECTED_FD, which can be
    set along with IFLA_XDP_FD. If set, the kernel will check that the program
    currently loaded on the interface matches the expected one, and fail the
    operation if it does not. This corresponds to a 'cmpxchg' memory operation.
    Setting the new attribute with a negative value means that no program is
    expected to be attached, which corresponds to setting the UPDATE_IF_NOEXIST
    flag.
    
    A new companion flag, XDP_FLAGS_REPLACE, is also added to explicitly
    request checking of the EXPECTED_FD attribute. This is needed for userspace
    to discover whether the kernel supports the new attribute.
    
    Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
    Link: https://lore.kernel.org/bpf/158515700640.92963.3551295145441017022.stgit@toke.dk
    92234c8f
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7