From: Wang Xiao W <xiao.w.wang@intel.com>
To: jing.d.chen@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 03/16] fm10k/base: cleanup namespace pollution and correct typecast
Date: Wed, 27 Jan 2016 11:50:34 +0800 [thread overview]
Message-ID: <1453866647-16215-4-git-send-email-xiao.w.wang@intel.com> (raw)
In-Reply-To: <1453866647-16215-1-git-send-email-xiao.w.wang@intel.com>
Correct typecast in fm10k_update_xc_addr_pf.
Make functions that are only referenced locally static.
And fix the function header comment for fm10k_tlv_attr_nest_stop() while
we're at it.
Wrap fm10k_msg_data fm10k_iov_msg_data_pf[] in the new ifndef
NO_DEFAULT_SRIOV_MSG_HANDLERS so that drivers with custom SR-IOV
message handlers can strip it.
remove unused struct element in struct fm10k_mac_ops.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
---
drivers/net/fm10k/base/fm10k_pf.c | 10 ++++++----
drivers/net/fm10k/base/fm10k_pf.h | 4 ++--
drivers/net/fm10k/base/fm10k_tlv.c | 16 ++++++++--------
drivers/net/fm10k/base/fm10k_tlv.h | 5 -----
drivers/net/fm10k/base/fm10k_type.h | 1 -
drivers/net/fm10k/base/fm10k_vf.c | 2 --
6 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/drivers/net/fm10k/base/fm10k_pf.c b/drivers/net/fm10k/base/fm10k_pf.c
index 6e6d71e..5b8c039 100644
--- a/drivers/net/fm10k/base/fm10k_pf.c
+++ b/drivers/net/fm10k/base/fm10k_pf.c
@@ -379,8 +379,8 @@ STATIC s32 fm10k_update_xc_addr_pf(struct fm10k_hw *hw, u16 glort,
((u32)mac[3] << 16) |
((u32)mac[4] << 8) |
((u32)mac[5]));
- mac_update.mac_upper = FM10K_CPU_TO_LE16(((u32)mac[0] << 8) |
- ((u32)mac[1]));
+ mac_update.mac_upper = FM10K_CPU_TO_LE16(((u16)mac[0] << 8) |
+ ((u16)mac[1]));
mac_update.vlan = FM10K_CPU_TO_LE16(vid);
mac_update.glort = FM10K_CPU_TO_LE16(glort);
mac_update.action = add ? 0 : 1;
@@ -1457,6 +1457,7 @@ s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *hw, u32 **results,
return err;
}
+#ifndef NO_DEFAULT_SRIOV_MSG_HANDLERS
const struct fm10k_msg_data fm10k_iov_msg_data_pf[] = {
FM10K_TLV_MSG_TEST_HANDLER(fm10k_tlv_msg_test),
FM10K_VF_MSG_MSIX_HANDLER(fm10k_iov_msg_msix_pf),
@@ -1465,6 +1466,7 @@ const struct fm10k_msg_data fm10k_iov_msg_data_pf[] = {
FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error),
};
+#endif
/**
* fm10k_update_stats_hw_pf - Updates hardware related statistics of PF
* @hw: pointer to hardware structure
@@ -1754,8 +1756,8 @@ const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[] = {
*
* This handler configures the default VLAN for the PF
**/
-s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results,
- struct fm10k_mbx_info *mbx)
+static s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results,
+ struct fm10k_mbx_info *mbx)
{
u16 glort, pvid;
u32 pvid_update;
diff --git a/drivers/net/fm10k/base/fm10k_pf.h b/drivers/net/fm10k/base/fm10k_pf.h
index 44bd193..92e2962 100644
--- a/drivers/net/fm10k/base/fm10k_pf.h
+++ b/drivers/net/fm10k/base/fm10k_pf.h
@@ -149,8 +149,6 @@ extern const struct fm10k_tlv_attr fm10k_lport_map_msg_attr[];
#define FM10K_PF_MSG_LPORT_MAP_HANDLER(func) \
FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_MAP, \
fm10k_lport_map_msg_attr, func)
-s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *, u32 **,
- struct fm10k_mbx_info *);
extern const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[];
#define FM10K_PF_MSG_UPDATE_PVID_HANDLER(func) \
FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_UPDATE_PVID, \
@@ -183,7 +181,9 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *, u32 **,
struct fm10k_mbx_info *);
s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *, u32 **,
struct fm10k_mbx_info *);
+#ifndef NO_DEFAULT_SRIOV_MSG_HANDLERS
extern const struct fm10k_msg_data fm10k_iov_msg_data_pf[];
+#endif
s32 fm10k_init_ops_pf(struct fm10k_hw *hw);
#endif /* _FM10K_PF_H */
diff --git a/drivers/net/fm10k/base/fm10k_tlv.c b/drivers/net/fm10k/base/fm10k_tlv.c
index 1d9d7d8..ade87d1 100644
--- a/drivers/net/fm10k/base/fm10k_tlv.c
+++ b/drivers/net/fm10k/base/fm10k_tlv.c
@@ -63,8 +63,8 @@ s32 fm10k_tlv_msg_init(u32 *msg, u16 msg_id)
* the attribute buffer. It will return success if provided with a valid
* pointers.
**/
-s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id,
- const unsigned char *string)
+static s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id,
+ const unsigned char *string)
{
u32 attr_data = 0, len = 0;
u32 *attr;
@@ -115,7 +115,7 @@ s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id,
* it in the array pointed by by string. It will return success if provided
* with a valid pointers.
**/
-s32 fm10k_tlv_attr_get_null_string(u32 *attr, unsigned char *string)
+static s32 fm10k_tlv_attr_get_null_string(u32 *attr, unsigned char *string)
{
u32 len;
@@ -386,7 +386,7 @@ s32 fm10k_tlv_attr_get_le_struct(u32 *attr, void *le_struct, u32 len)
* function will return NULL on failure, and a pointer to the start
* of the nested attributes on success.
**/
-u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id)
+static u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id)
{
u32 *attr;
@@ -405,7 +405,7 @@ u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id)
}
/**
- * fm10k_tlv_attr_nest_start - Start a set of nested attributes
+ * fm10k_tlv_attr_nest_stop - Stop a set of nested attributes
* @msg: Pointer to message block
*
* This function closes off an existing set of nested attributes. The
@@ -413,7 +413,7 @@ u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id)
* the case of a nest within the nest this would be the outer nest pointer.
* This function will return success provided all pointers are valid.
**/
-s32 fm10k_tlv_attr_nest_stop(u32 *msg)
+static s32 fm10k_tlv_attr_nest_stop(u32 *msg)
{
u32 *attr;
u32 len;
@@ -522,8 +522,8 @@ STATIC s32 fm10k_tlv_attr_validate(u32 *attr,
* FM10K_NOT_IMPLEMENTED for any attribute that is outside of the array
* and 0 on success.
**/
-s32 fm10k_tlv_attr_parse(u32 *attr, u32 **results,
- const struct fm10k_tlv_attr *tlv_attr)
+static s32 fm10k_tlv_attr_parse(u32 *attr, u32 **results,
+ const struct fm10k_tlv_attr *tlv_attr)
{
u32 i, attr_id, offset = 0;
s32 err = 0;
diff --git a/drivers/net/fm10k/base/fm10k_tlv.h b/drivers/net/fm10k/base/fm10k_tlv.h
index ad97236..a297bb8 100644
--- a/drivers/net/fm10k/base/fm10k_tlv.h
+++ b/drivers/net/fm10k/base/fm10k_tlv.h
@@ -119,8 +119,6 @@ struct fm10k_msg_data {
#define FM10K_MSG_HANDLER(id, attr, func) { id, attr, func }
s32 fm10k_tlv_msg_init(u32 *, u16);
-s32 fm10k_tlv_attr_put_null_string(u32 *, u16, const unsigned char *);
-s32 fm10k_tlv_attr_get_null_string(u32 *, unsigned char *);
s32 fm10k_tlv_attr_put_mac_vlan(u32 *, u16, const u8 *, u16);
s32 fm10k_tlv_attr_get_mac_vlan(u32 *, u8 *, u16 *);
s32 fm10k_tlv_attr_put_bool(u32 *, u16);
@@ -160,9 +158,6 @@ s32 fm10k_tlv_attr_get_value(u32 *, void *, u32);
fm10k_tlv_attr_get_value(attr, ptr, sizeof(s64))
s32 fm10k_tlv_attr_put_le_struct(u32 *, u16, const void *, u32);
s32 fm10k_tlv_attr_get_le_struct(u32 *, void *, u32);
-u32 *fm10k_tlv_attr_nest_start(u32 *, u16);
-s32 fm10k_tlv_attr_nest_stop(u32 *);
-s32 fm10k_tlv_attr_parse(u32 *, u32 **, const struct fm10k_tlv_attr *);
s32 fm10k_tlv_msg_parse(struct fm10k_hw *, u32 *, struct fm10k_mbx_info *,
const struct fm10k_msg_data *);
s32 fm10k_tlv_msg_error(struct fm10k_hw *hw, u32 **results,
diff --git a/drivers/net/fm10k/base/fm10k_type.h b/drivers/net/fm10k/base/fm10k_type.h
index df1d276..62fa73f 100644
--- a/drivers/net/fm10k/base/fm10k_type.h
+++ b/drivers/net/fm10k/base/fm10k_type.h
@@ -679,7 +679,6 @@ struct fm10k_mac_ops {
struct fm10k_dglort_cfg *);
void (*set_dma_mask)(struct fm10k_hw *, u64);
s32 (*get_fault)(struct fm10k_hw *, int, struct fm10k_fault *);
- void (*request_lport_map)(struct fm10k_hw *);
s32 (*adjust_systime)(struct fm10k_hw *, s32 ppb);
s32 (*notify_offset)(struct fm10k_hw *, u64 offset);
u64 (*read_systime)(struct fm10k_hw *);
diff --git a/drivers/net/fm10k/base/fm10k_vf.c b/drivers/net/fm10k/base/fm10k_vf.c
index a46b488..7822ab6 100644
--- a/drivers/net/fm10k/base/fm10k_vf.c
+++ b/drivers/net/fm10k/base/fm10k_vf.c
@@ -414,8 +414,6 @@ const struct fm10k_tlv_attr fm10k_lport_state_msg_attr[] = {
FM10K_TLV_ATTR_LAST
};
-extern const struct fm10k_tlv_attr fm10k_1588_msg_attr[];
-
/**
* fm10k_msg_lport_state_vf - Message handler for lport_state message from PF
* @hw: Pointer to hardware structure
--
1.9.3
next prev parent reply other threads:[~2016-01-27 3:51 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 ` [dpdk-dev] [PATCH v3 12/18] fm10k/base: allow removal of is_slot_appropriate function Wang Xiao W
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 ` Wang Xiao W [this message]
2016-02-16 10:55 ` [dpdk-dev] [PATCH v2 03/16] fm10k/base: cleanup namespace pollution and correct typecast 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=1453866647-16215-4-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).