Commit 8cb26756 authored by Edward Cree's avatar Edward Cree Committed by Jakub Kicinski

sfc: make ef100 xmit_more handling look more like ef10's

This should cause no functional change; merely make there only be one
 design of xmit_more handling to understand.  As with the EF10/Siena
 version, we set tx_queue->xmit_pending when we queue up a TX, and
 clear it when we ring the doorbell (in ef100_notify_tx_desc).
While we're at it, make ef100_notify_tx_desc static since nothing
 outside of ef100_tx.c uses it.
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1c0544d2
...@@ -117,11 +117,13 @@ static efx_oword_t *ef100_tx_desc(struct efx_tx_queue *tx_queue, unsigned int in ...@@ -117,11 +117,13 @@ static efx_oword_t *ef100_tx_desc(struct efx_tx_queue *tx_queue, unsigned int in
return NULL; return NULL;
} }
void ef100_notify_tx_desc(struct efx_tx_queue *tx_queue) static void ef100_notify_tx_desc(struct efx_tx_queue *tx_queue)
{ {
unsigned int write_ptr; unsigned int write_ptr;
efx_dword_t reg; efx_dword_t reg;
tx_queue->xmit_pending = false;
if (unlikely(tx_queue->notify_count == tx_queue->write_count)) if (unlikely(tx_queue->notify_count == tx_queue->write_count))
return; return;
...@@ -131,7 +133,6 @@ void ef100_notify_tx_desc(struct efx_tx_queue *tx_queue) ...@@ -131,7 +133,6 @@ void ef100_notify_tx_desc(struct efx_tx_queue *tx_queue)
efx_writed_page(tx_queue->efx, &reg, efx_writed_page(tx_queue->efx, &reg,
ER_GZ_TX_RING_DOORBELL, tx_queue->queue); ER_GZ_TX_RING_DOORBELL, tx_queue->queue);
tx_queue->notify_count = tx_queue->write_count; tx_queue->notify_count = tx_queue->write_count;
tx_queue->xmit_pending = false;
} }
static void ef100_tx_push_buffers(struct efx_tx_queue *tx_queue) static void ef100_tx_push_buffers(struct efx_tx_queue *tx_queue)
...@@ -372,15 +373,14 @@ int ef100_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) ...@@ -372,15 +373,14 @@ int ef100_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
netif_tx_start_queue(tx_queue->core_txq); netif_tx_start_queue(tx_queue->core_txq);
} }
if (__netdev_tx_sent_queue(tx_queue->core_txq, skb->len, xmit_more)) tx_queue->xmit_pending = true;
tx_queue->xmit_pending = false; /* push doorbell */
else if (tx_queue->write_count - tx_queue->notify_count > 255)
/* Ensure we never push more than 256 packets at once */
tx_queue->xmit_pending = false; /* push */
else
tx_queue->xmit_pending = true; /* don't push yet */
if (!tx_queue->xmit_pending) /* If xmit_more then we don't need to push the doorbell, unless there
* are 256 descriptors already queued in which case we have to push to
* ensure we never push more than 256 at once.
*/
if (__netdev_tx_sent_queue(tx_queue->core_txq, skb->len, xmit_more) ||
tx_queue->write_count - tx_queue->notify_count > 255)
ef100_tx_push_buffers(tx_queue); ef100_tx_push_buffers(tx_queue);
if (segments) { if (segments) {
...@@ -399,7 +399,7 @@ int ef100_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) ...@@ -399,7 +399,7 @@ int ef100_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
/* If we're not expecting another transmit and we had something to push /* If we're not expecting another transmit and we had something to push
* on this queue then we need to push here to get the previous packets * on this queue then we need to push here to get the previous packets
* out. We only enter this branch from before the 'Update BQL' section * out. We only enter this branch from before the xmit_more handling
* above, so xmit_pending still refers to the old state. * above, so xmit_pending still refers to the old state.
*/ */
if (tx_queue->xmit_pending && !xmit_more) if (tx_queue->xmit_pending && !xmit_more)
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
int ef100_tx_probe(struct efx_tx_queue *tx_queue); int ef100_tx_probe(struct efx_tx_queue *tx_queue);
void ef100_tx_init(struct efx_tx_queue *tx_queue); void ef100_tx_init(struct efx_tx_queue *tx_queue);
void ef100_tx_write(struct efx_tx_queue *tx_queue); void ef100_tx_write(struct efx_tx_queue *tx_queue);
void ef100_notify_tx_desc(struct efx_tx_queue *tx_queue);
unsigned int ef100_tx_max_skb_descs(struct efx_nic *efx); unsigned int ef100_tx_max_skb_descs(struct efx_nic *efx);
void ef100_ev_tx(struct efx_channel *channel, const efx_qword_t *p_event); void ef100_ev_tx(struct efx_channel *channel, const efx_qword_t *p_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