]>
Commit | Line | Data |
---|---|---|
6a8788f2 AG |
1 | /* Broadcom NetXtreme-C/E network driver. |
2 | * | |
3 | * Copyright (c) 2017-2018 Broadcom Limited | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation. | |
8 | */ | |
9 | ||
4f75da36 | 10 | #include <linux/dim.h> |
6a8788f2 AG |
11 | #include "bnxt_hsi.h" |
12 | #include "bnxt.h" | |
13 | ||
14 | void bnxt_dim_work(struct work_struct *work) | |
15 | { | |
8960b389 | 16 | struct dim *dim = container_of(work, struct dim, work); |
6a8788f2 AG |
17 | struct bnxt_cp_ring_info *cpr = container_of(dim, |
18 | struct bnxt_cp_ring_info, | |
19 | dim); | |
20 | struct bnxt_napi *bnapi = container_of(cpr, | |
21 | struct bnxt_napi, | |
22 | cp_ring); | |
8960b389 | 23 | struct dim_cq_moder cur_moder = |
026a807c | 24 | net_dim_get_rx_moderation(dim->mode, dim->profile_ix); |
6a8788f2 | 25 | |
026a807c TG |
26 | cpr->rx_ring_coal.coal_ticks = cur_moder.usec; |
27 | cpr->rx_ring_coal.coal_bufs = cur_moder.pkts; | |
6a8788f2 AG |
28 | |
29 | bnxt_hwrm_set_ring_coal(bnapi->bp, bnapi); | |
c002bd52 | 30 | dim->state = DIM_START_MEASURE; |
6a8788f2 | 31 | } |