DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
To: dev@dpdk.org
Cc: kirill.rybalchenko@intel.com, andrey.chilikin@intel.com,
	beilei.xing@intel.com, jingjing.wu@intel.com
Subject: [dpdk-dev] [PATCH v3 1/6] net/i40e: remove unnecessary bit operations
Date: Wed, 20 Sep 2017 15:32:58 +0100	[thread overview]
Message-ID: <1505917983-119112-2-git-send-email-kirill.rybalchenko@intel.com> (raw)
In-Reply-To: <1505917983-119112-1-git-send-email-kirill.rybalchenko@intel.com>

Remove unnecessary bit operations in I40E_PFQF_HENA
and I40E_VFQF_HENA registers

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c    | 21 +++------------------
 drivers/net/i40e/i40e_ethdev_vf.c | 22 ++++------------------
 2 files changed, 7 insertions(+), 36 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 720f067..18eac07 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -6697,16 +6697,9 @@ static void
 i40e_pf_disable_rss(struct i40e_pf *pf)
 {
 	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
-	uint64_t hena;
 
-	hena = (uint64_t)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(0));
-	hena |= ((uint64_t)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(1))) << 32;
-	if (hw->mac.type == I40E_MAC_X722)
-		hena &= ~I40E_RSS_HENA_ALL_X722;
-	else
-		hena &= ~I40E_RSS_HENA_ALL;
-	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), (uint32_t)hena);
-	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), (uint32_t)(hena >> 32));
+	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), 0);
+	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), 0);
 	I40E_WRITE_FLUSH(hw);
 }
 
@@ -6778,7 +6771,6 @@ static int
 i40e_hw_rss_hash_set(struct i40e_pf *pf, struct rte_eth_rss_conf *rss_conf)
 {
 	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
-	uint64_t rss_hf;
 	uint64_t hena;
 	int ret;
 
@@ -6787,14 +6779,7 @@ i40e_hw_rss_hash_set(struct i40e_pf *pf, struct rte_eth_rss_conf *rss_conf)
 	if (ret)
 		return ret;
 
-	rss_hf = rss_conf->rss_hf;
-	hena = (uint64_t)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(0));
-	hena |= ((uint64_t)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(1))) << 32;
-	if (hw->mac.type == I40E_MAC_X722)
-		hena &= ~I40E_RSS_HENA_ALL_X722;
-	else
-		hena &= ~I40E_RSS_HENA_ALL;
-	hena |= i40e_config_hena(rss_hf, hw->mac.type);
+	hena = i40e_config_hena(rss_conf->rss_hf, hw->mac.type);
 	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), (uint32_t)hena);
 	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), (uint32_t)(hena >> 32));
 	I40E_WRITE_FLUSH(hw);
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 38c3adc..f4ee424 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2435,7 +2435,7 @@ static int
 i40evf_hw_rss_hash_set(struct i40e_vf *vf, struct rte_eth_rss_conf *rss_conf)
 {
 	struct i40e_hw *hw = I40E_VF_TO_HW(vf);
-	uint64_t rss_hf, hena;
+	uint64_t hena;
 	int ret;
 
 	ret = i40evf_set_rss_key(&vf->vsi, rss_conf->rss_key,
@@ -2443,14 +2443,7 @@ i40evf_hw_rss_hash_set(struct i40e_vf *vf, struct rte_eth_rss_conf *rss_conf)
 	if (ret)
 		return ret;
 
-	rss_hf = rss_conf->rss_hf;
-	hena = (uint64_t)i40e_read_rx_ctl(hw, I40E_VFQF_HENA(0));
-	hena |= ((uint64_t)i40e_read_rx_ctl(hw, I40E_VFQF_HENA(1))) << 32;
-	if (hw->mac.type == I40E_MAC_X722)
-		hena &= ~I40E_RSS_HENA_ALL_X722;
-	else
-		hena &= ~I40E_RSS_HENA_ALL;
-	hena |= i40e_config_hena(rss_hf, hw->mac.type);
+	hena = i40e_config_hena(rss_conf->rss_hf, hw->mac.type);
 	i40e_write_rx_ctl(hw, I40E_VFQF_HENA(0), (uint32_t)hena);
 	i40e_write_rx_ctl(hw, I40E_VFQF_HENA(1), (uint32_t)(hena >> 32));
 	I40EVF_WRITE_FLUSH(hw);
@@ -2462,16 +2455,9 @@ static void
 i40evf_disable_rss(struct i40e_vf *vf)
 {
 	struct i40e_hw *hw = I40E_VF_TO_HW(vf);
-	uint64_t hena;
 
-	hena = (uint64_t)i40e_read_rx_ctl(hw, I40E_VFQF_HENA(0));
-	hena |= ((uint64_t)i40e_read_rx_ctl(hw, I40E_VFQF_HENA(1))) << 32;
-	if (hw->mac.type == I40E_MAC_X722)
-		hena &= ~I40E_RSS_HENA_ALL_X722;
-	else
-		hena &= ~I40E_RSS_HENA_ALL;
-	i40e_write_rx_ctl(hw, I40E_VFQF_HENA(0), (uint32_t)hena);
-	i40e_write_rx_ctl(hw, I40E_VFQF_HENA(1), (uint32_t)(hena >> 32));
+	i40e_write_rx_ctl(hw, I40E_VFQF_HENA(0), 0);
+	i40e_write_rx_ctl(hw, I40E_VFQF_HENA(1), 0);
 	I40EVF_WRITE_FLUSH(hw);
 }
 
-- 
2.5.5

  reply	other threads:[~2017-09-20 14:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1503569908-104074-1-git-send-email-kirill.rybalchenko@intel.com>
2017-09-01 15:02 ` [dpdk-dev] [PATCH v2 0/4] net/i40e: implement dynamic mapping of flow types to pctypes Kirill Rybalchenko
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 1/4] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-09-04 16:49     ` Ananyev, Konstantin
2017-09-08 16:58     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 2/4] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-09-04 17:24     ` Iremonger, Bernard
2017-09-08 17:01     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-09-04 17:29     ` Iremonger, Bernard
2017-09-08 17:02     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 4/4] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-09-08 17:01     ` Ferruh Yigit
2017-09-04 17:16   ` [dpdk-dev] [PATCH v2 0/4] net/i40e: implement dynamic mapping of flow types to pctypes Iremonger, Bernard
2017-09-20 14:32   ` [dpdk-dev] [PATCH v3 0/6] " Kirill Rybalchenko
2017-09-20 14:32     ` Kirill Rybalchenko [this message]
2017-09-20 14:32     ` [dpdk-dev] [PATCH v3 2/6] net/i40e: add definition for invalid pctype Kirill Rybalchenko
2017-09-22  7:29       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 3/6] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-09-25  9:44       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 4/6] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-09-22  7:27       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 5/6] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-09-25 11:54       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 6/6] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-02 15:08     ` [dpdk-dev] [PATCH v4 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Kirill Rybalchenko
2017-10-02 15:08       ` [dpdk-dev] [PATCH v4 1/5] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-10-02 15:08       ` [dpdk-dev] [PATCH v4 2/5] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 3/5] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 4/5] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-10-03 21:42         ` Ferruh Yigit
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 5/5] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-03 21:44       ` [dpdk-dev] [PATCH v4 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Ferruh Yigit
2017-10-04 12:52       ` [dpdk-dev] [PATCH v5 " Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 1/5] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 2/5] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 3/5] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 4/5] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 5/5] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-04 21:48         ` [dpdk-dev] [PATCH v5 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Ferruh Yigit
2017-10-05  1:28           ` Ferruh Yigit

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=1505917983-119112-2-git-send-email-kirill.rybalchenko@intel.com \
    --to=kirill.rybalchenko@intel.com \
    --cc=andrey.chilikin@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.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).