File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
drivers/net/ethernet/google/gve Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 13
13
#define GVE_ITR_CLEAR_PBA_BIT_DQO BIT(1)
14
14
#define GVE_ITR_NO_UPDATE_DQO (3 << 3)
15
15
16
+ #define GVE_ITR_INTERVAL_DQO_SHIFT 5
17
+ #define GVE_ITR_INTERVAL_DQO_MASK ((1 << 12) - 1)
18
+
16
19
#define GVE_TX_IRQ_RATELIMIT_US_DQO 50
17
20
#define GVE_RX_IRQ_RATELIMIT_US_DQO 20
18
21
@@ -38,6 +41,22 @@ gve_tx_put_doorbell_dqo(const struct gve_priv *priv,
38
41
iowrite32 (val , & priv -> db_bar2 [index ]);
39
42
}
40
43
44
+ /* Builds register value to write to DQO IRQ doorbell to enable with specified
45
+ * ratelimit.
46
+ */
47
+ static inline u32 gve_set_itr_ratelimit_dqo (u32 ratelimit_us )
48
+ {
49
+ u32 result = GVE_ITR_ENABLE_BIT_DQO ;
50
+
51
+ /* Interval has 2us granularity. */
52
+ ratelimit_us >>= 1 ;
53
+
54
+ ratelimit_us &= GVE_ITR_INTERVAL_DQO_MASK ;
55
+ result |= (ratelimit_us << GVE_ITR_INTERVAL_DQO_SHIFT );
56
+
57
+ return result ;
58
+ }
59
+
41
60
static inline void
42
61
gve_write_irq_doorbell_dqo (const struct gve_priv * priv ,
43
62
const struct gve_notify_block * block , u32 val )
Original file line number Diff line number Diff line change @@ -1077,14 +1077,26 @@ static void gve_turnup(struct gve_priv *priv)
1077
1077
struct gve_notify_block * block = & priv -> ntfy_blocks [ntfy_idx ];
1078
1078
1079
1079
napi_enable (& block -> napi );
1080
- iowrite32be (0 , gve_irq_doorbell (priv , block ));
1080
+ if (gve_is_gqi (priv )) {
1081
+ iowrite32be (0 , gve_irq_doorbell (priv , block ));
1082
+ } else {
1083
+ u32 val = gve_set_itr_ratelimit_dqo (GVE_TX_IRQ_RATELIMIT_US_DQO );
1084
+
1085
+ gve_write_irq_doorbell_dqo (priv , block , val );
1086
+ }
1081
1087
}
1082
1088
for (idx = 0 ; idx < priv -> rx_cfg .num_queues ; idx ++ ) {
1083
1089
int ntfy_idx = gve_rx_idx_to_ntfy (priv , idx );
1084
1090
struct gve_notify_block * block = & priv -> ntfy_blocks [ntfy_idx ];
1085
1091
1086
1092
napi_enable (& block -> napi );
1087
- iowrite32be (0 , gve_irq_doorbell (priv , block ));
1093
+ if (gve_is_gqi (priv )) {
1094
+ iowrite32be (0 , gve_irq_doorbell (priv , block ));
1095
+ } else {
1096
+ u32 val = gve_set_itr_ratelimit_dqo (GVE_RX_IRQ_RATELIMIT_US_DQO );
1097
+
1098
+ gve_write_irq_doorbell_dqo (priv , block , val );
1099
+ }
1088
1100
}
1089
1101
1090
1102
gve_set_napi_enabled (priv );
You can’t perform that action at this time.
0 commit comments