]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_main.c
index 9d5f6e56188f825bbbe605f1bfb3af09604d5e42..0c8e847a9eeedd5c531db24b3a8dfc2b9575338f 100644 (file)
@@ -1130,6 +1130,8 @@ static int mlx5e_alloc_txqsq(struct mlx5e_channel *c,
        sq->stats     = &c->priv->channel_stats[c->ix].sq[tc];
        sq->stop_room = MLX5E_SQ_STOP_ROOM;
        INIT_WORK(&sq->recover_work, mlx5e_tx_err_cqe_work);
+       if (!MLX5_CAP_ETH(mdev, wqe_vlan_insert))
+               set_bit(MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE, &sq->state);
        if (MLX5_IPSEC_DEV(c->priv->mdev))
                set_bit(MLX5E_SQ_STATE_IPSEC, &sq->state);
        if (mlx5_accel_is_tls_device(c->priv->mdev)) {
@@ -2321,7 +2323,7 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
                        goto err_close_channels;
        }
 
-       if (!IS_ERR_OR_NULL(priv->tx_reporter))
+       if (priv->tx_reporter)
                devlink_health_reporter_state_update(priv->tx_reporter,
                                                     DEVLINK_HEALTH_REPORTER_STATE_HEALTHY);
 
@@ -3422,7 +3424,7 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
 #ifdef CONFIG_MLX5_ESWITCH
 static int mlx5e_setup_tc_cls_flower(struct mlx5e_priv *priv,
                                     struct flow_cls_offload *cls_flower,
-                                    int flags)
+                                    unsigned long flags)
 {
        switch (cls_flower->command) {
        case FLOW_CLS_REPLACE:
@@ -3442,12 +3444,12 @@ static int mlx5e_setup_tc_cls_flower(struct mlx5e_priv *priv,
 static int mlx5e_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
                                   void *cb_priv)
 {
+       unsigned long flags = MLX5_TC_FLAG(INGRESS) | MLX5_TC_FLAG(NIC_OFFLOAD);
        struct mlx5e_priv *priv = cb_priv;
 
        switch (type) {
        case TC_SETUP_CLSFLOWER:
-               return mlx5e_setup_tc_cls_flower(priv, type_data, MLX5E_TC_INGRESS |
-                                                MLX5E_TC_NIC_OFFLOAD);
+               return mlx5e_setup_tc_cls_flower(priv, type_data, flags);
        default:
                return -EOPNOTSUPP;
        }
@@ -3640,7 +3642,7 @@ static int set_feature_tc_num_filters(struct net_device *netdev, bool enable)
 {
        struct mlx5e_priv *priv = netdev_priv(netdev);
 
-       if (!enable && mlx5e_tc_num_filters(priv, MLX5E_TC_NIC_OFFLOAD)) {
+       if (!enable && mlx5e_tc_num_filters(priv, MLX5_TC_FLAG(NIC_OFFLOAD))) {
                netdev_err(netdev,
                           "Active offloaded tc filters, can't turn hw_tc_offload off\n");
                return -EINVAL;
@@ -3781,9 +3783,10 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
                        netdev_warn(netdev, "Dropping C-tag vlan stripping offload due to S-tag vlan\n");
        }
        if (!MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_STRIDING_RQ)) {
-               features &= ~NETIF_F_LRO;
-               if (params->lro_en)
+               if (features & NETIF_F_LRO) {
                        netdev_warn(netdev, "Disabling LRO, not supported in legacy RQ\n");
+                       features &= ~NETIF_F_LRO;
+               }
        }
 
        if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) {
@@ -3950,7 +3953,8 @@ int mlx5e_hwstamp_set(struct mlx5e_priv *priv, struct ifreq *ifr)
        case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
        case HWTSTAMP_FILTER_NTP_ALL:
                /* Disable CQE compression */
-               netdev_warn(priv->netdev, "Disabling cqe compression");
+               if (MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_RX_CQE_COMPRESS))
+                       netdev_warn(priv->netdev, "Disabling RX cqe compression\n");
                err = mlx5e_modify_rx_cqe_compression_locked(priv, false);
                if (err) {
                        netdev_err(priv->netdev, "Failed disabling cqe compression err=%d\n", err);
@@ -4768,7 +4772,7 @@ void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,
        mlx5e_set_tx_cq_mode_params(params, MLX5_CQ_PERIOD_MODE_START_FROM_EQE);
 
        /* TX inline */
-       params->tx_min_inline_mode = mlx5e_params_calculate_tx_min_inline(mdev);
+       mlx5_query_min_inline(mdev, &params->tx_min_inline_mode);
 
        /* RSS */
        mlx5e_build_rss_params(rss_params, params->num_channels);