Commit 138506ab authored by Brett Creeley's avatar Brett Creeley Committed by David S. Miller

ionic: Check stop no restart

If there is a lot of transmit traffic the driver can get into a
situation that the device is starved due to the doorbell never
being rung. This can happen if xmit_more is set constantly
and __netdev_tx_sent_queue() keeps returning false. Fix this
by checking if the queue needs to be stopped right before
calling __netdev_tx_sent_queue(). Use MAX_SKB_FRAGS + 1 as the
stop condition because that's the maximum number of frags
supported for non-TSO transmit.
Signed-off-by: default avatarBrett Creeley <brett.creeley@amd.com>
Signed-off-by: default avatarShannon Nelson <shannon.nelson@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc581273
...@@ -1665,9 +1665,14 @@ static int ionic_tx(struct ionic_queue *q, struct sk_buff *skb) ...@@ -1665,9 +1665,14 @@ static int ionic_tx(struct ionic_queue *q, struct sk_buff *skb)
stats->pkts++; stats->pkts++;
stats->bytes += skb->len; stats->bytes += skb->len;
if (!ionic_txq_hwstamp_enabled(q)) if (!ionic_txq_hwstamp_enabled(q)) {
ring_dbell = __netdev_tx_sent_queue(q_to_ndq(q), skb->len, struct netdev_queue *ndq = q_to_ndq(q);
if (unlikely(!ionic_q_has_space(q, MAX_SKB_FRAGS + 1)))
netif_tx_stop_queue(ndq);
ring_dbell = __netdev_tx_sent_queue(ndq, skb->len,
netdev_xmit_more()); netdev_xmit_more());
}
ionic_txq_post(q, ring_dbell, ionic_tx_clean, skb); ionic_txq_post(q, ring_dbell, ionic_tx_clean, skb);
return 0; return 0;
......
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