Skip to content

Commit 98dd1ed

Browse files
CCX-Stingraydavem330
authored andcommitted
net/mlx5e: Move interrupt moderation structs to new file
Create new header file to prepare to move code that handles irq moderation to a library that lives in a header file. Signed-off-by: Andy Gospodarek <[email protected]> Acked-by: Tal Gilboa <[email protected]> Acked-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8448f91 commit 98dd1ed

File tree

2 files changed

+70
-32
lines changed

2 files changed

+70
-32
lines changed

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

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "wq.h"
5151
#include "mlx5_core.h"
5252
#include "en_stats.h"
53+
#include "en_dim.h"
5354

5455
#define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v)
5556

@@ -227,12 +228,6 @@ enum mlx5e_priv_flag {
227228
#define MLX5E_MAX_BW_ALLOC 100 /* Max percentage of BW allocation */
228229
#endif
229230

230-
struct mlx5e_cq_moder {
231-
u16 usec;
232-
u16 pkts;
233-
u8 cq_period_mode;
234-
};
235-
236231
struct mlx5e_params {
237232
u8 log_sq_size;
238233
u8 rq_wq_type;
@@ -473,32 +468,6 @@ struct mlx5e_mpw_info {
473468
u16 skbs_frags[MLX5_MPWRQ_PAGES_PER_WQE];
474469
};
475470

476-
struct mlx5e_rx_am_stats {
477-
int ppms; /* packets per msec */
478-
int bpms; /* bytes per msec */
479-
int epms; /* events per msec */
480-
};
481-
482-
struct mlx5e_rx_am_sample {
483-
ktime_t time;
484-
u32 pkt_ctr;
485-
u32 byte_ctr;
486-
u16 event_ctr;
487-
};
488-
489-
struct mlx5e_rx_am { /* Adaptive Moderation */
490-
u8 state;
491-
struct mlx5e_rx_am_stats prev_stats;
492-
struct mlx5e_rx_am_sample start_sample;
493-
struct work_struct work;
494-
u8 profile_ix;
495-
u8 mode;
496-
u8 tune_state;
497-
u8 steps_right;
498-
u8 steps_left;
499-
u8 tired;
500-
};
501-
502471
/* a single cache unit is capable to serve one napi call (for non-striding rq)
503472
* or a MPWQE (for striding rq).
504473
*/
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved.
3+
* Copyright (c) 2017-2018, Broadcom Limited
4+
*
5+
* This software is available to you under a choice of one of two
6+
* licenses. You may choose to be licensed under the terms of the GNU
7+
* General Public License (GPL) Version 2, available from the file
8+
* COPYING in the main directory of this source tree, or the
9+
* OpenIB.org BSD license below:
10+
*
11+
* Redistribution and use in source and binary forms, with or
12+
* without modification, are permitted provided that the following
13+
* conditions are met:
14+
*
15+
* - Redistributions of source code must retain the above
16+
* copyright notice, this list of conditions and the following
17+
* disclaimer.
18+
*
19+
* - Redistributions in binary form must reproduce the above
20+
* copyright notice, this list of conditions and the following
21+
* disclaimer in the documentation and/or other materials
22+
* provided with the distribution.
23+
*
24+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31+
* SOFTWARE.
32+
*/
33+
34+
#ifndef MLX5_AM_H
35+
#define MLX5_AM_H
36+
37+
struct mlx5e_cq_moder {
38+
u16 usec;
39+
u16 pkts;
40+
u8 cq_period_mode;
41+
};
42+
43+
struct mlx5e_rx_am_sample {
44+
ktime_t time;
45+
u32 pkt_ctr;
46+
u32 byte_ctr;
47+
u16 event_ctr;
48+
};
49+
50+
struct mlx5e_rx_am_stats {
51+
int ppms; /* packets per msec */
52+
int bpms; /* bytes per msec */
53+
int epms; /* events per msec */
54+
};
55+
56+
struct mlx5e_rx_am { /* Adaptive Moderation */
57+
u8 state;
58+
struct mlx5e_rx_am_stats prev_stats;
59+
struct mlx5e_rx_am_sample start_sample;
60+
struct work_struct work;
61+
u8 profile_ix;
62+
u8 mode;
63+
u8 tune_state;
64+
u8 steps_right;
65+
u8 steps_left;
66+
u8 tired;
67+
};
68+
69+
#endif /* MLX5_AM_H */

0 commit comments

Comments
 (0)