<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Linux QBMan QMan driver safe_copy_dqrr in Layerscape</title>
    <link>https://community.nxp.com/t5/Layerscape/Linux-QBMan-QMan-driver-safe-copy-dqrr/m-p/2398821#M16794</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P class=""&gt;Yes — the comment is most plausibly about a &lt;STRONG class=""&gt;bus/cache-line WRAP transaction&lt;/STRONG&gt; , not the DQRR producer/consumer index wrapping.&lt;/P&gt;
&lt;P class=""&gt;The reason it needs to be “safe” is that a DQRR entry is not ordinary RAM. It is a QBMan portal structure whose contents are produced by QMan, possibly stashed into the CPU cache, and consumed by software using the &lt;STRONG class=""&gt;valid bit in the VERB byte&lt;/STRONG&gt; . The DPAA manuals state that even though QMan updates a DQRR entry atomically, a GPP core’s reads may not observe all bytes of the entry changing at the same time; software must ensure the VERB byte containing the valid bit is loaded before the rest of the DQRR entry.&lt;/P&gt;
&lt;P class=""&gt;So &lt;CODE class=""&gt;safe_copy_dqrr()&lt;/CODE&gt; is trying to avoid this unsafe pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="text-left mx-auto flex h-full min-h-0 w-full"&gt;
&lt;DIV class="relative size-full overflow-auto rounded-none border border-border shadow-lg"&gt;
&lt;PRE style="background-color: var(--code-bg, #fafafa); background-position: 0% 0%; background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto; background-origin: padding-box; background-clip: border-box; color: #383a42; font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace; direction: ltr; text-align: left; white-space: pre; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 2; hyphens: none; padding: 1rem; margin: 0px; overflow: auto; border-radius: 0px; width: 100%; font-size: 0.875rem;"&gt;&lt;CODE class="language-javascript" style="white-space: pre; background: #fafafa; color: #383a42; font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace; direction: ltr; text-align: left; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 2; hyphens: none;"&gt;&lt;SPAN&gt;&lt;SPAN class="token"&gt;CPU&lt;/SPAN&gt; wants to copy &lt;SPAN class="token"&gt;DQRR&lt;/SPAN&gt; entry
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; compiler&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token"&gt;CPU&lt;/SPAN&gt;&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;cache subsystem turns that into a burst or cache&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;line fill
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; transaction reaches &lt;SPAN class="token maybe-class-name"&gt;QBMan&lt;/SPAN&gt; &lt;SPAN class="token module"&gt;as&lt;/SPAN&gt; a &lt;SPAN class="token"&gt;WRAP&lt;/SPAN&gt;&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;style read
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token maybe-class-name"&gt;QBMan&lt;/SPAN&gt;&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;interconnect may see&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;read beats &lt;SPAN class="token"&gt;in&lt;/SPAN&gt; an order different &lt;SPAN class="token module"&gt;from&lt;/SPAN&gt; the logical field order
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; software may observe a valid &lt;SPAN class="token"&gt;VERB&lt;/SPAN&gt; byte associated &lt;SPAN class="token"&gt;with&lt;/SPAN&gt; stale or not&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;yet&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;visible entry data&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P class=""&gt;That matters because the valid bit is the synchronization point. With DQRR entry stashing enabled, the documentation specifically warns that &lt;CODE class=""&gt;DQRR.PI&lt;/CODE&gt; can be updated before the associated DQRR entry stash arrives in the processor cache, creating a race; therefore software should use the valid bit in the DQRR entries, not &lt;CODE class=""&gt;DQRR.PI&lt;/CODE&gt; , to detect production. The valid bit itself is an alternating-polarity bit that toggles each time the ring wraps from the last entry back to entry 0.&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;Regards&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2026 16:00:55 GMT</pubDate>
    <dc:creator>Bio_TICFSL</dc:creator>
    <dc:date>2026-07-24T16:00:55Z</dc:date>
    <item>
      <title>Linux QBMan QMan driver safe_copy_dqrr</title>
      <link>https://community.nxp.com/t5/Layerscape/Linux-QBMan-QMan-driver-safe-copy-dqrr/m-p/2398316#M16792</link>
      <description>&lt;P&gt;The Linux SDK for QorIQ processors includes &lt;A href="https://github.com/nxp-qoriq/linux/blob/lf-6.12.y/drivers/staging/fsl_qbman/qman_high.c" target="_blank" rel="noopener"&gt;qman_high.c&lt;/A&gt; in the driver staging tree. This includes the function safe_copy_dqrr(), which the comments say is&amp;nbsp;&lt;EM&gt;ensuring reads reach QBMan in order&lt;/EM&gt; and //preventing a WRAP transaction to be seen by the QBMan//.&lt;BR /&gt;&lt;BR /&gt;I presume this is referring to an AXI WRAP burst transaction, rather than anything to do with the DQRR index wrap.&lt;BR /&gt;&lt;BR /&gt;Can anyone explain why this is problem that needs to be made safe?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2026 12:21:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/Linux-QBMan-QMan-driver-safe-copy-dqrr/m-p/2398316#M16792</guid>
      <dc:creator>tim8</dc:creator>
      <dc:date>2026-07-23T12:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Linux QBMan QMan driver safe_copy_dqrr</title>
      <link>https://community.nxp.com/t5/Layerscape/Linux-QBMan-QMan-driver-safe-copy-dqrr/m-p/2398821#M16794</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P class=""&gt;Yes — the comment is most plausibly about a &lt;STRONG class=""&gt;bus/cache-line WRAP transaction&lt;/STRONG&gt; , not the DQRR producer/consumer index wrapping.&lt;/P&gt;
&lt;P class=""&gt;The reason it needs to be “safe” is that a DQRR entry is not ordinary RAM. It is a QBMan portal structure whose contents are produced by QMan, possibly stashed into the CPU cache, and consumed by software using the &lt;STRONG class=""&gt;valid bit in the VERB byte&lt;/STRONG&gt; . The DPAA manuals state that even though QMan updates a DQRR entry atomically, a GPP core’s reads may not observe all bytes of the entry changing at the same time; software must ensure the VERB byte containing the valid bit is loaded before the rest of the DQRR entry.&lt;/P&gt;
&lt;P class=""&gt;So &lt;CODE class=""&gt;safe_copy_dqrr()&lt;/CODE&gt; is trying to avoid this unsafe pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="text-left mx-auto flex h-full min-h-0 w-full"&gt;
&lt;DIV class="relative size-full overflow-auto rounded-none border border-border shadow-lg"&gt;
&lt;PRE style="background-color: var(--code-bg, #fafafa); background-position: 0% 0%; background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto; background-origin: padding-box; background-clip: border-box; color: #383a42; font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace; direction: ltr; text-align: left; white-space: pre; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 2; hyphens: none; padding: 1rem; margin: 0px; overflow: auto; border-radius: 0px; width: 100%; font-size: 0.875rem;"&gt;&lt;CODE class="language-javascript" style="white-space: pre; background: #fafafa; color: #383a42; font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace; direction: ltr; text-align: left; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 2; hyphens: none;"&gt;&lt;SPAN&gt;&lt;SPAN class="token"&gt;CPU&lt;/SPAN&gt; wants to copy &lt;SPAN class="token"&gt;DQRR&lt;/SPAN&gt; entry
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; compiler&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token"&gt;CPU&lt;/SPAN&gt;&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;cache subsystem turns that into a burst or cache&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;line fill
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; transaction reaches &lt;SPAN class="token maybe-class-name"&gt;QBMan&lt;/SPAN&gt; &lt;SPAN class="token module"&gt;as&lt;/SPAN&gt; a &lt;SPAN class="token"&gt;WRAP&lt;/SPAN&gt;&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;style read
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token maybe-class-name"&gt;QBMan&lt;/SPAN&gt;&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;interconnect may see&lt;SPAN class="token"&gt;/&lt;/SPAN&gt;read beats &lt;SPAN class="token"&gt;in&lt;/SPAN&gt; an order different &lt;SPAN class="token module"&gt;from&lt;/SPAN&gt; the logical field order
&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;SPAN class="token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token"&gt;&amp;gt;&lt;/SPAN&gt; software may observe a valid &lt;SPAN class="token"&gt;VERB&lt;/SPAN&gt; byte associated &lt;SPAN class="token"&gt;with&lt;/SPAN&gt; stale or not&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;yet&lt;SPAN class="token"&gt;-&lt;/SPAN&gt;visible entry data&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P class=""&gt;That matters because the valid bit is the synchronization point. With DQRR entry stashing enabled, the documentation specifically warns that &lt;CODE class=""&gt;DQRR.PI&lt;/CODE&gt; can be updated before the associated DQRR entry stash arrives in the processor cache, creating a race; therefore software should use the valid bit in the DQRR entries, not &lt;CODE class=""&gt;DQRR.PI&lt;/CODE&gt; , to detect production. The valid bit itself is an alternating-polarity bit that toggles each time the ring wraps from the last entry back to entry 0.&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2026 16:00:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/Linux-QBMan-QMan-driver-safe-copy-dqrr/m-p/2398821#M16794</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2026-07-24T16:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Linux QBMan QMan driver safe_copy_dqrr</title>
      <link>https://community.nxp.com/t5/Layerscape/Linux-QBMan-QMan-driver-safe-copy-dqrr/m-p/2399704#M16803</link>
      <description>&lt;P&gt;Thanks for you reply.&lt;/P&gt;&lt;P&gt;If I understand correctly, with DQRR stashing disabled the CPU read of a DQRR entry (after a cache invalidation and memory barrier) triggers a cache line fill but this can be "broken" by a AXI wrap burst transaction while the DQRR entry is being updated?&lt;/P&gt;&lt;P&gt;I'm using LS1046A RDB and can see no reference to this behaviour in NXP manuals. Is it documented somewhere? I'm looking for a reference to justify this safe copy function.&lt;/P&gt;&lt;P&gt;With DQRR stashing enabled, QMan writes the DQRR entry to cache. Is this subject to the same issue?&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 17:00:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/Linux-QBMan-QMan-driver-safe-copy-dqrr/m-p/2399704#M16803</guid>
      <dc:creator>tim8</dc:creator>
      <dc:date>2026-07-28T17:00:42Z</dc:date>
    </item>
  </channel>
</rss>

