git: 543cf924bcdc - main - gve: Simplify tx loop over buffer ring
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 12 Aug 2023 08:02:00 UTC
The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=543cf924bcdcf064fed417ec3d66000ef66194d2 commit 543cf924bcdcf064fed417ec3d66000ef66194d2 Author: Shailend Chand <shailend@google.com> AuthorDate: 2023-08-12 07:59:26 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2023-08-12 08:01:53 +0000 gve: Simplify tx loop over buffer ring Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41281 --- sys/dev/gve/gve_tx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/gve/gve_tx.c b/sys/dev/gve/gve_tx.c index db3f7415f412..1e62e1226be1 100644 --- a/sys/dev/gve/gve_tx.c +++ b/sys/dev/gve/gve_tx.c @@ -696,10 +696,9 @@ gve_xmit_br(struct gve_tx_ring *tx) struct ifnet *ifp = priv->ifp; struct mbuf *mbuf; - while (!drbr_empty(ifp, tx->br) && - (if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { + while ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0 && + (mbuf = drbr_peek(ifp, tx->br)) != NULL) { - mbuf = drbr_peek(ifp, tx->br); if (__predict_false(gve_xmit(tx, mbuf) != 0)) { drbr_putback(ifp, tx->br, mbuf); taskqueue_enqueue(tx->xmit_tq, &tx->xmit_task);