Skip to content
Snippets Groups Projects
  1. Nov 30, 2020
    • Björn Töpel's avatar
      net: Add SO_BUSY_POLL_BUDGET socket option · 7c951caf
      Björn Töpel authored
      
      This option lets a user set a per socket NAPI budget for
      busy-polling. If the options is not set, it will use the default of 8.
      
      Signed-off-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/bpf/20201130185205.196029-3-bjorn.topel@gmail.com
      7c951caf
    • Björn Töpel's avatar
      net: Introduce preferred busy-polling · 7fd3253a
      Björn Töpel authored
      
      The existing busy-polling mode, enabled by the SO_BUSY_POLL socket
      option or system-wide using the /proc/sys/net/core/busy_read knob, is
      an opportunistic. That means that if the NAPI context is not
      scheduled, it will poll it. If, after busy-polling, the budget is
      exceeded the busy-polling logic will schedule the NAPI onto the
      regular softirq handling.
      
      One implication of the behavior above is that a busy/heavy loaded NAPI
      context will never enter/allow for busy-polling. Some applications
      prefer that most NAPI processing would be done by busy-polling.
      
      This series adds a new socket option, SO_PREFER_BUSY_POLL, that works
      in concert with the napi_defer_hard_irqs and gro_flush_timeout
      knobs. The napi_defer_hard_irqs and gro_flush_timeout knobs were
      introduced in commit 6f8b12d6 ("net: napi: add hard irqs deferral
      feature"), and allows for a user to defer interrupts to be enabled and
      instead schedule the NAPI context from a watchdog timer. When a user
      enables the SO_PREFER_BUSY_POLL, again with the other knobs enabled,
      and the NAPI context is being processed by a softirq, the softirq NAPI
      processing will exit early to allow the busy-polling to be performed.
      
      If the application stops performing busy-polling via a system call,
      the watchdog timer defined by gro_flush_timeout will timeout, and
      regular softirq handling will resume.
      
      In summary; Heavy traffic applications that prefer busy-polling over
      softirq processing should use this option.
      
      Example usage:
      
        $ echo 2 | sudo tee /sys/class/net/ens785f1/napi_defer_hard_irqs
        $ echo 200000 | sudo tee /sys/class/net/ens785f1/gro_flush_timeout
      
      Note that the timeout should be larger than the userspace processing
      window, otherwise the watchdog will timeout and fall back to regular
      softirq processing.
      
      Enable the SO_BUSY_POLL/SO_PREFER_BUSY_POLL options on your socket.
      
      Signed-off-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/bpf/20201130185205.196029-2-bjorn.topel@gmail.com
      7fd3253a
    • KP Singh's avatar
      selftests/bpf: Fix flavored variants of test_ima · 854055c0
      KP Singh authored
      
      Flavored variants of test_progs (e.g. test_progs-no_alu32) change their
      working directory to the corresponding subdirectory (e.g. no_alu32).
      Since the setup script required by test_ima (ima_setup.sh) is not
      mentioned in the dependencies, it does not get copied to these
      subdirectories and causes flavored variants of test_ima to fail.
      
      Adding the script to TRUNNER_EXTRA_FILES ensures that the file is also
      copied to the subdirectories for the flavored variants of test_progs.
      
      Fixes: 34b82d3a ("bpf: Add a selftest for bpf_ima_inode_hash")
      Reported-by: default avatarYonghong Song <yhs@fb.com>
      Suggested-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarKP Singh <kpsingh@google.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20201126184946.1708213-1-kpsingh@chromium.org
      854055c0
  2. Nov 27, 2020
  3. Nov 25, 2020
  4. Nov 24, 2020
  5. Nov 20, 2020
  6. Nov 19, 2020
  7. Nov 18, 2020
  8. Nov 17, 2020
Loading