mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
026a807c2d
Preparation for introducing adaptive TX to net DIM. Signed-off-by: Tal Gilboa <talgi@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
33 lines
938 B
C
33 lines
938 B
C
/* Broadcom NetXtreme-C/E network driver.
|
|
*
|
|
* Copyright (c) 2017-2018 Broadcom Limited
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/net_dim.h>
|
|
#include "bnxt_hsi.h"
|
|
#include "bnxt.h"
|
|
|
|
void bnxt_dim_work(struct work_struct *work)
|
|
{
|
|
struct net_dim *dim = container_of(work, struct net_dim,
|
|
work);
|
|
struct bnxt_cp_ring_info *cpr = container_of(dim,
|
|
struct bnxt_cp_ring_info,
|
|
dim);
|
|
struct bnxt_napi *bnapi = container_of(cpr,
|
|
struct bnxt_napi,
|
|
cp_ring);
|
|
struct net_dim_cq_moder cur_moder =
|
|
net_dim_get_rx_moderation(dim->mode, dim->profile_ix);
|
|
|
|
cpr->rx_ring_coal.coal_ticks = cur_moder.usec;
|
|
cpr->rx_ring_coal.coal_bufs = cur_moder.pkts;
|
|
|
|
bnxt_hwrm_set_ring_coal(bnapi->bp, bnapi);
|
|
dim->state = NET_DIM_START_MEASURE;
|
|
}
|