net/mlx5e: Enable stateless offloads for VF representor netdevs
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_rep.c
index f6eead24931fb17ab17159d21559dc296a1817b7..08ba2063e8f61be772fbaa66d2ab0b65ae64fbbc 100644 (file)
@@ -46,8 +46,6 @@
 
 #define MLX5E_REP_PARAMS_LOG_SQ_SIZE \
        max(0x6, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
-#define MLX5E_REP_PARAMS_LOG_RQ_SIZE \
-       max(0x6, MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE)
 
 static const char mlx5e_rep_driver_name[] = "mlx5e_rep";
 
@@ -934,14 +932,15 @@ static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev,
        params->hard_mtu    = MLX5E_ETH_HARD_MTU;
        params->sw_mtu      = mtu;
        params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE;
-       params->rq_wq_type  = MLX5_WQ_TYPE_CYCLIC;
-       params->log_rq_mtu_frames = MLX5E_REP_PARAMS_LOG_RQ_SIZE;
 
+       /* RQ */
+       mlx5e_build_rq_params(mdev, params);
+
+       /* CQ moderation params */
        params->rx_dim_enabled = MLX5_CAP_GEN(mdev, cq_moderation);
        mlx5e_set_rx_cq_mode_params(params, cq_period_mode);
 
        params->num_tc                = 1;
-       params->lro_wqe_sz            = MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ;
 
        mlx5_query_min_inline(mdev, &params->tx_min_inline_mode);
 }
@@ -963,6 +962,16 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev)
        netdev->features         |= NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_TC | NETIF_F_NETNS_LOCAL;
        netdev->hw_features      |= NETIF_F_HW_TC;
 
+       netdev->hw_features    |= NETIF_F_SG;
+       netdev->hw_features    |= NETIF_F_IP_CSUM;
+       netdev->hw_features    |= NETIF_F_IPV6_CSUM;
+       netdev->hw_features    |= NETIF_F_GRO;
+       netdev->hw_features    |= NETIF_F_TSO;
+       netdev->hw_features    |= NETIF_F_TSO6;
+       netdev->hw_features    |= NETIF_F_RXCSUM;
+
+       netdev->features |= netdev->hw_features;
+
        eth_hw_addr_random(netdev);
 
        netdev->min_mtu = ETH_MIN_MTU;
@@ -1077,7 +1086,7 @@ static const struct mlx5e_profile mlx5e_rep_profile = {
        .max_nch                = mlx5e_get_rep_max_num_channels,
        .update_carrier         = NULL,
        .rx_handlers.handle_rx_cqe       = mlx5e_handle_rx_cqe_rep,
-       .rx_handlers.handle_rx_cqe_mpwqe = NULL /* Not supported */,
+       .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
        .max_tc                 = 1,
 };