Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1223285 > unrolled thread

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

Started byScott Wood <scottwood@freescale.com>
First post2015-09-12 03:20 +0200
Last post2015-09-15 17:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [v2 04/11] soc/fsl: Introduce drivers for the DPAA QMan Scott Wood <scottwood@freescale.com> - 2015-09-12 03:20 +0200
    RE: [v2 04/11] soc/fsl: Introduce drivers for the DPAA QMan Roy Pledge <roy.pledge@freescale.com> - 2015-09-15 17:40 +0200

#1223285 — Re: [v2 04/11] soc/fsl: Introduce drivers for the DPAA QMan

FromScott Wood <scottwood@freescale.com>
Date2015-09-12 03:20 +0200
SubjectRe: [v2 04/11] soc/fsl: Introduce drivers for the DPAA QMan
Message-ID<q7HDY-29A-5@gated-at.bofh.it>
On Wed, Aug 12, 2015 at 04:14:50PM -0400, Roy Pledge wrote:
> +/* 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 = (fq); \
> +		if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \
> +			spin_lock(&__fq478->fqlock); \
> +	} while (0)
> +#define FQUNLOCK(fq) \
> +	do { \
> +		struct qman_fq *__fq478 = (fq); \
> +		if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \
> +			spin_unlock(&__fq478->fqlock); \
> +	} while (0)
> +

I don't see QMAN_FQ_FLAG_LOCKED set anywhere.  What is the use case?

-Scott
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1225329

FromRoy Pledge <roy.pledge@freescale.com>
Date2015-09-15 17:40 +0200
Message-ID<q90uS-xv-33@gated-at.bofh.it>
In reply to#1223285

> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Friday, September 11, 2015 9:10 PM
> To: Pledge Roy-R01356 <roy.pledge@freescale.com>
> 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
> 
> On Wed, Aug 12, 2015 at 04:14:50PM -0400, Roy Pledge wrote:
> > +/* 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 = (fq); \
> > +		if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \
> > +			spin_lock(&__fq478->fqlock); \
> > +	} while (0)
> > +#define FQUNLOCK(fq) \
> > +	do { \
> > +		struct qman_fq *__fq478 = (fq); \
> > +		if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \
> > +			spin_unlock(&__fq478->fqlock); \
> > +	} while (0)
> > +
> 
> 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 queue at the same time without clobbering each others changes since the operation is a read/modify/write.  I see two users of this flag in code that hasn't been submitted upstream yet, but I'm not sure if the use is required in 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 performing FQ management commands in multiple threads.

> 
> -Scott
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web