mlx5 updates 2021-08-19
Subsystems (6)
From: Saeed Mahameed <[email protected]>
Hi Dave & Jakub,
This series provides mlx5 support for:
1) TC flow sampling offload for tunneled traffic.
2) devlink QoS rate object groups
For more information please see tag log below.
Please pull and let me know if there is any problem.
Thanks,
Saeed.
---
The following changes since commit f444fea7896dbc267249d27f604082a51b8efca2:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (2021-08-19 18:09:18 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2021-08-19
for you to fetch changes up to 3202ea65f85c5488926e01aa51d73d53dfe17e6e:
net/mlx5: E-switch, Add QoS tracepoints (2021-08-19 21:50:41 -0700)
----------------------------------------------------------------
mlx5-updates-2021-08-19
This series introduces the support for two new mlx5 features:
1) Sample offload for tunneled traffic
2) devlink rate objects support
1) From Chris Mi: Sample offload for tunneled traffic
=====================================================
Background and solution
-----------------------
Currently the sample offload actions send the encapsulated packet to software. This series de-capsulates the packet before performing the sampling and set the tunnel properties on the skb metadata fields to make the behavior consistent with OVS sFlow.
If de-capsulating first, we can't use the same match like before in default table. So instantiate a post action instance to continue processing the action list. If HW can preserve reg_c, also use the post action instance.
Post action infrastructure
--------------------------
Some tc actions are modeled in hardware using multiple tables causing a tc action list split. For example, CT action is modeled by jumping to a ct table which is controlled by nf flow table. sFlow jumps in hardware to a sample table, which continues to a "default table" where it should continue processing the action list.
Multi table actions are modeled in hardware using a unique fte_id. The fte_id is set before jumping to a table. Split actions continue to a post-action table where the matched fte_id value continues the execution the tc action list.
This series also introduces post action infrastructure. Both ct and sample use it.
Sample for tunnel in TC SW
--------------------------
tc filter add dev vxlan1 protocol ip parent ffff: prio 3 \
flower src_mac 24:25:d0:e1:00:00 dst_mac 02:25:d0:13:01:02 \ enc_src_ip 192.168.1.14 enc_dst_ip 192.168.1.13 \ enc_dst_port 4789 enc_key_id 4 \ action sample rate 1 group 6 \ action tunnel_key unset \ action mirred egress redirect dev enp4s0f0_1
MLX5 sample HW offload
----------------------
For the following typical flow table:
+-------------------------------+ + original flow table + +-------------------------------+ + original match + +-------------------------------+
+ sample action + other actions +
+-------------------------------+
We translate the tc filter with sample action to the following HW model:
+---------------------+
+ original flow table +
+---------------------+
+ original match +
+---------------------+
| set fte_id (if reg_c preserve cap) | do decap
v
+------------------------------------------------+
+ Flow Sampler Object +
+------------------------------------------------+
+ sample ratio +
+------------------------------------------------+
+ sample table id | default table id +
+------------------------------------------------+
| |
v v
+-----------------------------+ +-------------------+
+ sample table + + default table +
+-----------------------------+ +-------------------+
+ forward to management vport + |
+-----------------------------+ |
+-------+------+
| |reg_c preserve cap
| |or decap action
v v
+-----------------+ +-------------+
+ per vport table + + post action +
+-----------------+ +-------------+
+ original match +
+-----------------+
+ other actions +
+-----------------+2) From Dmytro Linkin: devlink rate object support for mlx5_core driver
=======================================================================
HIGH-LEVEL OVERVIEW
Devlink leaf rate objects created per vport (VF/SF, and PF on BlueField) in switchdev mode on devlink port registration.
Implement devlink ops callbacks to create/destroy rate groups, set TX rate values of the vport/group, assign vport to the group. Driver accepts TX rate values as fraction of 1Mbps.
Refactor existing eswitch QoS infrastructure to be accessible by legacy NDO rate API and new devlink rate API. NDO rate API is not removed/disabled in switchdev mode to not break existing users. Rate values configured with NDO rate API are not visible for devlink infrastructure, therefore APIs should not be used simultaneously.
IMPLEMENTATION DETAILS
Driver provide two level rate hierarchy to manage bandwidth - group level and vport level. Initially each vport added to internal unlimited group created by default. Each rate element (vport or group) receive bandwidth relative to its parent element (for groups the parent is a physical link itself) in a Round Robin manner, where element get bandwidth value according to its weight. Example:
Created four rate groups with tx_share limits:
$ devlink port function rate add \
pci/0000:06:00.0/group_1 tx_share 30gbit
$ devlink port function rate add \
pci/0000:06:00.0/group_2 tx_share 20gbit
$ devlink port function rate add \
pci/0000:06:00.0/group_3 tx_share 20gbit
$ devlink port function rate add \
pci/0000:06:00.0/group_4 tx_share 10gbitWeights created in HW for each group are relative to the bigest tx_share value, which is 30gbit:
<group_1> 1.0
<group_2> 0.67
<group_3> 0.67
<group_4> 0.33
Assuming link speed is 50 Gbit/sec and each group can sustain such amount of traffic, maximum bandwidth is 50 / (1.0 + 0.67 + 0.67 + 0.33)
= ~18.75 Gbit/sec. Normilized bandwidth values for groups:
<group_1> 18.75 * 1.0 = 18.75 Gbit/sec
<group_2> 18.75 * 0.67 = 12.5 Gbit/sec
<group_3> 18.75 * 0.67 = 12.5 Gbit/sec
<group_4> 18.75 * 0.33 = 6.25 Gbit/sec
If in example above group_1 doesn't produce any traffic, then maximum bandwidth becomes 50 / (0.67 + 0.67 + 0.33) = ~30.0 Gbit/sec. Normalized values:
<group_2> 30.0 * 0.67 = 20.0 Gbit/sec
<group_3> 30.0 * 0.67 = 20.0 Gbit/sec
<group_4> 30.0 * 0.33 = 10.0 Gbit/sec
Same normalization applied to each vport in the group.
Normalized values are internal, therefore driver provides QoS tracepoints for next events:
* vport rate element creation/deletion:
* vport rate element configuration;
* group rate element creation/deletion;
* group rate element configuration.
PATCHES OVERVIEW
1 - Moving and isolation of eswitch QoS logic in separate file;
2 - Implement devlink leaf rate object support for vports;
3 - Implement rate groups creation/deletion;
4 - Implement TX rate management for the groups;
5 - Implement parent set for vports;
6 - Eswitch QoS tracepoints.
----------------------------------------------------------------
Chris Mi (8):
net/mlx5e: Move esw/sample to en/tc/sample
net/mlx5e: Move sample attribute to flow attribute
net/mlx5e: CT, Use xarray to manage fte ids
net/mlx5e: Introduce post action infrastructure
net/mlx5e: Refactor ct to use post action infrastructure net/mlx5e: TC, Remove CONFIG_NET_TC_SKB_EXT dependency when restoring tunnel net/mlx5e: TC, Restore tunnel info for sample offload net/mlx5e: TC, Support sample offload action for tunneled traffic
Dmytro Linkin (6):
net/mlx5: E-switch, Move QoS related code to dedicated file net/mlx5: E-switch, Enable devlink port tx_{share|max} rate control net/mlx5: E-switch, Introduce rate limiting groups API net/mlx5: E-switch, Allow setting share/max tx rate limits of rate groups net/mlx5: E-switch, Allow to add vports to rate groups net/mlx5: E-switch, Add QoS tracepoints
Saeed Mahameed (1):
net/mlx5e: Remove mlx5e dependency from E-Switch sample
.../device_drivers/ethernet/mellanox/mlx5.rst | 44 ++
drivers/net/ethernet/mellanox/mlx5/core/Makefile | 13 +-
drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 8 +
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 3 +
.../net/ethernet/mellanox/mlx5/core/en/rep/tc.c | 48 +-
.../ethernet/mellanox/mlx5/core/en/tc/post_act.c | 164 ++++
.../ethernet/mellanox/mlx5/core/en/tc/post_act.h | 35 +
.../mellanox/mlx5/core/{esw => en/tc}/sample.c | 474 +++++++----
.../net/ethernet/mellanox/mlx5/core/en/tc/sample.h | 41 +
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 154 +---
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h | 6 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rep.h | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 57 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.h | 1 +
.../ethernet/mellanox/mlx5/core/esw/devlink_port.c | 26 +
.../mellanox/mlx5/core/esw/diag/qos_tracepoint.h | 123 +++
.../net/ethernet/mellanox/mlx5/core/esw/legacy.c | 20 +
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 869 +++++++++++++++++++++
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h | 41 +
.../net/ethernet/mellanox/mlx5/core/esw/sample.h | 42 -
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 310 +-------
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 21 +-
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 11 +-
include/linux/mlx5/mlx5_ifc.h | 3 +-
24 files changed, 1815 insertions(+), 703 deletions(-)
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.h
rename drivers/net/ethernet/mellanox/mlx5/core/{esw => en/tc}/sample.c (53%)
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.h
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h
delete mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/sample.hPATCH 1/15 net/mlx5e: Remove mlx5e dependency from E-Switch sample
From: Saeed Mahameed <[email protected]>
mlx5/esw/sample.c doesn't really need mlx5e_priv object, we can remove this redundant dependency by passing the eswitch object directly to the sample object constructor.
--- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- .../ethernet/mellanox/mlx5/core/esw/sample.c | 25 +++++++++---------- .../ethernet/mellanox/mlx5/core/esw/sample.h | 4 +-- 3 files changed, 14 insertions(+), 17 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -1
@@ -4976,7 +4976,7 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht) MLX5_FLOW_NAMESPACE_FDB);#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) - uplink_priv->esw_psample =mlx5_esw_sample_init (netdev_priv (priv->netdev)); + uplink_priv->esw_psample =mlx5_esw_sample_init (esw);#endif mapping_id =mlx5_query_nic_system_image_guid (esw->dev);
drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c +12 -13
@@ -18,7 +18,7 @@ static const struct esw_vport_tbl_namespace mlx5_esw_vport_tbl_sample_ns = { };struct mlx5_esw_psample { -struct mlx5e_priv *priv; +struct mlx5_eswitch *esw;struct mlx5_flow_table *termtbl;struct mlx5_flow_handle *termtbl_rule; DECLARE_HASHTABLE(hashtbl, 8);
@@ -55,10 +55,10 @@ struct mlx5_sample_restore {static int sampler_termtbl_create (struct mlx5_esw_psample *esw_psample) { -struct mlx5_core_dev *dev = esw_psample->priv->mdev; -struct mlx5_eswitch *esw = dev->priv.eswitch; +struct mlx5_eswitch *esw = esw_psample->esw;struct mlx5_flow_table_attr ft_attr = {};struct mlx5_flow_destination dest = {}; +struct mlx5_core_dev *dev = esw->dev;struct mlx5_flow_namespace *root_ns;struct mlx5_flow_act act = {};int err;
@@ -187,7 +187,7 @@ sampler_get(struct mlx5_esw_psample *esw_psample, u32 sample_ratio, u32 default_ sampler->default_table_id = default_table_id; sampler->sample_ratio = sample_ratio; - err =sampler_obj_create (esw_psample->priv->mdev, sampler); + err =sampler_obj_create (esw_psample->esw->dev, sampler);if (err) goto err_create;
@@ -211,7 +211,7 @@ sampler_put(struct mlx5_esw_psample *esw_psample, struct mlx5_sampler *sampler)mutex_lock (&esw_psample->ht_lock);if (--sampler->count ==0 ) {hash_del (&sampler->hlist); -sampler_obj_destroy (esw_psample->priv->mdev, sampler->sampler_id); +sampler_obj_destroy (esw_psample->esw->dev, sampler->sampler_id);kfree (sampler); }mutex_unlock (&esw_psample->ht_lock);
@@ -249,8 +249,8 @@ sample_metadata_rule_get(struct mlx5_core_dev *mdev, u32 obj_id)static struct mlx5_sample_restore *sample_restore_get (struct mlx5_esw_psample *esw_psample,u32 obj_id) { -struct mlx5_core_dev *mdev = esw_psample->priv->mdev; -struct mlx5_eswitch *esw = mdev->priv.eswitch; +struct mlx5_eswitch *esw = esw_psample->esw; +struct mlx5_core_dev *mdev = esw->dev;struct mlx5_sample_restore *restore;struct mlx5_modify_hdr *modify_hdr;int err;
@@ -305,7 +305,7 @@ sample_restore_put(struct mlx5_esw_psample *esw_psample, struct mlx5_sample_restif (!restore->count) {mlx5_del_flow_rules (restore->rule); -mlx5_modify_header_dealloc (esw_psample->priv->mdev, restore->modify_hdr); +mlx5_modify_header_dealloc (esw_psample->esw->dev, restore->modify_hdr);kfree (restore); } }
@@ -384,7 +384,7 @@ mlx5_esw_sample_offload(struct mlx5_esw_psample *esw_psample,/* If slow path flag is set, eg. when the neigh is invalid for encap, * don't offload sample action. */ - esw = esw_psample->priv->mdev->priv.eswitch; + esw = esw_psample->esw;if (attr->flags &MLX5_ESW_ATTR_FLAG_SLOW_PATH )return mlx5_eswitch_add_offloaded_rule (esw, spec, attr);
@@ -522,7 +522,7 @@ mlx5_esw_sample_unoffload(struct mlx5_esw_psample *esw_psample,/* If slow path flag is set, sample action is not offloaded. * No need to delete sample rule. */ - esw = esw_psample->priv->mdev->priv.eswitch; + esw = esw_psample->esw;if (attr->flags &MLX5_ESW_ATTR_FLAG_SLOW_PATH ) {mlx5_eswitch_del_offloaded_rule (esw, rule, attr);return ;
@@ -531,7 +531,6 @@ mlx5_esw_sample_unoffload(struct mlx5_esw_psample *esw_psample, sample_flow = esw_attr->sample->sample_flow; pre_attr = sample_flow->pre_attr;memset (pre_attr,0 ,sizeof (*pre_attr)); - esw = esw_psample->priv->mdev->priv.eswitch;mlx5_eswitch_del_offloaded_rule (esw, sample_flow->pre_rule, pre_attr);mlx5_eswitch_del_offloaded_rule (esw, sample_flow->rule, attr);
@@ -550,7 +549,7 @@ mlx5_esw_sample_unoffload(struct mlx5_esw_psample *esw_psample, }struct mlx5_esw_psample * -mlx5_esw_sample_init (struct mlx5e_priv *priv) +mlx5_esw_sample_init (struct mlx5_eswitch *esw) {struct mlx5_esw_psample *esw_psample;int err;
@@ -558,7 +557,7 @@ mlx5_esw_sample_init(struct mlx5e_priv *priv) esw_psample =kzalloc (sizeof (*esw_psample),GFP_KERNEL );if (!esw_psample)return ERR_PTR (-ENOMEM ); - esw_psample->priv = priv; + esw_psample->esw = esw; err =sampler_termtbl_create (esw_psample);if (err) goto err_termtbl;
drivers/net/ethernet/mellanox/mlx5/core/esw/sample.h +1 -3
@@ -4,10 +4,8 @@#ifndef __MLX5_EN_TC_SAMPLE_H__#define __MLX5_EN_TC_SAMPLE_H__ -#include "en.h" #include "eswitch.h" -struct mlx5e_priv ;struct mlx5_flow_attr ;struct mlx5_esw_psample ;
@@ -34,7 +32,7 @@ mlx5_esw_sample_unoffload(struct mlx5_esw_psample *sample_priv, struct mlx5_flow_attr *attr);struct mlx5_esw_psample * -mlx5_esw_sample_init (struct mlx5e_priv *priv); +mlx5_esw_sample_init (struct mlx5_eswitch *esw);void mlx5_esw_sample_cleanup (struct mlx5_esw_psample *esw_psample);
Signature · 1 line
2.31.1
PATCH 2/15 net/mlx5e: Move esw/sample to en/tc/sample
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
Module sample belongs to en/tc instead of esw. Move it and rename accordingly.
---
.../net/ethernet/mellanox/mlx5/core/Makefile | 2 +-
.../ethernet/mellanox/mlx5/core/en/rep/tc.c | 4 +-
.../mlx5/core/{esw => en/tc}/sample.c | 160 +++++++++---------
.../mlx5/core/{esw => en/tc}/sample.h | 18 +-
.../net/ethernet/mellanox/mlx5/core/en_rep.h | 2 +-
.../net/ethernet/mellanox/mlx5/core/en_tc.c | 18 +-
.../net/ethernet/mellanox/mlx5/core/eswitch.h | 4 +-
7 files changed, 104 insertions(+), 104 deletions(-)
rename drivers/net/ethernet/mellanox/mlx5/core/{esw => en/tc}/sample.c (79%)
rename drivers/net/ethernet/mellanox/mlx5/core/{esw => en/tc}/sample.h (58%)drivers/net/ethernet/mellanox/mlx5/core/Makefile +1 -1
@@ -46,6 +46,7 @@ mlx5_core-$(CONFIG_MLX5_CLS_ACT) += en_tc.o en/rep/tc.o en/rep/neigh.o \ en/tc_tun_vxlan.o en/tc_tun_gre.o en/tc_tun_geneve.o \ en/tc_tun_mplsoudp.o diag/en_tc_tracepoint.o mlx5_core-$(CONFIG_MLX5_TC_CT) += en/tc_ct.o +mlx5_core-$(CONFIG_MLX5_TC_SAMPLE) += en/tc/sample.o # # Core extra
@@ -56,7 +57,6 @@ mlx5_core-$(CONFIG_MLX5_ESWITCH) += esw/acl/helper.o \ esw/acl/egress_lgcy.o esw/acl/egress_ofld.o \ esw/acl/ingress_lgcy.o esw/acl/ingress_ofld.o \ esw/devlink_port.o esw/vporttbl.o -mlx5_core-$(CONFIG_MLX5_TC_SAMPLE) += esw/sample.o mlx5_core-$(CONFIG_MLX5_BRIDGE) += esw/bridge.o en/rep/bridge.o mlx5_core-$(CONFIG_MLX5_MPFS) += lib/mpfs.o
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +2 -2
@@ -17,7 +17,7 @@#include "en/mapping.h" #include "en/tc_tun.h" #include "lib/port_tun.h" -#include "esw/sample.h" +#include "en/tc/sample.h" struct mlx5e_rep_indr_block_priv {struct net_device *netdev;
@@ -677,7 +677,7 @@ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe,#endif /* CONFIG_NET_TC_SKB_EXT */ #if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE )if (mapped_obj.type ==MLX5_MAPPED_OBJ_SAMPLE ) { -mlx5_esw_sample_skb (skb, &mapped_obj); +mlx5e_tc_sample_skb (skb, &mapped_obj);return false; }#endif /* CONFIG_MLX5_TC_SAMPLE */
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c renamed from drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c +80 -80
389 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.h renamed from drivers/net/ethernet/mellanox/mlx5/core/esw/sample.h +9 -9
@@ -7,34 +7,34 @@#include "eswitch.h" struct mlx5_flow_attr ; -struct mlx5_esw_psample ; +struct mlx5e_tc_psample ; -struct mlx5_sample_attr { +struct mlx5e_sample_attr {u32 group_num;u32 rate;u32 trunc_size;u32 restore_obj_id;u32 sampler_id;struct mlx5_flow_table *sample_default_tbl; -struct mlx5_sample_flow *sample_flow; +struct mlx5e_sample_flow *sample_flow; }; -void mlx5_esw_sample_skb (struct sk_buff *skb,struct mlx5_mapped_obj *mapped_obj); +void mlx5e_tc_sample_skb (struct sk_buff *skb,struct mlx5_mapped_obj *mapped_obj);struct mlx5_flow_handle * -mlx5_esw_sample_offload (struct mlx5_esw_psample *sample_priv, +mlx5e_tc_sample_offload (struct mlx5e_tc_psample *sample_priv,struct mlx5_flow_spec *spec,struct mlx5_flow_attr *attr);void -mlx5_esw_sample_unoffload (struct mlx5_esw_psample *sample_priv, +mlx5e_tc_sample_unoffload (struct mlx5e_tc_psample *sample_priv,struct mlx5_flow_handle *rule,struct mlx5_flow_attr *attr); -struct mlx5_esw_psample * -mlx5_esw_sample_init (struct mlx5_eswitch *esw); +struct mlx5e_tc_psample * +mlx5e_tc_sample_init (struct mlx5_eswitch *esw);void -mlx5_esw_sample_cleanup (struct mlx5_esw_psample *esw_psample); +mlx5e_tc_sample_cleanup (struct mlx5e_tc_psample *tc_psample);#endif /* __MLX5_EN_TC_SAMPLE_H__ */
drivers/net/ethernet/mellanox/mlx5/core/en_rep.h +1 -1
@@ -89,7 +89,7 @@ struct mlx5_rep_uplink_priv {struct mapping_ctx *tunnel_enc_opts_mapping;struct mlx5_tc_ct_priv *ct_priv; -struct mlx5_esw_psample *esw_psample; +struct mlx5e_tc_psample *tc_psample;/* support eswitch vports bonding */ struct mlx5e_rep_bond *bond;
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +9 -9
@@ -60,7 +60,7 @@#include "en/mod_hdr.h" #include "en/tc_priv.h" #include "en/tc_tun_encap.h" -#include "esw/sample.h" +#include "en/tc/sample.h" #include "lib/devcom.h" #include "lib/geneve.h" #include "lib/fs_chains.h"
@@ -246,7 +246,7 @@ get_ct_priv(struct mlx5e_priv *priv) }#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) -static struct mlx5_esw_psample * +static struct mlx5e_tc_psample *get_sample_priv (struct mlx5e_priv *priv) {struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
@@ -257,7 +257,7 @@ get_sample_priv(struct mlx5e_priv *priv) uplink_rpriv =mlx5_eswitch_get_uplink_priv (esw,REP_ETH ); uplink_priv = &uplink_rpriv->uplink_priv; -return uplink_priv->esw_psample; +return uplink_priv->tc_psample; }return NULL ;
@@ -1147,7 +1147,7 @@ mlx5e_tc_offload_fdb_rules(struct mlx5_eswitch *esw, mod_hdr_acts);#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) } else if (flow_flag_test(flow, SAMPLE)) { - rule =mlx5_esw_sample_offload (get_sample_priv (flow->priv), spec, attr); + rule =mlx5e_tc_sample_offload (get_sample_priv (flow->priv), spec, attr);#endif }else { rule =mlx5_eswitch_add_offloaded_rule (esw, spec, attr);
@@ -1186,7 +1186,7 @@ void mlx5e_tc_unoffload_fdb_rules(struct mlx5_eswitch *esw,#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE )if (flow_flag_test (flow,SAMPLE )) { -mlx5_esw_sample_unoffload (get_sample_priv (flow->priv), flow->rule[0 ], attr); +mlx5e_tc_sample_unoffload (get_sample_priv (flow->priv), flow->rule[0 ], attr);return ; }#endif
@@ -3722,7 +3722,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,bool ft_flow =mlx5e_is_ft_flow (flow);const struct flow_action_entry *act;struct mlx5_esw_flow_attr *esw_attr; -struct mlx5_sample_attr sample = {}; +struct mlx5e_sample_attr sample = {};bool encap = false, decap = false;u32 action = attr->action;int err, i, if_count =0 ;
@@ -4976,7 +4976,7 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht) MLX5_FLOW_NAMESPACE_FDB);#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) - uplink_priv->esw_psample =mlx5_esw_sample_init (esw); + uplink_priv->tc_psample =mlx5e_tc_sample_init (esw);#endif mapping_id =mlx5_query_nic_system_image_guid (esw->dev);
@@ -5022,7 +5022,7 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht)mapping_destroy (uplink_priv->tunnel_mapping); err_tun_mapping:#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) -mlx5_esw_sample_cleanup (uplink_priv->esw_psample); +mlx5e_tc_sample_cleanup (uplink_priv->tc_psample);#endif mlx5_tc_ct_clean (uplink_priv->ct_priv); netdev_warn(priv->netdev,
@@ -5043,7 +5043,7 @@ void mlx5e_tc_esw_cleanup(struct rhashtable *tc_ht)mapping_destroy (uplink_priv->tunnel_mapping);#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) -mlx5_esw_sample_cleanup (uplink_priv->esw_psample); +mlx5e_tc_sample_cleanup (uplink_priv->tc_psample);#endif mlx5_tc_ct_clean (uplink_priv->ct_priv); }
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 -2
@@ -46,7 +46,7 @@#include "lib/fs_chains.h" #include "sf/sf.h" #include "en/tc_ct.h" -#include "esw/sample.h" +#include "en/tc/sample.h" enum mlx5_mapped_obj_type {MLX5_MAPPED_OBJ_CHAIN ,
@@ -469,7 +469,7 @@ struct mlx5_esw_flow_attr { } dests[MLX5_MAX_FLOW_FWD_VPORTS ];struct mlx5_rx_tun_attr *rx_tun_attr;struct mlx5_pkt_reformat *decap_pkt_reformat; -struct mlx5_sample_attr *sample; +struct mlx5e_sample_attr *sample; }; int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
Signature · 1 line
2.31.1
PATCH 3/15 net/mlx5e: Move sample attribute to flow attribute
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
Currently it is in eswitch attribute. Move it to flow attribute to reflect the change in previous patch.
--- .../mellanox/mlx5/core/en/tc/sample.c | 27 ++++++++++--------- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 16 +++++------ .../net/ethernet/mellanox/mlx5/core/en_tc.h | 1 + .../net/ethernet/mellanox/mlx5/core/eswitch.h | 1 - .../mellanox/mlx5/core/eswitch_offloads.c | 12 ++++----- 5 files changed, 29 insertions(+), 28 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c +14 -13
@@ -391,7 +391,8 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, sample_flow =kzalloc (sizeof (*sample_flow),GFP_KERNEL );if (!sample_flow)return ERR_PTR (-ENOMEM ); - esw_attr->sample->sample_flow = sample_flow; + sample_attr = attr->sample_attr; + sample_attr->sample_flow = sample_flow;/* Allocate default table per vport, chain and prio. Otherwise, there is * only one default table for the same sampler object. Rules with different
@@ -411,7 +412,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,/* Perform the original matches on the default table. * Offload all actions except the sample action. */ - esw_attr->sample->sample_default_tbl = default_tbl; + sample_attr->sample_default_tbl = default_tbl;/* When offloading sample and encap action, if there is no valid * neigh data struct, a slow path rule is offloaded first. Source * port metadata match is set at that time. A per vport table is
@@ -426,7 +427,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, }/* Create sampler object. */ - sample_flow->sampler =sampler_get (tc_psample, esw_attr->sample->rate, default_tbl->id); + sample_flow->sampler =sampler_get (tc_psample, sample_attr->rate, default_tbl->id);if (IS_ERR (sample_flow->sampler)) { err =PTR_ERR (sample_flow->sampler); goto err_sampler;
@@ -434,13 +435,13 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,/* Create an id mapping reg_c0 value to sample object. */ restore_obj.type =MLX5_MAPPED_OBJ_SAMPLE ; - restore_obj.sample.group_id = esw_attr->sample->group_num; - restore_obj.sample.rate = esw_attr->sample->rate; - restore_obj.sample.trunc_size = esw_attr->sample->trunc_size; + restore_obj.sample.group_id = sample_attr->group_num; + restore_obj.sample.rate = sample_attr->rate; + restore_obj.sample.trunc_size = sample_attr->trunc_size; err =mapping_add (esw->offloads.reg_c0_obj_pool, &restore_obj, &obj_id);if (err) goto err_obj_id; - esw_attr->sample->restore_obj_id = obj_id; + sample_attr->restore_obj_id = obj_id;/* Create sample restore context. */ sample_flow->restore =sample_restore_get (tc_psample, obj_id);
@@ -462,14 +463,14 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, err = -ENOMEM ; goto err_alloc_sample_attr; } - pre_esw_attr = pre_attr->esw_attr; pre_attr->action =MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |MLX5_FLOW_CONTEXT_ACTION_MOD_HDR ; pre_attr->modify_hdr = sample_flow->restore->modify_hdr; pre_attr->flags =MLX5_ESW_ATTR_FLAG_SAMPLE ; pre_attr->chain = attr->chain; pre_attr->prio = attr->prio; - pre_esw_attr->sample = sample_attr; - pre_esw_attr->sample->sampler_id = sample_flow->sampler->sampler_id; + pre_attr->sample_attr = sample_attr; + sample_attr->sampler_id = sample_flow->sampler->sampler_id; + pre_esw_attr = pre_attr->esw_attr; pre_esw_attr->in_mdev = esw_attr->in_mdev; pre_esw_attr->in_rep = esw_attr->in_rep; sample_flow->pre_rule =mlx5_eswitch_add_offloaded_rule (esw, spec, pre_attr);
@@ -528,14 +529,14 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,return ; } - sample_flow = esw_attr->sample->sample_flow; + sample_flow = attr->sample_attr->sample_flow; pre_attr = sample_flow->pre_attr;memset (pre_attr,0 ,sizeof (*pre_attr));mlx5_eswitch_del_offloaded_rule (esw, sample_flow->pre_rule, pre_attr);mlx5_eswitch_del_offloaded_rule (esw, sample_flow->rule, attr);sample_restore_put (tc_psample, sample_flow->restore); -mapping_remove (esw->offloads.reg_c0_obj_pool, esw_attr->sample->restore_obj_id); +mapping_remove (esw->offloads.reg_c0_obj_pool, attr->sample_attr->restore_obj_id);sampler_put (tc_psample, sample_flow->sampler); tbl_attr.chain = attr->chain; tbl_attr.prio = attr->prio;
@@ -543,7 +544,7 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample, tbl_attr.vport_ns = &mlx5_esw_vport_tbl_sample_ns;mlx5_esw_vporttbl_put (esw, &tbl_attr); -kfree (pre_attr->esw_attr->sample); +kfree (pre_attr->sample_attr);kfree (pre_attr);kfree (sample_flow); }
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +8 -8
@@ -1550,6 +1550,7 @@ static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv,else mlx5e_detach_mod_hdr (priv, flow); } +kfree (attr->sample_attr);kvfree (attr->parse_attr);kvfree (attr->esw_attr->rx_tun_attr);
@@ -1559,7 +1560,6 @@ static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv,if (flow_flag_test (flow,L3_TO_L2_DECAP ))mlx5e_detach_decap (priv, flow); -kfree (flow->attr->esw_attr->sample);kfree (flow->attr); }
@@ -3716,13 +3716,13 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;struct mlx5e_tc_flow_parse_attr *parse_attr;struct mlx5e_rep_priv *rpriv = priv->ppriv; +struct mlx5e_sample_attr sample_attr = {};const struct ip_tunnel_info *info =NULL ;struct mlx5_flow_attr *attr = flow->attr;int ifindexes[MLX5_MAX_FLOW_FWD_VPORTS ];bool ft_flow =mlx5e_is_ft_flow (flow);const struct flow_action_entry *act;struct mlx5_esw_flow_attr *esw_attr; -struct mlx5e_sample_attr sample = {};bool encap = false, decap = false;u32 action = attr->action;int err, i, if_count =0 ;
@@ -3993,10 +3993,10 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,NL_SET_ERR_MSG_MOD (extack,"Sample action with connection tracking is not supported" );return -EOPNOTSUPP ; } - sample.rate = act->sample.rate; - sample.group_num = act->sample.psample_group->group_num; + sample_attr.rate = act->sample.rate; + sample_attr.group_num = act->sample.psample_group->group_num;if (act->sample.truncate) - sample.trunc_size = act->sample.trunc_size; + sample_attr.trunc_size = act->sample.trunc_size;flow_flag_set (flow,SAMPLE );break ;default :
@@ -4081,10 +4081,10 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,* no errors after parsing. */ if (flow_flag_test (flow,SAMPLE )) { - esw_attr->sample =kzalloc (sizeof (*esw_attr->sample),GFP_KERNEL ); -if (!esw_attr->sample) + attr->sample_attr =kzalloc (sizeof (*attr->sample_attr),GFP_KERNEL ); +if (!attr->sample_attr)return -ENOMEM ; - *esw_attr->sample = sample; + *attr->sample_attr = sample_attr; }return 0 ;
drivers/net/ethernet/mellanox/mlx5/core/en_tc.h +1 -0
@@ -70,6 +70,7 @@ struct mlx5_flow_attr {struct mlx5_fc *counter;struct mlx5_modify_hdr *modify_hdr;struct mlx5_ct_attr ct_attr; +struct mlx5e_sample_attr *sample_attr;struct mlx5e_tc_flow_parse_attr *parse_attr;u32 chain;u16 prio;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +0 -1
@@ -469,7 +469,6 @@ struct mlx5_esw_flow_attr { } dests[MLX5_MAX_FLOW_FWD_VPORTS ];struct mlx5_rx_tun_attr *rx_tun_attr;struct mlx5_pkt_reformat *decap_pkt_reformat; -struct mlx5e_sample_attr *sample; }; int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +6 -6
@@ -187,12 +187,12 @@ esw_cleanup_decap_indir(struct mlx5_eswitch *esw,static int esw_setup_sampler_dest (struct mlx5_flow_destination *dest,struct mlx5_flow_act *flow_act, -struct mlx5_esw_flow_attr *esw_attr, +struct mlx5_flow_attr *attr,int i) { flow_act->flags |=FLOW_ACT_IGNORE_FLOW_LEVEL ; dest[i].type =MLX5_FLOW_DESTINATION_TYPE_FLOW_SAMPLER ; - dest[i].sampler_id = esw_attr->sample->sampler_id; + dest[i].sampler_id = attr->sample_attr->sampler_id;return 0 ; }
@@ -435,7 +435,7 @@ esw_setup_dests(struct mlx5_flow_destination *dest, attr->flags |=MLX5_ESW_ATTR_FLAG_SRC_REWRITE ;if (attr->flags &MLX5_ESW_ATTR_FLAG_SAMPLE ) { -esw_setup_sampler_dest (dest, flow_act, esw_attr, *i); +esw_setup_sampler_dest (dest, flow_act, attr, *i); (*i)++; }else if (attr->dest_ft) {esw_setup_ft_dest (dest, flow_act, esw, attr, spec, *i);
@@ -540,9 +540,9 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,if (flow_act.action &MLX5_FLOW_CONTEXT_ACTION_MOD_HDR ) flow_act.modify_hdr = attr->modify_hdr; -/* esw_attr->sample is allocated only when there is a sample action */ -if (esw_attr->sample && esw_attr->sample->sample_default_tbl) { - fdb = esw_attr->sample->sample_default_tbl; +/* sample_attr is allocated only when there is a sample action */ +if (attr->sample_attr && attr->sample_attr->sample_default_tbl) { + fdb = attr->sample_attr->sample_default_tbl; }else if (split) { fwd_attr.chain = attr->chain; fwd_attr.prio = attr->prio;
Signature · 1 line
2.31.1
PATCH 4/15 net/mlx5e: CT, Use xarray to manage fte ids
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
IDR is deprecated. Use xarray instead.
--- .../net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +9 -9
@@ -46,7 +46,7 @@ struct mlx5_tc_ct_priv {struct mlx5_core_dev *dev;const struct net_device *netdev;struct mod_hdr_tbl *mod_hdr_tbl; -struct idr fte_ids; +struct xarray fte_ids;struct xarray tuple_ids;struct rhashtable zone_ht;struct rhashtable ct_tuples_ht;
@@ -1773,12 +1773,12 @@ __mlx5_tc_ct_flow_offload(struct mlx5_tc_ct_priv *ct_priv, } ct_flow->ft = ft; - err =idr_alloc_u32 (&ct_priv->fte_ids, ct_flow, &fte_id, -MLX5_FTE_ID_MAX ,GFP_KERNEL ); + err =xa_alloc (&ct_priv->fte_ids, &fte_id, ct_flow, +XA_LIMIT (1 ,MLX5_FTE_ID_MAX ),GFP_KERNEL );if (err) {netdev_warn (priv->netdev,"Failed to allocate fte id, err: %d\n" , err); - goto err_idr; + goto err_xarray; } ct_flow->fte_id = fte_id;
@@ -1914,8 +1914,8 @@ __mlx5_tc_ct_flow_offload(struct mlx5_tc_ct_priv *ct_priv, err_alloc_post:kfree (ct_flow->pre_ct_attr); err_alloc_pre: -idr_remove (&ct_priv->fte_ids, fte_id); -err_idr: +xa_erase (&ct_priv->fte_ids, fte_id); +err_xarray:mlx5_tc_ct_del_ft_cb (ct_priv, ft); err_ft:kvfree (post_ct_spec);
@@ -2033,7 +2033,7 @@ __mlx5_tc_ct_delete_flow(struct mlx5_tc_ct_priv *ct_priv,mlx5_tc_rule_delete (priv, ct_flow->post_ct_rule, ct_flow->post_ct_attr);mlx5_chains_put_chain_mapping (ct_priv->chains, ct_flow->chain_mapping); -idr_remove (&ct_priv->fte_ids, ct_flow->fte_id); +xa_erase (&ct_priv->fte_ids, ct_flow->fte_id);mlx5_tc_ct_del_ft_cb (ct_priv, ct_flow->ft); }
@@ -2203,7 +2203,7 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, goto err_post_ct_tbl; } -idr_init (&ct_priv->fte_ids); +xa_init_flags (&ct_priv->fte_ids,XA_FLAGS_ALLOC1 );mutex_init (&ct_priv->control_lock);rhashtable_init (&ct_priv->zone_ht, &zone_params);rhashtable_init (&ct_priv->ct_tuples_ht, &tuples_ht_params);
@@ -2247,7 +2247,7 @@ mlx5_tc_ct_clean(struct mlx5_tc_ct_priv *ct_priv)rhashtable_destroy (&ct_priv->ct_tuples_nat_ht);rhashtable_destroy (&ct_priv->zone_ht);mutex_destroy (&ct_priv->control_lock); -idr_destroy (&ct_priv->fte_ids); +xa_destroy (&ct_priv->fte_ids);kfree (ct_priv); }
Signature · 1 line
2.31.1
PATCH 5/15 net/mlx5e: Introduce post action infrastructure
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
Some tc actions are modeled in hardware using multiple tables causing a tc action list split. For example, CT action is modeled by jumping to a ct table which is controlled by nf flowtable. sFlow jumps in hardware to a sample table, which continues to a "default table" where it should continue processing the action list.
Multi table actions are modeled in hardware using a unique fte_id. The fte_id is set before jumping to a table. Split actions continue to a post-action table where the matched fte_id value continues the execution the tc action list.
Currently the post-action design is implemented only by the ct action. Introduce post action infrastructure as a pre-step for reusing it with the sFlow offload feature. Init and destroy the common post action table. Refactor the ct offload to use the common post table infrastructure in the next patch.
--- .../net/ethernet/mellanox/mlx5/core/Makefile | 3 +- .../mellanox/mlx5/core/en/tc/post_act.c | 62 +++++++++++++++++++ .../mellanox/mlx5/core/en/tc/post_act.h | 17 +++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.h
drivers/net/ethernet/mellanox/mlx5/core/Makefile +2 -1
@@ -44,7 +44,8 @@ mlx5_core-$(CONFIG_MLX5_CLS_ACT) += en_tc.o en/rep/tc.o en/rep/neigh.o \ lib/fs_chains.o en/tc_tun.o \ esw/indir_table.o en/tc_tun_encap.o \ en/tc_tun_vxlan.o en/tc_tun_gre.o en/tc_tun_geneve.o \ - en/tc_tun_mplsoudp.o diag/en_tc_tracepoint.o + en/tc_tun_mplsoudp.o diag/en_tc_tracepoint.o \ + en/tc/post_act.o mlx5_core-$(CONFIG_MLX5_TC_CT) += en/tc_ct.o mlx5_core-$(CONFIG_MLX5_TC_SAMPLE) += en/tc/sample.o
drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c new file +62 -0
62 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ +/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ + +#ifndef __MLX5_POST_ACTION_H__ +#define __MLX5_POST_ACTION_H__ + +#include "en.h" +#include "lib/fs_chains.h" + +struct mlx5e_post_act * +mlx5e_tc_post_act_init (struct mlx5e_priv *priv,struct mlx5_fs_chains *chains, +enum mlx5_flow_namespace_type ns_type); + +void +mlx5e_tc_post_act_destroy (struct mlx5e_post_act *post_act); + +#endif /* __MLX5_POST_ACTION_H__ */
Signature · 1 line
2.31.1
PATCH 6/15 net/mlx5e: Refactor ct to use post action infrastructure
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
Move post action table management to common library providing add/del/get API. Refactor the ct action offload to use the common API.
--- .../net/ethernet/mellanox/mlx5/core/en/fs.h | 3 + .../mellanox/mlx5/core/en/tc/post_act.c | 102 ++++++++++++ .../mellanox/mlx5/core/en/tc/post_act.h | 18 ++ .../ethernet/mellanox/mlx5/core/en/tc_ct.c | 154 ++++-------------- .../ethernet/mellanox/mlx5/core/en/tc_ct.h | 6 +- .../net/ethernet/mellanox/mlx5/core/en_rep.h | 2 + .../net/ethernet/mellanox/mlx5/core/en_tc.c | 13 +- 7 files changed, 176 insertions(+), 122 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h +3 -0
@@ -7,6 +7,8 @@#include "mod_hdr.h" #include "lib/fs_ttc.h" +struct mlx5e_post_act ; +enum {MLX5E_TC_FT_LEVEL =0 ,MLX5E_TC_TTC_FT_LEVEL ,
@@ -19,6 +21,7 @@ struct mlx5e_tc_table {struct mutex t_lock;struct mlx5_flow_table *t;struct mlx5_fs_chains *chains; +struct mlx5e_post_act *post_act;struct rhashtable ht;
drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c +102 -0
128 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.h +18 -0
@@ -7,6 +7,10 @@#include "en.h" #include "lib/fs_chains.h" +struct mlx5_flow_attr ; +struct mlx5e_priv ; +struct mlx5e_tc_mod_hdr_acts ; +struct mlx5e_post_act *mlx5e_tc_post_act_init (struct mlx5e_priv *priv,struct mlx5_fs_chains *chains,enum mlx5_flow_namespace_type ns_type);
@@ -14,4 +18,18 @@ mlx5e_tc_post_act_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,void mlx5e_tc_post_act_destroy (struct mlx5e_post_act *post_act); +struct mlx5e_post_act_handle * +mlx5e_tc_post_act_add (struct mlx5e_post_act *post_act,struct mlx5_flow_attr *attr); + +void +mlx5e_tc_post_act_del (struct mlx5e_post_act *post_act,struct mlx5e_post_act_handle *handle); + +struct mlx5_flow_table * +mlx5e_tc_post_act_get_ft (struct mlx5e_post_act *post_act); + +int +mlx5e_tc_post_act_set_handle (struct mlx5_core_dev *dev, +struct mlx5e_post_act_handle *handle, +struct mlx5e_tc_mod_hdr_acts *acts); +#endif /* __MLX5_POST_ACTION_H__ */
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +36 -118
340 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h +4 -2
@@ -92,7 +92,8 @@ struct mlx5_ct_attr {struct mlx5_tc_ct_priv *mlx5_tc_ct_init (struct mlx5e_priv *priv,struct mlx5_fs_chains *chains,struct mod_hdr_tbl *mod_hdr, -enum mlx5_flow_namespace_type ns_type); +enum mlx5_flow_namespace_type ns_type, +struct mlx5e_post_act *post_act);void mlx5_tc_ct_clean (struct mlx5_tc_ct_priv *ct_priv);
@@ -132,7 +133,8 @@ mlx5e_tc_ct_restore_flow(struct mlx5_tc_ct_priv *ct_priv,static inline struct mlx5_tc_ct_priv *mlx5_tc_ct_init (struct mlx5e_priv *priv,struct mlx5_fs_chains *chains,struct mod_hdr_tbl *mod_hdr, -enum mlx5_flow_namespace_type ns_type) +enum mlx5_flow_namespace_type ns_type, +struct mlx5e_post_act *post_act) {return NULL ; }
drivers/net/ethernet/mellanox/mlx5/core/en_rep.h +2 -0
@@ -60,6 +60,7 @@ struct mlx5e_neigh_update_table {struct mlx5_tc_ct_priv ;struct mlx5e_rep_bond ;struct mlx5e_tc_tun_encap ; +struct mlx5e_post_act ;struct mlx5_rep_uplink_priv {/* Filters DB - instantiated by the uplink representor and shared by
@@ -88,6 +89,7 @@ struct mlx5_rep_uplink_priv {/* maps tun_enc_opts to a unique id*/ struct mapping_ctx *tunnel_enc_opts_mapping; +struct mlx5e_post_act *post_act;struct mlx5_tc_ct_priv *ct_priv;struct mlx5e_tc_psample *tc_psample;
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +11 -2
@@ -47,6 +47,7 @@#include <net/bareudp.h> #include <net/bonding.h> #include "en.h" +#include "en/tc/post_act.h" #include "en_rep.h" #include "en/rep/tc.h" #include "en/rep/neigh.h"
@@ -4895,8 +4896,9 @@ int mlx5e_tc_nic_init(struct mlx5e_priv *priv) goto err_chains; } + tc->post_act =mlx5e_tc_post_act_init (priv, tc->chains,MLX5_FLOW_NAMESPACE_KERNEL ); tc->ct =mlx5_tc_ct_init (priv, tc->chains, &priv->fs.tc.mod_hdr, -MLX5_FLOW_NAMESPACE_KERNEL ); +MLX5_FLOW_NAMESPACE_KERNEL , tc->post_act); tc->netdevice_nb.notifier_call = mlx5e_tc_netdev_event; err = register_netdevice_notifier_dev_net(priv->netdev,
@@ -4912,6 +4914,7 @@ int mlx5e_tc_nic_init(struct mlx5e_priv *priv) err_reg:mlx5_tc_ct_clean (tc->ct); +mlx5e_tc_post_act_destroy (tc->post_act);mlx5_chains_destroy (tc->chains); err_chains:mapping_destroy (chains_mapping);
@@ -4950,6 +4953,7 @@ void mlx5e_tc_nic_cleanup(struct mlx5e_priv *priv)mutex_destroy (&tc->t_lock);mlx5_tc_ct_clean (tc->ct); +mlx5e_tc_post_act_destroy (tc->post_act);mapping_destroy (tc->mapping);mlx5_chains_destroy (tc->chains); }
@@ -4970,10 +4974,13 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht) priv =netdev_priv (rpriv->netdev); esw = priv->mdev->priv.eswitch; + uplink_priv->post_act =mlx5e_tc_post_act_init (priv,esw_chains (esw), +MLX5_FLOW_NAMESPACE_FDB ); uplink_priv->ct_priv =mlx5_tc_ct_init (netdev_priv (priv->netdev),esw_chains (esw), &esw->offloads.mod_hdr, -MLX5_FLOW_NAMESPACE_FDB ); +MLX5_FLOW_NAMESPACE_FDB , + uplink_priv->post_act);#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) uplink_priv->tc_psample =mlx5e_tc_sample_init (esw);
@@ -5027,6 +5034,7 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht)mlx5_tc_ct_clean (uplink_priv->ct_priv);netdev_warn (priv->netdev,"Failed to initialize tc (eswitch), err: %d" , err); +mlx5e_tc_post_act_destroy (uplink_priv->post_act);return err; }
@@ -5046,6 +5054,7 @@ void mlx5e_tc_esw_cleanup(struct rhashtable *tc_ht)mlx5e_tc_sample_cleanup (uplink_priv->tc_psample);#endif mlx5_tc_ct_clean (uplink_priv->ct_priv); +mlx5e_tc_post_act_destroy (uplink_priv->post_act); }int mlx5e_tc_num_filters (struct mlx5e_priv *priv,unsigned long flags)
Signature · 1 line
2.31.1
PATCH 7/15 net/mlx5e: TC, Remove CONFIG_NET_TC_SKB_EXT dependency when restoring tunnel
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
CONFIG_NET_TC_SKB_EXT controls the SKB extension support for restoring chain ids. SKB extension is not required for tunnel restoration.
Remove the CONFIG_NET_TC_SKB_EXT dependency as a pre-step for using the tunnel restore methods for sample offload use cases.
--- .../net/ethernet/mellanox/mlx5/core/en/rep/tc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +6 -9
@@ -516,7 +516,6 @@ void mlx5e_rep_tc_netdevice_event_unregister(struct mlx5e_rep_priv *rpriv) mlx5e_rep_indr_block_unbind); } -#if IS_ENABLED (CONFIG_NET_TC_SKB_EXT )static bool mlx5e_restore_tunnel (struct mlx5e_priv *priv,struct sk_buff *skb,struct mlx5e_tc_update_priv *tc_priv,u32 tunnel_id)
@@ -615,6 +614,7 @@ static bool mlx5e_restore_skb(struct sk_buff *skb, u32 chain, u32 reg_c1,struct mlx5e_priv *priv =netdev_priv (skb->dev);u32 tunnel_id = (reg_c1 >>ESW_TUN_OFFSET ) &TUNNEL_ID_MASK ; +#if IS_ENABLED (CONFIG_NET_TC_SKB_EXT )if (chain) {struct mlx5_rep_uplink_priv *uplink_priv;struct mlx5e_rep_priv *uplink_rpriv;
@@ -636,9 +636,10 @@ static bool mlx5e_restore_skb(struct sk_buff *skb, u32 chain, u32 reg_c1, zone_restore_id))return false; } +#endif /* CONFIG_NET_TC_SKB_EXT */ +return mlx5e_restore_tunnel (priv, skb, tc_priv, tunnel_id); } -#endif /* CONFIG_NET_TC_SKB_EXT */ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe, struct sk_buff *skb,
@@ -671,18 +672,14 @@ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe,return false; } -#if IS_ENABLED (CONFIG_NET_TC_SKB_EXT ) -if (mapped_obj.type ==MLX5_MAPPED_OBJ_CHAIN ) +if (mapped_obj.type ==MLX5_MAPPED_OBJ_CHAIN ) {return mlx5e_restore_skb (skb, mapped_obj.chain, reg_c1, tc_priv); -#endif /* CONFIG_NET_TC_SKB_EXT */ #if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) -if (mapped_obj.type ==MLX5_MAPPED_OBJ_SAMPLE ) { + } else if (mapped_obj.type == MLX5_MAPPED_OBJ_SAMPLE) {mlx5e_tc_sample_skb (skb, &mapped_obj);return false; - }#endif /* CONFIG_MLX5_TC_SAMPLE */ -if (mapped_obj.type !=MLX5_MAPPED_OBJ_SAMPLE && - mapped_obj.type !=MLX5_MAPPED_OBJ_CHAIN ) { + }else {netdev_dbg (priv->netdev,"Invalid mapped object type: %d\n" , mapped_obj.type);return false; }
Signature · 1 line
2.31.1
PATCH 8/15 net/mlx5e: TC, Restore tunnel info for sample offload
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
Currently the sample offload actions send the encapsulated packet to software. sFlow expects tunneled packets to be decapsulated while having the tunnel properties on the skb metadata fields.
Reuse the functions used by connection tracking to map the outer header properties to a unique id. The next patch will use that id to restore the tunnel information of decapsulated packets onto the skb.
--- .../ethernet/mellanox/mlx5/core/en/rep/tc.c | 31 +++++++++++++------ .../mellanox/mlx5/core/en/tc/sample.c | 4 ++- .../mellanox/mlx5/core/en/tc/sample.h | 3 +- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 12 +++++-- .../net/ethernet/mellanox/mlx5/core/eswitch.h | 1 + 5 files changed, 37 insertions(+), 14 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +22 -9
@@ -608,8 +608,8 @@ static bool mlx5e_restore_tunnel(struct mlx5e_priv *priv, struct sk_buff *skb,return true; } -static bool mlx5e_restore_skb (struct sk_buff *skb,u32 chain,u32 reg_c1, -struct mlx5e_tc_update_priv *tc_priv) +static bool mlx5e_restore_skb_chain (struct sk_buff *skb,u32 chain,u32 reg_c1, +struct mlx5e_tc_update_priv *tc_priv) {struct mlx5e_priv *priv =netdev_priv (skb->dev);u32 tunnel_id = (reg_c1 >>ESW_TUN_OFFSET ) &TUNNEL_ID_MASK ;
@@ -641,6 +641,21 @@ static bool mlx5e_restore_skb(struct sk_buff *skb, u32 chain, u32 reg_c1,return mlx5e_restore_tunnel (priv, skb, tc_priv, tunnel_id); } +static void mlx5e_restore_skb_sample (struct mlx5e_priv *priv,struct sk_buff *skb, +struct mlx5_mapped_obj *mapped_obj, +struct mlx5e_tc_update_priv *tc_priv) +{ +if (!mlx5e_restore_tunnel (priv, skb, tc_priv, mapped_obj->sample.tunnel_id)) { +netdev_dbg (priv->netdev, +"Failed to restore tunnel info for sampled packet\n" ); +return ; + } +#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) +mlx5e_tc_sample_skb (skb, mapped_obj); +#endif /* CONFIG_MLX5_TC_SAMPLE */ +mlx5_rep_tc_post_napi_receive (tc_priv); +} +bool mlx5e_rep_tc_update_skb (struct mlx5_cqe64 *cqe,struct sk_buff *skb,struct mlx5e_tc_update_priv *tc_priv)
@@ -648,7 +663,7 @@ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe,struct mlx5_mapped_obj mapped_obj;struct mlx5_eswitch *esw;struct mlx5e_priv *priv; -u32 reg_c0, reg_c1; +u32 reg_c0;int err; reg_c0 = (be32_to_cpu (cqe->sop_drop_qpn) &MLX5E_TC_FLOW_ID_MASK );
@@ -660,8 +675,6 @@ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe,*/ skb->mark =0 ; - reg_c1 =be32_to_cpu (cqe->ft_metadata); - priv =netdev_priv (skb->dev); esw = priv->mdev->priv.eswitch; err =mapping_find (esw->offloads.reg_c0_obj_pool, reg_c0, &mapped_obj);
@@ -673,12 +686,12 @@ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe, }if (mapped_obj.type ==MLX5_MAPPED_OBJ_CHAIN ) { -return mlx5e_restore_skb (skb, mapped_obj.chain, reg_c1, tc_priv); -#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) +u32 reg_c1 =be32_to_cpu (cqe->ft_metadata); + +return mlx5e_restore_skb_chain (skb, mapped_obj.chain, reg_c1, tc_priv); }else if (mapped_obj.type ==MLX5_MAPPED_OBJ_SAMPLE ) { -mlx5e_tc_sample_skb (skb, &mapped_obj); +mlx5e_restore_skb_sample (priv, skb, &mapped_obj, tc_priv);return false; -#endif /* CONFIG_MLX5_TC_SAMPLE */ }else {netdev_dbg (priv->netdev,"Invalid mapped object type: %d\n" , mapped_obj.type);return false;
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c +3 -1
@@ -364,7 +364,8 @@ void mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_objstruct mlx5_flow_handle *mlx5e_tc_sample_offload (struct mlx5e_tc_psample *tc_psample,struct mlx5_flow_spec *spec, -struct mlx5_flow_attr *attr) +struct mlx5_flow_attr *attr, +u32 tunnel_id) {struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;struct mlx5_vport_tbl_attr per_vport_tbl_attr;
@@ -438,6 +439,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, restore_obj.sample.group_id = sample_attr->group_num; restore_obj.sample.rate = sample_attr->rate; restore_obj.sample.trunc_size = sample_attr->trunc_size; + restore_obj.sample.tunnel_id = tunnel_id; err =mapping_add (esw->offloads.reg_c0_obj_pool, &restore_obj, &obj_id);if (err) goto err_obj_id;
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.h +2 -1
@@ -24,7 +24,8 @@ void mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_objstruct mlx5_flow_handle *mlx5e_tc_sample_offload (struct mlx5e_tc_psample *sample_priv,struct mlx5_flow_spec *spec, -struct mlx5_flow_attr *attr); +struct mlx5_flow_attr *attr, +u32 tunnel_id); void mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *sample_priv,
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +9 -3
@@ -1148,7 +1148,8 @@ mlx5e_tc_offload_fdb_rules(struct mlx5_eswitch *esw, mod_hdr_acts);#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) } else if (flow_flag_test(flow, SAMPLE)) { - rule =mlx5e_tc_sample_offload (get_sample_priv (flow->priv), spec, attr); + rule =mlx5e_tc_sample_offload (get_sample_priv (flow->priv), spec, attr, +mlx5e_tc_get_flow_tun_id (flow));#endif }else { rule =mlx5_eswitch_add_offloaded_rule (esw, spec, attr);
@@ -1625,17 +1626,22 @@ static void mlx5e_tc_del_flow(struct mlx5e_priv *priv, } } -static int flow_has_tc_fwd_action (struct flow_cls_offload *f) +static bool flow_requires_tunnel_mapping (u32 chain,struct flow_cls_offload *f) {struct flow_rule *rule =flow_cls_offload_flow_rule (f);struct flow_action *flow_action = &rule->action;const struct flow_action_entry *act;int i; +if (chain) +return false; +flow_action_for_each (i, act, flow_action) {switch (act->id) {case FLOW_ACTION_GOTO :return true; +case FLOW_ACTION_SAMPLE : +return true;default :continue ; }
@@ -1876,7 +1882,7 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,return -EOPNOTSUPP ; needs_mapping = !!flow->attr->chain; - sets_mapping = !flow->attr->chain &&flow_has_tc_fwd_action (f); + sets_mapping =flow_requires_tunnel_mapping (flow->attr->chain, f); *match_inner = !needs_mapping; if ((needs_mapping || sets_mapping) &&
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +1 -0
@@ -61,6 +61,7 @@ struct mlx5_mapped_obj {u32 group_id;u32 rate;u32 trunc_size; +u32 tunnel_id; } sample; }; };
Signature · 1 line
2.31.1
PATCH 10/15 net/mlx5: E-switch, Move QoS related code to dedicated file
In reply to Saeed MahameedFrom: Dmytro Linkin <[email protected]>
Move eswitch QoS related code into dedicated file. Provide eswitch API to access this code meaning it is isolated and restricted to be used only by eswitch.c. Exception is legacy NDO vf set rate, which moved to esw/legacy.c.
--- .../net/ethernet/mellanox/mlx5/core/Makefile | 8 +- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- .../ethernet/mellanox/mlx5/core/esw/legacy.c | 18 + .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 295 +++++++++++++++++ .../net/ethernet/mellanox/mlx5/core/esw/qos.h | 19 ++ .../net/ethernet/mellanox/mlx5/core/eswitch.c | 310 +----------------- .../net/ethernet/mellanox/mlx5/core/eswitch.h | 10 +- 7 files changed, 346 insertions(+), 316 deletions(-) create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h
drivers/net/ethernet/mellanox/mlx5/core/Makefile +5 -3
@@ -53,11 +53,13 @@ mlx5_core-$(CONFIG_MLX5_TC_SAMPLE) += en/tc/sample.o # Core extra # mlx5_core-$(CONFIG_MLX5_ESWITCH) += eswitch.o eswitch_offloads.o eswitch_offloads_termtbl.o \ - ecpf.o rdma.o esw/legacy.o + ecpf.o rdma.o esw/legacy.o \ + esw/devlink_port.o esw/vporttbl.o esw/qos.o + mlx5_core-$(CONFIG_MLX5_ESWITCH) += esw/acl/helper.o \ esw/acl/egress_lgcy.o esw/acl/egress_ofld.o \ - esw/acl/ingress_lgcy.o esw/acl/ingress_ofld.o \ - esw/devlink_port.o esw/vporttbl.o + esw/acl/ingress_lgcy.o esw/acl/ingress_ofld.o + mlx5_core-$(CONFIG_MLX5_BRIDGE) += esw/bridge.o en/rep/bridge.o mlx5_core-$(CONFIG_MLX5_MPFS) += lib/mpfs.o
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -1
@@ -4689,7 +4689,7 @@ static int apply_police_params(struct mlx5e_priv *priv, u64 rate, rate_mbps =max_t (u32, rate,1 ); } - err =mlx5_esw_modify_vport_rate (esw, vport_num, rate_mbps); + err =mlx5_esw_qos_modify_vport_rate (esw, vport_num, rate_mbps);if (err)NL_SET_ERR_MSG_MOD (extack,"failed applying action to hardware" );
drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c +18 -0
@@ -11,6 +11,7 @@#include "mlx5_core.h" #include "eswitch.h" #include "fs_core.h" +#include "esw/qos.h" enum {LEGACY_VEPA_PRIO =0 ,
@@ -508,3 +509,20 @@ int mlx5_eswitch_set_vport_trust(struct mlx5_eswitch *esw,mutex_unlock (&esw->state_lock);return err; } + +int mlx5_eswitch_set_vport_rate (struct mlx5_eswitch *esw,u16 vport, +u32 max_rate,u32 min_rate) +{ +struct mlx5_vport *evport =mlx5_eswitch_get_vport (esw, vport); +int err; + +if (!mlx5_esw_allowed (esw)) +return -EPERM ; +if (IS_ERR (evport)) +return PTR_ERR (evport); + +mutex_lock (&esw->state_lock); + err =mlx5_esw_qos_set_vport_rate (esw, evport, max_rate, min_rate); +mutex_unlock (&esw->state_lock); +return err; +}
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c new file +295 -0
295 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ +/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ + +#ifndef __MLX5_ESW_QOS_H__ +#define __MLX5_ESW_QOS_H__ + +#ifdef CONFIG_MLX5_ESWITCH + +int mlx5_esw_qos_set_vport_rate (struct mlx5_eswitch *esw,struct mlx5_vport *evport, +u32 max_rate,u32 min_rate); +void mlx5_esw_qos_create (struct mlx5_eswitch *esw); +void mlx5_esw_qos_destroy (struct mlx5_eswitch *esw); +int mlx5_esw_qos_vport_enable (struct mlx5_eswitch *esw,struct mlx5_vport *vport, +u32 max_rate,u32 bw_share); +void mlx5_esw_qos_vport_disable (struct mlx5_eswitch *esw,struct mlx5_vport *vport); + +#endif + +#endif
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +6 -304
358 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 -8
@@ -76,11 +76,6 @@ struct mlx5_mapped_obj {#define MLX5_MAX_MC_PER_VPORT (dev) \ (1 << MLX5_CAP_GEN(dev, log_max_current_mc_list)) -#define MLX5_MIN_BW_SHARE 1 - -#define MLX5_RATE_TO_BW_SHARE (rate, divider, limit) \ - min_t(u32, max_t(u32, (rate) / (divider), MLX5_MIN_BW_SHARE), limit) -#define mlx5_esw_has_fwd_fdb (dev) \ MLX5_CAP_ESW_FLOWTABLE(dev, fdb_multi_path_to_table)
@@ -310,7 +305,7 @@ struct mlx5_eswitch {struct {bool enabled; -u32 root_tsar_id; +u32 root_tsar_ix; } qos;struct mlx5_esw_bridge_offloads *br_offloads;
@@ -336,8 +331,7 @@ int mlx5_esw_offloads_vport_metadata_set(struct mlx5_eswitch *esw, bool enable);u32 mlx5_esw_match_metadata_alloc (struct mlx5_eswitch *esw);void mlx5_esw_match_metadata_free (struct mlx5_eswitch *esw,u32 metadata); -int mlx5_esw_modify_vport_rate (struct mlx5_eswitch *esw,u16 vport_num, -u32 rate_mbps); +int mlx5_esw_qos_modify_vport_rate (struct mlx5_eswitch *esw,u16 vport_num,u32 rate_mbps);/* E-Switch API */ int mlx5_eswitch_init (struct mlx5_core_dev *dev);
Signature · 1 line
2.31.1
PATCH 9/15 net/mlx5e: TC, Support sample offload action for tunneled traffic
In reply to Saeed MahameedFrom: Chris Mi <[email protected]>
Currently the sample offload actions send the encapsulated packet to software. This commit decapsulates the packet before performing the sampling and set the tunnel properties on the skb metadata fields to make the behavior consistent with OVS sFlow.
If decapsulating first, we can't use the same match like before in default table. So instantiate a post action instance to continue processing the action list. If HW can preserve reg_c, also use the post action instance.
--- .../mellanox/mlx5/core/en/tc/sample.c | 294 +++++++++++++----- .../mellanox/mlx5/core/en/tc/sample.h | 4 +- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- .../mellanox/mlx5/core/eswitch_offloads.c | 5 +- 4 files changed, 214 insertions(+), 91 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c +210 -84
@@ -4,6 +4,7 @@#include <linux/skbuff.h> #include <net/psample.h> #include "en/mapping.h" +#include "en/tc/post_act.h" #include "sample.h" #include "eswitch.h" #include "en_tc.h"
@@ -25,6 +26,7 @@ struct mlx5e_tc_psample {struct mutex ht_lock;/* protect hashtbl */ DECLARE_HASHTABLE (restore_hashtbl,8 );struct mutex restore_lock;/* protect restore_hashtbl */ +struct mlx5e_post_act *post_act; };struct mlx5e_sampler {
@@ -41,13 +43,16 @@ struct mlx5e_sample_flow {struct mlx5e_sample_restore *restore;struct mlx5_flow_attr *pre_attr;struct mlx5_flow_handle *pre_rule; -struct mlx5_flow_handle *rule; +struct mlx5_flow_attr *post_attr; +struct mlx5_flow_handle *post_rule; +struct mlx5e_post_act_handle *post_act_handle; };struct mlx5e_sample_restore {struct hlist_node hlist;struct mlx5_modify_hdr *modify_hdr;struct mlx5_flow_handle *rule; +struct mlx5e_post_act_handle *post_act_handle;u32 obj_id;int count; };
@@ -217,8 +222,15 @@ sampler_put(struct mlx5e_tc_psample *tc_psample, struct mlx5e_sampler *sampler)mutex_unlock (&tc_psample->ht_lock); } +/* obj_id is used to restore the sample parameters. +* Set fte_id in original flow table, then match it in the default table. +* Only set it for NICs can preserve reg_c or decap action. For other cases, +* use the same match in the default table. +* Use one header rewrite for both obj_id and fte_id. +*/ static struct mlx5_modify_hdr * -sample_metadata_rule_get (struct mlx5_core_dev *mdev,u32 obj_id) +sample_modify_hdr_get (struct mlx5_core_dev *mdev,u32 obj_id, +struct mlx5e_post_act_handle *handle) {struct mlx5e_tc_mod_hdr_acts mod_acts = {};struct mlx5_modify_hdr *modify_hdr;
@@ -229,6 +241,12 @@ sample_metadata_rule_get(struct mlx5_core_dev *mdev, u32 obj_id)if (err) goto err_set_regc0; +if (handle) { + err =mlx5e_tc_post_act_set_handle (mdev, handle, &mod_acts); +if (err) + goto err_post_act; + } + modify_hdr =mlx5_modify_header_alloc (mdev,MLX5_FLOW_NAMESPACE_FDB , mod_acts.num_actions, mod_acts.actions);
@@ -241,23 +259,40 @@ sample_metadata_rule_get(struct mlx5_core_dev *mdev, u32 obj_id)return modify_hdr; err_modify_hdr: +err_post_act:dealloc_mod_hdr_actions (&mod_acts); err_set_regc0:return ERR_PTR (err); } +static u32 +restore_hash (u32 obj_id,struct mlx5e_post_act_handle *post_act_handle) +{ +return jhash_2words (obj_id,hash32_ptr (post_act_handle),0 ); +} + +static bool +restore_equal (struct mlx5e_sample_restore *restore,u32 obj_id, +struct mlx5e_post_act_handle *post_act_handle) +{ +return restore->obj_id == obj_id && restore->post_act_handle == post_act_handle; +} +static struct mlx5e_sample_restore * -sample_restore_get (struct mlx5e_tc_psample *tc_psample,u32 obj_id) +sample_restore_get (struct mlx5e_tc_psample *tc_psample,u32 obj_id, +struct mlx5e_post_act_handle *post_act_handle) {struct mlx5_eswitch *esw = tc_psample->esw;struct mlx5_core_dev *mdev = esw->dev;struct mlx5e_sample_restore *restore;struct mlx5_modify_hdr *modify_hdr; +u32 hash_key;int err;mutex_lock (&tc_psample->restore_lock); -hash_for_each_possible (tc_psample->restore_hashtbl, restore, hlist, obj_id) -if (restore->obj_id == obj_id) + hash_key =restore_hash (obj_id, post_act_handle); +hash_for_each_possible (tc_psample->restore_hashtbl, restore, hlist, hash_key) +if (restore_equal (restore, obj_id, post_act_handle)) goto add_ref; restore =kzalloc (sizeof (*restore),GFP_KERNEL );
@@ -266,8 +301,9 @@ sample_restore_get(struct mlx5e_tc_psample *tc_psample, u32 obj_id) goto err_alloc; } restore->obj_id = obj_id; + restore->post_act_handle = post_act_handle; - modify_hdr =sample_metadata_rule_get (mdev, obj_id); + modify_hdr =sample_modify_hdr_get (mdev, obj_id, post_act_handle);if (IS_ERR (modify_hdr)) { err =PTR_ERR (modify_hdr); goto err_modify_hdr;
@@ -280,7 +316,7 @@ sample_restore_get(struct mlx5e_tc_psample *tc_psample, u32 obj_id) goto err_restore; } -hash_add (tc_psample->restore_hashtbl, &restore->hlist, obj_id); +hash_add (tc_psample->restore_hashtbl, &restore->hlist, hash_key); add_ref: restore->count++;mutex_unlock (&tc_psample->restore_lock);
@@ -325,6 +361,87 @@ void mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_objpsample_sample_packet (&psample_group, skb, mapped_obj->sample.rate, &md); } +static int +add_post_rule (struct mlx5_eswitch *esw,struct mlx5e_sample_flow *sample_flow, +struct mlx5_flow_spec *spec,struct mlx5_flow_attr *attr, +u32 *default_tbl_id) +{ +struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr; +u32 attr_sz =ns_to_attr_sz (MLX5_FLOW_NAMESPACE_FDB ); +struct mlx5_vport_tbl_attr per_vport_tbl_attr; +struct mlx5_flow_table *default_tbl; +struct mlx5_flow_attr *post_attr; +int err; + +/* Allocate default table per vport, chain and prio. Otherwise, there is +* only one default table for the same sampler object. Rules with different +* prio and chain may overlap. For CT sample action, per vport default +* table is needed to resotre the metadata. +*/ + per_vport_tbl_attr.chain = attr->chain; + per_vport_tbl_attr.prio = attr->prio; + per_vport_tbl_attr.vport = esw_attr->in_rep->vport; + per_vport_tbl_attr.vport_ns = &mlx5_esw_vport_tbl_sample_ns; + default_tbl =mlx5_esw_vporttbl_get (esw, &per_vport_tbl_attr); +if (IS_ERR (default_tbl)) { + err =PTR_ERR (default_tbl); + goto err_default_tbl; + } + *default_tbl_id = default_tbl->id; + + post_attr =mlx5_alloc_flow_attr (MLX5_FLOW_NAMESPACE_FDB ); +if (!post_attr) { + err = -ENOMEM ; + goto err_attr; + } + sample_flow->post_attr = post_attr; +memcpy (post_attr, attr, attr_sz); +/* Perform the original matches on the default table. +* Offload all actions except the sample action. +*/ + post_attr->chain =0 ; + post_attr->prio =0 ; + post_attr->ft = default_tbl; + post_attr->flags =MLX5_ESW_ATTR_FLAG_NO_IN_PORT ; + +/* When offloading sample and encap action, if there is no valid +* neigh data struct, a slow path rule is offloaded first. Source +* port metadata match is set at that time. A per vport table is +* already allocated. No need to match it again. So clear the source +* port metadata match. +*/ +mlx5_eswitch_clear_rule_source_port (esw, spec); + sample_flow->post_rule =mlx5_eswitch_add_offloaded_rule (esw, spec, post_attr); +if (IS_ERR (sample_flow->post_rule)) { + err =PTR_ERR (sample_flow->post_rule); + goto err_rule; + } +return 0 ; + +err_rule: +kfree (post_attr); +err_attr: +mlx5_esw_vporttbl_put (esw, &per_vport_tbl_attr); +err_default_tbl: +return err; +} + +static void +del_post_rule (struct mlx5_eswitch *esw,struct mlx5e_sample_flow *sample_flow, +struct mlx5_flow_attr *attr) +{ +struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr; +struct mlx5_vport_tbl_attr tbl_attr; + +mlx5_eswitch_del_offloaded_rule (esw, sample_flow->post_rule, sample_flow->post_attr); +kfree (sample_flow->post_attr); + tbl_attr.chain = attr->chain; + tbl_attr.prio = attr->prio; + tbl_attr.vport = esw_attr->in_rep->vport; + tbl_attr.vport_ns = &mlx5_esw_vport_tbl_sample_ns; +mlx5_esw_vporttbl_put (esw, &tbl_attr); +} +/* For the following typical flow table: * * +-------------------------------+
@@ -342,8 +459,9 @@ void mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_obj* +---------------------+ * + original match + * +---------------------+ -* | -* v +* | set fte_id (if reg_c preserve cap) +* | do decap (if required) +* v * +------------------------------------------------+ * + Flow Sampler Object + * +------------------------------------------------+
@@ -353,13 +471,22 @@ void mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_obj* +------------------------------------------------+ * | | * v v -* +-----------------------------+ +----------------------------------------+ -* + sample table + + default table per <vport, chain, prio> + -* +-----------------------------+ +----------------------------------------+ -* + forward to management vport + + original match + -* +-----------------------------+ +----------------------------------------+ -* + other actions + -* +----------------------------------------+ +* +-----------------------------+ +-------------------+ +* + sample table + + default table + +* +-----------------------------+ +-------------------+ +* + forward to management vport + | +* +-----------------------------+ | +* +-------+------+ +* | |reg_c preserve cap +* | |or decap action +* v v +* +-----------------+ +-------------+ +* + per vport table + + post action + +* +-----------------+ +-------------+ +* + original match + +* +-----------------+ +* + other actions + +* +-----------------+ */ struct mlx5_flow_handle * mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
@@ -367,15 +494,15 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, struct mlx5_flow_attr *attr, u32 tunnel_id) { +struct mlx5e_post_act_handle *post_act_handle =NULL ;struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr; -struct mlx5_vport_tbl_attr per_vport_tbl_attr;struct mlx5_esw_flow_attr *pre_esw_attr;struct mlx5_mapped_obj restore_obj = {};struct mlx5e_sample_flow *sample_flow;struct mlx5e_sample_attr *sample_attr; -struct mlx5_flow_table *default_tbl;struct mlx5_flow_attr *pre_attr;struct mlx5_eswitch *esw; +u32 default_tbl_id;u32 obj_id;int err;
@@ -395,40 +522,31 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, sample_attr = attr->sample_attr; sample_attr->sample_flow = sample_flow; -/* Allocate default table per vport, chain and prio. Otherwise, there is -* only one default table for the same sampler object. Rules with different -* prio and chain may overlap. For CT sample action, per vport default -* table is needed to resotre the metadata. -*/ - per_vport_tbl_attr.chain = attr->chain; - per_vport_tbl_attr.prio = attr->prio; - per_vport_tbl_attr.vport = esw_attr->in_rep->vport; - per_vport_tbl_attr.vport_ns = &mlx5_esw_vport_tbl_sample_ns; - default_tbl =mlx5_esw_vporttbl_get (esw, &per_vport_tbl_attr); -if (IS_ERR (default_tbl)) { - err =PTR_ERR (default_tbl); - goto err_default_tbl; - } - -/* Perform the original matches on the default table. -* Offload all actions except the sample action. -*/ - sample_attr->sample_default_tbl = default_tbl; -/* When offloading sample and encap action, if there is no valid -* neigh data struct, a slow path rule is offloaded first. Source -* port metadata match is set at that time. A per vport table is -* already allocated. No need to match it again. So clear the source -* port metadata match. +/* For NICs with reg_c_preserve support or decap action, use +* post action instead of the per vport, chain and prio table. +* Only match the fte id instead of the same match in the +* original flow table. */ -mlx5_eswitch_clear_rule_source_port (esw, spec); - sample_flow->rule =mlx5_eswitch_add_offloaded_rule (esw, spec, attr); -if (IS_ERR (sample_flow->rule)) { - err =PTR_ERR (sample_flow->rule); - goto err_offload_rule; +if (MLX5_CAP_GEN (esw->dev, reg_c_preserve) || + attr->action &MLX5_FLOW_CONTEXT_ACTION_DECAP ) { +struct mlx5_flow_table *ft; + + ft =mlx5e_tc_post_act_get_ft (tc_psample->post_act); + default_tbl_id = ft->id; + post_act_handle =mlx5e_tc_post_act_add (tc_psample->post_act, attr); +if (IS_ERR (post_act_handle)) { + err =PTR_ERR (post_act_handle); + goto err_post_act; + } + sample_flow->post_act_handle = post_act_handle; + }else { + err =add_post_rule (esw, sample_flow, spec, attr, &default_tbl_id); +if (err) + goto err_post_rule; }/* Create sampler object. */ - sample_flow->sampler =sampler_get (tc_psample, sample_attr->rate, default_tbl->id); + sample_flow->sampler =sampler_get (tc_psample, sample_attr->rate, default_tbl_id);if (IS_ERR (sample_flow->sampler)) { err =PTR_ERR (sample_flow->sampler); goto err_sampler;
@@ -446,7 +564,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, sample_attr->restore_obj_id = obj_id;/* Create sample restore context. */ - sample_flow->restore =sample_restore_get (tc_psample, obj_id); + sample_flow->restore =sample_restore_get (tc_psample, obj_id, post_act_handle);if (IS_ERR (sample_flow->restore)) { err =PTR_ERR (sample_flow->restore); goto err_sample_restore;
@@ -458,19 +576,21 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, pre_attr =mlx5_alloc_flow_attr (MLX5_FLOW_NAMESPACE_FDB );if (!pre_attr) { err = -ENOMEM ; - goto err_alloc_flow_attr; - } - sample_attr =kzalloc (sizeof (*sample_attr),GFP_KERNEL ); -if (!sample_attr) { - err = -ENOMEM ; - goto err_alloc_sample_attr; + goto err_alloc_pre_flow_attr; } pre_attr->action =MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |MLX5_FLOW_CONTEXT_ACTION_MOD_HDR ; +/* For decap action, do decap in the original flow table instead of the +* default flow table. +*/ +if (tunnel_id) + pre_attr->action |=MLX5_FLOW_CONTEXT_ACTION_DECAP ; pre_attr->modify_hdr = sample_flow->restore->modify_hdr; pre_attr->flags =MLX5_ESW_ATTR_FLAG_SAMPLE ; + pre_attr->inner_match_level = attr->inner_match_level; + pre_attr->outer_match_level = attr->outer_match_level; pre_attr->chain = attr->chain; pre_attr->prio = attr->prio; - pre_attr->sample_attr = sample_attr; + pre_attr->sample_attr = attr->sample_attr; sample_attr->sampler_id = sample_flow->sampler->sampler_id; pre_esw_attr = pre_attr->esw_attr; pre_esw_attr->in_mdev = esw_attr->in_mdev;
@@ -482,28 +602,23 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, } sample_flow->pre_attr = pre_attr; -return sample_flow->rule; +return sample_flow->post_rule; err_pre_offload_rule: -kfree (sample_attr); -err_alloc_sample_attr:kfree (pre_attr); -err_alloc_flow_attr: +err_alloc_pre_flow_attr:sample_restore_put (tc_psample, sample_flow->restore); err_sample_restore:mapping_remove (esw->offloads.reg_c0_obj_pool, obj_id); err_obj_id:sampler_put (tc_psample, sample_flow->sampler); err_sampler: -/* For sample offload, rule is added in default_tbl. No need to call -* mlx5_esw_chains_put_table() -*/ - attr->prio =0 ; - attr->chain =0 ; -mlx5_eswitch_del_offloaded_rule (esw, sample_flow->rule, attr); -err_offload_rule: -mlx5_esw_vporttbl_put (esw, &per_vport_tbl_attr); -err_default_tbl: +if (!post_act_handle) +del_post_rule (esw, sample_flow, attr); +err_post_rule: +if (post_act_handle) +mlx5e_tc_post_act_del (tc_psample->post_act, post_act_handle); +err_post_act:kfree (sample_flow);return ERR_PTR (err); }
@@ -516,7 +631,6 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;struct mlx5e_sample_flow *sample_flow;struct mlx5_vport_tbl_attr tbl_attr; -struct mlx5_flow_attr *pre_attr;struct mlx5_eswitch *esw;if (IS_ERR_OR_NULL (tc_psample))
@@ -531,28 +645,35 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,return ; } +/* The following delete order can't be changed, otherwise, +* will hit fw syndromes. +*/ sample_flow = attr->sample_attr->sample_flow; - pre_attr = sample_flow->pre_attr; -memset (pre_attr,0 ,sizeof (*pre_attr)); -mlx5_eswitch_del_offloaded_rule (esw, sample_flow->pre_rule, pre_attr); -mlx5_eswitch_del_offloaded_rule (esw, sample_flow->rule, attr); +mlx5_eswitch_del_offloaded_rule (esw, sample_flow->pre_rule, sample_flow->pre_attr); +if (!sample_flow->post_act_handle) +mlx5_eswitch_del_offloaded_rule (esw, sample_flow->post_rule, + sample_flow->post_attr);sample_restore_put (tc_psample, sample_flow->restore);mapping_remove (esw->offloads.reg_c0_obj_pool, attr->sample_attr->restore_obj_id);sampler_put (tc_psample, sample_flow->sampler); - tbl_attr.chain = attr->chain; - tbl_attr.prio = attr->prio; - tbl_attr.vport = esw_attr->in_rep->vport; - tbl_attr.vport_ns = &mlx5_esw_vport_tbl_sample_ns; -mlx5_esw_vporttbl_put (esw, &tbl_attr); +if (sample_flow->post_act_handle) { +mlx5e_tc_post_act_del (tc_psample->post_act, sample_flow->post_act_handle); + }else { + tbl_attr.chain = attr->chain; + tbl_attr.prio = attr->prio; + tbl_attr.vport = esw_attr->in_rep->vport; + tbl_attr.vport_ns = &mlx5_esw_vport_tbl_sample_ns; +mlx5_esw_vporttbl_put (esw, &tbl_attr); +kfree (sample_flow->post_attr); + } -kfree (pre_attr->sample_attr); -kfree (pre_attr); +kfree (sample_flow->pre_attr);kfree (sample_flow); }struct mlx5e_tc_psample * -mlx5e_tc_sample_init (struct mlx5_eswitch *esw) +mlx5e_tc_sample_init (struct mlx5_eswitch *esw,struct mlx5e_post_act *post_act) {struct mlx5e_tc_psample *tc_psample;int err;
@@ -560,17 +681,22 @@ mlx5e_tc_sample_init(struct mlx5_eswitch *esw) tc_psample =kzalloc (sizeof (*tc_psample),GFP_KERNEL );if (!tc_psample)return ERR_PTR (-ENOMEM ); +if (IS_ERR_OR_NULL (post_act)) { + err =PTR_ERR (post_act); + goto err_post_act; + } + tc_psample->post_act = post_act; tc_psample->esw = esw; err =sampler_termtbl_create (tc_psample);if (err) - goto err_termtbl; + goto err_post_act;mutex_init (&tc_psample->ht_lock);mutex_init (&tc_psample->restore_lock);return tc_psample; -err_termtbl: +err_post_act:kfree (tc_psample);return ERR_PTR (err); }
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.h +2 -2
@@ -8,6 +8,7 @@struct mlx5_flow_attr ;struct mlx5e_tc_psample ; +struct mlx5e_post_act ;struct mlx5e_sample_attr {u32 group_num;
@@ -15,7 +16,6 @@ struct mlx5e_sample_attr {u32 trunc_size;u32 restore_obj_id;u32 sampler_id; -struct mlx5_flow_table *sample_default_tbl;struct mlx5e_sample_flow *sample_flow; };
@@ -33,7 +33,7 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *sample_priv, struct mlx5_flow_attr *attr);struct mlx5e_tc_psample * -mlx5e_tc_sample_init (struct mlx5_eswitch *esw); +mlx5e_tc_sample_init (struct mlx5_eswitch *esw,struct mlx5e_post_act *post_act);void mlx5e_tc_sample_cleanup (struct mlx5e_tc_psample *tc_psample);
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -1
@@ -4989,7 +4989,7 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht) uplink_priv->post_act);#if IS_ENABLED (CONFIG_MLX5_TC_SAMPLE ) - uplink_priv->tc_psample =mlx5e_tc_sample_init (esw); + uplink_priv->tc_psample =mlx5e_tc_sample_init (esw, uplink_priv->post_act);#endif mapping_id =mlx5_query_nic_system_image_guid (esw->dev);
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +1 -4
@@ -540,10 +540,7 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,if (flow_act.action &MLX5_FLOW_CONTEXT_ACTION_MOD_HDR ) flow_act.modify_hdr = attr->modify_hdr; -/* sample_attr is allocated only when there is a sample action */ -if (attr->sample_attr && attr->sample_attr->sample_default_tbl) { - fdb = attr->sample_attr->sample_default_tbl; - }else if (split) { +if (split) { fwd_attr.chain = attr->chain; fwd_attr.prio = attr->prio; fwd_attr.vport = esw_attr->in_rep->vport;
Signature · 1 line
2.31.1
PATCH 11/15 net/mlx5: E-switch, Enable devlink port tx_{share|max} rate control
In reply to Saeed MahameedFrom: Dmytro Linkin <[email protected]>
Register devlink rate leaf object for every eswitch vport. Implement devlink ops that enable setting shared and max tx rates through devlink API.
Extract common eswitch code from existing tx rate set function that is accessed through NDO to be reused for the devlink. Values configured with NDO API are not visible for the devlink API, therefore shouldn't be used simultaneously.
When normalizing the BW share value, dividing the desired minimum rate by the common divider results in losing information since the quotient is rounded down. This has a significant affect on configurations of low rate where the round down eliminates a large percentage of the total rate. To improve the formula, round up the division result to make sure that the BW share is at least the value it was supposed to be and won't lost a significant amount of the expected value.
--- .../net/ethernet/mellanox/mlx5/core/devlink.c | 3 + .../mellanox/mlx5/core/esw/devlink_port.c | 22 +++ .../ethernet/mellanox/mlx5/core/esw/legacy.c | 4 +- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 141 +++++++++++++++--- .../net/ethernet/mellanox/mlx5/core/esw/qos.h | 14 +- 5 files changed, 157 insertions(+), 27 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +3 -0
@@ -7,6 +7,7 @@#include "fw_reset.h" #include "fs_core.h" #include "eswitch.h" +#include "esw/qos.h" #include "sf/dev/dev.h" #include "sf/sf.h"
@@ -292,6 +293,8 @@ static const struct devlink_ops mlx5_devlink_ops = { .eswitch_encap_mode_get = mlx5_devlink_eswitch_encap_mode_get, .port_function_hw_addr_get = mlx5_devlink_port_function_hw_addr_get, .port_function_hw_addr_set = mlx5_devlink_port_function_hw_addr_set, + .rate_leaf_tx_share_set = mlx5_esw_devlink_rate_leaf_tx_share_set, + .rate_leaf_tx_max_set = mlx5_esw_devlink_rate_leaf_tx_max_set,#endif #ifdef CONFIG_MLX5_SF_MANAGER .port_new = mlx5_devlink_sf_port_new,
drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +22 -0
@@ -91,9 +91,15 @@ int mlx5_esw_offloads_devlink_port_register(struct mlx5_eswitch *esw, u16 vport_if (err) goto reg_err; + err =devlink_rate_leaf_create (dl_port, vport); +if (err) + goto rate_err; + vport->dl_port = dl_port;return 0 ; +rate_err: +devlink_port_unregister (dl_port); reg_err:mlx5_esw_dl_port_free (dl_port);return err;
@@ -109,6 +115,10 @@ void mlx5_esw_offloads_devlink_port_unregister(struct mlx5_eswitch *esw, u16 vpo vport =mlx5_eswitch_get_vport (esw, vport_num);if (IS_ERR (vport))return ; + +if (vport->dl_port->devlink_rate) +devlink_rate_leaf_destroy (vport->dl_port); +devlink_port_unregister (vport->dl_port);mlx5_esw_dl_port_free (vport->dl_port); vport->dl_port =NULL ;
@@ -148,8 +158,16 @@ int mlx5_esw_devlink_sf_port_register(struct mlx5_eswitch *esw, struct devlink_pif (err)return err; + err =devlink_rate_leaf_create (dl_port, vport); +if (err) + goto rate_err; + vport->dl_port = dl_port;return 0 ; + +rate_err: +devlink_port_unregister (dl_port); +return err; }void mlx5_esw_devlink_sf_port_unregister (struct mlx5_eswitch *esw,u16 vport_num)
@@ -159,6 +177,10 @@ void mlx5_esw_devlink_sf_port_unregister(struct mlx5_eswitch *esw, u16 vport_num vport =mlx5_eswitch_get_vport (esw, vport_num);if (IS_ERR (vport))return ; + +if (vport->dl_port->devlink_rate) +devlink_rate_leaf_destroy (vport->dl_port); +devlink_port_unregister (vport->dl_port); vport->dl_port =NULL ; }
drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c +3 -1
@@ -522,7 +522,9 @@ int mlx5_eswitch_set_vport_rate(struct mlx5_eswitch *esw, u16 vport,return PTR_ERR (evport);mutex_lock (&esw->state_lock); - err =mlx5_esw_qos_set_vport_rate (esw, evport, max_rate, min_rate); + err =mlx5_esw_qos_set_vport_min_rate (esw, evport, min_rate,NULL ); +if (!err) + err =mlx5_esw_qos_set_vport_max_rate (esw, evport, max_rate,NULL );mutex_unlock (&esw->state_lock);return err; }
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +117 -24
199 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h +12 -2
@@ -6,14 +6,24 @@#ifdef CONFIG_MLX5_ESWITCH -int mlx5_esw_qos_set_vport_rate (struct mlx5_eswitch *esw,struct mlx5_vport *evport, -u32 max_rate,u32 min_rate); +int mlx5_esw_qos_set_vport_min_rate (struct mlx5_eswitch *esw, +struct mlx5_vport *evport, +u32 min_rate, +struct netlink_ext_ack *extack); +int mlx5_esw_qos_set_vport_max_rate (struct mlx5_eswitch *esw, +struct mlx5_vport *evport, +u32 max_rate, +struct netlink_ext_ack *extack);void mlx5_esw_qos_create (struct mlx5_eswitch *esw);void mlx5_esw_qos_destroy (struct mlx5_eswitch *esw);int mlx5_esw_qos_vport_enable (struct mlx5_eswitch *esw,struct mlx5_vport *vport,u32 max_rate,u32 bw_share);void mlx5_esw_qos_vport_disable (struct mlx5_eswitch *esw,struct mlx5_vport *vport); +int mlx5_esw_devlink_rate_leaf_tx_share_set (struct devlink_rate *rate_leaf,void *priv, +u64 tx_share,struct netlink_ext_ack *extack); +int mlx5_esw_devlink_rate_leaf_tx_max_set (struct devlink_rate *rate_leaf,void *priv, +u64 tx_max,struct netlink_ext_ack *extack);#endif #endif
Signature · 1 line
2.31.1
PATCH 12/15 net/mlx5: E-switch, Introduce rate limiting groups API
In reply to Saeed MahameedFrom: Dmytro Linkin <[email protected]>
Extend eswitch API with rate limiting groups:
- Define new struct mlx5_esw_rate_group that is used to hold all internal group data.
- Implement functions that allow creation, destruction and cleanup of groups.
- Assign all vports to internal unlimited zero group by default.
This commit lays the groundwork for group rate limiting by implementing devlink_ops->rate_node_{new|del}() callbacks to support creating and deleting groups through devlink rate node objects. APIs that allows setting rates and adding/removing members are implemented in following patches.
--- .../net/ethernet/mellanox/mlx5/core/devlink.c | 2 + .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 141 +++++++++++++++++- .../net/ethernet/mellanox/mlx5/core/esw/qos.h | 4 + .../net/ethernet/mellanox/mlx5/core/eswitch.h | 1 + include/linux/mlx5/mlx5_ifc.h | 3 +- 5 files changed, 145 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +2 -0
@@ -295,6 +295,8 @@ static const struct devlink_ops mlx5_devlink_ops = { .port_function_hw_addr_set = mlx5_devlink_port_function_hw_addr_set, .rate_leaf_tx_share_set = mlx5_esw_devlink_rate_leaf_tx_share_set, .rate_leaf_tx_max_set = mlx5_esw_devlink_rate_leaf_tx_max_set, + .rate_node_new = mlx5_esw_devlink_rate_node_new, + .rate_node_del = mlx5_esw_devlink_rate_node_del,#endif #ifdef CONFIG_MLX5_SF_MANAGER .port_new = mlx5_devlink_sf_port_new,
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +136 -5
186 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h +4 -0
@@ -24,6 +24,10 @@ int mlx5_esw_devlink_rate_leaf_tx_share_set(struct devlink_rate *rate_leaf, void u64 tx_share, struct netlink_ext_ack *extack);int mlx5_esw_devlink_rate_leaf_tx_max_set (struct devlink_rate *rate_leaf,void *priv,u64 tx_max,struct netlink_ext_ack *extack); +int mlx5_esw_devlink_rate_node_new (struct devlink_rate *rate_node,void **priv, +struct netlink_ext_ack *extack); +int mlx5_esw_devlink_rate_node_del (struct devlink_rate *rate_node,void *priv, +struct netlink_ext_ack *extack);#endif #endif
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +1 -0
@@ -306,6 +306,7 @@ struct mlx5_eswitch {struct {bool enabled;u32 root_tsar_ix; +struct mlx5_esw_rate_group *group0; } qos;struct mlx5_esw_bridge_offloads *br_offloads;
include/linux/mlx5/mlx5_ifc.h +2 -1
@@ -865,7 +865,8 @@ struct mlx5_ifc_qos_cap_bits {u8 nic_bw_share[0x1 ];u8 nic_rate_limit[0x1 ];u8 packet_pacing_uid[0x1 ]; -u8 reserved_at_c[0x14 ]; +u8 log_esw_max_sched_depth[0x4 ]; +u8 reserved_at_10[0x10 ];u8 reserved_at_20[0xb ];u8 log_max_qos_nic_queue_group[0x5 ];
Signature · 1 line
2.31.1
PATCH 13/15 net/mlx5: E-switch, Allow setting share/max tx rate limits of rate groups
In reply to Saeed MahameedFrom: Dmytro Linkin <[email protected]>
Provide eswitch API to allow controlling group rate limits. Use it to implement devlink_ops->mlx5_devlink_rate_node_tx_{share|max}_set().
The share rate will create relative bandwidth share on the groups level while within the group the user can set shared rate on the member vports of that group and this rate will be relative to the group's share rate. The group with the highest shared rate will get a BW share of 100 and the rest of the groups will get a value that reflects the ratio between their share rate and the maximum share rate.
Example:
Created four rate groups with tx_share limits:
$ devlink port function rate add \
pci/0000:06:00.0/group_1 tx_share 30gbit
$ devlink port function rate add \
pci/0000:06:00.0/group_2 tx_share 20gbit
$ devlink port function rate add \
pci/0000:06:00.0/group_3 tx_share 20gbit
$ devlink port function rate add \
pci/0000:06:00.0/group_4 tx_share 10gbitAssuming link speed is 50 Gbit/sec ratio divider will be 50 / (30+20+20+10) = 0.625. Normalized rate values for the groups:
<group_1> 30 * 0.625 = 18.75 Gbit/sec
<group_2> 20 * 0.625 = 12.5 Gbit/sec
<group_3> 20 * 0.625 = 12.5 Gbit/sec
<group_4> 10 * 0.625 = 6.25 Gbit/sec
Rate group with unlimited tx_share rate will receive minimum BW value (1Mbit/sec) if presented any group with tx_share rate limit. This allow to not drop all packets in case of heavy traffic.
--- .../net/ethernet/mellanox/mlx5/core/devlink.c | 2 + .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 257 +++++++++++++++--- .../net/ethernet/mellanox/mlx5/core/esw/qos.h | 4 + .../net/ethernet/mellanox/mlx5/core/eswitch.h | 1 + 4 files changed, 225 insertions(+), 39 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +2 -0
@@ -295,6 +295,8 @@ static const struct devlink_ops mlx5_devlink_ops = { .port_function_hw_addr_set = mlx5_devlink_port_function_hw_addr_set, .rate_leaf_tx_share_set = mlx5_esw_devlink_rate_leaf_tx_share_set, .rate_leaf_tx_max_set = mlx5_esw_devlink_rate_leaf_tx_max_set, + .rate_node_tx_share_set = mlx5_esw_devlink_rate_node_tx_share_set, + .rate_node_tx_max_set = mlx5_esw_devlink_rate_node_tx_max_set, .rate_node_new = mlx5_esw_devlink_rate_node_new, .rate_node_del = mlx5_esw_devlink_rate_node_del,#endif
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +218 -39
364 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h +4 -0
@@ -24,6 +24,10 @@ int mlx5_esw_devlink_rate_leaf_tx_share_set(struct devlink_rate *rate_leaf, void u64 tx_share, struct netlink_ext_ack *extack);int mlx5_esw_devlink_rate_leaf_tx_max_set (struct devlink_rate *rate_leaf,void *priv,u64 tx_max,struct netlink_ext_ack *extack); +int mlx5_esw_devlink_rate_node_tx_share_set (struct devlink_rate *rate_node,void *priv, +u64 tx_share,struct netlink_ext_ack *extack); +int mlx5_esw_devlink_rate_node_tx_max_set (struct devlink_rate *rate_node,void *priv, +u64 tx_max,struct netlink_ext_ack *extack);int mlx5_esw_devlink_rate_node_new (struct devlink_rate *rate_node,void **priv,struct netlink_ext_ack *extack); int mlx5_esw_devlink_rate_node_del(struct devlink_rate *rate_node, void *priv,
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +1 -0
@@ -307,6 +307,7 @@ struct mlx5_eswitch {bool enabled;u32 root_tsar_ix;struct mlx5_esw_rate_group *group0; +struct list_head groups;/* Protected by esw->state_lock */ } qos;struct mlx5_esw_bridge_offloads *br_offloads;
Signature · 1 line
2.31.1
PATCH 14/15 net/mlx5: E-switch, Allow to add vports to rate groups
In reply to Saeed MahameedFrom: Dmytro Linkin <[email protected]>
Implement eswitch API that allows updating rate groups. If group pointer is NULL, then move the vport to internal unlimited group zero.
Implement devlink_ops->rate_parent_node_set() callback in the terms of the new eswitch group update API.
Enable QoS for all group's elements if a group has allocated BW share.
--- .../net/ethernet/mellanox/mlx5/core/devlink.c | 1 + .../mellanox/mlx5/core/esw/devlink_port.c | 8 +- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 206 ++++++++++++++++-- .../net/ethernet/mellanox/mlx5/core/esw/qos.h | 4 + .../net/ethernet/mellanox/mlx5/core/eswitch.h | 5 + 5 files changed, 199 insertions(+), 25 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +1 -0
@@ -299,6 +299,7 @@ static const struct devlink_ops mlx5_devlink_ops = { .rate_node_tx_max_set = mlx5_esw_devlink_rate_node_tx_max_set, .rate_node_new = mlx5_esw_devlink_rate_node_new, .rate_node_del = mlx5_esw_devlink_rate_node_del, + .rate_leaf_parent_set = mlx5_esw_devlink_rate_parent_set,#endif #ifdef CONFIG_MLX5_SF_MANAGER .port_new = mlx5_devlink_sf_port_new,
drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +6 -2
@@ -116,8 +116,10 @@ void mlx5_esw_offloads_devlink_port_unregister(struct mlx5_eswitch *esw, u16 vpoif (IS_ERR (vport))return ; -if (vport->dl_port->devlink_rate) +if (vport->dl_port->devlink_rate) { +mlx5_esw_qos_vport_update_group (esw, vport,NULL ,NULL );devlink_rate_leaf_destroy (vport->dl_port); + }devlink_port_unregister (vport->dl_port);mlx5_esw_dl_port_free (vport->dl_port);
@@ -178,8 +180,10 @@ void mlx5_esw_devlink_sf_port_unregister(struct mlx5_eswitch *esw, u16 vport_numif (IS_ERR (vport))return ; -if (vport->dl_port->devlink_rate) +if (vport->dl_port->devlink_rate) { +mlx5_esw_qos_vport_update_group (esw, vport,NULL ,NULL );devlink_rate_leaf_destroy (vport->dl_port); + }devlink_port_unregister (vport->dl_port); vport->dl_port =NULL ;
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +183 -23
304 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h +4 -0
@@ -32,6 +32,10 @@ int mlx5_esw_devlink_rate_node_new(struct devlink_rate *rate_node, void **priv, struct netlink_ext_ack *extack);int mlx5_esw_devlink_rate_node_del (struct devlink_rate *rate_node,void *priv,struct netlink_ext_ack *extack); +int mlx5_esw_devlink_rate_parent_set (struct devlink_rate *devlink_rate, +struct devlink_rate *parent, +void *priv,void *parent_priv, +struct netlink_ext_ack *extack);#endif #endif
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +5 -0
@@ -177,6 +177,7 @@ struct mlx5_vport {u32 bw_share;u32 min_rate;u32 max_rate; +struct mlx5_esw_rate_group *group; } qos;u16 vport;
@@ -356,6 +357,10 @@ int mlx5_eswitch_set_vport_trust(struct mlx5_eswitch *esw, u16 vport_num, bool setting);int mlx5_eswitch_set_vport_rate (struct mlx5_eswitch *esw,u16 vport,u32 max_rate,u32 min_rate); +int mlx5_esw_qos_vport_update_group (struct mlx5_eswitch *esw, +struct mlx5_vport *vport, +struct mlx5_esw_rate_group *group, +struct netlink_ext_ack *extack);int mlx5_eswitch_set_vepa (struct mlx5_eswitch *esw,u8 setting);int mlx5_eswitch_get_vepa (struct mlx5_eswitch *esw,u8 *setting); int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
Signature · 1 line
2.31.1
PATCH 15/15 net/mlx5: E-switch, Add QoS tracepoints
In reply to Saeed MahameedFrom: Dmytro Linkin <[email protected]>
Add tracepoints to log QoS enabling/disabling/configuration for vports and rate groups.
--- .../device_drivers/ethernet/mellanox/mlx5.rst | 44 +++++++ .../mlx5/core/esw/diag/qos_tracepoint.h | 123 ++++++++++++++++++ .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 13 +- 3 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h
Documentation/networking/device_drivers/ethernet/mellanox/mlx5.rst +44 -0
@@ -656,3 +656,47 @@ Bridge offloads tracepoints: $ cat /sys/kernel/debug/tracing/trace ... ip-5387 [000] ...1 573713: mlx5_esw_bridge_vport_cleanup: vport_num=1 + +Eswitch QoS tracepoints: + +- mlx5_esw_vport_qos_create: trace creation of transmit scheduler arbiter for vport:: + + $ echo mlx5:mlx5_esw_vport_qos_create >> /sys/kernel/debug/tracing/set_event + $ cat /sys/kernel/debug/tracing/trace + ... + <...>-23496 [018] .... 73136.838831: mlx5_esw_vport_qos_create: (0000:82:00.0) vport=2 tsar_ix=4 bw_share=0, max_rate=0 group=000000007b576bb3 + +- mlx5_esw_vport_qos_config: trace configuration of transmit scheduler arbiter for vport:: + + $ echo mlx5:mlx5_esw_vport_qos_config >> /sys/kernel/debug/tracing/set_event + $ cat /sys/kernel/debug/tracing/trace + ... + <...>-26548 [023] .... 75754.223823: mlx5_esw_vport_qos_config: (0000:82:00.0) vport=1 tsar_ix=3 bw_share=34, max_rate=10000 group=000000007b576bb3 + +- mlx5_esw_vport_qos_destroy: trace deletion of transmit scheduler arbiter for vport:: + + $ echo mlx5:mlx5_esw_vport_qos_destroy >> /sys/kernel/debug/tracing/set_event + $ cat /sys/kernel/debug/tracing/trace + ... + <...>-27418 [004] .... 76546.680901: mlx5_esw_vport_qos_destroy: (0000:82:00.0) vport=1 tsar_ix=3 + +- mlx5_esw_group_qos_create: trace creation of transmit scheduler arbiter for rate group:: + + $ echo mlx5:mlx5_esw_group_qos_create >> /sys/kernel/debug/tracing/set_event + $ cat /sys/kernel/debug/tracing/trace + ... + <...>-26578 [008] .... 75776.022112: mlx5_esw_group_qos_create: (0000:82:00.0) group=000000008dac63ea tsar_ix=5 + +- mlx5_esw_group_qos_config: trace configuration of transmit scheduler arbiter for rate group:: + + $ echo mlx5:mlx5_esw_group_qos_config >> /sys/kernel/debug/tracing/set_event + $ cat /sys/kernel/debug/tracing/trace + ... + <...>-27303 [020] .... 76461.455356: mlx5_esw_group_qos_config: (0000:82:00.0) group=000000008dac63ea tsar_ix=5 bw_share=100 max_rate=20000 + +- mlx5_esw_group_qos_destroy: trace deletion of transmit scheduler arbiter for group:: + + $ echo mlx5:mlx5_esw_group_qos_destroy >> /sys/kernel/debug/tracing/set_event + $ cat /sys/kernel/debug/tracing/trace + ... + <...>-27418 [006] .... 76547.187258: mlx5_esw_group_qos_destroy: (0000:82:00.0) group=000000007b576bb3 tsar_ix=1
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h new file +123 -0
123 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +12 -1
@@ -4,6 +4,8 @@#include "eswitch.h" #include "esw/qos.h" #include "en/port.h" +#define CREATE_TRACE_POINTS +#include "diag/qos_tracepoint.h" /* Minimum supported BW share value by the HW is 1 Mbit/sec */ #define MLX5_MIN_BW_SHARE 1
@@ -54,6 +56,8 @@ static int esw_qos_group_config(struct mlx5_eswitch *esw, struct mlx5_esw_rate_gif (err)NL_SET_ERR_MSG_MOD (extack,"E-Switch modify group TSAR element failed" ); +trace_mlx5_esw_group_qos_config (dev, group, group->tsar_ix, bw_share, max_rate); +return err; }
@@ -89,6 +93,8 @@ static int esw_qos_vport_config(struct mlx5_eswitch *esw,return err; } +trace_mlx5_esw_vport_qos_config (vport, bw_share, max_rate); +return 0 ; }
@@ -461,6 +467,7 @@ esw_qos_create_rate_group(struct mlx5_eswitch *esw, struct netlink_ext_ack *exta goto err_min_rate; } } +trace_mlx5_esw_group_qos_create (esw->dev, group, group->tsar_ix);return group;
@@ -496,6 +503,7 @@ static int esw_qos_destroy_rate_group(struct mlx5_eswitch *esw,if (err)NL_SET_ERR_MSG_MOD (extack,"E-Switch destroy TSAR_ID failed" ); +trace_mlx5_esw_group_qos_destroy (esw->dev, group, group->tsar_ix);kfree (group);return err; }
@@ -613,8 +621,10 @@ int mlx5_esw_qos_vport_enable(struct mlx5_eswitch *esw, struct mlx5_vport *vport vport->qos.group = esw->qos.group0; err =esw_qos_vport_create_sched_element (esw, vport, max_rate, bw_share); -if (!err) +if (!err) { vport->qos.enabled = true; +trace_mlx5_esw_vport_qos_create (vport, bw_share, max_rate); + }return err; }
@@ -637,6 +647,7 @@ void mlx5_esw_qos_vport_disable(struct mlx5_eswitch *esw, struct mlx5_vport *vpo vport->vport, err); vport->qos.enabled = false; +trace_mlx5_esw_vport_qos_destroy (vport); }int mlx5_esw_qos_modify_vport_rate (struct mlx5_eswitch *esw,u16 vport_num,u32 rate_mbps)
Signature · 1 line
2.31.1
Re: [net-next 01/15] net/mlx5e: Remove mlx5e dependency from E-Switch sample
In reply to Saeed MahameedThis series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 10 lines · On Thu, 19 Aug 2021 21:55:01 -0700 you wrote:
From: Saeed Mahameed <[email protected]>
mlx5/esw/sample.cdoesn't really needmlx5e_privobject, we can remove this redundant dependency by passing the eswitch object directly to the sample object constructor.Signed-off-by Saeed Mahameed <[email protected]>Reviewed-by Roi Dayan <[email protected]>[...]
Here is the summary with links:
- [net-next,01/15] net/mlx5e: Remove mlx5e dependency from E-Switch sample
https://git.kernel.org/netdev/net-next/c/5024fa95a144 - [net-next,02/15] net/mlx5e: Move esw/sample to en/tc/sample https://git.kernel.org/netdev/net-next/c/0027d70c73c9 - [net-next,03/15] net/mlx5e: Move sample attribute to flow attribute https://git.kernel.org/netdev/net-next/c/bcd6740c6b6d - [net-next,04/15] net/mlx5e: CT, Use xarray to manage fte ids https://git.kernel.org/netdev/net-next/c/2799797845db - [net-next,05/15] net/mlx5e: Introduce post action infrastructure https://git.kernel.org/netdev/net-next/c/6f0b692a5aa9 - [net-next,06/15] net/mlx5e: Refactor ct to use post action infrastructure https://git.kernel.org/netdev/net-next/c/f0da4daa3413 - [net-next,07/15] net/mlx5e: TC, Remove CONFIG_NET_TC_SKB_EXT dependency when restoring tunnel https://git.kernel.org/netdev/net-next/c/d12e20ac0661 - [net-next,08/15] net/mlx5e: TC, Restore tunnel info for sample offload https://git.kernel.org/netdev/net-next/c/ee950e5db1b9 - [net-next,09/15] net/mlx5e: TC, Support sample offload action for tunneled traffic https://git.kernel.org/netdev/net-next/c/2741f2230905 - [net-next,10/15] net/mlx5: E-switch, Move QoS related code to dedicated file https://git.kernel.org/netdev/net-next/c/2d116e3e7e49 - [net-next,11/15] net/mlx5: E-switch, Enable devlink port tx_{share|max} rate control https://git.kernel.org/netdev/net-next/c/ad34f02fe2c9 - [net-next,12/15] net/mlx5: E-switch, Introduce rate limiting groups API https://git.kernel.org/netdev/net-next/c/1ae258f8b343 - [net-next,13/15] net/mlx5: E-switch, Allow setting share/max tx rate limits of rate groups https://git.kernel.org/netdev/net-next/c/f47e04eb96e0 - [net-next,14/15] net/mlx5: E-switch, Allow to add vports to rate groups https://git.kernel.org/netdev/net-next/c/0fe132eac38c - [net-next,15/15] net/mlx5: E-switch, Add QoS tracepoints https://git.kernel.org/netdev/net-next/c/3202ea65f85c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html