netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Gospodarek <andy@greyhouse.net>
To: Michael Chan <michael.chan@broadcom.com>
Cc: Netdev <netdev@vger.kernel.org>,
	"michael.chan@broadcom.com" <mchan@broadcom.com>,
	talgi@mellanox.com, ogerlitz@mellanox.com,
	Andy Gospodarek <gospo@broadcom.com>
Subject: Re: [net-next 09/10] bnxt_en: add support for software dynamic interrupt moderation
Date: Fri, 5 Jan 2018 08:44:57 -0500	[thread overview]
Message-ID: <20180105134457.GA78313@C02RW35GFVH8> (raw)
In-Reply-To: <CACKFLikBmyzpjZORX7ZWG=kxGyRKg9cFOXeq-jUHY9_n=cYw_w@mail.gmail.com>

On Thu, Jan 04, 2018 at 02:16:26PM -0800, Michael Chan wrote:
> On Thu, Jan 4, 2018 at 12:21 PM, Andy Gospodarek <andy@greyhouse.net> wrote:
> > From: Andy Gospodarek <gospo@broadcom.com>
> >
> > This implements the changes needed for the bnxt_en driver to add support
> > for dynamic interrupt moderation per ring.
> >
> > This does add additional counters in the receive path, but testing shows
> > that any additional instructions are offset by throughput gain when the
> > default configuration is for low latency.
> >
> > Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
> > Cc: Michael Chan <mchan@broadcom.com>
> 
> Andy, looks good in general. I just have a few comments below.  These
> minor issues can be cleaned up after merge if you want.

Thanks for the review -- not the first time you've seen it :-) -- and for
agreeing that we can cleanup after the merge.  I'll need a v2, so I might as
well fix anything we want to fix now.

> 
> ....
> > +int bnxt_hwrm_set_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi)
> > +{
> > +       struct hwrm_ring_cmpl_ring_cfg_aggint_params_input req_rx = {0};
> > +       struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
> > +       struct bnxt_coal coal;
> > +       unsigned int grp_idx;
> > +       int rc = 0;
> > +
> > +        /* Tick values in micro seconds.
> > +         * 1 coal_buf x bufs_per_record = 1 completion record.
> > +         */
> > +       memcpy(&coal, &bp->rx_coal, sizeof(struct bnxt_coal));
> > +
> > +       coal.coal_ticks = cpr->rx_ring_coal.coal_ticks;
> > +       coal.coal_bufs = cpr->rx_ring_coal.coal_bufs;
> > +
> > +       if (!bnapi->rx_ring)
> > +               return -ENODEV;
> > +
> > +       bnxt_hwrm_cmd_hdr_init(bp, &req_rx,
> > +                              HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS, -1, -1);
> > +
> > +       bnxt_hwrm_set_coal_params(&coal, &req_rx);
> > +
> > +       mutex_lock(&bp->hwrm_cmd_lock);
> > +       grp_idx = bnapi->index;
> > +
> > +       req_rx.ring_id = cpu_to_le16(bp->grp_info[grp_idx].cp_fw_ring_id);
> > +
> > +       rc = _hwrm_send_message(bp, &req_rx, sizeof(req_rx),
> > +                               HWRM_CMD_TIMEOUT);
> > +       mutex_unlock(&bp->hwrm_cmd_lock);
> 
> You can use the hwrm_send_message() variant that does not require you
> to take the mutex.  You only need this variant and take the mutex if
> you need to check the firmware reply.
> 

OK, good to know.  I'll consider whether or not it is important to check
the reply.  I think I'd want to know if it failed, but I'm not sure what
I'd do were that error condition encountered....

> > +       return rc;
> > +}
> > +
> >  int bnxt_hwrm_set_coal(struct bnxt *bp)
> >  {
> >         int i, rc = 0;
> > @@ -5705,7 +5753,11 @@ static void bnxt_enable_napi(struct bnxt *bp)
> >         int i;
> >
> >         for (i = 0; i < bp->cp_nr_rings; i++) {
> 
> We only need to enable this for every completion ring that has an RX
> ring.  In some cases, for example when XDP is enabled, there will be a
> set of completion rings with only TX rings.  So I think we can
> optimize this for completion rings with RX only.

Good call.

> > +               struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring;
> >                 bp->bnapi[i]->in_reset = false;
> > +
> > +               INIT_WORK(&cpr->am.work, bnxt_dim_work);
> > +               cpr->am.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
> >                 napi_enable(&bp->bnapi[i]->napi);
> >         }
> >  }

  reply	other threads:[~2018-01-05 13:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 20:21 [net-next 00/10] net: create dynamic software irq moderation library Andy Gospodarek
2018-01-04 20:21 ` [net-next 01/10] net/mlx5e: move interrupt moderation structs to new file Andy Gospodarek
2018-01-04 20:21 ` [net-next 02/10] net/mlx5e: move interrupt moderation forward declarations Andy Gospodarek
2018-01-04 20:21 ` [net-next 03/10] net/mlx5e: remove rq references in mlx5e_rx_am Andy Gospodarek
2018-01-04 20:21 ` [net-next 04/10] net/mlx5e: move AM logic enums Andy Gospodarek
2018-01-04 20:21 ` [net-next 05/10] net/mlx5e: move generic functions to new file Andy Gospodarek
2018-01-04 20:21 ` [net-next 06/10] net/mlx5e: change Mellanox references in DIM code Andy Gospodarek
2018-01-05  8:04   ` Tal Gilboa
2018-01-05 13:55     ` Andy Gospodarek
2018-01-05 20:57     ` Andy Gospodarek
2018-01-04 20:21 ` [net-next 07/10] net: move dynamic interrupt coalescing code to include/linux Andy Gospodarek
2018-01-04 20:21 ` [net-next 08/10] net/dim: use struct net_dim_sample as arg to net_dim Andy Gospodarek
2018-01-05  8:13   ` Tal Gilboa
2018-01-04 20:21 ` [net-next 09/10] bnxt_en: add support for software dynamic interrupt moderation Andy Gospodarek
2018-01-04 22:16   ` Michael Chan
2018-01-05 13:44     ` Andy Gospodarek [this message]
2018-01-04 20:21 ` [net-next 10/10] MAINTAINERS: add entry for Dynamic Interrupt Moderation Andy Gospodarek
2018-01-04 22:36   ` Stephen Hemminger
2018-01-04 22:45     ` Andy Gospodarek
2018-01-04 20:37 ` [net-next 00/10] net: create dynamic software irq moderation library Or Gerlitz
2018-01-04 22:46   ` Andy Gospodarek
2018-01-04 21:37 ` Saeed Mahameed
2018-01-05  8:14 ` Tal Gilboa
2018-01-05 13:48   ` Andy Gospodarek

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=20180105134457.GA78313@C02RW35GFVH8 \
    --to=andy@greyhouse.net \
    --cc=gospo@broadcom.com \
    --cc=mchan@broadcom.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=talgi@mellanox.com \
    /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).