lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  1 Dec 2015 08:01:30 +0000
From:	kan.liang@...el.com
To:	netdev@...r.kernel.org, intel-wired-lan@...ts.osuosl.org,
	davem@...emloft.net
Cc:	jesse.brandeburg@...el.com, andi@...stfloor.org,
	jeffrey.t.kirsher@...el.com, shannon.nelson@...el.com,
	carolyn.wyborny@...el.com, donald.c.skidmore@...el.com,
	matthew.vick@...el.com, john.ronciak@...el.com,
	mitch.a.williams@...el.com, john.r.fastabend@...el.com,
	ogerlitz@...lanox.com, edumazet@...gle.com, jiri@...lanox.com,
	sfeldma@...il.com, gospo@...ulusnetworks.com,
	sasha.levin@...cle.com, f.fainelli@...il.com, dsahern@...il.com,
	tj@...nel.org, cascardo@...hat.com, corbet@....net,
	Kan Liang <kan.liang@...el.com>
Subject: [RFC 2/4] i40e: handle per queue tx_usecs setting

From: Kan Liang <kan.liang@...el.com>

Handle ndo_get_per_queue_tx_usecs and ndo_set_per_queue_tx_usecs
options for i40e driver specifically.

Signed-off-by: Kan Liang <kan.liang@...el.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 4b7d874..d4310ae 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8673,6 +8673,43 @@ static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				       nlflags, 0, 0, filter_mask, NULL);
 }
 
+/**
+ * i40e_ndo_get_per_queue_tx_usecs - Get per queue coalesce parameter tx_usecs
+ * @dev: the netdev being configured
+ * @index: queue index
+ *
+ * Return tx_usecs for specific channel
+ **/
+u32 i40e_ndo_get_per_queue_tx_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(1, index));
+
+	return (val * 2);
+}
+
+/**
+ * i40e_ndo_set_per_queue_tx_usecs - Set per queue coalesce parameter tx_usecs
+ * @dev: the netdev being configured
+ * @index: queue index
+ * @val: tx_usecs value
+ **/
+void i40e_ndo_set_per_queue_tx_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(1, index), val / 2);
+	i40e_flush(hw);
+}
+
 #define I40E_MAX_TUNNEL_HDR_LEN 80
 /**
  * i40e_features_check - Validate encapsulated packet conforms to limits
@@ -8729,6 +8766,8 @@ static const struct net_device_ops i40e_netdev_ops = {
 	.ndo_features_check	= i40e_features_check,
 	.ndo_bridge_getlink	= i40e_ndo_bridge_getlink,
 	.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,
 };
 
 /**
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ