]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Push min-inline mode resolution helper into the core
authorOr Gerlitz <ogerlitz@mellanox.com>
Wed, 30 Nov 2016 18:23:51 +0000 (20:23 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 24 Jan 2017 19:14:05 +0000 (21:14 +0200)
So we can use that from the IB driver too in downstream patches.

This patch doesn't change any functionality.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/vport.c
include/linux/mlx5/vport.h

index c819d07fbdb381c669ca39f0729b2589a404c24a..636372873e644ae6d94fc877abdf40b1c47f53ce 100644 (file)
@@ -3458,22 +3458,6 @@ void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
                        MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC_FROM_CQE;
 }
 
-static void mlx5e_query_min_inline(struct mlx5_core_dev *mdev,
-                                  u8 *min_inline_mode)
-{
-       switch (MLX5_CAP_ETH(mdev, wqe_inline_mode)) {
-       case MLX5_CAP_INLINE_MODE_L2:
-               *min_inline_mode = MLX5_INLINE_MODE_L2;
-               break;
-       case MLX5_CAP_INLINE_MODE_VPORT_CONTEXT:
-               mlx5_query_nic_vport_min_inline(mdev, 0, min_inline_mode);
-               break;
-       case MLX5_CAP_INLINE_MODE_NOT_REQUIRED:
-               *min_inline_mode = MLX5_INLINE_MODE_NONE;
-               break;
-       }
-}
-
 u32 mlx5e_choose_lro_timeout(struct mlx5_core_dev *mdev, u32 wanted_timeout)
 {
        int i;
@@ -3533,7 +3517,7 @@ static void mlx5e_build_nic_netdev_priv(struct mlx5_core_dev *mdev,
        priv->params.tx_cq_moderation.pkts =
                MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_PKTS;
        priv->params.tx_max_inline         = mlx5e_get_max_inline_cap(mdev);
-       mlx5e_query_min_inline(mdev, &priv->params.tx_min_inline_mode);
+       mlx5_query_min_inline(mdev, &priv->params.tx_min_inline_mode);
        priv->params.num_tc                = 1;
        priv->params.rss_hfunc             = ETH_RSS_HASH_XOR;
 
index 269e4401c342d1375e70a40ba9905dddf9b65cef..b49cfc895c1091cdc4846359ac812655513cfc7c 100644 (file)
@@ -127,6 +127,23 @@ int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev,
 }
 EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_min_inline);
 
+void mlx5_query_min_inline(struct mlx5_core_dev *mdev,
+                          u8 *min_inline_mode)
+{
+       switch (MLX5_CAP_ETH(mdev, wqe_inline_mode)) {
+       case MLX5_CAP_INLINE_MODE_L2:
+               *min_inline_mode = MLX5_INLINE_MODE_L2;
+               break;
+       case MLX5_CAP_INLINE_MODE_VPORT_CONTEXT:
+               mlx5_query_nic_vport_min_inline(mdev, 0, min_inline_mode);
+               break;
+       case MLX5_CAP_INLINE_MODE_NOT_REQUIRED:
+               *min_inline_mode = MLX5_INLINE_MODE_NONE;
+               break;
+       }
+}
+EXPORT_SYMBOL_GPL(mlx5_query_min_inline);
+
 int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev,
                                     u16 vport, u8 min_inline)
 {
index ec35157ea7252c587894ff4f94d406f50b7aeb66..656c70b65dd270a137f43106d993f1113fef73ab 100644 (file)
@@ -51,6 +51,7 @@ int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev,
                                     u16 vport, u8 *addr);
 int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev,
                                    u16 vport, u8 *min_inline);
+void mlx5_query_min_inline(struct mlx5_core_dev *mdev, u8 *min_inline);
 int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev,
                                     u16 vport, u8 min_inline);
 int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev,