From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Anjali Singhai Jain <anjali.singhai@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 07/17] i40e: Define and use i40e_is_vf macro
Date: Fri, 21 Nov 2014 21:54:58 -0800 [thread overview]
Message-ID: <1416635708-4765-9-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1416635708-4765-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Anjali Singhai Jain <anjali.singhai@intel.com>
This patch is useful for future expansion when new VF MAC types get
added. It helps with cleaning up VF driver flow.
Change-ID: Ibe1eeb71262a3a40f24a1c5409436bdc3411da7f
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_type.h | 2 ++
drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 2 +-
drivers/net/ethernet/intel/i40evf/i40e_type.h | 2 ++
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index 5dc12c4..35fa09a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -51,7 +51,7 @@ static inline bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc)
static void i40e_adminq_init_regs(struct i40e_hw *hw)
{
/* set head and tail registers in our local struct */
- if (hw->mac.type == I40E_MAC_VF) {
+ if (i40e_is_vf(hw)) {
hw->aq.asq.tail = I40E_VF_ATQT1;
hw->aq.asq.head = I40E_VF_ATQH1;
hw->aq.asq.len = I40E_VF_ATQLEN1;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index c852143..3904dd8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -482,6 +482,8 @@ struct i40e_hw {
u32 debug_mask;
};
+#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF)
+
struct i40e_driver_version {
u8 major_version;
u8 minor_version;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
index ff6305a..1698994 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
@@ -49,7 +49,7 @@ static inline bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc)
static void i40e_adminq_init_regs(struct i40e_hw *hw)
{
/* set head and tail registers in our local struct */
- if (hw->mac.type == I40E_MAC_VF) {
+ if (i40e_is_vf(hw)) {
hw->aq.asq.tail = I40E_VF_ATQT1;
hw->aq.asq.head = I40E_VF_ATQH1;
hw->aq.asq.len = I40E_VF_ATQLEN1;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index 8fe34fc..77abe17 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -476,6 +476,8 @@ struct i40e_hw {
u32 debug_mask;
};
+#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF)
+
struct i40e_driver_version {
u8 major_version;
u8 minor_version;
--
1.9.3
next prev parent reply other threads:[~2014-11-22 5:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-22 5:54 [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2014-11-21 Jeff Kirsher
2014-11-22 5:54 ` [net-next 01/17] i40e: Remove unneeded break statement Jeff Kirsher
2014-11-22 5:58 ` Jeff Kirsher
2014-11-22 5:54 ` Jeff Kirsher
2014-11-22 5:54 ` [net-next 02/17] i40e: remove useless debug noise Jeff Kirsher
2014-11-22 5:54 ` [net-next 03/17] i40e: allow various base numbers in debugfs aq commands Jeff Kirsher
2014-11-24 16:50 ` David Laight
2014-11-24 17:26 ` Nelson, Shannon
2014-11-22 5:54 ` [net-next 04/17] i40e: Add description to misc and fd interrupts Jeff Kirsher
2014-11-22 5:54 ` [net-next 05/17] i40e: don't enable PTP support on more than one PF per port Jeff Kirsher
2014-11-22 5:54 ` [net-next 06/17] i40e: Add a virtual channel op to config RSS Jeff Kirsher
2014-11-22 5:54 ` Jeff Kirsher [this message]
2014-11-22 5:54 ` [net-next 08/17] i40e: fix netdev_stat macro definition Jeff Kirsher
2014-11-22 5:55 ` [net-next 09/17] i40evf: make early init sequence even more robust Jeff Kirsher
2014-11-22 5:55 ` [net-next 10/17] i40e: Increase reset delay Jeff Kirsher
2014-11-22 5:55 ` [net-next 11/17] i40e: Add new update VSI flow to accommodate FW fix with VSI Loopback mode Jeff Kirsher
2014-11-22 5:55 ` [net-next 12/17] i40e: Re enable Main VSI loopback setting in the reset path Jeff Kirsher
2014-11-22 5:55 ` [net-next 13/17] i40evf: refactor ethtool RSS handling Jeff Kirsher
2014-11-23 3:44 ` Ben Hutchings
2014-11-22 5:55 ` [net-next 14/17] i40e: implement ethtool RSS config Jeff Kirsher
2014-11-22 18:22 ` Eric Dumazet
2014-11-23 3:52 ` Ben Hutchings
2014-11-23 3:53 ` Ben Hutchings
2014-11-22 5:55 ` [net-next 15/17] i40e: increase ARQ size Jeff Kirsher
2014-11-22 5:55 ` [net-next 16/17] i40e: get pf_id from HW rather than PCI function Jeff Kirsher
2014-11-22 5:55 ` [net-next 17/17] i40e: Bump i40e version to 1.2.2 and i40evf version to 1.0.6 Jeff Kirsher
2014-11-23 19:22 ` [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2014-11-21 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=1416635708-4765-9-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=anjali.singhai@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.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).