Patch "net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch" has been added to the 4.10-stable tree
This is a note to let you know that I've just added the patch titled
net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch
to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-mlx5e-change-the-tc-offload-rule-add-del-code-path-to-be-per-nic-or-e-switch.patch
and it can be found in the queue-4.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Mar 27 18:18:08 CEST 2017
From: Or Gerlitz <[email protected]>
Date: Tue, 21 Mar 2017 15:59:13 +0200
Subject: net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch
From: Or Gerlitz <[email protected]>
[ Upstream commit d85cdccbb3fe9a632ec9d0f4e4526c8c84fc3523 ]
Refactor the code to deal with add/del TC rules to have handler per NIC/E-switch offloading use case, and push the latter into the e-switch code. This provides better separation and is to be used in down-stream patch for applying a fix.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 57 ++++++++----- drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 5 + drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 14 +++ 3 files changed, 58 insertions(+), 18 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +39 -18
@@ -128,6 +128,23 @@ err_create_ft:return rule; } +static void mlx5e_tc_del_nic_flow (struct mlx5e_priv *priv, +struct mlx5e_tc_flow *flow) +{ +struct mlx5_fc *counter =NULL ; + +if (!IS_ERR (flow->rule)) { + counter =mlx5_flow_rule_counter (flow->rule); +mlx5_del_flow_rules (flow->rule); +mlx5_fc_destroy (priv->mdev, counter); + } + +if (!mlx5e_tc_num_filters (priv) && (priv->fs.tc.t)) { +mlx5_destroy_flow_table (priv->fs.tc.t); + priv->fs.tc.t =NULL ; + } +} +static struct mlx5_flow_handle * mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv, struct mlx5_flow_spec *spec,
@@ -144,7 +161,24 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv }static void mlx5e_detach_encap (struct mlx5e_priv *priv, -struct mlx5e_tc_flow *flow) { +struct mlx5e_tc_flow *flow); + +static void mlx5e_tc_del_fdb_flow (struct mlx5e_priv *priv, +struct mlx5e_tc_flow *flow) +{ +struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; + +mlx5_eswitch_del_offloaded_rule (esw, flow->rule, flow->attr); + +mlx5_eswitch_del_vlan_action (esw, flow->attr); + +if (flow->attr->action &MLX5_FLOW_CONTEXT_ACTION_ENCAP ) +mlx5e_detach_encap (priv, flow); +} + +static void mlx5e_detach_encap (struct mlx5e_priv *priv, +struct mlx5e_tc_flow *flow) +{struct list_head *next = flow->encap.next;list_del (&flow->encap);
@@ -169,24 +203,11 @@ static void mlx5e_tc_del_flow(struct mlx struct mlx5e_tc_flow *flow) {struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; -struct mlx5_fc *counter =NULL ; -if (!IS_ERR (flow->rule)) { - counter =mlx5_flow_rule_counter (flow->rule); -mlx5_del_flow_rules (flow->rule); -mlx5_fc_destroy (priv->mdev, counter); - } - -if (esw && esw->mode ==SRIOV_OFFLOADS ) { -mlx5_eswitch_del_vlan_action (esw, flow->attr); -if (flow->attr->action &MLX5_FLOW_CONTEXT_ACTION_ENCAP ) -mlx5e_detach_encap (priv, flow); - } - -if (!mlx5e_tc_num_filters (priv) && (priv->fs.tc.t)) { -mlx5_destroy_flow_table (priv->fs.tc.t); - priv->fs.tc.t =NULL ; - } +if (esw && esw->mode ==SRIOV_OFFLOADS ) +mlx5e_tc_del_fdb_flow (priv, flow); +else +mlx5e_tc_del_nic_flow (priv, flow); } static void parse_vxlan_attr(struct mlx5_flow_spec *spec,
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +5 -0
@@ -263,6 +263,11 @@ struct mlx5_flow_handle * mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, struct mlx5_flow_spec *spec, struct mlx5_esw_flow_attr *attr); +void +mlx5_eswitch_del_offloaded_rule (struct mlx5_eswitch *esw, +struct mlx5_flow_handle *rule, +struct mlx5_esw_flow_attr *attr); +struct mlx5_flow_handle *mlx5_eswitch_create_vport_rx_rule (struct mlx5_eswitch *esw,int vport,u32 tirn);
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +14 -0
@@ -97,6 +97,20 @@ mlx5_eswitch_add_offloaded_rule(struct mreturn rule; } +void +mlx5_eswitch_del_offloaded_rule (struct mlx5_eswitch *esw, +struct mlx5_flow_handle *rule, +struct mlx5_esw_flow_attr *attr) +{ +struct mlx5_fc *counter =NULL ; + +if (!IS_ERR (rule)) { + counter =mlx5_flow_rule_counter (rule); +mlx5_del_flow_rules (rule); +mlx5_fc_destroy (esw->dev, counter); + } +} +static int esw_set_global_vlan_pop (struct mlx5_eswitch *esw,u8 val) {struct mlx5_eswitch_rep *rep;
Patches currently in stable-queue which might be from [email protected] are
queue-4.10/net-mlx5e-change-the-tc-offload-rule-add-del-code-path-to-be-per-nic-or-e-switch.patch queue-4.10/net-mlx5-add-missing-entries-for-set-query-rate-limit-commands.patch queue-4.10/net-mlx5e-avoid-supporting-udp-tunnel-port-ndo-for-vf-reps.patch queue-4.10/net-mlx5e-use-the-proper-uapi-values-when-offloading-tc-vlan-actions.patch queue-4.10/net-mlx5-e-switch-don-t-allow-changing-inline-mode-when-flows-are-configured.patch queue-4.10/net-openvswitch-set-the-ipv6-source-tunnel-key-address-attribute-correctly.patch