1. 17 Jan, 2023 3 commits
    • Jesper Dangaard Brouer's avatar
      net: fix call location in kfree_skb_list_reason · a4650da2
      Jesper Dangaard Brouer authored
      The SKB drop reason uses __builtin_return_address(0) to give the call
      "location" to trace_kfree_skb() tracepoint skb:kfree_skb.
      
      To keep this stable for compilers kfree_skb_reason() is annotated with
      __fix_address (noinline __noclone) as fixed in commit c205cc75
      ("net: skb: prevent the split of kfree_skb_reason() by gcc").
      
      The function kfree_skb_list_reason() invoke kfree_skb_reason(), which
      cause the __builtin_return_address(0) "location" to report the
      unexpected address of kfree_skb_list_reason.
      
      Example output from 'perf script':
       kpktgend_0  1337 [000]    81.002597: skb:kfree_skb: skbaddr=0xffff888144824700 protocol=2048 location=kfree_skb_list_reason+0x1e reason: QDISC_DROP
      
      Patch creates an __always_inline __kfree_skb_reason() helper call that
      is called from both kfree_skb_list() and kfree_skb_list_reason().
      Suggestions for solutions that shares code better are welcome.
      
      As preparation for next patch move __kfree_skb() invocation out of
      this helper function.
      Reviewed-by: default avatarSaeed Mahameed <saeed@kernel.org>
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      a4650da2
    • Dan Carpenter's avatar
      devlink: remove some unnecessary code · 501543b4
      Dan Carpenter authored
      This code checks if (attrs[DEVLINK_ATTR_TRAP_POLICER_ID]) twice.  Once
      at the start of the function and then a couple lines later.  Delete the
      second check since that one must be true.
      
      Because the second condition is always true, it means the:
      
      	policer_item = group_item->policer_item;
      
      assignment is immediately over-written.  Delete that as well.
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Link: https://lore.kernel.org/r/Y8EJz8oxpMhfiPUb@kiliSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      501543b4
    • Hangbin Liu's avatar
      sched: add new attr TCA_EXT_WARN_MSG to report tc extact message · 0349b877
      Hangbin Liu authored
      We will report extack message if there is an error via netlink_ack(). But
      if the rule is not to be exclusively executed by the hardware, extack is not
      passed along and offloading failures don't get logged.
      
      In commit 81c7288b ("sched: cls: enable verbose logging") Marcelo
      made cls could log verbose info for offloading failures, which helps
      improving Open vSwitch debuggability when using flower offloading.
      
      It would also be helpful if userspace monitor tools, like "tc monitor",
      could log this kind of message, as it doesn't require vswitchd log level
      adjusment. Let's add a new tc attributes to report the extack message so
      the monitor program could receive the failures. e.g.
      
        # tc monitor
        added chain dev enp3s0f1np1 parent ffff: chain 0
        added filter dev enp3s0f1np1 ingress protocol all pref 49152 flower chain 0 handle 0x1
          ct_state +trk+new
          not_in_hw
                action order 1: gact action drop
                 random type none pass val 0
                 index 1 ref 1 bind 1
      
        Warning: mlx5_core: matching on ct_state +new isn't supported.
      
      In this patch I only report the extack message on add/del operations.
      It doesn't look like we need to report the extack message on get/dump
      operations.
      
      Note this message not only reporte to multicast groups, it could also
      be reported unicast, which may affect the current usersapce tool's behaivor.
      Suggested-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Link: https://lore.kernel.org/r/20230113034353.2766735-1-liuhangbin@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      0349b877
  2. 16 Jan, 2023 37 commits