Skip to content

Commit ea3100a

Browse files
committed
Merge tag 'mlx5-GRE-Offload' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== mlx5-updates-2017-08-31 (GRE Offloads support) This series provides the support for MPLS RSS and GRE TX offloads and RSS support. The first patch from Gal and Ariel provides the mlx5 driver support for ConnectX capability to perform IP version identification and matching in order to distinguish between IPv4 and IPv6 without the need to specify the encapsulation type, thus perform RSS in MPLS automatically without specifying MPLS ethertyoe. This patch will also serve for inner GRE IPv4/6 classification for inner GRE RSS. 2nd patch from Gal, Adds the TX offloads support for GRE tunneled packets, by reporting the needed netdev features. 3rd patch from Gal, Adds GRE inner RSS support by creating the needed device resources (Steering Tables/rules and traffic classifiers) to Match GRE traffic and perform RSS hashing on the inner headers. Improvement: Testing 8 TCP streams bandwidth over GRE: System: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz NIC: Mellanox Technologies MT28800 Family [ConnectX-5 Ex] Before: 21.3 Gbps (Single RQ) Now : 90.5 Gbps (RSS spread on 8 RQs) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents acfb98b + 7b3722f commit ea3100a

6 files changed

Lines changed: 384 additions & 40 deletions

File tree

‎drivers/net/ethernet/mellanox/mlx5/core/en.h‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,12 @@ enum mlx5e_traffic_types {
620620
MLX5E_NUM_INDIR_TIRS = MLX5E_TT_ANY,
621621
};
622622

623+
enum mlx5e_tunnel_types {
624+
MLX5E_TT_IPV4_GRE,
625+
MLX5E_TT_IPV6_GRE,
626+
MLX5E_NUM_TUNNEL_TT,
627+
};
628+
623629
enum {
624630
MLX5E_STATE_ASYNC_EVENTS_ENABLED,
625631
MLX5E_STATE_OPENED,
@@ -679,6 +685,7 @@ struct mlx5e_l2_table {
679685
struct mlx5e_ttc_table {
680686
struct mlx5e_flow_table ft;
681687
struct mlx5_flow_handle *rules[MLX5E_NUM_TT];
688+
struct mlx5_flow_handle *tunnel_rules[MLX5E_NUM_TUNNEL_TT];
682689
};
683690

684691
#define ARFS_HASH_SHIFT BITS_PER_BYTE
@@ -711,6 +718,7 @@ enum {
711718
MLX5E_VLAN_FT_LEVEL = 0,
712719
MLX5E_L2_FT_LEVEL,
713720
MLX5E_TTC_FT_LEVEL,
721+
MLX5E_INNER_TTC_FT_LEVEL,
714722
MLX5E_ARFS_FT_LEVEL
715723
};
716724

@@ -736,6 +744,7 @@ struct mlx5e_flow_steering {
736744
struct mlx5e_vlan_table vlan;
737745
struct mlx5e_l2_table l2;
738746
struct mlx5e_ttc_table ttc;
747+
struct mlx5e_ttc_table inner_ttc;
739748
struct mlx5e_arfs_tables arfs;
740749
};
741750

@@ -769,6 +778,7 @@ struct mlx5e_priv {
769778
u32 tisn[MLX5E_MAX_NUM_TC];
770779
struct mlx5e_rqt indir_rqt;
771780
struct mlx5e_tir indir_tir[MLX5E_NUM_INDIR_TIRS];
781+
struct mlx5e_tir inner_indir_tir[MLX5E_NUM_INDIR_TIRS];
772782
struct mlx5e_tir direct_tir[MLX5E_MAX_NUM_CHANNELS];
773783
u32 tx_rates[MLX5E_MAX_NUM_SQS];
774784
int hard_mtu;
@@ -903,7 +913,7 @@ int mlx5e_redirect_rqt(struct mlx5e_priv *priv, u32 rqtn, int sz,
903913
struct mlx5e_redirect_rqt_param rrp);
904914
void mlx5e_build_indir_tir_ctx_hash(struct mlx5e_params *params,
905915
enum mlx5e_traffic_types tt,
906-
void *tirc);
916+
void *tirc, bool inner);
907917

908918
int mlx5e_open_locked(struct net_device *netdev);
909919
int mlx5e_close_locked(struct net_device *netdev);
@@ -932,6 +942,12 @@ void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params,
932942
void mlx5e_set_rq_type_params(struct mlx5_core_dev *mdev,
933943
struct mlx5e_params *params, u8 rq_type);
934944

945+
static inline bool mlx5e_tunnel_inner_ft_supported(struct mlx5_core_dev *mdev)
946+
{
947+
return (MLX5_CAP_ETH(mdev, tunnel_stateless_gre) &&
948+
MLX5_CAP_FLOWTABLE_NIC_RX(mdev, ft_field_support.inner_ip_version));
949+
}
950+
935951
static inline
936952
struct mlx5e_tx_wqe *mlx5e_post_nop(struct mlx5_wq_cyc *wq, u32 sqn, u16 *pc)
937953
{

‎drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,9 +1212,18 @@ static void mlx5e_modify_tirs_hash(struct mlx5e_priv *priv, void *in, int inlen)
12121212

12131213
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
12141214
memset(tirc, 0, ctxlen);
1215-
mlx5e_build_indir_tir_ctx_hash(&priv->channels.params, tt, tirc);
1215+
mlx5e_build_indir_tir_ctx_hash(&priv->channels.params, tt, tirc, false);
12161216
mlx5_core_modify_tir(mdev, priv->indir_tir[tt].tirn, in, inlen);
12171217
}
1218+
1219+
if (!mlx5e_tunnel_inner_ft_supported(priv->mdev))
1220+
return;
1221+
1222+
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
1223+
memset(tirc, 0, ctxlen);
1224+
mlx5e_build_indir_tir_ctx_hash(&priv->channels.params, tt, tirc, true);
1225+
mlx5_core_modify_tir(mdev, priv->inner_indir_tir[tt].tirn, in, inlen);
1226+
}
12181227
}
12191228

12201229
static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,

0 commit comments

Comments
 (0)