1. 19 Nov, 2023 2 commits
    • Pedro Tammela's avatar
      net/sched: cls_u32: replace int refcounts with proper refcounts · 6b78debe
      Pedro Tammela authored
      Proper refcounts will always warn splat when something goes wrong,
      be it underflow, saturation or object resurrection. As these are always
      a source of bugs, use it in cls_u32 as a safeguard to prevent/catch issues.
      Another benefit is that the refcount API self documents the code, making
      clear when transitions to dead are expected.
      
      For such an update we had to make minor adaptations on u32 to fit the refcount
      API. First we set explicitly to '1' when objects are created, then the
      objects are alive until a 1 -> 0 happens, which is then released appropriately.
      
      The above made clear some redundant operations in the u32 code
      around the root_ht handling that were removed. The root_ht is created
      with a refcnt set to 1. Then when it's associated with tcf_proto it increments the refcnt to 2.
      Throughout the entire code the root_ht is an exceptional case and can never be referenced,
      therefore the refcnt never incremented/decremented.
      Its lifetime is always bound to tcf_proto, meaning if you delete tcf_proto
      the root_ht is deleted as well. The code made up for the fact that root_ht refcnt is 2 and did
      a double decrement to free it, which is not a fit for the refcount API.
      
      Even though refcount_t is implemented using atomics, we should observe
      a negligible control plane impact.
      Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Link: https://lore.kernel.org/r/20231114141856.974326-2-pctammela@mojatatu.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6b78debe
    • Jakub Kicinski's avatar
      net: partial revert of the "Make timestamping selectable: series · 289354f2
      Jakub Kicinski authored
      Revert following commits:
      
      commit acec05fb ("net_tstamp: Add TIMESTAMPING SOFTWARE and HARDWARE mask")
      commit 11d55be0 ("net: ethtool: Add a command to expose current time stamping layer")
      commit bb8645b0 ("netlink: specs: Introduce new netlink command to get current timestamp")
      commit d905f9c7 ("net: ethtool: Add a command to list available time stamping layers")
      commit aed5004e ("netlink: specs: Introduce new netlink command to list available time stamping layers")
      commit 51bdf316 ("net: Replace hwtstamp_source by timestamping layer")
      commit 0f7f463d ("net: Change the API of PHY default timestamp to MAC")
      commit 091fab12 ("net: ethtool: ts: Update GET_TS to reply the current selected timestamp")
      commit 152c75e1 ("net: ethtool: ts: Let the active time stamping layer be selectable")
      commit ee60ea6b ("netlink: specs: Introduce time stamping set command")
      
      They need more time for reviews.
      
      Link: https://lore.kernel.org/all/20231118183529.6e67100c@kernel.org/Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      289354f2
  2. 18 Nov, 2023 38 commits