From: Wang Xiao W <xiao.w.wang@intel.com>
To: jing.d.chen@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 12/18] fm10k/base: allow removal of is_slot_appropriate function
Date: Fri, 19 Feb 2016 19:06:59 +0800 [thread overview]
Message-ID: <1455880025-6912-13-git-send-email-xiao.w.wang@intel.com> (raw)
In-Reply-To: <1455880025-6912-1-git-send-email-xiao.w.wang@intel.com>
The Linux Kernel provides the OS a call "pcie_get_minimum_link" which
can crawl the PCIe tree and determine the actual minimum link speed of a
device which is a more general check than provided by
is_slot_appropriate. Thus, the upstream driver does not use or want the
is_slot_appropriate function call. Add a NO_IS_SLOT_APPROPRIATE_CHECK
definition which can be defined during strip process to remove the code.
If left undefined (the default) then the code will all be active and no
driver changes should be necessary.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
---
drivers/net/fm10k/base/fm10k_api.c | 2 ++
drivers/net/fm10k/base/fm10k_api.h | 2 ++
drivers/net/fm10k/base/fm10k_pf.c | 4 ++++
drivers/net/fm10k/base/fm10k_type.h | 2 ++
drivers/net/fm10k/base/fm10k_vf.c | 4 ++++
5 files changed, 14 insertions(+)
diff --git a/drivers/net/fm10k/base/fm10k_api.c b/drivers/net/fm10k/base/fm10k_api.c
index eb5bdaa..c49d20d 100644
--- a/drivers/net/fm10k/base/fm10k_api.c
+++ b/drivers/net/fm10k/base/fm10k_api.c
@@ -181,6 +181,7 @@ s32 fm10k_get_bus_info(struct fm10k_hw *hw)
FM10K_NOT_IMPLEMENTED);
}
+#ifndef NO_IS_SLOT_APPROPRIATE_CHECK
/**
* fm10k_is_slot_appropriate - Indicate appropriate slot for this SKU
* @hw: pointer to hardware structure
@@ -195,6 +196,7 @@ bool fm10k_is_slot_appropriate(struct fm10k_hw *hw)
return true;
}
+#endif
/**
* fm10k_update_vlan - Clear VLAN ID to VLAN filter table
* @hw: pointer to hardware structure
diff --git a/drivers/net/fm10k/base/fm10k_api.h b/drivers/net/fm10k/base/fm10k_api.h
index 113aef5..2ab3149 100644
--- a/drivers/net/fm10k/base/fm10k_api.h
+++ b/drivers/net/fm10k/base/fm10k_api.h
@@ -44,7 +44,9 @@ s32 fm10k_stop_hw(struct fm10k_hw *hw);
s32 fm10k_start_hw(struct fm10k_hw *hw);
s32 fm10k_init_shared_code(struct fm10k_hw *hw);
s32 fm10k_get_bus_info(struct fm10k_hw *hw);
+#ifndef NO_IS_SLOT_APPROPRIATE_CHECK
bool fm10k_is_slot_appropriate(struct fm10k_hw *hw);
+#endif
s32 fm10k_update_vlan(struct fm10k_hw *hw, u32 vid, u8 idx, bool set);
s32 fm10k_read_mac_addr(struct fm10k_hw *hw);
void fm10k_update_hw_stats(struct fm10k_hw *hw, struct fm10k_hw_stats *stats);
diff --git a/drivers/net/fm10k/base/fm10k_pf.c b/drivers/net/fm10k/base/fm10k_pf.c
index a1469aa..f5cbda4 100644
--- a/drivers/net/fm10k/base/fm10k_pf.c
+++ b/drivers/net/fm10k/base/fm10k_pf.c
@@ -216,6 +216,7 @@ STATIC s32 fm10k_init_hw_pf(struct fm10k_hw *hw)
return FM10K_SUCCESS;
}
+#ifndef NO_IS_SLOT_APPROPRIATE_CHECK
/**
* fm10k_is_slot_appropriate_pf - Indicate appropriate slot for this SKU
* @hw: pointer to hardware structure
@@ -231,6 +232,7 @@ STATIC bool fm10k_is_slot_appropriate_pf(struct fm10k_hw *hw)
(hw->bus.width == hw->bus_caps.width);
}
+#endif
/**
* fm10k_update_vlan_pf - Update status of VLAN ID in VLAN filter table
* @hw: pointer to hardware structure
@@ -2064,7 +2066,9 @@ s32 fm10k_init_ops_pf(struct fm10k_hw *hw)
mac->ops.init_hw = &fm10k_init_hw_pf;
mac->ops.start_hw = &fm10k_start_hw_generic;
mac->ops.stop_hw = &fm10k_stop_hw_generic;
+#ifndef NO_IS_SLOT_APPROPRIATE_CHECK
mac->ops.is_slot_appropriate = &fm10k_is_slot_appropriate_pf;
+#endif
mac->ops.update_vlan = &fm10k_update_vlan_pf;
mac->ops.read_mac_addr = &fm10k_read_mac_addr_pf;
mac->ops.update_uc_addr = &fm10k_update_uc_addr_pf;
diff --git a/drivers/net/fm10k/base/fm10k_type.h b/drivers/net/fm10k/base/fm10k_type.h
index 1e84294..c4e5450 100644
--- a/drivers/net/fm10k/base/fm10k_type.h
+++ b/drivers/net/fm10k/base/fm10k_type.h
@@ -679,7 +679,9 @@ struct fm10k_mac_ops {
s32 (*stop_hw)(struct fm10k_hw *);
s32 (*get_bus_info)(struct fm10k_hw *);
s32 (*get_host_state)(struct fm10k_hw *, bool *);
+#ifndef NO_IS_SLOT_APPROPRIATE_CHECK
bool (*is_slot_appropriate)(struct fm10k_hw *);
+#endif
s32 (*update_vlan)(struct fm10k_hw *, u32, u8, bool);
s32 (*read_mac_addr)(struct fm10k_hw *);
s32 (*update_uc_addr)(struct fm10k_hw *, u16, const u8 *,
diff --git a/drivers/net/fm10k/base/fm10k_vf.c b/drivers/net/fm10k/base/fm10k_vf.c
index 43eb081..efbdbd1 100644
--- a/drivers/net/fm10k/base/fm10k_vf.c
+++ b/drivers/net/fm10k/base/fm10k_vf.c
@@ -178,6 +178,7 @@ reset_max_queues:
return err;
}
+#ifndef NO_IS_SLOT_APPROPRIATE_CHECK
/**
* fm10k_is_slot_appropriate_vf - Indicate appropriate slot for this SKU
* @hw: pointer to hardware structure
@@ -194,6 +195,7 @@ STATIC bool fm10k_is_slot_appropriate_vf(struct fm10k_hw *hw)
return TRUE;
}
+#endif
/* This structure defines the attibutes to be parsed below */
const struct fm10k_tlv_attr fm10k_mac_vlan_msg_attr[] = {
FM10K_TLV_ATTR_U32(FM10K_MAC_VLAN_MSG_VLAN),
@@ -648,7 +650,9 @@ s32 fm10k_init_ops_vf(struct fm10k_hw *hw)
mac->ops.init_hw = &fm10k_init_hw_vf;
mac->ops.start_hw = &fm10k_start_hw_generic;
mac->ops.stop_hw = &fm10k_stop_hw_vf;
+#ifndef NO_IS_SLOT_APPROPRIATE_CHECK
mac->ops.is_slot_appropriate = &fm10k_is_slot_appropriate_vf;
+#endif
mac->ops.update_vlan = &fm10k_update_vlan_vf;
mac->ops.read_mac_addr = &fm10k_read_mac_addr_vf;
mac->ops.update_uc_addr = &fm10k_update_uc_addr_vf;
--
1.9.3
next prev parent reply other threads:[~2016-02-19 11:07 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-21 10:35 [dpdk-dev] [PATCH 00/16] fm10k: update shared code from ND team Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 01/16] fm10k/base: cleanup namespace pollution and correct typecast Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 02/16] fm10k/base: use bitshift for itr_scale Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 03/16] fm10k/base: reset max_queues on init_hw_vf failure Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 04/16] fm10k/base: document ITR scale workaround in VF TDLEN register Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 05/16] fm10k/base: fix checkpatch warning Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 06/16] fm10k/base: use BIT macro instead of open-coded bit-shifting of 1 Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 07/16] fm10k/base: do not use CamelCase Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 08/16] fm10k/base: use memcpy for mac addr copy Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 09/16] fm10k/base: allow removal of is_slot_appropriate function Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 10/16] fm10k/base: consistently use VLAN ID when referencing vid variables Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 11/16] fm10k/base: fix comment per upstream review changes Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 12/16] fm10k/base: TLV structures must be 4byte aligned, not 1byte aligned Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 13/16] fm10k/base: move constants to the right of binary operators Wang Xiao W
2016-01-21 10:35 ` [dpdk-dev] [PATCH 14/16] fm10k/base: minor cleanups Wang Xiao W
2016-01-21 10:36 ` [dpdk-dev] [PATCH 15/16] fm10k: use default mailbox message handler for pf Wang Xiao W
2016-01-22 21:31 ` Bruce Richardson
2016-01-25 2:31 ` Wang, Xiao W
2016-01-26 20:16 ` Bruce Richardson
2016-01-27 1:57 ` Wang, Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 00/16] fm10k: update shared code Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 01/16] fm10k: use default mailbox message handler for pf Wang Xiao W
2016-02-16 10:50 ` Bruce Richardson
2016-02-18 10:25 ` Wang, Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 00/18] fm10k: update shared code Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 01/18] fm10k: use default mailbox message handler for PF Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 02/18] fm10k/base: correct typecast in fm10k_update_xc_addr_pf Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 03/18] fm10k/base: cleanup namespace pollution Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 04/18] fm10k/base: use bitshift for itr_scale Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 05/18] fm10k/base: reset max_queues on init_hw_vf failure Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 06/18] fm10k/base: document ITR scale workaround in VF TDLEN register Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 07/18] fm10k/base: cleanup lines over 80 characters Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 08/18] fm10k/base: cleanup useless else Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 09/18] fm10k/base: use BIT macro instead of open-coded bit-shifting of 1 Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 10/18] fm10k/base: do not use CamelCase Wang Xiao W
2016-02-19 11:06 ` [dpdk-dev] [PATCH v3 11/18] fm10k/base: use memcpy for mac addr copy Wang Xiao W
2016-02-19 11:06 ` Wang Xiao W [this message]
2016-02-19 11:07 ` [dpdk-dev] [PATCH v3 13/18] fm10k/base: consistently use VLAN ID when referencing vid variables Wang Xiao W
2016-02-19 11:07 ` [dpdk-dev] [PATCH v3 14/18] fm10k/base: imporve comment per upstream review changes Wang Xiao W
2016-02-19 11:07 ` [dpdk-dev] [PATCH v3 15/18] fm10k/base: fix TLV structures alignment Wang Xiao W
2016-02-19 11:07 ` [dpdk-dev] [PATCH v3 16/18] fm10k/base: move constants to the right of binary operators Wang Xiao W
2016-02-19 11:07 ` [dpdk-dev] [PATCH v3 17/18] fm10k/base: minor cleanups Wang Xiao W
2016-02-19 11:07 ` [dpdk-dev] [PATCH v3 18/18] fm10k/base: remove unused struct element Wang Xiao W
2016-02-29 2:30 ` [dpdk-dev] [PATCH v3 00/18] fm10k: update shared code Ding, HengX
2016-03-08 16:27 ` Bruce Richardson
2016-03-08 13:24 ` Bruce Richardson
2016-03-08 14:15 ` Wang, Xiao W
2016-03-08 14:25 ` Chen, Jing D
2016-03-08 14:32 ` Wang, Xiao W
2016-03-08 14:53 ` Bruce Richardson
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 02/16] fm10k/base: add macro definitions that are needed Wang Xiao W
2016-02-16 10:52 ` Bruce Richardson
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 03/16] fm10k/base: cleanup namespace pollution and correct typecast Wang Xiao W
2016-02-16 10:55 ` Bruce Richardson
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 04/16] fm10k/base: use bitshift for itr_scale Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 05/16] fm10k/base: reset max_queues on init_hw_vf failure Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 06/16] fm10k/base: document ITR scale workaround in VF TDLEN register Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 07/16] fm10k/base: fix checkpatch warning Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 08/16] fm10k/base: use BIT macro instead of open-coded bit-shifting of 1 Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 09/16] fm10k/base: do not use CamelCase Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 10/16] fm10k/base: use memcpy for mac addr copy Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 11/16] fm10k/base: allow removal of is_slot_appropriate function Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 12/16] fm10k/base: consistently use VLAN ID when referencing vid variables Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 13/16] fm10k/base: fix comment per upstream review changes Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 14/16] fm10k/base: TLV structures must be 4byte aligned, not 1byte aligned Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 15/16] fm10k/base: move constants to the right of binary operators Wang Xiao W
2016-01-27 3:50 ` [dpdk-dev] [PATCH v2 16/16] fm10k/base: minor cleanups Wang Xiao W
2016-02-16 8:11 ` [dpdk-dev] [PATCH v2 00/16] fm10k: update shared code Chen, Jing D
2016-01-21 10:36 ` [dpdk-dev] [PATCH 16/16] fm10k/base: add macro definitions that are needed Wang Xiao W
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=1455880025-6912-13-git-send-email-xiao.w.wang@intel.com \
--to=xiao.w.wang@intel.com \
--cc=dev@dpdk.org \
--cc=jing.d.chen@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).