mlx5: Make mlx5_del_flow_rule() NULL safe.
This change factors out repeated NULL checks. No functional change intended. MFC after: 1 week Sponsored by: NVIDIA Networking
This commit is contained in:
parent
3bb3e4768f
commit
b0b87d9151
@ -158,7 +158,7 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft,
|
||||
u32 action,
|
||||
u32 flow_tag,
|
||||
struct mlx5_flow_destination *dest);
|
||||
void mlx5_del_flow_rule(struct mlx5_flow_rule *fr);
|
||||
void mlx5_del_flow_rule(struct mlx5_flow_rule **);
|
||||
|
||||
/*The following API is for sniffer*/
|
||||
typedef int (*rule_event_fn)(struct mlx5_flow_rule *rule,
|
||||
|
@ -398,9 +398,7 @@ static int esw_del_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
|
||||
|
||||
mlx5_mpfs_del_mac(esw->dev, esw_uc->table_index);
|
||||
|
||||
if (vaddr->flow_rule)
|
||||
mlx5_del_flow_rule(vaddr->flow_rule);
|
||||
vaddr->flow_rule = NULL;
|
||||
mlx5_del_flow_rule(&vaddr->flow_rule);
|
||||
|
||||
l2addr_hash_del(esw_uc);
|
||||
return 0;
|
||||
@ -459,15 +457,12 @@ static int esw_del_mc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
|
||||
vport, mac, vaddr->flow_rule, esw_mc->refcnt,
|
||||
esw_mc->uplink_rule);
|
||||
|
||||
if (vaddr->flow_rule)
|
||||
mlx5_del_flow_rule(vaddr->flow_rule);
|
||||
vaddr->flow_rule = NULL;
|
||||
mlx5_del_flow_rule(&vaddr->flow_rule);
|
||||
|
||||
if (--esw_mc->refcnt)
|
||||
return 0;
|
||||
|
||||
if (esw_mc->uplink_rule)
|
||||
mlx5_del_flow_rule(esw_mc->uplink_rule);
|
||||
mlx5_del_flow_rule(&esw_mc->uplink_rule);
|
||||
|
||||
l2addr_hash_del(esw_mc);
|
||||
return 0;
|
||||
@ -684,14 +679,8 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw,
|
||||
static void esw_vport_cleanup_egress_rules(struct mlx5_eswitch *esw,
|
||||
struct mlx5_vport *vport)
|
||||
{
|
||||
if (!IS_ERR_OR_NULL(vport->egress.allowed_vlan))
|
||||
mlx5_del_flow_rule(vport->egress.allowed_vlan);
|
||||
|
||||
if (!IS_ERR_OR_NULL(vport->egress.drop_rule))
|
||||
mlx5_del_flow_rule(vport->egress.drop_rule);
|
||||
|
||||
vport->egress.allowed_vlan = NULL;
|
||||
vport->egress.drop_rule = NULL;
|
||||
mlx5_del_flow_rule(&vport->egress.allowed_vlan);
|
||||
mlx5_del_flow_rule(&vport->egress.drop_rule);
|
||||
}
|
||||
|
||||
static void esw_vport_disable_egress_acl(struct mlx5_eswitch *esw,
|
||||
@ -775,9 +764,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw,
|
||||
static void esw_vport_cleanup_ingress_rules(struct mlx5_eswitch *esw,
|
||||
struct mlx5_vport *vport)
|
||||
{
|
||||
if (!IS_ERR_OR_NULL(vport->ingress.drop_rule))
|
||||
mlx5_del_flow_rule(vport->ingress.drop_rule);
|
||||
vport->ingress.drop_rule = NULL;
|
||||
mlx5_del_flow_rule(&vport->ingress.drop_rule);
|
||||
}
|
||||
|
||||
static void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw,
|
||||
|
@ -83,7 +83,7 @@ accel_fs_tcp_set_ipv6_flow(struct mlx5_flow_spec *spec, struct inpcb *inp)
|
||||
void
|
||||
mlx5e_accel_fs_del_inpcb(struct mlx5_flow_rule *rule)
|
||||
{
|
||||
mlx5_del_flow_rule(rule);
|
||||
mlx5_del_flow_rule(&rule);
|
||||
}
|
||||
|
||||
struct mlx5_flow_rule *
|
||||
@ -341,7 +341,7 @@ accel_fs_tcp_destroy_table(struct mlx5e_priv *priv, int i)
|
||||
fs_tcp = &priv->fts.accel_tcp;
|
||||
ft = fs_tcp->tables + i;
|
||||
|
||||
mlx5_del_flow_rule(fs_tcp->default_rules[i]);
|
||||
mlx5_del_flow_rule(&fs_tcp->default_rules[i]);
|
||||
|
||||
accel_fs_tcp_destroy_groups(ft);
|
||||
kfree(ft->g);
|
||||
@ -394,7 +394,7 @@ mlx5e_accel_fs_tcp_create(struct mlx5e_priv *priv)
|
||||
|
||||
err_destroy_rules:
|
||||
while (i--)
|
||||
mlx5_del_flow_rule(priv->fts.accel_tcp.default_rules[i]);
|
||||
mlx5_del_flow_rule(&priv->fts.accel_tcp.default_rules[i]);
|
||||
i = MLX5E_ACCEL_FS_TCP_NUM_TYPES;
|
||||
|
||||
err_destroy_tables:
|
||||
|
@ -1876,10 +1876,16 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft,
|
||||
}
|
||||
EXPORT_SYMBOL(mlx5_add_flow_rule);
|
||||
|
||||
void mlx5_del_flow_rule(struct mlx5_flow_rule *dst)
|
||||
void mlx5_del_flow_rule(struct mlx5_flow_rule **pp)
|
||||
{
|
||||
struct mlx5_flow_namespace *ns;
|
||||
struct mlx5_flow_rule *dst;
|
||||
|
||||
dst = *pp;
|
||||
*pp = NULL;
|
||||
|
||||
if (IS_ERR_OR_NULL(dst))
|
||||
return;
|
||||
ns = get_ns_with_notifiers(&dst->base);
|
||||
if (ns)
|
||||
down_read(&ns->dests_rw_sem);
|
||||
|
@ -959,7 +959,6 @@ struct mlx5_flow_rule;
|
||||
|
||||
struct mlx5e_eth_addr_info {
|
||||
u8 addr [ETH_ALEN + 2];
|
||||
u32 tt_vec;
|
||||
/* flow table rule per traffic type */
|
||||
struct mlx5_flow_rule *ft_rule[MLX5E_NUM_TT];
|
||||
};
|
||||
|
@ -145,41 +145,17 @@ static void
|
||||
mlx5e_del_eth_addr_from_flow_table(struct mlx5e_priv *priv,
|
||||
struct mlx5e_eth_addr_info *ai)
|
||||
{
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV6_IPSEC_ESP))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_IPSEC_ESP]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV4_IPSEC_ESP))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_IPSEC_ESP]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV6_IPSEC_AH))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_IPSEC_AH]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV4_IPSEC_AH))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_IPSEC_AH]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV6_TCP))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_TCP]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV4_TCP))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_TCP]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV6_UDP))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_UDP]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV4_UDP))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_UDP]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV6))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_IPV4))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4]);
|
||||
|
||||
if (ai->tt_vec & (1 << MLX5E_TT_ANY))
|
||||
mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_ANY]);
|
||||
|
||||
/* ensure the rules are not freed again */
|
||||
ai->tt_vec = 0;
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_IPSEC_ESP]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_IPSEC_ESP]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_IPSEC_AH]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_IPSEC_AH]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_TCP]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_TCP]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_UDP]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_UDP]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4]);
|
||||
mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_ANY]);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -319,7 +295,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_ANY);
|
||||
}
|
||||
|
||||
mc_enable = MLX5_MATCH_OUTER_HEADERS;
|
||||
@ -335,7 +310,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV4);
|
||||
}
|
||||
|
||||
if (tt_vec & BIT(MLX5E_TT_IPV6)) {
|
||||
@ -348,7 +322,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV6);
|
||||
}
|
||||
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, outer_headers.ip_protocol);
|
||||
@ -364,7 +337,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV4_UDP);
|
||||
}
|
||||
|
||||
if (tt_vec & BIT(MLX5E_TT_IPV6_UDP)) {
|
||||
@ -377,7 +349,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV6_UDP);
|
||||
}
|
||||
|
||||
MLX5_SET(fte_match_param, mv, outer_headers.ip_protocol, IPPROTO_TCP);
|
||||
@ -392,7 +363,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV4_TCP);
|
||||
}
|
||||
|
||||
if (tt_vec & BIT(MLX5E_TT_IPV6_TCP)) {
|
||||
@ -405,8 +375,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV6_TCP);
|
||||
}
|
||||
|
||||
MLX5_SET(fte_match_param, mv, outer_headers.ip_protocol, IPPROTO_AH);
|
||||
@ -421,7 +389,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV4_IPSEC_AH);
|
||||
}
|
||||
|
||||
if (tt_vec & BIT(MLX5E_TT_IPV6_IPSEC_AH)) {
|
||||
@ -434,7 +401,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV6_IPSEC_AH);
|
||||
}
|
||||
|
||||
MLX5_SET(fte_match_param, mv, outer_headers.ip_protocol, IPPROTO_ESP);
|
||||
@ -449,7 +415,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV4_IPSEC_ESP);
|
||||
}
|
||||
|
||||
if (tt_vec & BIT(MLX5E_TT_IPV6_IPSEC_ESP)) {
|
||||
@ -462,7 +427,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv,
|
||||
MLX5_FS_ETH_FLOW_TAG, &dest);
|
||||
if (IS_ERR_OR_NULL(*rule_p))
|
||||
goto err_del_ai;
|
||||
ai->tt_vec |= BIT(MLX5E_TT_IPV6_IPSEC_ESP);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -503,73 +467,17 @@ mlx5e_add_eth_addr_rule(struct mlx5e_priv *priv,
|
||||
static void
|
||||
mlx5e_del_main_vxlan_rules(struct mlx5e_priv *priv)
|
||||
{
|
||||
struct mlx5_flow_rule **ra = priv->fts.main_vxlan_rule, **r;
|
||||
|
||||
r = &ra[MLX5E_TT_IPV6_IPSEC_ESP];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV4_IPSEC_ESP];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV6_IPSEC_AH];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV4_IPSEC_AH];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV6_TCP];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV4_TCP];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV6_UDP];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV4_UDP];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV6];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_IPV4];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
|
||||
r = &ra[MLX5E_TT_ANY];
|
||||
if (*r != NULL) {
|
||||
mlx5_del_flow_rule(*r);
|
||||
*r = NULL;
|
||||
}
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_IPSEC_ESP]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_IPSEC_ESP]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_IPSEC_AH]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_IPSEC_AH]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_TCP]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_TCP]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_UDP]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_UDP]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4]);
|
||||
mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_ANY]);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -857,28 +765,16 @@ mlx5e_del_vlan_rule(struct mlx5e_priv *priv,
|
||||
{
|
||||
switch (rule_type) {
|
||||
case MLX5E_VLAN_RULE_TYPE_UNTAGGED:
|
||||
if (priv->vlan.untagged_ft_rule) {
|
||||
mlx5_del_flow_rule(priv->vlan.untagged_ft_rule);
|
||||
priv->vlan.untagged_ft_rule = NULL;
|
||||
}
|
||||
mlx5_del_flow_rule(&priv->vlan.untagged_ft_rule);
|
||||
break;
|
||||
case MLX5E_VLAN_RULE_TYPE_ANY_CTAG_VID:
|
||||
if (priv->vlan.any_cvlan_ft_rule) {
|
||||
mlx5_del_flow_rule(priv->vlan.any_cvlan_ft_rule);
|
||||
priv->vlan.any_cvlan_ft_rule = NULL;
|
||||
}
|
||||
mlx5_del_flow_rule(&priv->vlan.any_cvlan_ft_rule);
|
||||
break;
|
||||
case MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID:
|
||||
if (priv->vlan.any_svlan_ft_rule) {
|
||||
mlx5_del_flow_rule(priv->vlan.any_svlan_ft_rule);
|
||||
priv->vlan.any_svlan_ft_rule = NULL;
|
||||
}
|
||||
mlx5_del_flow_rule(&priv->vlan.any_svlan_ft_rule);
|
||||
break;
|
||||
case MLX5E_VLAN_RULE_TYPE_MATCH_VID:
|
||||
if (priv->vlan.active_vlans_ft_rule[vid]) {
|
||||
mlx5_del_flow_rule(priv->vlan.active_vlans_ft_rule[vid]);
|
||||
priv->vlan.active_vlans_ft_rule[vid] = NULL;
|
||||
}
|
||||
mlx5_del_flow_rule(&priv->vlan.active_vlans_ft_rule[vid]);
|
||||
mlx5e_vport_context_update_vlans(priv);
|
||||
break;
|
||||
default:
|
||||
@ -1997,7 +1893,7 @@ mlx5e_del_vxlan_rule(struct mlx5e_priv *priv, sa_family_t family, u_int port)
|
||||
}
|
||||
|
||||
if (el->installed)
|
||||
mlx5_del_flow_rule(el->vxlan_ft_rule);
|
||||
mlx5_del_flow_rule(&el->vxlan_ft_rule);
|
||||
TAILQ_REMOVE(&priv->vxlan.head, el, link);
|
||||
kvfree(el);
|
||||
return (0);
|
||||
@ -2011,7 +1907,7 @@ mlx5e_del_all_vxlan_rules(struct mlx5e_priv *priv)
|
||||
TAILQ_FOREACH(el, &priv->vxlan.head, link) {
|
||||
if (!el->installed)
|
||||
continue;
|
||||
mlx5_del_flow_rule(el->vxlan_ft_rule);
|
||||
mlx5_del_flow_rule(&el->vxlan_ft_rule);
|
||||
el->installed = false;
|
||||
}
|
||||
}
|
||||
@ -2019,7 +1915,7 @@ mlx5e_del_all_vxlan_rules(struct mlx5e_priv *priv)
|
||||
static void
|
||||
mlx5e_del_vxlan_catchall_rule(struct mlx5e_priv *priv)
|
||||
{
|
||||
mlx5_del_flow_rule(priv->fts.vxlan_catchall_ft_rule);
|
||||
mlx5_del_flow_rule(&priv->fts.vxlan_catchall_ft_rule);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2074,13 +2074,13 @@ static int mlx5_ib_destroy_flow(struct ib_flow *flow_id)
|
||||
mutex_lock(&dev->flow_db.lock);
|
||||
|
||||
list_for_each_entry_safe(iter, tmp, &handler->list, list) {
|
||||
mlx5_del_flow_rule(iter->rule);
|
||||
mlx5_del_flow_rule(&iter->rule);
|
||||
put_flow_table(dev, iter->prio, true);
|
||||
list_del(&iter->list);
|
||||
kfree(iter);
|
||||
}
|
||||
|
||||
mlx5_del_flow_rule(handler->rule);
|
||||
mlx5_del_flow_rule(&handler->rule);
|
||||
put_flow_table(dev, handler->prio, true);
|
||||
mutex_unlock(&dev->flow_db.lock);
|
||||
|
||||
@ -2245,7 +2245,7 @@ static struct mlx5_ib_flow_handler *create_dont_trap_rule(struct mlx5_ib_dev *de
|
||||
handler_dst = create_flow_rule(dev, ft_prio,
|
||||
flow_attr, dst);
|
||||
if (IS_ERR(handler_dst)) {
|
||||
mlx5_del_flow_rule(handler->rule);
|
||||
mlx5_del_flow_rule(&handler->rule);
|
||||
ft_prio->refcount--;
|
||||
kfree(handler);
|
||||
handler = handler_dst;
|
||||
@ -2308,7 +2308,7 @@ static struct mlx5_ib_flow_handler *create_leftovers_rule(struct mlx5_ib_dev *de
|
||||
&leftovers_specs[LEFTOVERS_UC].flow_attr,
|
||||
dst);
|
||||
if (IS_ERR(handler_ucast)) {
|
||||
mlx5_del_flow_rule(handler->rule);
|
||||
mlx5_del_flow_rule(&handler->rule);
|
||||
ft_prio->refcount--;
|
||||
kfree(handler);
|
||||
handler = handler_ucast;
|
||||
@ -2351,7 +2351,7 @@ static struct mlx5_ib_flow_handler *create_sniffer_rule(struct mlx5_ib_dev *dev,
|
||||
return handler_rx;
|
||||
|
||||
err_tx:
|
||||
mlx5_del_flow_rule(handler_rx->rule);
|
||||
mlx5_del_flow_rule(&handler_rx->rule);
|
||||
ft_rx->refcount--;
|
||||
kfree(handler_rx);
|
||||
err:
|
||||
|
Loading…
Reference in New Issue
Block a user