Skip to content

Commit 0f48fb6

Browse files
committed
Merge branch 'nfp-fixes'
Simon Horman says: ==================== nfp: fix bugs caused by adaptive coalesce this series contains fixes for two bugs introduced when when adaptive coalesce support was added to the NFP driver in v5.15 by 9d32e4e ("nfp: add support for coalesce adaptive feature") ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents e300a85 + 17e712c commit 0f48fb6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net_common.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget)
20672067
if (napi_complete_done(napi, pkts_polled))
20682068
nfp_net_irq_unmask(r_vec->nfp_net, r_vec->irq_entry);
20692069

2070-
if (r_vec->nfp_net->rx_coalesce_adapt_on) {
2070+
if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) {
20712071
struct dim_sample dim_sample = {};
20722072
unsigned int start;
20732073
u64 pkts, bytes;
@@ -2082,7 +2082,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget)
20822082
net_dim(&r_vec->rx_dim, dim_sample);
20832083
}
20842084

2085-
if (r_vec->nfp_net->tx_coalesce_adapt_on) {
2085+
if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) {
20862086
struct dim_sample dim_sample = {};
20872087
unsigned int start;
20882088
u64 pkts, bytes;
@@ -3016,10 +3016,8 @@ static void nfp_net_rx_dim_work(struct work_struct *work)
30163016

30173017
/* copy RX interrupt coalesce parameters */
30183018
value = (moder.pkts << 16) | (factor * moder.usec);
3019-
rtnl_lock();
30203019
nn_writel(nn, NFP_NET_CFG_RXR_IRQ_MOD(r_vec->rx_ring->idx), value);
30213020
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
3022-
rtnl_unlock();
30233021

30243022
dim->state = DIM_START_MEASURE;
30253023
}
@@ -3047,10 +3045,8 @@ static void nfp_net_tx_dim_work(struct work_struct *work)
30473045

30483046
/* copy TX interrupt coalesce parameters */
30493047
value = (moder.pkts << 16) | (factor * moder.usec);
3050-
rtnl_lock();
30513048
nn_writel(nn, NFP_NET_CFG_TXR_IRQ_MOD(r_vec->tx_ring->idx), value);
30523049
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
3053-
rtnl_unlock();
30543050

30553051
dim->state = DIM_START_MEASURE;
30563052
}

0 commit comments

Comments
 (0)