1. 17 6月, 2021 2 次提交
  2. 13 6月, 2021 2 次提交
  3. 12 6月, 2021 1 次提交
  4. 11 6月, 2021 1 次提交
  5. 07 6月, 2021 1 次提交
    • F
      netfilter: add new hook nfnl subsystem · e2cf17d3
      Florian Westphal 提交于
      This nfnl subsystem allows to dump the list of all active netfiler hooks,
      e.g. defrag, conntrack, nf/ip/arp/ip6tables and so on.
      
      This helps to see what kind of features are currently enabled in
      the network stack.
      
      Sample output from nft tool using this infra:
      
       $ nft list hook ip input
       family ip hook input {
         +0000000010 nft_do_chain_inet [nf_tables] # nft table firewalld INPUT
         +0000000100 nf_nat_ipv4_local_in [nf_nat]
         +2147483647 ipv4_confirm [nf_conntrack]
       }
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      e2cf17d3
  6. 04 6月, 2021 2 次提交
  7. 03 6月, 2021 4 次提交
    • D
      devlink: Allow setting parent node of rate objects · d7555984
      Dmytro Linkin 提交于
      Refactor DEVLINK_CMD_RATE_{GET|SET} command handlers to support setting
      a node as a parent for another rate object (leaf or node) by means of
      new attribute DEVLINK_ATTR_RATE_PARENT_NODE_NAME. Extend devlink ops
      with new callbacks rate_{leaf|node}_parent_set() to set node as a parent
      for rate object to allow supporting drivers to implement rate grouping
      through devlink. Driver implementations are allowed to support leafs
      or node children only. Invoking callback with NULL as parent should be
      threated by the driver as unset parent action.
      Extend rate object struct with reference counter to disallow deleting a
      node with any child pointing to it. User should unset parent for the
      child explicitly.
      
      Example:
      
      $ devlink port function rate add netdevsim/netdevsim10/group1
      
      $ devlink port function rate add netdevsim/netdevsim10/group2
      
      $ devlink port function rate set netdevsim/netdevsim10/group1 parent group2
      
      $ devlink port function rate show netdevsim/netdevsim10/group1
      netdevsim/netdevsim10/group1: type node parent group2
      
      $ devlink port function rate set netdevsim/netdevsim10/group1 noparent
      Co-developed-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7555984
    • D
      devlink: Introduce rate nodes · a8ecb93e
      Dmytro Linkin 提交于
      Implement support for DEVLINK_CMD_RATE_{NEW|DEL} commands that are used
      to create and delete devlink rate nodes. Add new attribute
      DEVLINK_ATTR_RATE_NODE_NAME that specify node name string. The node name
      is an alphanumeric identifier. No valid node name can be a devlink port
      index, eg. decimal number. Extend devlink ops with new callbacks
      rate_node_{new|del}() and rate_node_tx_{share|max}_set() to allow
      supporting drivers to implement ports rate grouping and setting tx rate
      of rate nodes through devlink.
      Expose devlink_rate_nodes_destroy() function to allow vendor driver do
      proper cleanup of internally allocated resources for the nodes if the
      driver goes down or due to any other reasons which requires nodes to be
      destroyed.
      Disallow moving device from switchdev to legacy mode if any node exists
      on that device. User must explicitly delete nodes before switching mode.
      
      Example:
      
      $ devlink port function rate add netdevsim/netdevsim10/group1
      
      $ devlink port function rate set netdevsim/netdevsim10/group1 \
              tx_share 10mbit tx_max 100mbit
      
      Add + set command can be combined:
      
      $ devlink port function rate add netdevsim/netdevsim10/group1 \
              tx_share 10mbit tx_max 100mbit
      
      $ devlink port function rate show netdevsim/netdevsim10/group1
      netdevsim/netdevsim10/group1: type node tx_share 10mbit tx_max 100mbit
      
      $ devlink port function rate del netdevsim/netdevsim10/group1
      Co-developed-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8ecb93e
    • D
      devlink: Allow setting tx rate for devlink rate leaf objects · 1897db2e
      Dmytro Linkin 提交于
      Implement support for DEVLINK_CMD_RATE_SET command with new attributes
      DEVLINK_ATTR_RATE_TX_{SHARE|MAX} that are used to set devlink rate
      shared/max tx rate values. Extend devlink ops with new callbacks
      rate_leaf_tx_{share|max}_set() to allow supporting drivers to implement
      rate control through devlink.
      
      New attributes are optional. Driver implementations are allowed to
      support either or both of them.
      
      Shared rate example:
      
      $ devlink port function rate set netdevsim/netdevsim10/0 tx_share 10mbit
      
      $ devlink port function rate show netdevsim/netdevsim10/0
      netdevsim/netdevsim10/0: type leaf tx_share 10mbit
      
      Max rate example:
      
      $ devlink port function rate set netdevsim/netdevsim10/0 tx_max 100mbit
      
      $ devlink port function rate show netdevsim/netdevsim10/0
      netdevsim/netdevsim10/0: type leaf tx_max 100mbit
      Co-developed-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1897db2e
    • D
      devlink: Introduce rate object · 4677efc4
      Dmytro Linkin 提交于
      Allow registering rate object for devlink ports with dedicated
      devlink_rate_leaf_{create|destroy}() API. Implement new netlink
      DEVLINK_CMD_RATE_GET command that is used to retrieve rate object info.
      Add new DEVLINK_CMD_RATE_{NEW|DEL} commands that are used for
      notifications when creating/deleting leaf rate object.
      
      Rate API is intended to be used for rate limiting of individual
      devlink ports (leafs) and their aggregates (nodes).
      
      Example:
      
      $ devlink port show
      pci/0000:03:00.0/0
      pci/0000:03:00.0/1
      
      $ devlink port function rate show
      pci/0000:03:00.0/0: type leaf
      pci/0000:03:00.0/1: type leaf
      Co-developed-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4677efc4
  8. 02 6月, 2021 2 次提交
  9. 29 5月, 2021 1 次提交
    • P
      netfilter: nft_exthdr: Support SCTP chunks · 133dc203
      Phil Sutter 提交于
      Chunks are SCTP header extensions similar in implementation to IPv6
      extension headers or TCP options. Reusing exthdr expression to find and
      extract field values from them is therefore pretty straightforward.
      
      For now, this supports extracting data from chunks at a fixed offset
      (and length) only - chunks themselves are an extensible data structure;
      in order to make all fields available, a nested extension search is
      needed.
      Signed-off-by: NPhil Sutter <phil@nwl.cc>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      133dc203
  10. 27 5月, 2021 2 次提交
  11. 19 5月, 2021 7 次提交
  12. 14 5月, 2021 1 次提交
  13. 10 5月, 2021 1 次提交
  14. 07 5月, 2021 1 次提交
  15. 06 5月, 2021 4 次提交
    • D
      mm/vmscan: move RECLAIM* bits to uapi header · b6676de8
      Dave Hansen 提交于
      It is currently not obvious that the RECLAIM_* bits are part of the uapi
      since they are defined in vmscan.c.  Move them to a uapi header to make it
      obvious.
      
      This should have no functional impact.
      
      Link: https://lkml.kernel.org/r/20210219172557.08074910@viggo.jf.intel.comSigned-off-by: NDave Hansen <dave.hansen@linux.intel.com>
      Reviewed-by: NBen Widawsky <ben.widawsky@intel.com>
      Reviewed-by: NOscar Salvador <osalvador@suse.de>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Acked-by: NChristoph Lameter <cl@linux.com>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Daniel Wagner <dwagner@suse.de>
      Cc: "Tobin C. Harding" <tobin@kernel.org>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Qian Cai <cai@lca.pw>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b6676de8
    • A
      userfaultfd: add UFFDIO_CONTINUE ioctl · f6191471
      Axel Rasmussen 提交于
      This ioctl is how userspace ought to resolve "minor" userfaults.  The
      idea is, userspace is notified that a minor fault has occurred.  It
      might change the contents of the page using its second non-UFFD mapping,
      or not.  Then, it calls UFFDIO_CONTINUE to tell the kernel "I have
      ensured the page contents are correct, carry on setting up the mapping".
      
      Note that it doesn't make much sense to use UFFDIO_{COPY,ZEROPAGE} for
      MINOR registered VMAs.  ZEROPAGE maps the VMA to the zero page; but in
      the minor fault case, we already have some pre-existing underlying page.
      Likewise, UFFDIO_COPY isn't useful if we have a second non-UFFD mapping.
      We'd just use memcpy() or similar instead.
      
      It turns out hugetlb_mcopy_atomic_pte() already does very close to what
      we want, if an existing page is provided via `struct page **pagep`.  We
      already special-case the behavior a bit for the UFFDIO_ZEROPAGE case, so
      just extend that design: add an enum for the three modes of operation,
      and make the small adjustments needed for the MCOPY_ATOMIC_CONTINUE
      case.  (Basically, look up the existing page, and avoid adding the
      existing page to the page cache or calling set_page_huge_active() on
      it.)
      
      Link: https://lkml.kernel.org/r/20210301222728.176417-5-axelrasmussen@google.comSigned-off-by: NAxel Rasmussen <axelrasmussen@google.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Cc: Adam Ruprecht <ruprecht@google.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Cannon Matthews <cannonmatthews@google.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chinwen Chang <chinwen.chang@mediatek.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Lokesh Gidra <lokeshgidra@google.com>
      Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: "Michal Koutn" <mkoutny@suse.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Mina Almasry <almasrymina@google.com>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Oliver Upton <oupton@google.com>
      Cc: Shaohua Li <shli@fb.com>
      Cc: Shawn Anastasio <shawn@anastas.io>
      Cc: Steven Price <steven.price@arm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f6191471
    • A
      userfaultfd: add minor fault registration mode · 7677f7fd
      Axel Rasmussen 提交于
      Patch series "userfaultfd: add minor fault handling", v9.
      
      Overview
      ========
      
      This series adds a new userfaultfd feature, UFFD_FEATURE_MINOR_HUGETLBFS.
      When enabled (via the UFFDIO_API ioctl), this feature means that any
      hugetlbfs VMAs registered with UFFDIO_REGISTER_MODE_MISSING will *also*
      get events for "minor" faults.  By "minor" fault, I mean the following
      situation:
      
      Let there exist two mappings (i.e., VMAs) to the same page(s) (shared
      memory).  One of the mappings is registered with userfaultfd (in minor
      mode), and the other is not.  Via the non-UFFD mapping, the underlying
      pages have already been allocated & filled with some contents.  The UFFD
      mapping has not yet been faulted in; when it is touched for the first
      time, this results in what I'm calling a "minor" fault.  As a concrete
      example, when working with hugetlbfs, we have huge_pte_none(), but
      find_lock_page() finds an existing page.
      
      We also add a new ioctl to resolve such faults: UFFDIO_CONTINUE.  The idea
      is, userspace resolves the fault by either a) doing nothing if the
      contents are already correct, or b) updating the underlying contents using
      the second, non-UFFD mapping (via memcpy/memset or similar, or something
      fancier like RDMA, or etc...).  In either case, userspace issues
      UFFDIO_CONTINUE to tell the kernel "I have ensured the page contents are
      correct, carry on setting up the mapping".
      
      Use Case
      ========
      
      Consider the use case of VM live migration (e.g. under QEMU/KVM):
      
      1. While a VM is still running, we copy the contents of its memory to a
         target machine. The pages are populated on the target by writing to the
         non-UFFD mapping, using the setup described above. The VM is still running
         (and therefore its memory is likely changing), so this may be repeated
         several times, until we decide the target is "up to date enough".
      
      2. We pause the VM on the source, and start executing on the target machine.
         During this gap, the VM's user(s) will *see* a pause, so it is desirable to
         minimize this window.
      
      3. Between the last time any page was copied from the source to the target, and
         when the VM was paused, the contents of that page may have changed - and
         therefore the copy we have on the target machine is out of date. Although we
         can keep track of which pages are out of date, for VMs with large amounts of
         memory, it is "slow" to transfer this information to the target machine. We
         want to resume execution before such a transfer would complete.
      
      4. So, the guest begins executing on the target machine. The first time it
         touches its memory (via the UFFD-registered mapping), userspace wants to
         intercept this fault. Userspace checks whether or not the page is up to date,
         and if not, copies the updated page from the source machine, via the non-UFFD
         mapping. Finally, whether a copy was performed or not, userspace issues a
         UFFDIO_CONTINUE ioctl to tell the kernel "I have ensured the page contents
         are correct, carry on setting up the mapping".
      
      We don't have to do all of the final updates on-demand. The userfaultfd manager
      can, in the background, also copy over updated pages once it receives the map of
      which pages are up-to-date or not.
      
      Interaction with Existing APIs
      ==============================
      
      Because this is a feature, a registered VMA could potentially receive both
      missing and minor faults.  I spent some time thinking through how the
      existing API interacts with the new feature:
      
      UFFDIO_CONTINUE cannot be used to resolve non-minor faults, as it does not
      allocate a new page.  If UFFDIO_CONTINUE is used on a non-minor fault:
      
      - For non-shared memory or shmem, -EINVAL is returned.
      - For hugetlb, -EFAULT is returned.
      
      UFFDIO_COPY and UFFDIO_ZEROPAGE cannot be used to resolve minor faults.
      Without modifications, the existing codepath assumes a new page needs to
      be allocated.  This is okay, since userspace must have a second
      non-UFFD-registered mapping anyway, thus there isn't much reason to want
      to use these in any case (just memcpy or memset or similar).
      
      - If UFFDIO_COPY is used on a minor fault, -EEXIST is returned.
      - If UFFDIO_ZEROPAGE is used on a minor fault, -EEXIST is returned (or -EINVAL
        in the case of hugetlb, as UFFDIO_ZEROPAGE is unsupported in any case).
      - UFFDIO_WRITEPROTECT simply doesn't work with shared memory, and returns
        -ENOENT in that case (regardless of the kind of fault).
      
      Future Work
      ===========
      
      This series only supports hugetlbfs.  I have a second series in flight to
      support shmem as well, extending the functionality.  This series is more
      mature than the shmem support at this point, and the functionality works
      fully on hugetlbfs, so this series can be merged first and then shmem
      support will follow.
      
      This patch (of 6):
      
      This feature allows userspace to intercept "minor" faults.  By "minor"
      faults, I mean the following situation:
      
      Let there exist two mappings (i.e., VMAs) to the same page(s).  One of the
      mappings is registered with userfaultfd (in minor mode), and the other is
      not.  Via the non-UFFD mapping, the underlying pages have already been
      allocated & filled with some contents.  The UFFD mapping has not yet been
      faulted in; when it is touched for the first time, this results in what
      I'm calling a "minor" fault.  As a concrete example, when working with
      hugetlbfs, we have huge_pte_none(), but find_lock_page() finds an existing
      page.
      
      This commit adds the new registration mode, and sets the relevant flag on
      the VMAs being registered.  In the hugetlb fault path, if we find that we
      have huge_pte_none(), but find_lock_page() does indeed find an existing
      page, then we have a "minor" fault, and if the VMA has the userfaultfd
      registration flag, we call into userfaultfd to handle it.
      
      This is implemented as a new registration mode, instead of an API feature.
      This is because the alternative implementation has significant drawbacks
      [1].
      
      However, doing it this was requires we allocate a VM_* flag for the new
      registration mode.  On 32-bit systems, there are no unused bits, so this
      feature is only supported on architectures with
      CONFIG_ARCH_USES_HIGH_VMA_FLAGS.  When attempting to register a VMA in
      MINOR mode on 32-bit architectures, we return -EINVAL.
      
      [1] https://lore.kernel.org/patchwork/patch/1380226/
      
      [peterx@redhat.com: fix minor fault page leak]
        Link: https://lkml.kernel.org/r/20210322175132.36659-1-peterx@redhat.com
      
      Link: https://lkml.kernel.org/r/20210301222728.176417-1-axelrasmussen@google.com
      Link: https://lkml.kernel.org/r/20210301222728.176417-2-axelrasmussen@google.comSigned-off-by: NAxel Rasmussen <axelrasmussen@google.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NMike Kravetz <mike.kravetz@oracle.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chinwen Chang <chinwen.chang@mediatek.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Lokesh Gidra <lokeshgidra@google.com>
      Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: "Michal Koutn" <mkoutny@suse.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Peter Xu <peterx@redhat.com>
      Cc: Shaohua Li <shli@fb.com>
      Cc: Shawn Anastasio <shawn@anastas.io>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Steven Price <steven.price@arm.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Adam Ruprecht <ruprecht@google.com>
      Cc: Axel Rasmussen <axelrasmussen@google.com>
      Cc: Cannon Matthews <cannonmatthews@google.com>
      Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Mina Almasry <almasrymina@google.com>
      Cc: Oliver Upton <oupton@google.com>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7677f7fd
    • A
      vfio/pci: Revert nvlink removal uAPI breakage · 77b8aeb9
      Alex Williamson 提交于
      Revert the uAPI changes from the below commit with notice that these
      regions and capabilities are no longer provided.
      
      Fixes: b392a198 ("vfio/pci: remove vfio_pci_nvlink2")
      Reported-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Tested-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Message-Id: <162014341432.3807030.11054087109120670135.stgit@omen>
      77b8aeb9
  16. 04 5月, 2021 1 次提交
  17. 30 4月, 2021 1 次提交
    • A
      seg6: add counters support for SRv6 Behaviors · 94604548
      Andrea Mayer 提交于
      This patch provides counters for SRv6 Behaviors as defined in [1],
      section 6. For each SRv6 Behavior instance, counters defined in [1] are:
      
       - the total number of packets that have been correctly processed;
       - the total amount of traffic in bytes of all packets that have been
         correctly processed;
      
      In addition, this patch introduces a new counter that counts the number of
      packets that have NOT been properly processed (i.e. errors) by an SRv6
      Behavior instance.
      
      Counters are not only interesting for network monitoring purposes (i.e.
      counting the number of packets processed by a given behavior) but they also
      provide a simple tool for checking whether a behavior instance is working
      as we expect or not.
      Counters can be useful for troubleshooting misconfigured SRv6 networks.
      Indeed, an SRv6 Behavior can silently drop packets for very different
      reasons (i.e. wrong SID configuration, interfaces set with SID addresses,
      etc) without any notification/message to the user.
      
      Due to the nature of SRv6 networks, diagnostic tools such as ping and
      traceroute may be ineffective: paths used for reaching a given router can
      be totally different from the ones followed by probe packets. In addition,
      paths are often asymmetrical and this makes it even more difficult to keep
      up with the journey of the packets and to understand which behaviors are
      actually processing our traffic.
      
      When counters are enabled on an SRv6 Behavior instance, it is possible to
      verify if packets are actually processed by such behavior and what is the
      outcome of the processing. Therefore, the counters for SRv6 Behaviors offer
      an non-invasive observability point which can be leveraged for both traffic
      monitoring and troubleshooting purposes.
      
      [1] https://www.rfc-editor.org/rfc/rfc8986.html#name-counters
      
      Troubleshooting using SRv6 Behavior counters
      --------------------------------------------
      
      Let's make a brief example to see how helpful counters can be for SRv6
      networks. Let's consider a node where an SRv6 End Behavior receives an SRv6
      packet whose Segment Left (SL) is equal to 0. In this case, the End
      Behavior (which accepts only packets with SL >= 1) discards the packet and
      increases the error counter.
      This information can be leveraged by the network operator for
      troubleshooting. Indeed, the error counter is telling the user that the
      packet:
      
        (i) arrived at the node;
       (ii) the packet has been taken into account by the SRv6 End behavior;
      (iii) but an error has occurred during the processing.
      
      The error (iii) could be caused by different reasons, such as wrong route
      settings on the node or due to an invalid SID List carried by the SRv6
      packet. Anyway, the error counter is used to exclude that the packet did
      not arrive at the node or it has not been processed by the behavior at
      all.
      
      Turning on/off counters for SRv6 Behaviors
      ------------------------------------------
      
      Each SRv6 Behavior instance can be configured, at the time of its creation,
      to make use of counters.
      This is done through iproute2 which allows the user to create an SRv6
      Behavior instance specifying the optional "count" attribute as shown in the
      following example:
      
       $ ip -6 route add 2001:db8::1 encap seg6local action End count dev eth0
      
      per-behavior counters can be shown by adding "-s" to the iproute2 command
      line, i.e.:
      
       $ ip -s -6 route show 2001:db8::1
       2001:db8::1 encap seg6local action End packets 0 bytes 0 errors 0 dev eth0
      
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Impact of counters for SRv6 Behaviors on performance
      ====================================================
      
      To determine the performance impact due to the introduction of counters in
      the SRv6 Behavior subsystem, we have carried out extensive tests.
      
      We chose to test the throughput achieved by the SRv6 End.DX2 Behavior
      because, among all the other behaviors implemented so far, it reaches the
      highest throughput which is around 1.5 Mpps (per core at 2.4 GHz on a
      Xeon(R) CPU E5-2630 v3) on kernel 5.12-rc2 using packets of size ~ 100
      bytes.
      
      Three different tests were conducted in order to evaluate the overall
      throughput of the SRv6 End.DX2 Behavior in the following scenarios:
      
       1) vanilla kernel (without the SRv6 Behavior counters patch) and a single
          instance of an SRv6 End.DX2 Behavior;
       2) patched kernel with SRv6 Behavior counters and a single instance of
          an SRv6 End.DX2 Behavior with counters turned off;
       3) patched kernel with SRv6 Behavior counters and a single instance of
          SRv6 End.DX2 Behavior with counters turned on.
      
      All tests were performed on a testbed deployed on the CloudLab facilities
      [2], a flexible infrastructure dedicated to scientific research on the
      future of Cloud Computing.
      
      Results of tests are shown in the following table:
      
      Scenario (1): average 1504764,81 pps (~1504,76 kpps); std. dev 3956,82 pps
      Scenario (2): average 1501469,78 pps (~1501,47 kpps); std. dev 2979,85 pps
      Scenario (3): average 1501315,13 pps (~1501,32 kpps); std. dev 2956,00 pps
      
      As can be observed, throughputs achieved in scenarios (2),(3) did not
      suffer any observable degradation compared to scenario (1).
      
      Thanks to Jakub Kicinski and David Ahern for their valuable suggestions
      and comments provided during the discussion of the proposed RFCs.
      
      [2] https://www.cloudlab.usSigned-off-by: NAndrea Mayer <andrea.mayer@uniroma2.it>
      Reviewed-by: NDavid Ahern <dsahern@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      94604548
  18. 29 4月, 2021 1 次提交
  19. 28 4月, 2021 1 次提交
    • P
      netfilter: nftables: add catch-all set element support · aaa31047
      Pablo Neira Ayuso 提交于
      This patch extends the set infrastructure to add a special catch-all set
      element. If the lookup fails to find an element (or range) in the set,
      then the catch-all element is selected. Users can specify a mapping,
      expression(s) and timeout to be attached to the catch-all element.
      
      This patch adds a catchall list to the set, this list might contain more
      than one single catch-all element (e.g. in case that the catch-all
      element is removed and a new one is added in the same transaction).
      However, most of the time, there will be either one element or no
      elements at all in this list.
      
      The catch-all element is identified via NFT_SET_ELEM_CATCHALL flag and
      such special element has no NFTA_SET_ELEM_KEY attribute. There is a new
      nft_set_elem_catchall object that stores a reference to the dummy
      catch-all element (catchall->elem) whose layout is the same of the set
      element type to reuse the existing set element codebase.
      
      The set size does not apply to the catch-all element, users can define a
      catch-all element even if the set is full.
      
      The check for valid set element flags hava been updates to report
      EOPNOTSUPP in case userspace requests flags that are not supported when
      using new userspace nftables and old kernel.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      aaa31047
  20. 26 4月, 2021 4 次提交