@@ -270,12 +270,9 @@ void mlx5e_update_stats_work(struct work_struct *work)
270270 struct delayed_work * dwork = to_delayed_work (work );
271271 struct mlx5e_priv * priv = container_of (dwork , struct mlx5e_priv ,
272272 update_stats_work );
273+
273274 mutex_lock (& priv -> state_lock );
274- if (test_bit (MLX5E_STATE_OPENED , & priv -> state )) {
275- priv -> profile -> update_stats (priv );
276- queue_delayed_work (priv -> wq , dwork ,
277- msecs_to_jiffies (MLX5E_UPDATE_STATS_INTERVAL ));
278- }
275+ priv -> profile -> update_stats (priv );
279276 mutex_unlock (& priv -> state_lock );
280277}
281278
@@ -352,8 +349,8 @@ static int mlx5e_rq_alloc_mpwqe_info(struct mlx5e_rq *rq,
352349{
353350 int wq_sz = mlx5_wq_ll_get_size (& rq -> mpwqe .wq );
354351
355- rq -> mpwqe .info = kcalloc_node (wq_sz , sizeof (* rq -> mpwqe .info ),
356- GFP_KERNEL , cpu_to_node (c -> cpu ));
352+ rq -> mpwqe .info = kvzalloc_node (wq_sz * sizeof (* rq -> mpwqe .info ),
353+ GFP_KERNEL , cpu_to_node (c -> cpu ));
357354 if (!rq -> mpwqe .info )
358355 return - ENOMEM ;
359356
@@ -670,7 +667,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
670667err_free :
671668 switch (rq -> wq_type ) {
672669 case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ :
673- kfree (rq -> mpwqe .info );
670+ kvfree (rq -> mpwqe .info );
674671 mlx5_core_destroy_mkey (mdev , & rq -> umr_mkey );
675672 break ;
676673 default : /* MLX5_WQ_TYPE_CYCLIC */
@@ -702,7 +699,7 @@ static void mlx5e_free_rq(struct mlx5e_rq *rq)
702699
703700 switch (rq -> wq_type ) {
704701 case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ :
705- kfree (rq -> mpwqe .info );
702+ kvfree (rq -> mpwqe .info );
706703 mlx5_core_destroy_mkey (rq -> mdev , & rq -> umr_mkey );
707704 break ;
708705 default : /* MLX5_WQ_TYPE_CYCLIC */
@@ -965,15 +962,15 @@ static void mlx5e_close_rq(struct mlx5e_rq *rq)
965962
966963static void mlx5e_free_xdpsq_db (struct mlx5e_xdpsq * sq )
967964{
968- kfree (sq -> db .di );
965+ kvfree (sq -> db .di );
969966}
970967
971968static int mlx5e_alloc_xdpsq_db (struct mlx5e_xdpsq * sq , int numa )
972969{
973970 int wq_sz = mlx5_wq_cyc_get_size (& sq -> wq );
974971
975- sq -> db .di = kcalloc_node ( wq_sz , sizeof (* sq -> db .di ),
976- GFP_KERNEL , numa );
972+ sq -> db .di = kvzalloc_node ( sizeof (* sq -> db .di ) * wq_sz ,
973+ GFP_KERNEL , numa );
977974 if (!sq -> db .di ) {
978975 mlx5e_free_xdpsq_db (sq );
979976 return - ENOMEM ;
@@ -1024,15 +1021,15 @@ static void mlx5e_free_xdpsq(struct mlx5e_xdpsq *sq)
10241021
10251022static void mlx5e_free_icosq_db (struct mlx5e_icosq * sq )
10261023{
1027- kfree (sq -> db .ico_wqe );
1024+ kvfree (sq -> db .ico_wqe );
10281025}
10291026
10301027static int mlx5e_alloc_icosq_db (struct mlx5e_icosq * sq , int numa )
10311028{
10321029 u8 wq_sz = mlx5_wq_cyc_get_size (& sq -> wq );
10331030
1034- sq -> db .ico_wqe = kcalloc_node ( wq_sz , sizeof (* sq -> db .ico_wqe ),
1035- GFP_KERNEL , numa );
1031+ sq -> db .ico_wqe = kvzalloc_node ( sizeof (* sq -> db .ico_wqe ) * wq_sz ,
1032+ GFP_KERNEL , numa );
10361033 if (!sq -> db .ico_wqe )
10371034 return - ENOMEM ;
10381035
@@ -1077,19 +1074,19 @@ static void mlx5e_free_icosq(struct mlx5e_icosq *sq)
10771074
10781075static void mlx5e_free_txqsq_db (struct mlx5e_txqsq * sq )
10791076{
1080- kfree (sq -> db .wqe_info );
1081- kfree (sq -> db .dma_fifo );
1077+ kvfree (sq -> db .wqe_info );
1078+ kvfree (sq -> db .dma_fifo );
10821079}
10831080
10841081static int mlx5e_alloc_txqsq_db (struct mlx5e_txqsq * sq , int numa )
10851082{
10861083 int wq_sz = mlx5_wq_cyc_get_size (& sq -> wq );
10871084 int df_sz = wq_sz * MLX5_SEND_WQEBB_NUM_DS ;
10881085
1089- sq -> db .dma_fifo = kcalloc_node (df_sz , sizeof (* sq -> db .dma_fifo ),
1090- GFP_KERNEL , numa );
1091- sq -> db .wqe_info = kcalloc_node (wq_sz , sizeof (* sq -> db .wqe_info ),
1092- GFP_KERNEL , numa );
1086+ sq -> db .dma_fifo = kvzalloc_node (df_sz * sizeof (* sq -> db .dma_fifo ),
1087+ GFP_KERNEL , numa );
1088+ sq -> db .wqe_info = kvzalloc_node (wq_sz * sizeof (* sq -> db .wqe_info ),
1089+ GFP_KERNEL , numa );
10931090 if (!sq -> db .dma_fifo || !sq -> db .wqe_info ) {
10941091 mlx5e_free_txqsq_db (sq );
10951092 return - ENOMEM ;
@@ -1893,7 +1890,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
18931890 int err ;
18941891 int eqn ;
18951892
1896- c = kzalloc_node (sizeof (* c ), GFP_KERNEL , cpu_to_node (cpu ));
1893+ c = kvzalloc_node (sizeof (* c ), GFP_KERNEL , cpu_to_node (cpu ));
18971894 if (!c )
18981895 return - ENOMEM ;
18991896
@@ -1979,7 +1976,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
19791976
19801977err_napi_del :
19811978 netif_napi_del (& c -> napi );
1982- kfree (c );
1979+ kvfree (c );
19831980
19841981 return err ;
19851982}
@@ -2018,7 +2015,7 @@ static void mlx5e_close_channel(struct mlx5e_channel *c)
20182015 mlx5e_close_cq (& c -> icosq .cq );
20192016 netif_napi_del (& c -> napi );
20202017
2021- kfree (c );
2018+ kvfree (c );
20222019}
20232020
20242021#define DEFAULT_FRAG_SIZE (2048)
@@ -2276,7 +2273,7 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
22762273 chs -> num = chs -> params .num_channels ;
22772274
22782275 chs -> c = kcalloc (chs -> num , sizeof (struct mlx5e_channel * ), GFP_KERNEL );
2279- cparam = kzalloc (sizeof (struct mlx5e_channel_param ), GFP_KERNEL );
2276+ cparam = kvzalloc (sizeof (struct mlx5e_channel_param ), GFP_KERNEL );
22802277 if (!chs -> c || !cparam )
22812278 goto err_free ;
22822279
@@ -2287,7 +2284,7 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
22872284 goto err_close_channels ;
22882285 }
22892286
2290- kfree (cparam );
2287+ kvfree (cparam );
22912288 return 0 ;
22922289
22932290err_close_channels :
@@ -2296,7 +2293,7 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
22962293
22972294err_free :
22982295 kfree (chs -> c );
2299- kfree (cparam );
2296+ kvfree (cparam );
23002297 chs -> num = 0 ;
23012298 return err ;
23022299}
@@ -3405,6 +3402,9 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
34053402 struct mlx5e_vport_stats * vstats = & priv -> stats .vport ;
34063403 struct mlx5e_pport_stats * pstats = & priv -> stats .pport ;
34073404
3405+ /* update HW stats in background for next time */
3406+ queue_delayed_work (priv -> wq , & priv -> update_stats_work , 0 );
3407+
34083408 if (mlx5e_is_uplink_rep (priv )) {
34093409 stats -> rx_packets = PPORT_802_3_GET (pstats , a_frames_received_ok );
34103410 stats -> rx_bytes = PPORT_802_3_GET (pstats , a_octets_received_ok );
@@ -4592,6 +4592,9 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
45924592 netdev -> features |= NETIF_F_HIGHDMA ;
45934593 netdev -> features |= NETIF_F_HW_VLAN_STAG_FILTER ;
45944594
4595+ netdev -> features |= NETIF_F_GSO_UDP_L4 ;
4596+ netdev -> hw_features |= NETIF_F_GSO_UDP_L4 ;
4597+
45954598 netdev -> priv_flags |= IFF_UNICAST_FLT ;
45964599
45974600 mlx5e_set_netdev_dev_addr (netdev );
0 commit comments