Skip to content

Commit

Permalink
dpaa2: ni: Provide its own ATOMIC_XCHG.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsalychev committed Jun 22, 2022
1 parent 72ae323 commit 34014de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sys/dev/dpaa2/dpaa2_ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");

#include <machine/bus.h>
#include <machine/resource.h>
#include <machine/atomic.h>

#include <net/ethernet.h>
#include <net/bpf.h>
Expand Down Expand Up @@ -110,6 +111,9 @@ __FBSDID("$FreeBSD$");
#define DPAA2_TX_RING(sc, chan, tc) \
(&(sc)->channels[(chan)]->txc_queue.tx_rings[(tc)])

/* Handy wrapper over an atomic operation. */
#define ATOMIC_XCHG(a, val) (atomic_swap_int(&(a)->counter, (val)))

#define DPNI_IRQ_INDEX 0 /* Index of the only DPNI IRQ. */
#define DPNI_IRQ_LINK_CHANGED 1 /* Link state changed */
#define DPNI_IRQ_EP_CHANGED 2 /* DPAA2 endpoint dis/connected */
Expand Down Expand Up @@ -3484,7 +3488,7 @@ dpaa2_ni_chan_storage_next(struct dpaa2_ni_channel *chan, struct dpaa2_dq **dq)
/* Reset token. */
msg->fdr.desc.tok = 0;
/* Make VDQ command available again. */
atomic_xchg(&swp->vdq.avail, 1);
ATOMIC_XCHG(&swp->vdq.avail, 1);
} else {
return (rc); /* DQ response is not available yet. */
}
Expand Down

0 comments on commit 34014de

Please sign in to comment.