ionic: clean tx queue of unfinished requests

Clean out tx requests that didn't get finished before
shutting down the queue.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Shannon Nelson 2020-03-27 20:14:45 -07:00 committed by David S. Miller
parent 0b0641009b
commit f9c00e2cf2
3 changed files with 18 additions and 0 deletions

View File

@ -1454,6 +1454,7 @@ static void ionic_txrx_deinit(struct ionic_lif *lif)
for (i = 0; i < lif->nxqs; i++) { for (i = 0; i < lif->nxqs; i++) {
ionic_lif_qcq_deinit(lif, lif->txqcqs[i].qcq); ionic_lif_qcq_deinit(lif, lif->txqcqs[i].qcq);
ionic_tx_flush(&lif->txqcqs[i].qcq->cq); ionic_tx_flush(&lif->txqcqs[i].qcq->cq);
ionic_tx_empty(&lif->txqcqs[i].qcq->q);
ionic_lif_qcq_deinit(lif, lif->rxqcqs[i].qcq); ionic_lif_qcq_deinit(lif, lif->rxqcqs[i].qcq);
ionic_rx_flush(&lif->rxqcqs[i].qcq->cq); ionic_rx_flush(&lif->rxqcqs[i].qcq->cq);

View File

@ -593,6 +593,22 @@ void ionic_tx_flush(struct ionic_cq *cq)
work_done, 0); work_done, 0);
} }
void ionic_tx_empty(struct ionic_queue *q)
{
struct ionic_desc_info *desc_info;
int done = 0;
/* walk the not completed tx entries, if any */
while (q->head != q->tail) {
desc_info = q->tail;
q->tail = desc_info->next;
ionic_tx_clean(q, desc_info, NULL, desc_info->cb_arg);
desc_info->cb = NULL;
desc_info->cb_arg = NULL;
done++;
}
}
static int ionic_tx_tcp_inner_pseudo_csum(struct sk_buff *skb) static int ionic_tx_tcp_inner_pseudo_csum(struct sk_buff *skb)
{ {
int err; int err;

View File

@ -9,6 +9,7 @@ void ionic_tx_flush(struct ionic_cq *cq);
void ionic_rx_fill(struct ionic_queue *q); void ionic_rx_fill(struct ionic_queue *q);
void ionic_rx_empty(struct ionic_queue *q); void ionic_rx_empty(struct ionic_queue *q);
void ionic_tx_empty(struct ionic_queue *q);
int ionic_rx_napi(struct napi_struct *napi, int budget); int ionic_rx_napi(struct napi_struct *napi, int budget);
netdev_tx_t ionic_start_xmit(struct sk_buff *skb, struct net_device *netdev); netdev_tx_t ionic_start_xmit(struct sk_buff *skb, struct net_device *netdev);