1. 27 3月, 2020 5 次提交
    • J
      devlink: track snapshot id usage count using an xarray · 12102436
      Jacob Keller 提交于
      Each snapshot created for a devlink region must have an id. These ids
      are supposed to be unique per "event" that caused the snapshot to be
      created. Drivers call devlink_region_snapshot_id_get to obtain a new id
      to use for a new event trigger. The id values are tracked per devlink,
      so that the same id number can be used if a triggering event creates
      multiple snapshots on different regions.
      
      There is no mechanism for snapshot ids to ever be reused. Introduce an
      xarray to store the count of how many snapshots are using a given id,
      replacing the snapshot_id field previously used for picking the next id.
      
      The devlink_region_snapshot_id_get() function will use xa_alloc to
      insert an initial value of 1 value at an available slot between 0 and
      U32_MAX.
      
      The new __devlink_snapshot_id_increment() and
      __devlink_snapshot_id_decrement() functions will be used to track how
      many snapshots currently use an id.
      
      Drivers must now call devlink_snapshot_id_put() in order to release
      their reference of the snapshot id after adding region snapshots.
      
      By tracking the total number of snapshots using a given id, it is
      possible for the decrement() function to erase the id from the xarray
      when it is not in use.
      
      With this method, a snapshot id can become reused again once all
      snapshots that referred to it have been deleted via
      DEVLINK_CMD_REGION_DEL, and the driver has finished adding snapshots.
      
      This work also paves the way to introduce a mechanism for userspace to
      request a snapshot.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12102436
    • J
      devlink: report error once U32_MAX snapshot ids have been used · 7ef19d3b
      Jacob Keller 提交于
      The devlink_snapshot_id_get() function returns a snapshot id. The
      snapshot id is a u32, so there is no way to indicate an error code.
      
      A future change is going to possibly add additional cases where this
      function could fail. Refactor the function to return the snapshot id in
      an argument, so that it can return zero or an error value.
      
      This ensures that snapshot ids cannot be confused with error values, and
      aids in the future refactor of snapshot id allocation management.
      
      Because there is no current way to release previously used snapshot ids,
      add a simple check ensuring that an error is reported in case the
      snapshot_id would over flow.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ef19d3b
    • J
      devlink: convert snapshot destructor callback to region op · a0a09f6b
      Jacob Keller 提交于
      It does not makes sense that two snapshots for a given region would use
      different destructors. Simplify snapshot creation by adding
      a .destructor op for regions.
      
      This operation will replace the data_destructor for the snapshot
      creation, and makes snapshot creation easier.
      Noticed-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a0a09f6b
    • J
      devlink: prepare to support region operations · e8937681
      Jacob Keller 提交于
      Modify the devlink region code in preparation for adding new operations
      on regions.
      
      Create a devlink_region_ops structure, and move the name pointer from
      within the devlink_region structure into the ops structure (similar to
      the devlink_health_reporter_ops).
      
      This prepares the regions to enable support of additional operations in
      the future such as requesting snapshots, or accessing the region
      directly without a snapshot.
      
      In order to re-use the constant strings in the mlx4 driver their
      declaration must be changed to 'const char * const' to ensure the
      compiler realizes that both the data and the pointer cannot change.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8937681
    • P
      net: flow_offload.h: Fix a comment at flow_action_entry.mangle · 1f40be6a
      Petr Machata 提交于
      This field references FLOW_ACTION_PACKET_EDIT. Such action does not exist
      though. Instead the field is used for FLOW_ACTION_MANGLE and _ADD.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f40be6a
  2. 26 3月, 2020 1 次提交
    • P
      net: Fix CONFIG_NET_CLS_ACT=n and CONFIG_NFT_FWD_NETDEV={y, m} build · 2c64605b
      Pablo Neira Ayuso 提交于
      net/netfilter/nft_fwd_netdev.c: In function ‘nft_fwd_netdev_eval’:
          net/netfilter/nft_fwd_netdev.c:32:10: error: ‘struct sk_buff’ has no member named ‘tc_redirected’
            pkt->skb->tc_redirected = 1;
                    ^~
          net/netfilter/nft_fwd_netdev.c:33:10: error: ‘struct sk_buff’ has no member named ‘tc_from_ingress’
            pkt->skb->tc_from_ingress = 1;
                    ^~
      
      To avoid a direct dependency with tc actions from netfilter, wrap the
      redirect bits around CONFIG_NET_REDIRECT and move helpers to
      include/linux/skbuff.h. Turn on this toggle from the ifb driver, the
      only existing client of these bits in the tree.
      
      This patch adds skb_set_redirected() that sets on the redirected bit
      on the skbuff, it specifies if the packet was redirect from ingress
      and resets the timestamp (timestamp reset was originally missing in the
      netfilter bugfix).
      
      Fixes: bcfabee1 ("netfilter: nft_fwd_netdev: allow to redirect to ifb via ingress")
      Reported-by: noreply@ellerman.id.au
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c64605b
  3. 25 3月, 2020 1 次提交
    • V
      net: dsa: tag_8021q: replace dsa_8021q_remove_header with __skb_vlan_pop · e80f40cb
      Vladimir Oltean 提交于
      Not only did this wheel did not need reinventing, but there is also
      an issue with it: It doesn't remove the VLAN header in a way that
      preserves the L2 payload checksum when that is being provided by the DSA
      master hw.  It should recalculate checksum both for the push, before
      removing the header, and for the pull afterwards. But the current
      implementation is quite dizzying, with pulls followed immediately
      afterwards by pushes, the memmove is done before the push, etc.  This
      makes a DSA master with RX checksumming offload to print stack traces
      with the infamous 'hw csum failure' message.
      
      So remove the dsa_8021q_remove_header function and replace it with
      something that actually works with inet checksumming.
      
      Fixes: d4619336 ("net: dsa: tag_8021q: Create helper function for removing VLAN header")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e80f40cb
  4. 24 3月, 2020 10 次提交
  5. 22 3月, 2020 2 次提交
  6. 21 3月, 2020 1 次提交
  7. 20 3月, 2020 19 次提交
  8. 19 3月, 2020 1 次提交