1 /* Broadcom NetXtreme-C/E network driver.
3 * Copyright (c) 2017-2018 Broadcom Limited
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.
10 #include <linux/net_dim.h>
14 void bnxt_dim_work(struct work_struct
*work
)
16 struct net_dim
*dim
= container_of(work
, struct net_dim
,
18 struct bnxt_cp_ring_info
*cpr
= container_of(dim
,
19 struct bnxt_cp_ring_info
,
21 struct bnxt_napi
*bnapi
= container_of(cpr
,
24 struct net_dim_cq_moder cur_moder
=
25 net_dim_get_rx_moderation(dim
->mode
, dim
->profile_ix
);
27 cpr
->rx_ring_coal
.coal_ticks
= cur_moder
.usec
;
28 cpr
->rx_ring_coal
.coal_bufs
= cur_moder
.pkts
;
30 bnxt_hwrm_set_ring_coal(bnapi
->bp
, bnapi
);
31 dim
->state
= NET_DIM_START_MEASURE
;