From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: Kan Liang <kan.liang@intel.com>,
netdev@vger.kernel.org, davem@davemloft.net, bwh@kernel.org,
ben@decadent.org.uk
Cc: andi@firstfloor.org, jesse.brandeburg@intel.com,
shannon.nelson@intel.com, f.fainelli@gmail.com,
alexander.duyck@gmail.com, carolyn.wyborny@intel.com,
donald.c.skidmore@intel.com, mitch.a.williams@intel.com,
ogerlitz@mellanox.com, edumazet@google.com, jiri@mellanox.com,
sfeldma@gmail.com, gospo@cumulusnetworks.com,
sasha.levin@oracle.com, dsahern@gmail.com, tj@kernel.org,
cascardo@redhat.com, corbet@lwn.net, decot@googlers.com
Subject: Re: [PATCH V7 6/8] i40e: queue-specific settings for interrupt moderation
Date: Fri, 19 Feb 2016 13:54:24 -0800 [thread overview]
Message-ID: <1455918864.3016.38.camel@intel.com> (raw)
In-Reply-To: <1455891846-12271-7-git-send-email-kan.liang@intel.com>
[-- Attachment #1: Type: text/plain, Size: 6815 bytes --]
On Fri, 2016-02-19 at 09:24 -0500, Kan Liang wrote:
> From: Kan Liang <kan.liang@intel.com>
>
> For i40e driver, each vector has its own ITR register. However, there
> are no concept of queue-specific settings in the driver proper. Only
> global variable is used to store ITR values. That will cause problems
> especially when resetting the vector. The specific ITR values could
> be
> lost.
> This patch move rx_itr_setting and tx_itr_setting to i40e_ring to
> store
> specific ITR register for each queue.
> i40e_get_coalesce and i40e_set_coalesce are also modified accordingly
> to
> support queue-specific settings. To make it compatible with old
> ethtool,
> if user doesn't specify the queue number, i40e_get_coalesce will
> return
> queue 0's value. While i40e_set_coalesce will apply value to all
> queues.
>
> Signed-off-by: Kan Liang <kan.liang@intel.com>
> Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
There is one minor nitpick noted below, but that should not hold up
this patch.
> ---
> drivers/net/ethernet/intel/i40e/i40e.h | 7 --
> drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 15 ++-
> drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 139
> ++++++++++++++++---------
> drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +--
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 +-
> drivers/net/ethernet/intel/i40e/i40e_txrx.h | 8 ++
> 6 files changed, 120 insertions(+), 70 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e.h
> b/drivers/net/ethernet/intel/i40e/i40e.h
> index e99be9f..2f6210a 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e.h
> @@ -521,13 +521,6 @@ struct i40e_vsi {
> struct i40e_ring **tx_rings;
>
> u16 work_limit;
> - /* high bit set means dynamic, use accessor routines to
> read/write.
> - * hardware only supports 2us resolution for the ITR
> registers.
> - * these values always store the USER setting, and must be
> converted
> - * before programming to a register.
> - */
> - u16 rx_itr_setting;
> - u16 tx_itr_setting;
> u16 int_rate_limit; /* value in usecs */
>
> u16 rss_table_size; /* HW RSS table size */
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> index 2a44f2e..0c97733 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> @@ -302,6 +302,10 @@ static void i40e_dbg_dump_vsi_seid(struct
> i40e_pf *pf, int seid)
> " rx_rings[%i]: vsi = %p, q_vector =
> %p\n",
> i, rx_ring->vsi,
> rx_ring->q_vector);
> + dev_info(&pf->pdev->dev,
> + " rx_rings[%i]: rx_itr_setting = %d
> (%s)\n",
> + i, rx_ring->rx_itr_setting,
> + ITR_IS_DYNAMIC(rx_ring->rx_itr_setting) ?
> "dynamic" : "fixed");
> }
> for (i = 0; i < vsi->num_queue_pairs; i++) {
> struct i40e_ring *tx_ring = ACCESS_ONCE(vsi-
> >tx_rings[i]);
> @@ -352,14 +356,15 @@ static void i40e_dbg_dump_vsi_seid(struct
> i40e_pf *pf, int seid)
> dev_info(&pf->pdev->dev,
> " tx_rings[%i]: DCB tc = %d\n",
> i, tx_ring->dcb_tc);
> + dev_info(&pf->pdev->dev,
> + " tx_rings[%i]: tx_itr_setting = %d
> (%s)\n",
> + i, tx_ring->tx_itr_setting,
> + ITR_IS_DYNAMIC(tx_ring->tx_itr_setting) ?
> "dynamic" : "fixed");
> }
> rcu_read_unlock();
> dev_info(&pf->pdev->dev,
> - " work_limit = %d, rx_itr_setting = %d (%s),
> tx_itr_setting = %d (%s)\n",
> - vsi->work_limit, vsi->rx_itr_setting,
> - ITR_IS_DYNAMIC(vsi->rx_itr_setting) ? "dynamic" :
> "fixed",
> - vsi->tx_itr_setting,
> - ITR_IS_DYNAMIC(vsi->tx_itr_setting) ? "dynamic" :
> "fixed");
> + " work_limit = %d\n",
> + vsi->work_limit);
> dev_info(&pf->pdev->dev,
> " max_frame = %d, rx_hdr_len = %d, rx_buf_len =
> %d dtype = %d\n",
> vsi->max_frame, vsi->rx_hdr_len, vsi->rx_buf_len,
> vsi->dtype);
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index a85bc94..a470599 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> @@ -1879,8 +1879,9 @@ static int i40e_set_phys_id(struct net_device
> *netdev,
> * 125us (8000 interrupts per second) == ITR(62)
> */
>
> -static int i40e_get_coalesce(struct net_device *netdev,
> - struct ethtool_coalesce *ec)
> +static int __i40e_get_coalesce(struct net_device *netdev,
> + struct ethtool_coalesce *ec,
> + int queue)
> {
> struct i40e_netdev_priv *np = netdev_priv(netdev);
> struct i40e_vsi *vsi = np->vsi;
> @@ -1888,14 +1889,24 @@ static int i40e_get_coalesce(struct
> net_device *netdev,
> ec->tx_max_coalesced_frames_irq = vsi->work_limit;
> ec->rx_max_coalesced_frames_irq = vsi->work_limit;
>
> - if (ITR_IS_DYNAMIC(vsi->rx_itr_setting))
> + /* rx and tx usecs has per queue value. If user doesn't
> specify the queue,
> + * return queue 0's value to represent.
> + */
> + if (queue < 0) {
> + queue = 0;
> + } else if (queue >= vsi->num_queue_pairs) {
> + return -EINVAL;
> + }
> +
> + if (ITR_IS_DYNAMIC(vsi->rx_rings[queue]->rx_itr_setting))
The curly braces are not needed in the above if/else if statement.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-02-19 21:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 14:23 [PATCH V7 0/8] ethtool per queue parameters support Kan Liang
2016-02-19 14:23 ` [PATCH V7 1/8] lib/bitmap.c: conversion routines to/from u32 array Kan Liang
2016-02-19 14:24 ` [PATCH V7 2/8] test_bitmap: unit tests for lib/bitmap.c Kan Liang
2016-02-19 14:24 ` [PATCH V7 3/8] net/ethtool: introduce a new ioctl for per queue setting Kan Liang
2016-02-19 14:24 ` [PATCH V7 4/8] net/ethtool: support get coalesce per queue Kan Liang
2016-02-19 14:24 ` [PATCH V7 5/8] net/ethtool: support set " Kan Liang
2016-02-19 14:24 ` [PATCH V7 6/8] i40e: queue-specific settings for interrupt moderation Kan Liang
2016-02-19 21:54 ` Jeff Kirsher [this message]
2016-02-19 14:24 ` [PATCH V7 7/8] i40e/ethtool: support coalesce getting by queue Kan Liang
2016-02-19 21:55 ` Jeff Kirsher
2016-02-19 14:24 ` [PATCH V7 8/8] i40e/ethtool: support coalesce setting " Kan Liang
2016-02-19 21:56 ` Jeff Kirsher
2016-02-19 21:50 ` [PATCH V7 0/8] ethtool per queue parameters support Jeff Kirsher
2016-02-20 0:59 ` David Miller
2016-02-20 3:54 ` David Miller
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=1455918864.3016.38.camel@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=alexander.duyck@gmail.com \
--cc=andi@firstfloor.org \
--cc=ben@decadent.org.uk \
--cc=bwh@kernel.org \
--cc=carolyn.wyborny@intel.com \
--cc=cascardo@redhat.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=decot@googlers.com \
--cc=donald.c.skidmore@intel.com \
--cc=dsahern@gmail.com \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=gospo@cumulusnetworks.com \
--cc=jesse.brandeburg@intel.com \
--cc=jiri@mellanox.com \
--cc=kan.liang@intel.com \
--cc=mitch.a.williams@intel.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=sasha.levin@oracle.com \
--cc=sfeldma@gmail.com \
--cc=shannon.nelson@intel.com \
--cc=tj@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).