netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petri Gynther <pgynther@google.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next] net: bcmgenet: fix Tx ring priority programming
Date: Tue, 7 Oct 2014 09:09:20 -0700	[thread overview]
Message-ID: <CAGXr9JGL535nJ9SC9iA1P_tt39zA7T672adoWd9GqaqM_jHafA@mail.gmail.com> (raw)
In-Reply-To: <20141006.235926.30933585433924137.davem@davemloft.net>

Hi David,

On Mon, Oct 6, 2014 at 8:59 PM, David Miller <davem@davemloft.net> wrote:
> From: Petri Gynther <pgynther@google.com>
> Date: Mon,  6 Oct 2014 17:50:01 -0700 (PDT)
>
>> @@ -1731,11 +1744,12 @@ static void bcmgenet_init_multiq(struct net_device *dev)
>>       reg |= ring_cfg;
>>       bcmgenet_tdma_writel(priv, reg, DMA_RING_CFG);
>>
>> -     /* Use configured rings priority and set ring #16 priority */
>> -     reg = bcmgenet_tdma_readl(priv, DMA_RING_PRIORITY);
>> -     reg |= ((GENET_Q0_PRIORITY + priv->hw_params->tx_queues) << 20);
>> -     reg |= dma_priority;
>> -     bcmgenet_tdma_writel(priv, reg, DMA_PRIORITY);
>> +     /* Set ring 16 priority and program the hardware registers */
>> +     dma_priority[2] |=
>> +             ((GENET_Q0_PRIORITY + priv->hw_params->tx_queues) << 20);
>
> Please use "<< (16 - 12) * DMA_RING_BUF_PRIORITY_SHIFT" otherwise this
> constant is magic.
>
> You might, optionally, add macros for the subtraction adjustment each
> priority register uses (0, 6, 12, respectively).

Thanks for the comments. I'm going to simplify this with a few macros.

      reply	other threads:[~2014-10-07 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07  0:50 [PATCH net-next] net: bcmgenet: fix Tx ring priority programming Petri Gynther
2014-10-07  3:59 ` David Miller
2014-10-07 16:09   ` Petri Gynther [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGXr9JGL535nJ9SC9iA1P_tt39zA7T672adoWd9GqaqM_jHafA@mail.gmail.com \
    --to=pgynther@google.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).