summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/core.h
diff options
context:
space:
mode:
authorPetr Machata2019-06-30 08:04:52 +0200
committerDavid S. Miller2019-07-02 03:58:34 +0200
commitd7cd206dbfb25efc5f06ea3c595074a51d48d00a (patch)
treed603ff49faafb1047f87b48ed426e032055f9aeb /drivers/net/ethernet/mellanox/mlxsw/core.h
parentmlxsw: spectrum: PTP: Hook into packet receive path (diff)
downloadkernel-qcow2-linux-d7cd206dbfb25efc5f06ea3c595074a51d48d00a.tar.gz
kernel-qcow2-linux-d7cd206dbfb25efc5f06ea3c595074a51d48d00a.tar.xz
kernel-qcow2-linux-d7cd206dbfb25efc5f06ea3c595074a51d48d00a.zip
mlxsw: core: Add support for using SKB control buffer
The SKB control buffer is useful (and used) for bookkeeping of information related to that SKB. Add helpers so that the mlxsw driver(s) can safely use the buffer as well. The structure is currently empty, individual users will add members to it as necessary. Note that SKB allocation functions already clear the buffer, so the cleanup is only necessary when ndo_start_xmit is called. Signed-off-by: Petr Machata <petrm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/core.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/core.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 6dbb0ede502e..06babcc58c7a 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h
@@ -418,4 +418,13 @@ enum mlxsw_devlink_param_id {
MLXSW_DEVLINK_PARAM_ID_ACL_REGION_REHASH_INTERVAL,
};
+struct mlxsw_skb_cb {
+};
+
+static inline struct mlxsw_skb_cb *mlxsw_skb_cb(struct sk_buff *skb)
+{
+ BUILD_BUG_ON(sizeof(mlxsw_skb_cb) > sizeof(skb->cb));
+ return (struct mlxsw_skb_cb *) skb->cb;
+}
+
#endif