summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTal Gilboa <talgi@mellanox.com>2019-01-31 16:44:48 +0200
committerSaeed Mahameed <saeedm@mellanox.com>2019-06-25 13:46:39 -0700
commit8960b38932bee8db0bc9c4d8c135f21df6cdd297 (patch)
tree411faabad103240faad36000dd42362b7d8a3f91 /include
parente5b6ab02d7aa4118c9a36491633812dcc442acbe (diff)
downloadlwn-8960b38932bee8db0bc9c4d8c135f21df6cdd297.tar.gz
lwn-8960b38932bee8db0bc9c4d8c135f21df6cdd297.zip
linux/dim: Rename externally used net_dim members
Removed 'net' prefix from functions and structs used by external drivers. Signed-off-by: Tal Gilboa <talgi@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dim.h21
-rw-r--r--include/linux/net_dim.h30
2 files changed, 25 insertions, 26 deletions
diff --git a/include/linux/dim.h b/include/linux/dim.h
index f0f20ed25497..60e5074a7cc0 100644
--- a/include/linux/dim.h
+++ b/include/linux/dim.h
@@ -14,13 +14,13 @@
#define BIT_GAP(bits, end, start) ((((end) - (start)) + BIT_ULL(bits)) \
& (BIT_ULL(bits) - 1))
-struct net_dim_cq_moder {
+struct dim_cq_moder {
u16 usec;
u16 pkts;
u8 cq_period_mode;
};
-struct net_dim_sample {
+struct dim_sample {
ktime_t time;
u32 pkt_ctr;
u32 byte_ctr;
@@ -33,10 +33,10 @@ struct dim_stats {
int epms; /* events per msec */
};
-struct net_dim { /* Dynamic Interrupt Moderation */
+struct dim { /* Dynamic Interrupt Moderation */
u8 state;
struct dim_stats prev_stats;
- struct net_dim_sample start_sample;
+ struct dim_sample start_sample;
struct work_struct work;
u8 profile_ix;
u8 mode;
@@ -77,7 +77,7 @@ enum {
DIM_ON_EDGE,
};
-static inline bool dim_on_top(struct net_dim *dim)
+static inline bool dim_on_top(struct dim *dim)
{
switch (dim->tune_state) {
case DIM_PARKING_ON_TOP:
@@ -90,7 +90,7 @@ static inline bool dim_on_top(struct net_dim *dim)
}
}
-static inline void dim_turn(struct net_dim *dim)
+static inline void dim_turn(struct dim *dim)
{
switch (dim->tune_state) {
case DIM_PARKING_ON_TOP:
@@ -107,7 +107,7 @@ static inline void dim_turn(struct net_dim *dim)
}
}
-static inline void dim_park_on_top(struct net_dim *dim)
+static inline void dim_park_on_top(struct dim *dim)
{
dim->steps_right = 0;
dim->steps_left = 0;
@@ -115,7 +115,7 @@ static inline void dim_park_on_top(struct net_dim *dim)
dim->tune_state = DIM_PARKING_ON_TOP;
}
-static inline void dim_park_tired(struct net_dim *dim)
+static inline void dim_park_tired(struct dim *dim)
{
dim->steps_right = 0;
dim->steps_left = 0;
@@ -123,8 +123,7 @@ static inline void dim_park_tired(struct net_dim *dim)
}
static inline void
-net_dim_update_sample(u16 event_ctr, u64 packets, u64 bytes,
- struct net_dim_sample *s)
+dim_update_sample(u16 event_ctr, u64 packets, u64 bytes, struct dim_sample *s)
{
s->time = ktime_get();
s->pkt_ctr = packets;
@@ -133,7 +132,7 @@ net_dim_update_sample(u16 event_ctr, u64 packets, u64 bytes,
}
static inline void
-dim_calc_stats(struct net_dim_sample *start, struct net_dim_sample *end,
+dim_calc_stats(struct dim_sample *start, struct dim_sample *end,
struct dim_stats *curr_stats)
{
/* u32 holds up to 71 minutes, should be enough */
diff --git a/include/linux/net_dim.h b/include/linux/net_dim.h
index d4b40adc7fa1..4e009ec193ef 100644
--- a/include/linux/net_dim.h
+++ b/include/linux/net_dim.h
@@ -77,28 +77,28 @@
{64, 32} \
}
-static const struct net_dim_cq_moder
+static const struct dim_cq_moder
rx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
NET_DIM_RX_EQE_PROFILES,
NET_DIM_RX_CQE_PROFILES,
};
-static const struct net_dim_cq_moder
+static const struct dim_cq_moder
tx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
NET_DIM_TX_EQE_PROFILES,
NET_DIM_TX_CQE_PROFILES,
};
-static inline struct net_dim_cq_moder
+static inline struct dim_cq_moder
net_dim_get_rx_moderation(u8 cq_period_mode, int ix)
{
- struct net_dim_cq_moder cq_moder = rx_profile[cq_period_mode][ix];
+ struct dim_cq_moder cq_moder = rx_profile[cq_period_mode][ix];
cq_moder.cq_period_mode = cq_period_mode;
return cq_moder;
}
-static inline struct net_dim_cq_moder
+static inline struct dim_cq_moder
net_dim_get_def_rx_moderation(u8 cq_period_mode)
{
u8 profile_ix = cq_period_mode == DIM_CQ_PERIOD_MODE_START_FROM_CQE ?
@@ -107,16 +107,16 @@ net_dim_get_def_rx_moderation(u8 cq_period_mode)
return net_dim_get_rx_moderation(cq_period_mode, profile_ix);
}
-static inline struct net_dim_cq_moder
+static inline struct dim_cq_moder
net_dim_get_tx_moderation(u8 cq_period_mode, int ix)
{
- struct net_dim_cq_moder cq_moder = tx_profile[cq_period_mode][ix];
+ struct dim_cq_moder cq_moder = tx_profile[cq_period_mode][ix];
cq_moder.cq_period_mode = cq_period_mode;
return cq_moder;
}
-static inline struct net_dim_cq_moder
+static inline struct dim_cq_moder
net_dim_get_def_tx_moderation(u8 cq_period_mode)
{
u8 profile_ix = cq_period_mode == DIM_CQ_PERIOD_MODE_START_FROM_CQE ?
@@ -125,7 +125,7 @@ net_dim_get_def_tx_moderation(u8 cq_period_mode)
return net_dim_get_tx_moderation(cq_period_mode, profile_ix);
}
-static inline int net_dim_step(struct net_dim *dim)
+static inline int net_dim_step(struct dim *dim)
{
if (dim->tired == (NET_DIM_PARAMS_NUM_PROFILES * 2))
return DIM_TOO_TIRED;
@@ -152,7 +152,7 @@ static inline int net_dim_step(struct net_dim *dim)
return DIM_STEPPED;
}
-static inline void net_dim_exit_parking(struct net_dim *dim)
+static inline void net_dim_exit_parking(struct dim *dim)
{
dim->tune_state = dim->profile_ix ? DIM_GOING_LEFT :
DIM_GOING_RIGHT;
@@ -189,7 +189,7 @@ static inline int net_dim_stats_compare(struct dim_stats *curr,
}
static inline bool net_dim_decision(struct dim_stats *curr_stats,
- struct net_dim *dim)
+ struct dim *dim)
{
int prev_state = dim->tune_state;
int prev_ix = dim->profile_ix;
@@ -240,8 +240,8 @@ static inline bool net_dim_decision(struct dim_stats *curr_stats,
return dim->profile_ix != prev_ix;
}
-static inline void net_dim(struct net_dim *dim,
- struct net_dim_sample end_sample)
+static inline void net_dim(struct dim *dim,
+ struct dim_sample end_sample)
{
struct dim_stats curr_stats;
u16 nevents;
@@ -261,8 +261,8 @@ static inline void net_dim(struct net_dim *dim,
}
/* fall through */
case DIM_START_MEASURE:
- net_dim_update_sample(end_sample.event_ctr, end_sample.pkt_ctr,
- end_sample.byte_ctr, &dim->start_sample);
+ dim_update_sample(end_sample.event_ctr, end_sample.pkt_ctr,
+ end_sample.byte_ctr, &dim->start_sample);
dim->state = DIM_MEASURE_IN_PROGRESS;
break;
case DIM_APPLY_NEW_PROFILE: