Thread (15 messages) 15 messages, 2 authors, 2022-12-07

Re: [PATCH net-next 2/6] tsnep: Add XDP TX support

flat view

From: Gerhard Engleder <hidden>
Date: 2022-12-07 20:06:00
Also in: bpf

On 07.12.22 11:24, Paolo Abeni wrote:
On Sat, 2022-12-03 at 22:54 +0100, Gerhard Engleder wrote:
[...]
quoted
+/* This function requires __netif_tx_lock is held by the caller. */
+static int tsnep_xdp_xmit_frame_ring(struct xdp_frame *xdpf,
+				     struct tsnep_tx *tx, bool dma_map)
+{
+	struct skb_shared_info *shinfo = xdp_get_shared_info_from_frame(xdpf);
+	unsigned long flags;
+	int count = 1;
+	struct tsnep_tx_entry *entry;
+	int length;
+	int i;
+	int retval;
+
+	if (unlikely(xdp_frame_has_frags(xdpf)))
+		count += shinfo->nr_frags;
+
+	spin_lock_irqsave(&tx->lock, flags);
Not strictily related to this patch, but why are you using the _irqsafe
variant? it looks like all the locak users are either in process or BH
context.
You are right. I will check that and would post a patch later.

Thank you!

Gerhard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help