1. 12 Dec, 2022 18 commits
  2. 10 Dec, 2022 17 commits
  3. 09 Dec, 2022 5 commits
    • wangchuanlei's avatar
      net: openvswitch: Add support to count upcall packets · 1933ea36
      wangchuanlei authored
      Add support to count upall packets, when kmod of openvswitch
      upcall to count the number of packets for upcall succeed and
      failed, which is a better way to see how many packets upcalled
      on every interfaces.
      Signed-off-by: default avatarwangchuanlei <wangchuanlei@inspur.com>
      Acked-by: default avatarEelco Chaudron <echaudro@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1933ea36
    • Tejun Heo's avatar
      rhashtable: Allow rhashtable to be used from irq-safe contexts · e47877c7
      Tejun Heo authored
      rhashtable currently only does bh-safe synchronization making it impossible
      to use from irq-safe contexts. Switch it to use irq-safe synchronization to
      remove the restriction.
      
      v2: Update the lock functions to return the ulong flags value and unlock
          functions to take the value directly instead of passing around the
          pointer. Suggested by Linus.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reviewed-by: default avatarDavid Vernet <dvernet@meta.com>
      Acked-by: default avatarJosh Don <joshdon@google.com>
      Acked-by: default avatarHao Luo <haoluo@google.com>
      Acked-by: default avatarBarret Rhoden <brho@google.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e47877c7
    • David S. Miller's avatar
      Merge branch 'net-sched-retpoline' · b602d003
      David S. Miller authored
      Pedro Tammela says:
      
      ====================
      net/sched: retpoline wrappers for tc
      
      In tc all qdics, classifiers and actions can be compiled as modules.
      This results today in indirect calls in all transitions in the tc hierarchy.
      Due to CONFIG_RETPOLINE, CPUs with mitigations=on might pay an extra cost on
      indirect calls. For newer Intel cpus with IBRS the extra cost is
      nonexistent, but AMD Zen cpus and older x86 cpus still go through the
      retpoline thunk.
      
      Known built-in symbols can be optimized into direct calls, thus
      avoiding the retpoline thunk. So far, tc has not been leveraging this
      build information and leaving out a performance optimization for some
      CPUs. In this series we wire up 'tcf_classify()' and 'tcf_action_exec()'
      with direct calls when known modules are compiled as built-in as an
      opt-in optimization.
      
      We measured these changes in one AMD Zen 4 cpu (Retpoline), one AMD Zen 3 cpu (Retpoline),
      one Intel 10th Gen CPU (IBRS), one Intel 3rd Gen cpu (Retpoline) and one
      Intel Xeon CPU (IBRS) using pktgen with 64b udp packets. Our test setup is a
      dummy device with clsact and matchall in a kernel compiled with every
      tc module as built-in.  We observed a 3-8% speed up on the retpoline CPUs,
      when going through 1 tc filter, and a 60-100% speed up when going through 100 filters.
      For the IBRS cpus we observed a 1-2% degradation in both scenarios, we believe
      the extra branches check introduced a small overhead therefore we added
      a static key that bypasses the wrapper on kernels not using the retpoline mitigation,
      but compiled with CONFIG_RETPOLINE.
      
      1 filter:
      CPU        | before (pps) | after (pps) | diff
      R9 7950X   | 5914980      | 6380227     | +7.8%
      R9 5950X   | 4237838      | 4412241     | +4.1%
      R9 5950X   | 4265287      | 4413757     | +3.4%   [*]
      i5-3337U   | 1580565      | 1682406     | +6.4%
      i5-10210U  | 3006074      | 3006857     | +0.0%
      i5-10210U  | 3160245      | 3179945     | +0.6%   [*]
      Xeon 6230R | 3196906      | 3197059a     | +0.0%
      Xeon 6230R | 3190392      | 3196153     | +0.01%  [*]
      
      100 filters:
      CPU        | before (pps) | after (pps) | diff
      R9 7950X   | 373598       | 820396      | +119.59%
      R9 5950X   | 313469       | 633303      | +102.03%
      R9 5950X   | 313797       | 633150      | +101.77% [*]
      i5-3337U   | 127454       | 211210      | +65.71%
      i5-10210U  | 389259       | 381765      | -1.9%
      i5-10210U  | 408812       | 412730      | +0.9%    [*]
      Xeon 6230R | 415420       | 406612      | -2.1%
      Xeon 6230R | 416705       | 405869      | -2.6%    [*]
      
      [*] In these tests we ran pktgen with clone set to 1000.
      
      On the 7950x system we also tested the impact of filters if iteration order
      placement varied, first by compiling a kernel with the filter under test being
      the first one in the static iteration and then repeating it with being last (of 15 classifiers existing today).
      We saw a difference of +0.5-1% in pps between being the first in the iteration vs being the last.
      Therefore we order the classifiers and actions according to relevance per our current thinking.
      
      v5->v6:
      - Address Eric Dumazet suggestions
      
      v4->v5:
      - Rebase
      
      v3->v4:
      - Address Eric Dumazet suggestions
      
      v2->v3:
      - Address suggestions by Jakub, Paolo and Eric
      - Dropped RFC tag (I forgot to add it on v2)
      
      v1->v2:
      - Fix build errors found by the bots
      - Address Kuniyuki Iwashima suggestions
      
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b602d003
    • Pedro Tammela's avatar
      net/sched: avoid indirect classify functions on retpoline kernels · 9f3101dc
      Pedro Tammela authored
      Expose the necessary tc classifier functions and wire up cls_api to use
      direct calls in retpoline kernels.
      Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
      Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarVictor Nogueira <victor@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f3101dc
    • Pedro Tammela's avatar
      net/sched: avoid indirect act functions on retpoline kernels · 871cf386
      Pedro Tammela authored
      Expose the necessary tc act functions and wire up act_api to use
      direct calls in retpoline kernels.
      Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
      Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarVictor Nogueira <victor@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      871cf386