Commit 5227eccc authored by Bert Kenward's avatar Bert Kenward Committed by David S. Miller

sfc: remove tx and MCDI handling from NAPI budget consideration

The NAPI budget is only for RX processing work, not other work such as
 TX or MCDI completion handling.
Signed-off-by: default avatarBert Kenward <bkenward@solarflare.com>
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb07a820
...@@ -3572,31 +3572,26 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel, ...@@ -3572,31 +3572,26 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel,
return n_packets; return n_packets;
} }
static int static void
efx_ef10_handle_tx_event(struct efx_channel *channel, efx_qword_t *event) efx_ef10_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
{ {
struct efx_nic *efx = channel->efx; struct efx_nic *efx = channel->efx;
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
unsigned int tx_ev_desc_ptr; unsigned int tx_ev_desc_ptr;
unsigned int tx_ev_q_label; unsigned int tx_ev_q_label;
int tx_descs = 0;
if (unlikely(READ_ONCE(efx->reset_pending))) if (unlikely(READ_ONCE(efx->reset_pending)))
return 0; return;
if (unlikely(EFX_QWORD_FIELD(*event, ESF_DZ_TX_DROP_EVENT))) if (unlikely(EFX_QWORD_FIELD(*event, ESF_DZ_TX_DROP_EVENT)))
return 0; return;
/* Transmit completion */ /* Transmit completion */
tx_ev_desc_ptr = EFX_QWORD_FIELD(*event, ESF_DZ_TX_DESCR_INDX); tx_ev_desc_ptr = EFX_QWORD_FIELD(*event, ESF_DZ_TX_DESCR_INDX);
tx_ev_q_label = EFX_QWORD_FIELD(*event, ESF_DZ_TX_QLABEL); tx_ev_q_label = EFX_QWORD_FIELD(*event, ESF_DZ_TX_QLABEL);
tx_queue = efx_channel_get_tx_queue(channel, tx_queue = efx_channel_get_tx_queue(channel,
tx_ev_q_label % EFX_TXQ_TYPES); tx_ev_q_label % EFX_TXQ_TYPES);
tx_descs = ((tx_ev_desc_ptr + 1 - tx_queue->read_count) &
tx_queue->ptr_mask);
efx_xmit_done(tx_queue, tx_ev_desc_ptr & tx_queue->ptr_mask); efx_xmit_done(tx_queue, tx_ev_desc_ptr & tx_queue->ptr_mask);
return tx_descs;
} }
static void static void
...@@ -3658,7 +3653,6 @@ static int efx_ef10_ev_process(struct efx_channel *channel, int quota) ...@@ -3658,7 +3653,6 @@ static int efx_ef10_ev_process(struct efx_channel *channel, int quota)
efx_qword_t event, *p_event; efx_qword_t event, *p_event;
unsigned int read_ptr; unsigned int read_ptr;
int ev_code; int ev_code;
int tx_descs = 0;
int spent = 0; int spent = 0;
if (quota <= 0) if (quota <= 0)
...@@ -3698,13 +3692,7 @@ static int efx_ef10_ev_process(struct efx_channel *channel, int quota) ...@@ -3698,13 +3692,7 @@ static int efx_ef10_ev_process(struct efx_channel *channel, int quota)
} }
break; break;
case ESE_DZ_EV_CODE_TX_EV: case ESE_DZ_EV_CODE_TX_EV:
tx_descs += efx_ef10_handle_tx_event(channel, &event); efx_ef10_handle_tx_event(channel, &event);
if (tx_descs > efx->txq_entries) {
spent = quota;
goto out;
} else if (++spent == quota) {
goto out;
}
break; break;
case ESE_DZ_EV_CODE_DRIVER_EV: case ESE_DZ_EV_CODE_DRIVER_EV:
efx_ef10_handle_driver_event(channel, &event); efx_ef10_handle_driver_event(channel, &event);
......
...@@ -818,17 +818,16 @@ static void efx_farch_magic_event(struct efx_channel *channel, u32 magic) ...@@ -818,17 +818,16 @@ static void efx_farch_magic_event(struct efx_channel *channel, u32 magic)
* The NIC batches TX completion events; the message we receive is of * The NIC batches TX completion events; the message we receive is of
* the form "complete all TX events up to this index". * the form "complete all TX events up to this index".
*/ */
static int static void
efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event) efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
{ {
unsigned int tx_ev_desc_ptr; unsigned int tx_ev_desc_ptr;
unsigned int tx_ev_q_label; unsigned int tx_ev_q_label;
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
struct efx_nic *efx = channel->efx; struct efx_nic *efx = channel->efx;
int tx_packets = 0;
if (unlikely(READ_ONCE(efx->reset_pending))) if (unlikely(READ_ONCE(efx->reset_pending)))
return 0; return;
if (likely(EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_COMP))) { if (likely(EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_COMP))) {
/* Transmit completion */ /* Transmit completion */
...@@ -836,8 +835,6 @@ efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event) ...@@ -836,8 +835,6 @@ efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
tx_ev_q_label = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_Q_LABEL); tx_ev_q_label = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_Q_LABEL);
tx_queue = efx_channel_get_tx_queue( tx_queue = efx_channel_get_tx_queue(
channel, tx_ev_q_label % EFX_TXQ_TYPES); channel, tx_ev_q_label % EFX_TXQ_TYPES);
tx_packets = ((tx_ev_desc_ptr - tx_queue->read_count) &
tx_queue->ptr_mask);
efx_xmit_done(tx_queue, tx_ev_desc_ptr); efx_xmit_done(tx_queue, tx_ev_desc_ptr);
} else if (EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_WQ_FF_FULL)) { } else if (EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_WQ_FF_FULL)) {
/* Rewrite the FIFO write pointer */ /* Rewrite the FIFO write pointer */
...@@ -856,8 +853,6 @@ efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event) ...@@ -856,8 +853,6 @@ efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
EFX_QWORD_FMT"\n", channel->channel, EFX_QWORD_FMT"\n", channel->channel,
EFX_QWORD_VAL(*event)); EFX_QWORD_VAL(*event));
} }
return tx_packets;
} }
/* Detect errors included in the rx_evt_pkt_ok bit. */ /* Detect errors included in the rx_evt_pkt_ok bit. */
...@@ -1270,7 +1265,6 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget) ...@@ -1270,7 +1265,6 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget)
unsigned int read_ptr; unsigned int read_ptr;
efx_qword_t event, *p_event; efx_qword_t event, *p_event;
int ev_code; int ev_code;
int tx_packets = 0;
int spent = 0; int spent = 0;
if (budget <= 0) if (budget <= 0)
...@@ -1304,12 +1298,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget) ...@@ -1304,12 +1298,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget)
goto out; goto out;
break; break;
case FSE_AZ_EV_CODE_TX_EV: case FSE_AZ_EV_CODE_TX_EV:
tx_packets += efx_farch_handle_tx_event(channel, efx_farch_handle_tx_event(channel, &event);
&event);
if (tx_packets > efx->txq_entries) {
spent = budget;
goto out;
}
break; break;
case FSE_AZ_EV_CODE_DRV_GEN_EV: case FSE_AZ_EV_CODE_DRV_GEN_EV:
efx_farch_handle_generated_event(channel, &event); efx_farch_handle_generated_event(channel, &event);
......
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