diff options
author | Petr Machata <petrm@mellanox.com> | 2019-06-30 09:04:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-01 18:58:34 -0700 |
commit | d7cd206dbfb25efc5f06ea3c595074a51d48d00a (patch) | |
tree | d603ff49faafb1047f87b48ed426e032055f9aeb /drivers/net/ethernet/mellanox/mlxsw/switchx2.c | |
parent | aed4b5721143506c8170d04b13c74edeafc1a70e (diff) | |
download | kernel_replicant_linux-d7cd206dbfb25efc5f06ea3c595074a51d48d00a.tar.gz kernel_replicant_linux-d7cd206dbfb25efc5f06ea3c595074a51d48d00a.tar.bz2 kernel_replicant_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/switchx2.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c index fc4f19167262..bdab96f5bc70 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c +++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c @@ -299,6 +299,8 @@ static netdev_tx_t mlxsw_sx_port_xmit(struct sk_buff *skb, u64 len; int err; + memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb)); + if (mlxsw_core_skb_transmit_busy(mlxsw_sx->core, &tx_info)) return NETDEV_TX_BUSY; |