Mellanox, mlx5e updates 2018-06-01
Subsystems (5)
Hi dave,
Sorry for the extra 2 patches in this series, but mostly the series contains small patches and some fixes to previous patches in this submission window, with one main patch from Tariq to improve legacy RQ buffer management, for more information please refer to that tag log below.
Please pull and let me know if there's any problem.
Thanks,
Saeed.
---
The following changes since commit 21ad1173589ef63a93f94e05c879393e2c27588c:
Merge branch 'hns3-next' (2018-06-01 14:23:59 -0400)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5e-updates-2018-06-01
for you to fetch changes up to f65a59ffbcc26135e225058b2e6cd49ab9f9f13f:
net/mlx5e: TX, Separate cachelines of xmit and completion stats (2018-06-01 16:48:15 -0700)
----------------------------------------------------------------
mlx5e-updates-2018-06-01
1) From Tariq, Two patches to Fix IPoIB issues introduced in "net/mlx5e: TX, Use actual WQE size for SQ edge fill"
2) From Eran, Additional improvements to mlx5e statistics reporting
3) From Maor, Increase aRFS flow tables size
4) From Adi, Support MTU change for ethernet representors
5) From Ilan and Adi, Handle QP error events in FPGA
6) From Tariq, last 10 patches mainly deals with RX buffer scheme improvements for legacy RQ to use only order-0 pages and fragmented SKBs for large MTUs.
- Tariq starts with some refactoring and removing HW LRO support from traditional (legacy) RQ, since it complicates the buffer scheme and removing it makes it smoother to move to cyclic descriptor buffer for traditional RQ.
- Use cyclic WQ in legacy RQ, which has many benefits and paves the way for fragmented SKBs for large MTUs.
- Enhance legacy Receive Queue memory scheme, such that only order-0 pages are used. Whenever possible, prefer using a linear SKB, and build it wrapping the WQE buffer. Otherwise (for example, jumbo frames on x86), use non-linear SKB, with as many frags as needed. In this case, multiple WQE scatter entries are used, up to a maximum of 4 frags and 10KB of MTU.
- TX statistics access improvements.
----------------------------------------------------------------
Adi Nissim (1):
net/mlx5e: Support configurable MTU for vport representors
Eran Ben Elisha (2):
net/mlx5e: Present SW stats when state is not opened net/mlx5e: Remove redundant active_channels indication
Ilan Tayari (1):
net/mlx5: FPGA, Handle QP error event
Maor Gottlieb (1):
net/mlx5e: Increase aRFS flow tables size
Tariq Toukan (12):
net/mlx5e: IPOIB, Fix overflowing SQ WQE memset net/mlx5e: IPOIB, Add a missing skb_pull
net/mlx5e: TX, Obsolete maintaining local copies of skb->len/data net/mlx5e: RX, Generalise name of non-linear SKB head size net/mlx5e: RX, Generalise function of SKB frag addition net/mlx5e: RX, Dedicate a function for copying SKB header net/mlx5e: RX, Remove HW LRO support in legacy RQ net/mlx5e: RX, Split WQ objects for different RQ types net/mlx5e: RX, Use cyclic WQ in legacy RQ
net/mlx5e: RX, Enhance legacy Receive Queue memory scheme net/mlx5e: RX, Always prefer Linear SKB configuration net/mlx5e: TX, Separate cachelines of xmit and completion stats
drivers/net/ethernet/mellanox/mlx5/core/en.h | 62 ++- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 + drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 469 +++++++++++++++------ drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 22 +- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 359 ++++++++++------ .../net/ethernet/mellanox/mlx5/core/en_selftest.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 23 +- drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 9 +- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 47 +-- .../net/ethernet/mellanox/mlx5/core/fpga/core.c | 28 +- drivers/net/ethernet/mellanox/mlx5/core/wq.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/wq.h | 55 ++- 13 files changed, 726 insertions(+), 360 deletions(-)
PATCH 1/17 net/mlx5e: IPOIB, Fix overflowing SQ WQE memset
From: Tariq Toukan <[email protected]>
IPoIB WQE size is larger than a single WQEBB. Must not fetch the WQE, and surely not memset it, until it is guaranteed that there are enough WQEBBs available before getting to SQ/frag edge.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +3 -3
@@ -653,8 +653,6 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,int num_dma;__be16 mss; -mlx5i_sq_fetch_wqe (sq, &wqe, &pi); -/* Calc ihs and ds cnt, no writes to wqe yet */ ds_cnt =sizeof (*wqe) /MLX5_SEND_WQE_DS ;if (skb_is_gso (skb)) {
@@ -686,10 +684,12 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, num_wqebbs =DIV_ROUND_UP (ds_cnt,MLX5_SEND_WQEBB_NUM_DS ); frag_pi =mlx5_wq_cyc_ctr2fragix (wq, sq->pc);if (unlikely (frag_pi + num_wqebbs >mlx5_wq_cyc_get_frag_size (wq))) { + pi =mlx5_wq_cyc_ctr2ix (wq, sq->pc);mlx5e_fill_sq_frag_edge (sq, wq, pi, frag_pi); -mlx5i_sq_fetch_wqe (sq, &wqe, &pi); } +mlx5i_sq_fetch_wqe (sq, &wqe, &pi); +/* fill wqe */ wi = &sq->db.wqe_info[pi]; cseg = &wqe->ctrl;
Signature · 1 line
2.17.0
PATCH 2/17 net/mlx5e: IPOIB, Add a missing skb_pull
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
A call to mlx5e_tx_skb_pull_inline was mistakenly dropped in the cited patch. Get it back.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +1 -0
@@ -705,6 +705,7 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,if (ihs) {memcpy (eseg->inline_hdr.start, skb_data, ihs); +mlx5e_tx_skb_pull_inline (&skb_data, &skb_len, ihs); eseg->inline_hdr.sz =cpu_to_be16 (ihs); dseg += ds_cnt_inl; }
Signature · 1 line
2.17.0
PATCH 3/17 net/mlx5e: Present SW stats when state is not opened
In reply to Saeed MahameedFrom: Eran Ben Elisha <[email protected]>
The driver can present all SW stats even when the state not opened. Fixed get strings, count and stats to support it.
In addition, fix tc2txq to hold a static mapping which doesn't depend on the amount of open channels, and cannot have the same value on two different cells while moving between configurations. Example:
- OOB 16 channels
- Change to 2 channels, 8 TCs
- tc2txq[15][0] == tc2txq[1][7] == 15
This will cause multiple appearances of the same TX index in statistics output.
--- .../net/ethernet/mellanox/mlx5/core/en_main.c | 19 +++++++++++++------ .../ethernet/mellanox/mlx5/core/en_stats.c | 10 ---------- 2 files changed, 13 insertions(+), 16 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +13 -6
@@ -2633,15 +2633,21 @@ static void mlx5e_netdev_set_tcs(struct net_device *netdev)netdev_set_tc_queue (netdev, tc, nch,0 ); } -static void mlx5e_build_channels_tx_maps (struct mlx5e_priv *priv) +static void mlx5e_build_tc2txq_maps (struct mlx5e_priv *priv) { -struct mlx5e_channel *c; -struct mlx5e_txqsq *sq; +int max_nch = priv->profile->max_nch (priv->mdev);int i, tc; -for (i =0 ; i < priv->profile->max_nch (priv->mdev); i++) +for (i =0 ; i < max_nch; i++)for (tc =0 ; tc < priv->profile->max_tc; tc++) - priv->channel_tc2txq[i][tc] = i + tc * priv->channels.num; + priv->channel_tc2txq[i][tc] = i + tc * max_nch; +} + +static void mlx5e_build_tx2sq_maps (struct mlx5e_priv *priv) +{ +struct mlx5e_channel *c; +struct mlx5e_txqsq *sq; +int i, tc;for (i =0 ; i < priv->channels.num; i++) { c = priv->channels.c[i];
@@ -2661,7 +2667,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)netif_set_real_num_tx_queues (netdev, num_txqs);netif_set_real_num_rx_queues (netdev, priv->channels.num); -mlx5e_build_channels_tx_maps (priv); +mlx5e_build_tx2sq_maps (priv);mlx5e_activate_channels (&priv->channels);write_lock (&priv->stats_lock); priv->channels_active = true;
@@ -4446,6 +4452,7 @@ static void mlx5e_nic_init(struct mlx5_core_dev *mdev,if (err)mlx5_core_err (mdev,"TLS initialization failed, %d\n" , err);mlx5e_build_nic_netdev (netdev); +mlx5e_build_tc2txq_maps (priv);mlx5e_vxlan_init (priv); }
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +0 -10
@@ -1161,9 +1161,6 @@ static int mlx5e_grp_channels_get_num_stats(struct mlx5e_priv *priv) {int max_nch = priv->profile->max_nch (priv->mdev); -if (!test_bit (MLX5E_STATE_OPENED , &priv->state)) -return 0 ; -return (NUM_RQ_STATS * max_nch) + (NUM_CH_STATS * max_nch) + (NUM_SQ_STATS * max_nch * priv->max_opened_tc);
@@ -1175,9 +1172,6 @@ static int mlx5e_grp_channels_fill_strings(struct mlx5e_priv *priv, u8 *data,int max_nch = priv->profile->max_nch (priv->mdev);int i, j, tc; -if (!test_bit (MLX5E_STATE_OPENED , &priv->state)) -return idx; -for (i =0 ; i < max_nch; i++)for (j =0 ; j <NUM_CH_STATS ; j++) sprintf(data + (idx++) * ETH_GSTRING_LEN,
@@ -1187,7 +1181,6 @@ static int mlx5e_grp_channels_fill_strings(struct mlx5e_priv *priv, u8 *data,for (j =0 ; j <NUM_RQ_STATS ; j++)sprintf (data + (idx++) *ETH_GSTRING_LEN , rq_stats_desc[j].format, i); -/* priv->channel_tc2txq[i][tc] is valid only when device is open */ for (tc =0 ; tc < priv->max_opened_tc; tc++)for (i =0 ; i < max_nch; i++)for (j =0 ; j <NUM_SQ_STATS ; j++)
@@ -1204,9 +1197,6 @@ static int mlx5e_grp_channels_fill_stats(struct mlx5e_priv *priv, u64 *data,int max_nch = priv->profile->max_nch (priv->mdev);int i, j, tc; -if (!test_bit (MLX5E_STATE_OPENED , &priv->state)) -return idx; -for (i =0 ; i < max_nch; i++)for (j =0 ; j <NUM_CH_STATS ; j++) data[idx++] =
Signature · 1 line
2.17.0
PATCH 4/17 net/mlx5e: Remove redundant active_channels indication
In reply to Saeed MahameedFrom: Eran Ben Elisha <[email protected]>
Now, when all channels stats are saved regardless of the channel's state {open, closed}, we can safely remove this indication and the stats spin lock which protects it.
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 -- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 ------- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 6 ------ drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 5 ----- 4 files changed, 20 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -2
@@ -777,8 +777,6 @@ struct mlx5e_priv {struct mutex state_lock;/* Protects Interface state */ struct mlx5e_rq drop_rq; -rwlock_t stats_lock;/* Protects channels SW stats updates */ -bool channels_active;struct mlx5e_channels channels;u32 tisn[MLX5E_MAX_NUM_TC ];struct mlx5e_rqt indir_rqt;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -7
@@ -2669,9 +2669,6 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)mlx5e_build_tx2sq_maps (priv);mlx5e_activate_channels (&priv->channels); -write_lock (&priv->stats_lock); - priv->channels_active = true; -write_unlock (&priv->stats_lock);netif_tx_start_all_queues (priv->netdev);if (MLX5_VPORT_MANAGER (priv->mdev))
@@ -2693,9 +2690,6 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv)*/ netif_tx_stop_all_queues (priv->netdev);netif_tx_disable (priv->netdev); -write_lock (&priv->stats_lock); - priv->channels_active = false; -write_unlock (&priv->stats_lock);mlx5e_deactivate_channels (&priv->channels); }
@@ -4269,7 +4263,6 @@ static void mlx5e_build_nic_netdev_priv(struct mlx5_core_dev *mdev, profile->max_nch(mdev), netdev->mtu);mutex_init (&priv->state_lock); -rwlock_init (&priv->stats_lock);INIT_WORK (&priv->update_carrier_work, mlx5e_update_carrier_work);INIT_WORK (&priv->set_rx_mode_work, mlx5e_set_rx_mode_work);
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +0 -6
@@ -130,10 +130,6 @@ static void mlx5e_rep_update_sw_counters(struct mlx5e_priv *priv)struct mlx5e_sq_stats *sq_stats;int i, j; -read_lock (&priv->stats_lock); -if (!priv->channels_active) - goto out; -memset (s,0 ,sizeof (*s));for (i =0 ; i < priv->channels.num; i++) {struct mlx5e_channel *c = priv->channels.c[i];
@@ -150,8 +146,6 @@ static void mlx5e_rep_update_sw_counters(struct mlx5e_priv *priv) s->tx_bytes += sq_stats->bytes; } } -out: -read_unlock (&priv->stats_lock); } static void mlx5e_rep_get_ethtool_stats(struct net_device *dev,
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +0 -5
@@ -114,9 +114,6 @@ void mlx5e_grp_sw_update_stats(struct mlx5e_priv *priv)int i;memset (s,0 ,sizeof (*s)); -read_lock (&priv->stats_lock); -if (!priv->channels_active) - goto out;for (i =0 ; i < priv->profile->max_nch (priv->mdev); i++) { struct mlx5e_channel_stats *channel_stats =
@@ -177,8 +174,6 @@ void mlx5e_grp_sw_update_stats(struct mlx5e_priv *priv) }memcpy (&priv->stats.sw, s,sizeof (*s)); -out: -read_unlock (&priv->stats_lock); }static const struct counter_desc q_stats_desc[] = {
Signature · 1 line
2.17.0
PATCH 5/17 net/mlx5e: Increase aRFS flow tables size
In reply to Saeed MahameedFrom: Maor Gottlieb <[email protected]>
Increase the aRFS flow table size to 64k so it could contain up to 64k different streams.
--- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +1 -1
@@ -213,7 +213,7 @@ static int arfs_add_default_rule(struct mlx5e_priv *priv, }#define MLX5E_ARFS_NUM_GROUPS 2 -#define MLX5E_ARFS_GROUP1_SIZE BIT(12) +#define MLX5E_ARFS_GROUP1_SIZE (BIT(16) - 1)#define MLX5E_ARFS_GROUP2_SIZE BIT(0)#define MLX5E_ARFS_TABLE_SIZE (MLX5E_ARFS_GROUP1_SIZE +\ MLX5E_ARFS_GROUP2_SIZE)
Signature · 1 line
2.17.0
PATCH 6/17 net/mlx5e: Support configurable MTU for vport representors
In reply to Saeed MahameedFrom: Adi Nissim <[email protected]>
The representor MTU was hard coded to 1500 bytes.
Allow setting arbitrary MTU values up to the max supported by the FW.
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 4 ++++ drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 14 ++++++++++---- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +4 -0
@@ -1102,6 +1102,10 @@ void mlx5e_update_stats_work(struct work_struct *work);int mlx5e_bits_invert (unsigned long a,int size); +typedef int (*change_hw_mtu_cb )(struct mlx5e_priv *priv); +int mlx5e_change_mtu (struct net_device *netdev,int new_mtu, +change_hw_mtu_cb set_mtu_cb); +/* ethtool helpers */ void mlx5e_ethtool_get_drvinfo (struct mlx5e_priv *priv,struct ethtool_drvinfo *drvinfo);
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +10 -4
@@ -3495,7 +3495,8 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,return features; } -static int mlx5e_change_mtu (struct net_device *netdev,int new_mtu) +int mlx5e_change_mtu (struct net_device *netdev,int new_mtu, +change_hw_mtu_cb set_mtu_cb) {struct mlx5e_priv *priv =netdev_priv (netdev);struct mlx5e_channels new_channels = {};
@@ -3522,7 +3523,7 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)if (!reset) { params->sw_mtu = new_mtu; -mlx5e_set_dev_port_mtu (priv); +set_mtu_cb (priv); netdev->mtu = params->sw_mtu; goto out; }
@@ -3531,7 +3532,7 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)if (err) goto out; -mlx5e_switch_priv_channels (priv, &new_channels, mlx5e_set_dev_port_mtu); +mlx5e_switch_priv_channels (priv, &new_channels, set_mtu_cb); netdev->mtu = new_channels.params.sw_mtu; out:
@@ -3539,6 +3540,11 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)return err; } +static int mlx5e_change_nic_mtu (struct net_device *netdev,int new_mtu) +{ +return mlx5e_change_mtu (netdev, new_mtu, mlx5e_set_dev_port_mtu); +} +int mlx5e_hwstamp_set (struct mlx5e_priv *priv,struct ifreq *ifr) {struct hwtstamp_config config;
@@ -4033,7 +4039,7 @@ static const struct net_device_ops mlx5e_netdev_ops = { .ndo_vlan_rx_kill_vid = mlx5e_vlan_rx_kill_vid, .ndo_set_features = mlx5e_set_features, .ndo_fix_features = mlx5e_fix_features, - .ndo_change_mtu = mlx5e_change_mtu, + .ndo_change_mtu = mlx5e_change_nic_mtu, .ndo_do_ioctl = mlx5e_ioctl, .ndo_set_tx_maxrate = mlx5e_set_tx_maxrate, .ndo_udp_tunnel_add = mlx5e_add_vxlan_port,
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +14 -0
@@ -900,6 +900,11 @@ static const struct switchdev_ops mlx5e_rep_switchdev_ops = { .switchdev_port_attr_get = mlx5e_attr_get, }; +int mlx5e_change_rep_mtu (struct net_device *netdev,int new_mtu) +{ +return mlx5e_change_mtu (netdev, new_mtu,NULL ); +} +static const struct net_device_ops mlx5e_netdev_ops_rep = { .ndo_open = mlx5e_rep_open, .ndo_stop = mlx5e_rep_close,
@@ -909,6 +914,7 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = { .ndo_get_stats64 = mlx5e_rep_get_stats, .ndo_has_offload_stats = mlx5e_has_offload_stats, .ndo_get_offload_stats = mlx5e_get_offload_stats, + .ndo_change_mtu = mlx5e_change_rep_mtu, }; static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev,
@@ -935,6 +941,10 @@ static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev,static void mlx5e_build_rep_netdev (struct net_device *netdev) { +struct mlx5e_priv *priv =netdev_priv (netdev); +struct mlx5_core_dev *mdev = priv->mdev; +u16 max_mtu; + netdev->netdev_ops = &mlx5e_netdev_ops_rep; netdev->watchdog_timeo =15 *HZ ;
@@ -947,6 +957,10 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev) netdev->hw_features |=NETIF_F_HW_TC ;eth_hw_addr_random (netdev); + + netdev->min_mtu =ETH_MIN_MTU ; +mlx5_query_port_max_mtu (mdev, &max_mtu,1 ); + netdev->max_mtu =MLX5E_HW2SW_MTU (&priv->channels.params, max_mtu); } static void mlx5e_init_rep(struct mlx5_core_dev *mdev,
Signature · 1 line
2.17.0
PATCH 7/17 net/mlx5: FPGA, Handle QP error event
In reply to Saeed MahameedFrom: Ilan Tayari <[email protected]>
Add handlers for this event to perform graceful teardown of the device.
--- .../ethernet/mellanox/mlx5/core/fpga/core.c | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c +24 -4
@@ -50,6 +50,11 @@ static const char *const mlx5_fpga_error_strings[] = { "Temperature Critical", }; +static const char *const mlx5_fpga_qp_error_strings[] = { +"Null Syndrome" , +"Retry Counter Expired" , +"RNR Expired" , +};static struct mlx5_fpga_device *mlx5_fpga_device_alloc (void ) {struct mlx5_fpga_device *fdev =NULL ;
@@ -271,23 +276,38 @@ static const char *mlx5_fpga_syndrome_to_string(u8 syndrome)return "Unknown" ; } +static const char *mlx5_fpga_qp_syndrome_to_string (u8 syndrome) +{ +if (syndrome <ARRAY_SIZE (mlx5_fpga_qp_error_strings)) +return mlx5_fpga_qp_error_strings[syndrome]; +return "Unknown" ; +} +void mlx5_fpga_event (struct mlx5_core_dev *mdev,u8 event,void *data) {struct mlx5_fpga_device *fdev = mdev->fpga;const char *event_name;bool teardown = false;unsigned long flags; +u32 fpga_qpn;u8 syndrome; -if (event !=MLX5_EVENT_TYPE_FPGA_ERROR ) { +switch (event) { +case MLX5_EVENT_TYPE_FPGA_ERROR : + syndrome =MLX5_GET (fpga_error_event, data, syndrome); + event_name =mlx5_fpga_syndrome_to_string (syndrome); +break ; +case MLX5_EVENT_TYPE_FPGA_QP_ERROR : + syndrome =MLX5_GET (fpga_qp_error_event, data, syndrome); + event_name =mlx5_fpga_qp_syndrome_to_string (syndrome); + fpga_qpn =MLX5_GET (fpga_qp_error_event, data, fpga_qpn); +break ; +default :mlx5_fpga_warn_ratelimited (fdev,"Unexpected event %u\n" , event);return ; } - syndrome =MLX5_GET (fpga_error_event, data, syndrome); - event_name =mlx5_fpga_syndrome_to_string (syndrome); -spin_lock_irqsave (&fdev->state_lock, flags);switch (fdev->state) {case MLX5_FPGA_STATUS_SUCCESS :
Signature · 1 line
2.17.0
PATCH 8/17 net/mlx5e: TX, Obsolete maintaining local copies of skb->len/data
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Instead of maintaining a local copy of skb->len/data and updating it upon every copy to the WQE inline part, just calculate it once when needed, using the ihs.
This obsoletes the function mlx5e_tx_skb_pull_inline.
--- .../net/ethernet/mellanox/mlx5/core/en_tx.c | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +12 -30
@@ -188,28 +188,16 @@ static inline u16 mlx5e_calc_min_inline(enum mlx5_inline_modes mode,return min_t (u16, hlen,skb_headlen (skb)); } -static inline void mlx5e_tx_skb_pull_inline (unsigned char **skb_data, -unsigned int *skb_len, -unsigned int len) -{ - *skb_len -= len; - *skb_data += len; -} - -static inline void mlx5e_insert_vlan (void *start,struct sk_buff *skb,u16 ihs, -unsigned char **skb_data, -unsigned int *skb_len) +static inline void mlx5e_insert_vlan (void *start,struct sk_buff *skb,u16 ihs) {struct vlan_ethhdr *vhdr = (struct vlan_ethhdr *)start;int cpy1_sz =2 *ETH_ALEN ;int cpy2_sz = ihs - cpy1_sz; -memcpy (vhdr, *skb_data, cpy1_sz); -mlx5e_tx_skb_pull_inline (skb_data, skb_len, cpy1_sz); +memcpy (vhdr, skb->data, cpy1_sz); vhdr->h_vlan_proto = skb->vlan_proto; vhdr->h_vlan_TCI =cpu_to_be16 (skb_vlan_tag_get (skb)); -memcpy (&vhdr->h_vlan_encapsulated_proto, *skb_data, cpy2_sz); -mlx5e_tx_skb_pull_inline (skb_data, skb_len, cpy2_sz); +memcpy (&vhdr->h_vlan_encapsulated_proto, skb->data + cpy1_sz, cpy2_sz); } static inline void
@@ -357,8 +345,6 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,struct mlx5e_tx_wqe_info *wi;struct mlx5e_sq_stats *stats = sq->stats; -unsigned char *skb_data = skb->data; -unsigned int skb_len = skb->len;u16 ds_cnt, ds_cnt_inl =0 ;u16 headlen, ihs, frag_pi;u8 num_wqebbs, opcode;
@@ -385,7 +371,7 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, stats->bytes += num_bytes; stats->xmit_more += skb->xmit_more; - headlen = skb_len - ihs - skb->data_len; + headlen = skb->len - ihs - skb->data_len; ds_cnt += !!headlen; ds_cnt +=skb_shinfo (skb)->nr_frags;
@@ -414,15 +400,14 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, eseg->mss = mss;if (ihs) { + eseg->inline_hdr.sz =cpu_to_be16 (ihs);if (skb_vlan_tag_present (skb)) { -mlx5e_insert_vlan (eseg->inline_hdr.start, skb, - ihs -VLAN_HLEN , &skb_data, &skb_len); + ihs -=VLAN_HLEN ; +mlx5e_insert_vlan (eseg->inline_hdr.start, skb, ihs); stats->added_vlan_packets++; }else { -memcpy (eseg->inline_hdr.start, skb_data, ihs); -mlx5e_tx_skb_pull_inline (&skb_data, &skb_len, ihs); +memcpy (eseg->inline_hdr.start, skb->data, ihs); } - eseg->inline_hdr.sz =cpu_to_be16 (ihs); dseg += ds_cnt_inl; }else if (skb_vlan_tag_present (skb)) { eseg->insert.type =cpu_to_be16 (MLX5_ETH_WQE_INSERT_VLAN );
@@ -432,7 +417,7 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, stats->added_vlan_packets++; } - num_dma =mlx5e_txwqe_build_dsegs (sq, skb, skb_data, headlen, dseg); + num_dma =mlx5e_txwqe_build_dsegs (sq, skb, skb->data + ihs, headlen, dseg);if (unlikely (num_dma <0 )) goto err_drop;
@@ -644,8 +629,6 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,struct mlx5e_tx_wqe_info *wi;struct mlx5e_sq_stats *stats = sq->stats; -unsigned char *skb_data = skb->data; -unsigned int skb_len = skb->len;u16 headlen, ihs, pi, frag_pi;u16 ds_cnt, ds_cnt_inl =0 ;u8 num_wqebbs, opcode;
@@ -672,7 +655,7 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, stats->bytes += num_bytes; stats->xmit_more += skb->xmit_more; - headlen = skb_len - ihs - skb->data_len; + headlen = skb->len - ihs - skb->data_len; ds_cnt += !!headlen; ds_cnt +=skb_shinfo (skb)->nr_frags;
@@ -704,13 +687,12 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, eseg->mss = mss;if (ihs) { -memcpy (eseg->inline_hdr.start, skb_data, ihs); -mlx5e_tx_skb_pull_inline (&skb_data, &skb_len, ihs); +memcpy (eseg->inline_hdr.start, skb->data, ihs); eseg->inline_hdr.sz =cpu_to_be16 (ihs); dseg += ds_cnt_inl; } - num_dma =mlx5e_txwqe_build_dsegs (sq, skb, skb_data, headlen, dseg); + num_dma =mlx5e_txwqe_build_dsegs (sq, skb, skb->data + ihs, headlen, dseg);if (unlikely (num_dma <0 )) goto err_drop;
Signature · 1 line
2.17.0
PATCH 9/17 net/mlx5e: RX, Generalise name of non-linear SKB head size
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Make name more generic by dropping MPWRQ from it, as it will be used also in Legacy RQ in a downstream patch.
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +1 -1
@@ -112,7 +112,7 @@ struct page_pool;#define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE_MPW 0x2 -#define MLX5_MPWRQ_SMALL_PACKET_THRESHOLD (256) +#define MLX5E_RX_MAX_HEAD (256)#define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ (64 * 1024)#define MLX5E_DEFAULT_LRO_TIMEOUT 32
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +2 -2
@@ -1070,7 +1070,7 @@ struct sk_buff * mlx5e_skb_from_cqe_mpwrq_nonlinear(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, u16 cqe_bcnt, u32 head_offset, u32 page_idx) { - u16 headlen = min_t(u16, MLX5_MPWRQ_SMALL_PACKET_THRESHOLD, cqe_bcnt); + u16 headlen = min_t(u16, MLX5E_RX_MAX_HEAD, cqe_bcnt);struct mlx5e_dma_info *di = &wi->umr.dma_info[page_idx];u32 frag_offset = head_offset + headlen;u32 byte_cnt = cqe_bcnt - headlen;
@@ -1078,7 +1078,7 @@ mlx5e_skb_from_cqe_mpwrq_nonlinear(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wstruct sk_buff *skb; skb =napi_alloc_skb (rq->cq.napi, -ALIGN (MLX5_MPWRQ_SMALL_PACKET_THRESHOLD ,sizeof (long ))); +ALIGN (MLX5E_RX_MAX_HEAD ,sizeof (long )));if (unlikely (!skb)) { rq->stats->buff_alloc_err++;return NULL ;
drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +1 -1
@@ -100,7 +100,7 @@ static int mlx5e_test_link_speed(struct mlx5e_priv *priv)#ifdef CONFIG_INET /* loopback test */ -#define MLX5E_TEST_PKT_SIZE (MLX5_MPWRQ_SMALL_PACKET_THRESHOLD - NET_IP_ALIGN) +#define MLX5E_TEST_PKT_SIZE (MLX5E_RX_MAX_HEAD - NET_IP_ALIGN)static const char mlx5e_test_text[ETH_GSTRING_LEN ] ="MLX5E SELF TEST" ;#define MLX5E_TEST_MAGIC 0x5AEED15C001ULL
Signature · 1 line
2.17.0
PATCH 10/17 net/mlx5e: RX, Generalise function of SKB frag addition
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Rename it and pass truesize as an extra argument, as it will be used also in Legacy RQ in a downstream patch.
--- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +8 -8
@@ -311,13 +311,11 @@ void mlx5e_dealloc_rx_wqe(struct mlx5e_rq *rq, u16 ix)mlx5e_free_rx_wqe (rq, wi); } -static inline void mlx5e_add_skb_frag_mpwqe (struct mlx5e_rq *rq, -struct sk_buff *skb, -struct mlx5e_dma_info *di, -u32 frag_offset,u32 len) +static inline void +mlx5e_add_skb_frag (struct mlx5e_rq *rq,struct sk_buff *skb, +struct mlx5e_dma_info *di,u32 frag_offset,u32 len, +unsigned int truesize) { -unsigned int truesize =ALIGN (len,BIT (rq->mpwqe.log_stride_sz)); -dma_sync_single_for_cpu (rq->pdev, di->addr + frag_offset, len,DMA_FROM_DEVICE );
@@ -1094,9 +1092,11 @@ mlx5e_skb_from_cqe_mpwrq_nonlinear(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wwhile (byte_cnt) {u32 pg_consumed_bytes =min_t (u32,PAGE_SIZE - frag_offset, byte_cnt); +unsigned int truesize = +ALIGN (pg_consumed_bytes,BIT (rq->mpwqe.log_stride_sz)); -mlx5e_add_skb_frag_mpwqe (rq, skb, di, frag_offset, - pg_consumed_bytes); +mlx5e_add_skb_frag (rq, skb, di, frag_offset, + pg_consumed_bytes, truesize); byte_cnt -= pg_consumed_bytes; frag_offset =0 ; di++;
Signature · 1 line
2.17.0
PATCH 11/17 net/mlx5e: RX, Dedicate a function for copying SKB header
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Get the logic of copying the packet header into the SKB linear part into a generic function. Function does copy length alignment and dma buffer sync.
It is currently called only within the MPWQE flow.
In a downstream patch, it will be called within the legacy RQ flow as well.
--- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +17 -13
@@ -324,6 +324,20 @@ mlx5e_add_skb_frag(struct mlx5e_rq *rq, struct sk_buff *skb, di->page, frag_offset, len, truesize); } +static inline void +mlx5e_copy_skb_header (struct device *pdev,struct sk_buff *skb, +struct mlx5e_dma_info *dma_info, +int offset_from,int offset_to,u32 headlen) +{ +const void *from =page_address (dma_info->page) + offset_from; +/* Aligning len to sizeof(long) optimizes memcpy performance */ +unsigned int len =ALIGN (headlen,sizeof (long )); + +dma_sync_single_for_cpu (pdev, dma_info->addr + offset_from, len, +DMA_FROM_DEVICE ); +skb_copy_to_linear_data_offset (skb, offset_to, from, len); +} + static inline void mlx5e_copy_skb_header_mpwqe(struct device *pdev, struct sk_buff *skb,
@@ -331,23 +345,13 @@ mlx5e_copy_skb_header_mpwqe(struct device *pdev, u32 offset, u32 headlen) {u16 headlen_pg =min_t (u32, headlen,PAGE_SIZE - offset); -unsigned int len; -/* Aligning len to sizeof(long) optimizes memcpy performance */ - len =ALIGN (headlen_pg,sizeof (long )); -dma_sync_single_for_cpu (pdev, dma_info->addr + offset, len, -DMA_FROM_DEVICE ); -skb_copy_to_linear_data (skb,page_address (dma_info->page) + offset, len); +mlx5e_copy_skb_header (pdev, skb, dma_info, offset,0 , headlen_pg);if (unlikely (offset + headlen >PAGE_SIZE )) { dma_info++; - headlen_pg = len; - len =ALIGN (headlen - headlen_pg,sizeof (long )); -dma_sync_single_for_cpu (pdev, dma_info->addr, len, -DMA_FROM_DEVICE ); -skb_copy_to_linear_data_offset (skb, headlen_pg, -page_address (dma_info->page), - len); +mlx5e_copy_skb_header (pdev, skb, dma_info,0 , headlen_pg, + headlen - headlen_pg); } }
Signature · 1 line
2.17.0
PATCH 12/17 net/mlx5e: RX, Remove HW LRO support in legacy RQ
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Current LRO implementation in Legacy RQ uses high-order pages. In downstream patches of this series we complete the transition to using only order-0 pages in RX datapath (which was already done in Striding RQ).
Unlike the more advanced Striding RQ, Legacy RQ does not make reuse of any non-consumed buffers of non-full LRO sessions, and combining it with order-0 pages has many performance drawbacks.
Hence, here we totally remove LRO support in Legacy RQ. This guarantees having no out-of-order completions, which allows using a cyclic work queue (instead of a linked-list) in a downstream patch.
--- .../ethernet/mellanox/mlx5/core/en_ethtool.c | 7 ++++ .../net/ethernet/mellanox/mlx5/core/en_main.c | 33 +++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +7 -0
@@ -1515,6 +1515,9 @@ static int set_pflag_rx_striding_rq(struct net_device *netdev, bool enable)return -EOPNOTSUPP ;if (!mlx5e_striding_rq_possible (mdev, &priv->channels.params))return -EINVAL ; + }else if (priv->channels.params.lro_en) { +netdev_warn (netdev,"Can't set legacy RQ with LRO, disable LRO first\n" ); +return -EINVAL ; } new_channels.params = priv->channels.params;
@@ -1589,6 +1592,10 @@ static int mlx5e_set_priv_flags(struct net_device *netdev, u32 pflags) out:mutex_unlock (&priv->state_lock); + +/* Need to fix some features.. */ +netdev_update_features (netdev); +return err; }
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +19 -14
@@ -182,14 +182,6 @@ void mlx5e_init_rq_type_params(struct mlx5_core_dev *mdev, params->log_rq_mtu_frames =is_kdump_kernel () ?MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE :MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE ; -switch (params->rq_wq_type) { -case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ : -break ; -default :/* MLX5_WQ_TYPE_LINKED_LIST */ -/* Extra room needed for build_skb */ - params->lro_wqe_sz -=mlx5e_get_rq_headroom (mdev, params) + -SKB_DATA_ALIGN (sizeof (struct skb_shared_info )); - } mlx5_core_info(mdev, "MLX5E: StrdRq(%d) RqSz(%ld) StrdSz(%ld) RxCqeCmprss(%d)\n", params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ,
@@ -503,14 +495,12 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c, goto err_rq_wq_destroy; } - byte_count = params->lro_en ? - params->lro_wqe_sz : -MLX5E_SW2HW_MTU (params, params->sw_mtu); + byte_count =MLX5E_SW2HW_MTU (params, params->sw_mtu);#ifdef CONFIG_MLX5_EN_IPSEC if (MLX5_IPSEC_DEV (mdev)) byte_count +=MLX5E_METADATA_ETHER_LEN ;#endif - rq->wqe.page_reuse = !params->xdp_prog && !params->lro_en; + rq->wqe.page_reuse = !params->xdp_prog;/* calc the required page order */ rq->wqe.frag_sz =MLX5_SKB_FRAG_SZ (rq->buff.headroom + byte_count);
@@ -3311,6 +3301,12 @@ static int set_feature_lro(struct net_device *netdev, bool enable)mutex_lock (&priv->state_lock); old_params = &priv->channels.params; +if (enable && !MLX5E_GET_PFLAG (old_params,MLX5E_PFLAG_RX_STRIDING_RQ )) { +netdev_warn (netdev,"can't set LRO with legacy RQ\n" ); + err = -EINVAL ; + goto out; + } + reset =test_bit (MLX5E_STATE_OPENED , &priv->state); new_channels.params = *old_params;
@@ -3480,16 +3476,24 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev, netdev_features_t features) {struct mlx5e_priv *priv =netdev_priv (netdev); +struct mlx5e_params *params;mutex_lock (&priv->state_lock); + params = &priv->channels.params;if (!bitmap_empty (priv->fs.vlan.active_svlans,VLAN_N_VID )) {/* HW strips the outer C-tag header, this is a problem * for S-tag traffic. */ features &= ~NETIF_F_HW_VLAN_CTAG_RX ; -if (!priv->channels.params.vlan_strip_disable) +if (!params->vlan_strip_disable)netdev_warn (netdev,"Dropping C-tag vlan stripping offload due to S-tag vlan\n" ); } +if (!MLX5E_GET_PFLAG (params,MLX5E_PFLAG_RX_STRIDING_RQ )) { + features &= ~NETIF_F_LRO ; +if (params->lro_en) +netdev_warn (netdev,"Disabling LRO, not supported in legacy RQ\n" ); + } +mutex_unlock (&priv->state_lock);return features;
@@ -4328,7 +4332,8 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) netdev->hw_enc_features |=NETIF_F_HW_VLAN_CTAG_TX ; netdev->hw_enc_features |=NETIF_F_HW_VLAN_CTAG_RX ; -if (!!MLX5_CAP_ETH (mdev, lro_cap)) +if (!!MLX5_CAP_ETH (mdev, lro_cap) && +mlx5e_check_fragmented_striding_rq_cap (mdev)) netdev->vlan_features |=NETIF_F_LRO ; netdev->hw_features = netdev->vlan_features;
Signature · 1 line
2.17.0
PATCH 13/17 net/mlx5e: RX, Split WQ objects for different RQ types
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Replace the common RQ WQ object with two separate ones for the different RQ types.
This is in preparation for switching to using a cyclic WQ type in Legacy RQ.
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 4 +- .../net/ethernet/mellanox/mlx5/core/en_main.c | 128 ++++++++++++------ .../net/ethernet/mellanox/mlx5/core/en_rx.c | 35 +++-- 3 files changed, 110 insertions(+), 57 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +2 -2
@@ -498,10 +498,9 @@ enum mlx5e_rq_flag { struct mlx5e_rq { /* data path */ - struct mlx5_wq_ll wq; - union { struct { + struct mlx5_wq_ll wq; struct mlx5e_wqe_frag_info *frag_info; u32 frag_sz; /* max possible skb frag_sz */ union {
@@ -509,6 +508,7 @@ struct mlx5e_rq { }; } wqe;struct { +struct mlx5_wq_ll wq;struct mlx5e_umr_wqe umr_wqe;struct mlx5e_mpw_info *info;mlx5e_fp_skb_from_cqe_mpwrq skb_from_cqe_mpwrq;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +88 -40
208 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +20 -15
@@ -113,7 +113,7 @@ static inline void mlx5e_decompress_cqe(struct mlx5e_rq *rq,mpwrq_get_cqe_consumed_strides (&cq->title); else cq->decmprs_wqe_counter = -mlx5_wq_ll_ctr2ix (&rq->wq, cq->decmprs_wqe_counter +1 ); +mlx5_wq_ll_ctr2ix (&rq->wqe.wq, cq->decmprs_wqe_counter +1 ); } static inline void mlx5e_decompress_cqe_no_hash(struct mlx5e_rq *rq,
@@ -369,7 +369,7 @@ void mlx5e_free_rx_mpwqe(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi)static void mlx5e_post_rx_mpwqe (struct mlx5e_rq *rq) { -struct mlx5_wq_ll *wq = &rq->wq; +struct mlx5_wq_ll *wq = &rq->mpwqe.wq;struct mlx5e_rx_wqe *wqe =mlx5_wq_ll_get_wqe (wq, wq->head); rq->mpwqe.umr_in_progress = false;
@@ -470,7 +470,7 @@ void mlx5e_dealloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix)bool mlx5e_post_rx_wqes (struct mlx5e_rq *rq) { -struct mlx5_wq_ll *wq = &rq->wq; +struct mlx5_wq_ll *wq = &rq->wqe.wq;int err;if (unlikely (!test_bit (MLX5E_RQ_STATE_ENABLED , &rq->state)))
@@ -546,7 +546,7 @@ static void mlx5e_poll_ico_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq)bool mlx5e_post_rx_mpwqes (struct mlx5e_rq *rq) { -struct mlx5_wq_ll *wq = &rq->wq; +struct mlx5_wq_ll *wq = &rq->mpwqe.wq;if (unlikely (!test_bit (MLX5E_RQ_STATE_ENABLED , &rq->state)))return false;
@@ -987,6 +987,7 @@ struct sk_buff *skb_from_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe,void mlx5e_handle_rx_cqe (struct mlx5e_rq *rq,struct mlx5_cqe64 *cqe) { +struct mlx5_wq_ll *wq = &rq->wqe.wq;struct mlx5e_wqe_frag_info *wi;struct mlx5e_rx_wqe *wqe;__be16 wqe_counter_be;
@@ -996,7 +997,7 @@ void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe) wqe_counter_be = cqe->wqe_counter; wqe_counter =be16_to_cpu (wqe_counter_be); - wqe =mlx5_wq_ll_get_wqe (&rq->wq, wqe_counter); + wqe =mlx5_wq_ll_get_wqe (wq, wqe_counter); wi = &rq->wqe.frag_info[wqe_counter]; cqe_bcnt =be32_to_cpu (cqe->byte_cnt);
@@ -1018,7 +1019,7 @@ void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)mlx5e_free_rx_wqe_reuse (rq, wi); wq_ll_pop: -mlx5_wq_ll_pop (&rq->wq, wqe_counter_be, +mlx5_wq_ll_pop (wq, wqe_counter_be, &wqe->next.next_wqe_index); }
@@ -1029,6 +1030,7 @@ void mlx5e_handle_rx_cqe_rep(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)struct mlx5e_priv *priv =netdev_priv (netdev);struct mlx5e_rep_priv *rpriv = priv->ppriv;struct mlx5_eswitch_rep *rep = rpriv->rep; +struct mlx5_wq_ll *wq = &rq->wqe.wq;struct mlx5e_wqe_frag_info *wi;struct mlx5e_rx_wqe *wqe;struct sk_buff *skb;
@@ -1038,7 +1040,7 @@ void mlx5e_handle_rx_cqe_rep(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe) wqe_counter_be = cqe->wqe_counter; wqe_counter =be16_to_cpu (wqe_counter_be); - wqe =mlx5_wq_ll_get_wqe (&rq->wq, wqe_counter); + wqe =mlx5_wq_ll_get_wqe (wq, wqe_counter); wi = &rq->wqe.frag_info[wqe_counter]; cqe_bcnt =be32_to_cpu (cqe->byte_cnt);
@@ -1063,7 +1065,7 @@ void mlx5e_handle_rx_cqe_rep(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)mlx5e_free_rx_wqe_reuse (rq, wi); wq_ll_pop: -mlx5_wq_ll_pop (&rq->wq, wqe_counter_be, +mlx5_wq_ll_pop (wq, wqe_counter_be, &wqe->next.next_wqe_index); }#endif
@@ -1164,6 +1166,7 @@ void mlx5e_handle_rx_cqe_mpwrq(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)u32 head_offset = wqe_offset & (PAGE_SIZE -1 );u32 page_idx = wqe_offset >>PAGE_SHIFT ;struct mlx5e_rx_wqe *wqe; +struct mlx5_wq_ll *wq;struct sk_buff *skb;u16 cqe_bcnt;
@@ -1193,9 +1196,10 @@ void mlx5e_handle_rx_cqe_mpwrq(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)if (likely (wi->consumed_strides < rq->mpwqe.num_strides))return ; - wqe =mlx5_wq_ll_get_wqe (&rq->wq, wqe_id); + wq = &rq->mpwqe.wq; + wqe =mlx5_wq_ll_get_wqe (wq, wqe_id);mlx5e_free_rx_mpwqe (rq, wi); -mlx5_wq_ll_pop (&rq->wq, cqe->wqe_id, &wqe->next.next_wqe_index); +mlx5_wq_ll_pop (wq, cqe->wqe_id, &wqe->next.next_wqe_index); }int mlx5e_poll_rx_cq (struct mlx5e_cq *cq,int budget)
@@ -1399,6 +1403,7 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,void mlx5i_handle_rx_cqe (struct mlx5e_rq *rq,struct mlx5_cqe64 *cqe) { +struct mlx5_wq_ll *wq = &rq->wqe.wq;struct mlx5e_wqe_frag_info *wi;struct mlx5e_rx_wqe *wqe;__be16 wqe_counter_be;
@@ -1408,7 +1413,7 @@ void mlx5i_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe) wqe_counter_be = cqe->wqe_counter; wqe_counter =be16_to_cpu (wqe_counter_be); - wqe =mlx5_wq_ll_get_wqe (&rq->wq, wqe_counter); + wqe =mlx5_wq_ll_get_wqe (wq, wqe_counter); wi = &rq->wqe.frag_info[wqe_counter]; cqe_bcnt =be32_to_cpu (cqe->byte_cnt);
@@ -1425,7 +1430,7 @@ void mlx5i_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe) wq_free_wqe:mlx5e_free_rx_wqe_reuse (rq, wi); -mlx5_wq_ll_pop (&rq->wq, wqe_counter_be, +mlx5_wq_ll_pop (wq, wqe_counter_be, &wqe->next.next_wqe_index); }
@@ -1435,6 +1440,7 @@ void mlx5i_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)void mlx5e_ipsec_handle_rx_cqe (struct mlx5e_rq *rq,struct mlx5_cqe64 *cqe) { +struct mlx5_wq_ll *wq = &rq->wqe.wq;struct mlx5e_wqe_frag_info *wi;struct mlx5e_rx_wqe *wqe;__be16 wqe_counter_be;
@@ -1444,7 +1450,7 @@ void mlx5e_ipsec_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe) wqe_counter_be = cqe->wqe_counter; wqe_counter =be16_to_cpu (wqe_counter_be); - wqe =mlx5_wq_ll_get_wqe (&rq->wq, wqe_counter); + wqe =mlx5_wq_ll_get_wqe (wq, wqe_counter); wi = &rq->wqe.frag_info[wqe_counter]; cqe_bcnt =be32_to_cpu (cqe->byte_cnt);
@@ -1465,8 +1471,7 @@ void mlx5e_ipsec_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)mlx5e_free_rx_wqe_reuse (rq, wi); wq_ll_pop: -mlx5_wq_ll_pop (&rq->wq, wqe_counter_be, - &wqe->next.next_wqe_index); + mlx5_wq_ll_pop(wq, wqe_counter_be, &wqe->next.next_wqe_index); }#endif /* CONFIG_MLX5_EN_IPSEC */
Signature · 1 line
2.17.0
PATCH 14/17 net/mlx5e: RX, Use cyclic WQ in legacy RQ
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Now that LRO is not supported for Legacy RQ, there is no source of out-of-order completions in the WQ, and we can use a cyclic one.
This has multiple advantages:
- reduces the WQE size (smaller PCI transactions).
- lower overhead in datapath (no handling of 'next' pointers).
- no reserved WQE for the WQ head (was need in linked-list).
- allows using a constant map between frag and dma_info struct, in downstream patch.
Performance tests:
ConnectX-4, single core, single RX ring.
Major gain in packet rate of single ring XDP drop. Bottleneck is shifted form HW (at 16Mpps) to SW (at 20Mpps).
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 10 +- .../net/ethernet/mellanox/mlx5/core/en_main.c | 89 ++++++++------ .../net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 115 ++++++++---------- drivers/net/ethernet/mellanox/mlx5/core/wq.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/wq.h | 55 ++++++++- 6 files changed, 161 insertions(+), 111 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +7 -3
@@ -186,9 +186,13 @@ struct mlx5e_tx_wqe {struct mlx5_wqe_data_seg data[0 ]; }; -struct mlx5e_rx_wqe { +struct mlx5e_rx_wqe_ll {struct mlx5_wqe_srq_next_seg next; -struct mlx5_wqe_data_seg data; +struct mlx5_wqe_data_seg data[0 ]; +}; + +struct mlx5e_rx_wqe_cyc { +struct mlx5_wqe_data_seg data[0 ]; };struct mlx5e_umr_wqe {
@@ -500,7 +504,7 @@ struct mlx5e_rq {/* data path */ union { struct { - struct mlx5_wq_ll wq; + struct mlx5_wq_cyc wq; struct mlx5e_wqe_frag_info *frag_info; u32 frag_sz; /* max possible skb frag_sz */ union {
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +51 -38
213 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +1 -1
@@ -927,7 +927,7 @@ static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev, params->hard_mtu =MLX5E_ETH_HARD_MTU ; params->sw_mtu = mtu; params->log_sq_size =MLX5E_REP_PARAMS_LOG_SQ_SIZE ; - params->rq_wq_type =MLX5_WQ_TYPE_LINKED_LIST ; + params->rq_wq_type =MLX5_WQ_TYPE_CYCLIC ; params->log_rq_mtu_frames =MLX5E_REP_PARAMS_LOG_RQ_SIZE ; params->rx_dim_enabled =MLX5_CAP_GEN (mdev, cq_moderation);
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +51 -64
260 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/wq.c +1 -0
@@ -85,6 +85,7 @@ int mlx5_wq_cyc_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,mlx5_fill_fbc (MLX5_GET (wq, wqc, log_wq_stride),MLX5_GET (wq, wqc, log_wq_sz), fbc); + wq->sz = wq->fbc.sz_m1 +1 ; err =mlx5_db_alloc_node (mdev, &wq_ctrl->db, param->db_numa_node);if (err) {
drivers/net/ethernet/mellanox/mlx5/core/wq.h +50 -5
79 lines not on this page · raw message
Signature · 1 line
2.17.0
PATCH 15/17 net/mlx5e: RX, Enhance legacy Receive Queue memory scheme
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Enhance the memory scheme of the legacy RQ, such that only order-0 pages are used.
Whenever possible, prefer using a linear SKB, and build it wrapping the WQE buffer.
Otherwise (for example, jumbo frames on x86), use non-linear SKB, with as many frags as needed. In this case, multiple WQE scatter entries are used, up to a maximum of 4 frags and 10KB of MTU.
This implied to remove support of HW LRO in legacy RQ, as it would require large number of page allocations and scatter entries per WQE on archs with PAGE_SIZE = 4KB, yielding bad performance.
In earlier patches, we guaranteed that all completions are in-order, and that we use a cyclic WQ.
This creates an oppurtunity for a performance optimization:
The mapping between a "struct mlx5e_dma_info", and the WQEs (struct mlx5e_wqe_frag_info) pointing to it, is constant across different cycles of a WQ. This allows initializing the mapping in the time of RQ creation, and not handle it in datapath.
A struct mlx5e_dma_info that is shared between different WQEs is allocated by the first WQE, and freed by the last one. This implies an important requirement: WQEs that share the same struct mlx5e_dma_info must be posted within the same NAPI. Otherwise, upon completion, struct mlx5e_wqe_frag_info would mistakenly point to the new struct mlx5e_dma_info, not the one that was posted (and the HW wrote to).
This bulking requirement is actually good also for performance reasons, hence we extend the bulk beyong the minimal requirement above.
With this memory scheme, the RQs memory footprint is reduce by a factor of 2 on x86, and by a factor of 32 on PowerPC. Same factors apply for the number of pages in a GRO session.
Performance tests:
ConnectX-4, single core, single RX ring, default MTU.
x86:
CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
Packet rate (early drop in TC): no degradation
TCP streams: ~5% improvement
PowerPC:
CPU: POWER8 (raw), altivec supported
Packet rate (early drop in TC): 20% gain
TCP streams: 25% gain
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 44 +++- .../net/ethernet/mellanox/mlx5/core/en_main.c | 238 +++++++++++++----- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 207 ++++++++++----- 3 files changed, 362 insertions(+), 127 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +35 -9
@@ -101,11 +101,15 @@ struct page_pool; (MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW + \ (MLX5_MPWRQ_LOG_WQE_SZ - MLX5E_ORDER2_MAX_PACKET_MTU)) +#define MLX5E_MIN_SKB_FRAG_SZ (MLX5_SKB_FRAG_SZ(MLX5_RX_HEADROOM)) +#define MLX5E_LOG_MAX_RX_WQE_BULK \ + (ilog2(PAGE_SIZE / roundup_pow_of_two(MLX5E_MIN_SKB_FRAG_SZ))) +#define MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE 0x6#define MLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE 0xa#define MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE 0xd -#define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE 0x1 +#define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE (1 + MLX5E_LOG_MAX_RX_WQE_BULK)#define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE min_t(u8, 0xd, \ MLX5E_LOG_MAX_RQ_NUM_PACKETS_MPW)
@@ -462,8 +466,9 @@ struct mlx5e_dma_info { };struct mlx5e_wqe_frag_info { -struct mlx5e_dma_info di; +struct mlx5e_dma_info *di;u32 offset; +bool last_in_page; };struct mlx5e_umr_dma_info {
@@ -476,6 +481,8 @@ struct mlx5e_mpw_info {DECLARE_BITMAP (xdp_xmit_bitmap,MLX5_MPWRQ_PAGES_PER_WQE ); }; +#define MLX5E_MAX_RX_FRAGS 4 +/* a single cache unit is capable to serve one napi call (for non-striding rq) * or a MPWQE (for striding rq). */
@@ -493,6 +500,9 @@ typedef void (*mlx5e_fp_handle_rx_cqe)(struct mlx5e_rq*, struct mlx5_cqe64*);typedef struct sk_buff * (*mlx5e_fp_skb_from_cqe_mpwrq )(struct mlx5e_rq *rq,struct mlx5e_mpw_info *wi,u16 cqe_bcnt,u32 head_offset,u32 page_idx); +typedef struct sk_buff * +(*mlx5e_fp_skb_from_cqe )(struct mlx5e_rq *rq,struct mlx5_cqe64 *cqe, +struct mlx5e_wqe_frag_info *wi,u32 cqe_bcnt);typedef bool (*mlx5e_fp_post_rx_wqes )(struct mlx5e_rq *rq);typedef void (*mlx5e_fp_dealloc_wqe )(struct mlx5e_rq *,u16 );
@@ -500,16 +510,27 @@ enum mlx5e_rq_flag { MLX5E_RQ_FLAG_XDP_XMIT = BIT(0), }; +struct mlx5e_rq_frag_info { +int frag_size; +int frag_stride; +}; + +struct mlx5e_rq_frags_info { +struct mlx5e_rq_frag_info arr[MLX5E_MAX_RX_FRAGS ]; +u8 num_frags; +u8 log_num_frags; +u8 wqe_bulk; +}; + struct mlx5e_rq { /* data path */ union { struct { - struct mlx5_wq_cyc wq; - struct mlx5e_wqe_frag_info *frag_info; - u32 frag_sz; /* max possible skb frag_sz */ - union { - bool page_reuse; - }; + struct mlx5_wq_cyc wq; + struct mlx5e_wqe_frag_info *frags; + struct mlx5e_dma_info *di; + struct mlx5e_rq_frags_info info; + mlx5e_fp_skb_from_cqe skb_from_cqe; } wqe; struct { struct mlx5_wq_ll wq;
@@ -523,7 +544,6 @@ struct mlx5e_rq { };struct {u16 headroom; -u8 page_order;u8 map_dir;/* dma map direction */ } buff;
@@ -879,6 +899,12 @@ mlx5e_skb_from_cqe_mpwrq_linear(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi,struct sk_buff *mlx5e_skb_from_cqe_mpwrq_nonlinear (struct mlx5e_rq *rq,struct mlx5e_mpw_info *wi,u16 cqe_bcnt,u32 head_offset,u32 page_idx); +struct sk_buff * +mlx5e_skb_from_cqe_linear (struct mlx5e_rq *rq,struct mlx5_cqe64 *cqe, +struct mlx5e_wqe_frag_info *wi,u32 cqe_bcnt); +struct sk_buff * +mlx5e_skb_from_cqe_nonlinear (struct mlx5e_rq *rq,struct mlx5_cqe64 *cqe, +struct mlx5e_wqe_frag_info *wi,u32 cqe_bcnt);void mlx5e_update_stats (struct mlx5e_priv *priv);
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +180 -58
381 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +147 -60
359 lines not on this page · raw message
Signature · 1 line
2.17.0
PATCH 16/17 net/mlx5e: RX, Always prefer Linear SKB configuration
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Prefer the linear SKB configuration of Legacy RQ over the non-linear one of Striding RQ.
This implies that ConnectX-4 LX now uses legacy RQ by default, as it does not support the linear configuration of Striding RQ.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +10 -3
@@ -4405,9 +4405,16 @@ void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,MLX5E_SET_PFLAG (params,MLX5E_PFLAG_RX_CQE_COMPRESS , params->rx_cqe_compress_def);/* RQ */ -if (mlx5e_striding_rq_possible (mdev, params)) -MLX5E_SET_PFLAG (params,MLX5E_PFLAG_RX_STRIDING_RQ , - !slow_pci_heuristic (mdev)); +/* Prefer Striding RQ, unless any of the following holds: +* - Striding RQ configuration is not possible/supported. +* - Slow PCI heuristic. +* - Legacy RQ would use linear SKB while Striding RQ would use non-linear. +*/ +if (!slow_pci_heuristic (mdev) && +mlx5e_striding_rq_possible (mdev, params) && + (mlx5e_rx_mpwqe_is_linear_skb (mdev, params) || + !mlx5e_rx_is_linear_skb (mdev, params))) +MLX5E_SET_PFLAG (params,MLX5E_PFLAG_RX_STRIDING_RQ , true);mlx5e_set_rq_type (mdev, params);mlx5e_init_rq_type_params (mdev, params);
Signature · 1 line
2.17.0
PATCH 17/17 net/mlx5e: TX, Separate cachelines of xmit and completion stats
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Avoid false sharing of cachelines by separating the cachelines of TX stats that are dertied in xmit flow and in completion flow.
--- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 8 ++++---- drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +4 -4
@@ -64,11 +64,11 @@ static const struct counter_desc sw_stats_desc[] = { { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_csum_partial) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_csum_partial_inner) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_stopped) }, - { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_wake) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_dropped) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_xmit_more) }, - { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_cqe_err) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_recover) }, + { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_wake) }, + { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_cqe_err) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_wqe_err) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_mpwqe_filler) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_buff_alloc_err) },
@@ -1137,11 +1137,11 @@ static const struct counter_desc sq_stats_desc[] = { { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, nop) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, csum_none) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, stopped) }, - { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, wake) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, dropped) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, xmit_more) }, - { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, cqe_err) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, recover) }, + { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, wake) }, + { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, cqe_err) }, }; static const struct counter_desc ch_stats_desc[] = {
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +5 -4
@@ -75,11 +75,11 @@ struct mlx5e_sw_stats {u64 tx_csum_partial;u64 tx_csum_partial_inner;u64 tx_queue_stopped; -u64 tx_queue_wake;u64 tx_queue_dropped;u64 tx_xmit_more; -u64 tx_cqe_err;u64 tx_recover; +u64 tx_queue_wake; +u64 tx_cqe_err;u64 rx_wqe_err;u64 rx_mpwqe_filler;u64 rx_buff_alloc_err;
@@ -203,10 +203,11 @@ struct mlx5e_sq_stats {/* less likely accessed in data path */ u64 csum_none;u64 stopped; -u64 wake;u64 dropped; -u64 cqe_err;u64 recover; +/* dirtied @completion */ +u64 wake____cacheline_aligned_in_smp ; +u64 cqe_err; };struct mlx5e_ch_stats {
Signature · 1 line
2.17.0
David Miller
maintainerFrom: Saeed Mahameed <[email protected]>
Date: Fri, 1 Jun 2018 17:05:27 -0700
Quoted 7 lines
Sorry for the extra 2 patches in this series, but mostly the series contains small patches and some fixes to previous patches in this submission window, with one main patch from Tariq to improve legacy RQ buffer management, for more information please refer to that tag log below.
Please pull and let me know if there's any problem.
Pulled, thanks Saeed.