Thread (18 messages) 18 messages, 3 authors, 2015-10-27

RE: [v2 04/11] soc/fsl: Introduce drivers for the DPAA QMan

From: Roy Pledge <hidden>
Date: 2015-09-15 15:32:17
Also in: lkml, netdev

-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, September 11, 2015 9:10 PM
To: Pledge Roy-R01356 <redacted>
Cc: linuxppc-dev@lists.ozlabs.org; netdev@vger.kernel.org; linux-
kernel@vger.kernel.org
Subject: Re: [v2 04/11] soc/fsl: Introduce drivers for the DPAA QMan
=20
On Wed, Aug 12, 2015 at 04:14:50PM -0400, Roy Pledge wrote:
quoted
+/* Lock/unlock frame queues, subject to the "LOCKED" flag. This is
+about
+ * inter-processor locking only. Note, FQLOCK() is always called
+either under a
+ * local_irq_save() or from interrupt context - hence there's no need
+for irq
+ * protection (and indeed, attempting to nest irq-protection doesn't
+work, as
+ * the "irq en/disable" machinery isn't recursive...). */ #define
+FQLOCK(fq) \
+	do { \
+		struct qman_fq *__fq478 =3D (fq); \
+		if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \
+			spin_lock(&__fq478->fqlock); \
+	} while (0)
+#define FQUNLOCK(fq) \
+	do { \
+		struct qman_fq *__fq478 =3D (fq); \
+		if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \
+			spin_unlock(&__fq478->fqlock); \
+	} while (0)
+
=20
I don't see QMAN_FQ_FLAG_LOCKED set anywhere.  What is the use case?
The idea was to allow multiple threads to manipulate the state of a frame q=
ueue at the same time without clobbering each others changes since the oper=
ation is a read/modify/write.  I see two users of this flag in code that ha=
sn't been submitted upstream yet, but I'm not sure if the use is required i=
n those two instances either. At a glance it doesn't seem like it is needed=
 but I would need to follow up with the users to make sure they aren't perf=
orming FQ management commands in multiple threads.
=20
-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help