Skip to content

Commit

Permalink
net/mlx5e: TLS, build TLS netdev from capabilities
Browse files Browse the repository at this point in the history
This patch enables TLS Rx based on available HW capabilities.

Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Boris Pismenny authored and David S. Miller committed Jul 16, 2018
1 parent afd3baa commit 790af90
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,27 @@ static const struct tlsdev_ops mlx5e_tls_ops = {

void mlx5e_tls_build_netdev(struct mlx5e_priv *priv)
{
u32 caps = mlx5_accel_tls_device_caps(priv->mdev);
struct net_device *netdev = priv->netdev;

if (!mlx5_accel_is_tls_device(priv->mdev))
return;

netdev->features |= NETIF_F_HW_TLS_TX;
netdev->hw_features |= NETIF_F_HW_TLS_TX;
if (caps & MLX5_ACCEL_TLS_TX) {
netdev->features |= NETIF_F_HW_TLS_TX;
netdev->hw_features |= NETIF_F_HW_TLS_TX;
}

if (caps & MLX5_ACCEL_TLS_RX) {
netdev->features |= NETIF_F_HW_TLS_RX;
netdev->hw_features |= NETIF_F_HW_TLS_RX;
}

if (!(caps & MLX5_ACCEL_TLS_LRO)) {
netdev->features &= ~NETIF_F_LRO;
netdev->hw_features &= ~NETIF_F_LRO;
}

netdev->tlsdev_ops = &mlx5e_tls_ops;
}

Expand Down

0 comments on commit 790af90

Please sign in to comment.