net/mlx5e: Clean static checker complaints on TC offload and VF reps code
Clean warning/check complaints made by checkpatch on en_{tc,rep}.c Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
Родитель
4601266095
Коммит
b3a433de7b
|
@ -681,8 +681,8 @@ static int mlx5e_rep_open(struct net_device *dev)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
|
|
||||||
if (!mlx5_modify_vport_admin_state(priv->mdev,
|
if (!mlx5_modify_vport_admin_state(priv->mdev,
|
||||||
MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT,
|
MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT,
|
||||||
rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_UP))
|
rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_UP))
|
||||||
netif_carrier_on(dev);
|
netif_carrier_on(dev);
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
|
@ -699,8 +699,8 @@ static int mlx5e_rep_close(struct net_device *dev)
|
||||||
|
|
||||||
mutex_lock(&priv->state_lock);
|
mutex_lock(&priv->state_lock);
|
||||||
mlx5_modify_vport_admin_state(priv->mdev,
|
mlx5_modify_vport_admin_state(priv->mdev,
|
||||||
MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT,
|
MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT,
|
||||||
rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_DOWN);
|
rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_DOWN);
|
||||||
ret = mlx5e_close_locked(dev);
|
ret = mlx5e_close_locked(dev);
|
||||||
mutex_unlock(&priv->state_lock);
|
mutex_unlock(&priv->state_lock);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -97,7 +97,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MLX5E_TC_TABLE_NUM_GROUPS 4
|
#define MLX5E_TC_TABLE_NUM_GROUPS 4
|
||||||
#define MLX5E_TC_TABLE_MAX_GROUP_SIZE (1 << 16)
|
#define MLX5E_TC_TABLE_MAX_GROUP_SIZE BIT(16)
|
||||||
|
|
||||||
struct mlx5e_hairpin {
|
struct mlx5e_hairpin {
|
||||||
struct mlx5_hairpin *pair;
|
struct mlx5_hairpin *pair;
|
||||||
|
@ -789,7 +789,7 @@ static void mlx5e_tc_del_nic_flow(struct mlx5e_priv *priv,
|
||||||
mlx5_del_flow_rules(flow->rule);
|
mlx5_del_flow_rules(flow->rule);
|
||||||
mlx5_fc_destroy(priv->mdev, counter);
|
mlx5_fc_destroy(priv->mdev, counter);
|
||||||
|
|
||||||
if (!mlx5e_tc_num_filters(priv) && (priv->fs.tc.t)) {
|
if (!mlx5e_tc_num_filters(priv) && priv->fs.tc.t) {
|
||||||
mlx5_destroy_flow_table(priv->fs.tc.t);
|
mlx5_destroy_flow_table(priv->fs.tc.t);
|
||||||
priv->fs.tc.t = NULL;
|
priv->fs.tc.t = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1765,12 +1765,12 @@ static int parse_tc_pedit_action(struct mlx5e_priv *priv,
|
||||||
err = -EOPNOTSUPP; /* can't be all optimistic */
|
err = -EOPNOTSUPP; /* can't be all optimistic */
|
||||||
|
|
||||||
if (htype == TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK) {
|
if (htype == TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK) {
|
||||||
printk(KERN_WARNING "mlx5: legacy pedit isn't offloaded\n");
|
netdev_warn(priv->netdev, "legacy pedit isn't offloaded\n");
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd != TCA_PEDIT_KEY_EX_CMD_SET && cmd != TCA_PEDIT_KEY_EX_CMD_ADD) {
|
if (cmd != TCA_PEDIT_KEY_EX_CMD_SET && cmd != TCA_PEDIT_KEY_EX_CMD_ADD) {
|
||||||
printk(KERN_WARNING "mlx5: pedit cmd %d isn't offloaded\n", cmd);
|
netdev_warn(priv->netdev, "pedit cmd %d isn't offloaded\n", cmd);
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1794,8 +1794,7 @@ static int parse_tc_pedit_action(struct mlx5e_priv *priv,
|
||||||
for (cmd = 0; cmd < __PEDIT_CMD_MAX; cmd++) {
|
for (cmd = 0; cmd < __PEDIT_CMD_MAX; cmd++) {
|
||||||
cmd_masks = &masks[cmd];
|
cmd_masks = &masks[cmd];
|
||||||
if (memcmp(cmd_masks, &zero_masks, sizeof(zero_masks))) {
|
if (memcmp(cmd_masks, &zero_masks, sizeof(zero_masks))) {
|
||||||
printk(KERN_WARNING "mlx5: attempt to offload an unsupported field (cmd %d)\n",
|
netdev_warn(priv->netdev, "attempt to offload an unsupported field (cmd %d)\n", cmd);
|
||||||
cmd);
|
|
||||||
print_hex_dump(KERN_WARNING, "mask: ", DUMP_PREFIX_ADDRESS,
|
print_hex_dump(KERN_WARNING, "mask: ", DUMP_PREFIX_ADDRESS,
|
||||||
16, 1, cmd_masks, sizeof(zero_masks), true);
|
16, 1, cmd_masks, sizeof(zero_masks), true);
|
||||||
err = -EOPNOTSUPP;
|
err = -EOPNOTSUPP;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче