Commit 0f48fb66 authored by David S. Miller's avatar David S. Miller

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 9d32e4e7 ("nfp: add support for coalesce adaptive feature")
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e300a85d 17e712c6
...@@ -2067,7 +2067,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget) ...@@ -2067,7 +2067,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget)
if (napi_complete_done(napi, pkts_polled)) if (napi_complete_done(napi, pkts_polled))
nfp_net_irq_unmask(r_vec->nfp_net, r_vec->irq_entry); nfp_net_irq_unmask(r_vec->nfp_net, r_vec->irq_entry);
if (r_vec->nfp_net->rx_coalesce_adapt_on) { if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) {
struct dim_sample dim_sample = {}; struct dim_sample dim_sample = {};
unsigned int start; unsigned int start;
u64 pkts, bytes; u64 pkts, bytes;
...@@ -2082,7 +2082,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget) ...@@ -2082,7 +2082,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget)
net_dim(&r_vec->rx_dim, dim_sample); net_dim(&r_vec->rx_dim, dim_sample);
} }
if (r_vec->nfp_net->tx_coalesce_adapt_on) { if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) {
struct dim_sample dim_sample = {}; struct dim_sample dim_sample = {};
unsigned int start; unsigned int start;
u64 pkts, bytes; u64 pkts, bytes;
...@@ -3016,10 +3016,8 @@ static void nfp_net_rx_dim_work(struct work_struct *work) ...@@ -3016,10 +3016,8 @@ static void nfp_net_rx_dim_work(struct work_struct *work)
/* copy RX interrupt coalesce parameters */ /* copy RX interrupt coalesce parameters */
value = (moder.pkts << 16) | (factor * moder.usec); value = (moder.pkts << 16) | (factor * moder.usec);
rtnl_lock();
nn_writel(nn, NFP_NET_CFG_RXR_IRQ_MOD(r_vec->rx_ring->idx), value); nn_writel(nn, NFP_NET_CFG_RXR_IRQ_MOD(r_vec->rx_ring->idx), value);
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD); (void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
rtnl_unlock();
dim->state = DIM_START_MEASURE; dim->state = DIM_START_MEASURE;
} }
...@@ -3047,10 +3045,8 @@ static void nfp_net_tx_dim_work(struct work_struct *work) ...@@ -3047,10 +3045,8 @@ static void nfp_net_tx_dim_work(struct work_struct *work)
/* copy TX interrupt coalesce parameters */ /* copy TX interrupt coalesce parameters */
value = (moder.pkts << 16) | (factor * moder.usec); value = (moder.pkts << 16) | (factor * moder.usec);
rtnl_lock();
nn_writel(nn, NFP_NET_CFG_TXR_IRQ_MOD(r_vec->tx_ring->idx), value); nn_writel(nn, NFP_NET_CFG_TXR_IRQ_MOD(r_vec->tx_ring->idx), value);
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD); (void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
rtnl_unlock();
dim->state = DIM_START_MEASURE; dim->state = DIM_START_MEASURE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment