From: kan.liang@intel.com <kan.liang@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [RFC 4/4] i40e: handle per queue rx_usecs setting
Date: Tue, 1 Dec 2015 08:01:32 +0000 [thread overview]
Message-ID: <1448956892-15509-4-git-send-email-kan.liang@intel.com> (raw)
In-Reply-To: <1448956892-15509-1-git-send-email-kan.liang@intel.com>
From: Kan Liang <kan.liang@intel.com>
Handle ndo_get_per_queue_rx_usecs and ndo_set_per_queue_rx_usecs
options for i40e driver specifically.
Signed-off-by: Kan Liang <kan.liang@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 39 +++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d4310ae..c0291bb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8710,6 +8710,43 @@ void i40e_ndo_set_per_queue_tx_usecs(struct net_device *dev, int index, u32 val)
i40e_flush(hw);
}
+/**
+ * i40e_ndo_get_per_queue_rx_usecs - Get per queue coalesce parameter rx_usecs
+ * @dev: the netdev being configured
+ * @index: queue index
+ *
+ * Return rx_usecs for specific queue
+ **/
+u32 i40e_ndo_get_per_queue_rx_usecs(struct net_device *dev, int index)
+{
+ struct i40e_netdev_priv *np = netdev_priv(dev);
+ struct i40e_vsi *vsi = np->vsi;
+ struct i40e_pf *pf = vsi->back;
+ struct i40e_hw *hw = &pf->hw;
+ u32 val;
+
+ val = rd32(hw, I40E_PFINT_ITRN(0, index));
+
+ return (val * 2);
+}
+
+/**
+ * i40e_ndo_set_per_queue_rx_usecs - Set per queue coalesce parameter rx_usecs
+ * @dev: the netdev being configured
+ * @index: queue index
+ * @val: rx_usecs value
+ **/
+void i40e_ndo_set_per_queue_rx_usecs(struct net_device *dev, int index, u32 val)
+{
+ struct i40e_netdev_priv *np = netdev_priv(dev);
+ struct i40e_vsi *vsi = np->vsi;
+ struct i40e_pf *pf = vsi->back;
+ struct i40e_hw *hw = &pf->hw;
+
+ wr32(hw, I40E_PFINT_ITRN(0, index), val / 2);
+ i40e_flush(hw);
+}
+
#define I40E_MAX_TUNNEL_HDR_LEN 80
/**
* i40e_features_check - Validate encapsulated packet conforms to limits
@@ -8768,6 +8805,8 @@ static const struct net_device_ops i40e_netdev_ops = {
.ndo_bridge_setlink = i40e_ndo_bridge_setlink,
.ndo_get_per_queue_tx_usecs = i40e_ndo_get_per_queue_tx_usecs,
.ndo_set_per_queue_tx_usecs = i40e_ndo_set_per_queue_tx_usecs,
+ .ndo_get_per_queue_rx_usecs = i40e_ndo_get_per_queue_rx_usecs,
+ .ndo_set_per_queue_rx_usecs = i40e_ndo_set_per_queue_rx_usecs,
};
/**
--
1.7.11.7
next prev parent reply other threads:[~2015-12-01 8:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-01 8:01 [Intel-wired-lan] [RFC 1/4] net: support per queue tx_usecs in sysfs kan.liang
2015-12-01 8:01 ` [Intel-wired-lan] [RFC 2/4] i40e: handle per queue tx_usecs setting kan.liang
2015-12-01 8:01 ` [Intel-wired-lan] [RFC 3/4] net: support per queue rx_usecs in sysfs kan.liang
2015-12-01 8:01 ` kan.liang [this message]
2015-12-01 19:47 ` [Intel-wired-lan] [RFC 4/4] i40e: handle per queue rx_usecs setting Stephen Hemminger
2015-12-01 22:13 ` [Intel-wired-lan] [RFC 1/4] net: support per queue tx_usecs in sysfs Florian Fainelli
2015-12-01 23:44 ` Jesse Brandeburg
2015-12-02 1:57 ` Alexander Duyck
2015-12-02 2:27 ` David Miller
2015-12-02 2:23 ` 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=1448956892-15509-4-git-send-email-kan.liang@intel.com \
--to=kan.liang@intel.com \
--cc=intel-wired-lan@osuosl.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