Message ID | 1453372561-11431-16-git-send-email-xiao.w.wang@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id A359B91FC; Thu, 21 Jan 2016 11:36:48 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A228F8E64 for <dev@dpdk.org>; Thu, 21 Jan 2016 11:36:40 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 21 Jan 2016 02:36:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,324,1449561600"; d="scan'208";a="637724687" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 21 Jan 2016 02:36:39 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u0LAabPP006678; Thu, 21 Jan 2016 18:36:37 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u0LAaZNw011573; Thu, 21 Jan 2016 18:36:37 +0800 Received: (from xiaowan1@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u0LAaZOJ011569; Thu, 21 Jan 2016 18:36:35 +0800 From: Wang Xiao W <xiao.w.wang@intel.com> To: jing.d.chen@intel.com Date: Thu, 21 Jan 2016 18:36:00 +0800 Message-Id: <1453372561-11431-16-git-send-email-xiao.w.wang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1453372561-11431-1-git-send-email-xiao.w.wang@intel.com> References: <1453372561-11431-1-git-send-email-xiao.w.wang@intel.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 15/16] fm10k: use default mailbox message handler for pf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Xiao Wang
Jan. 21, 2016, 10:36 a.m. UTC
The new share code makes fm10k_msg_update_pvid_pf function static, so we can
not refer to it now in fm10k_ethdev.c. The registered pf handler is almost the
same as the default pf handler, removing it has no impact on mailbox.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
---
drivers/net/fm10k/fm10k_ethdev.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
Comments
On Thu, Jan 21, 2016 at 06:36:00PM +0800, Wang Xiao W wrote: > The new share code makes fm10k_msg_update_pvid_pf function static, so we can > not refer to it now in fm10k_ethdev.c. The registered pf handler is almost the > same as the default pf handler, removing it has no impact on mailbox. > > Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com> What patch makes the function static, as we need to ensure that the build is not broken by having this patch in the wrong place in the patchset? Also, it seems strange having this patch in the middle of a series of base code updates - perhaps it should go first, so that all base code update patches can go one after the other. /Bruce > --- > drivers/net/fm10k/fm10k_ethdev.c | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) > > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c > index e967628..a118cf4 100644 > --- a/drivers/net/fm10k/fm10k_ethdev.c > +++ b/drivers/net/fm10k/fm10k_ethdev.c > @@ -2367,29 +2367,16 @@ static const struct fm10k_msg_data fm10k_msgdata_vf[] = { > FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), > }; > > -/* Mailbox message handler in PF */ > -static const struct fm10k_msg_data fm10k_msgdata_pf[] = { > - FM10K_PF_MSG_ERR_HANDLER(XCAST_MODES, fm10k_msg_err_pf), > - FM10K_PF_MSG_ERR_HANDLER(UPDATE_MAC_FWD_RULE, fm10k_msg_err_pf), > - FM10K_PF_MSG_LPORT_MAP_HANDLER(fm10k_msg_lport_map_pf), > - FM10K_PF_MSG_ERR_HANDLER(LPORT_CREATE, fm10k_msg_err_pf), > - FM10K_PF_MSG_ERR_HANDLER(LPORT_DELETE, fm10k_msg_err_pf), > - FM10K_PF_MSG_UPDATE_PVID_HANDLER(fm10k_msg_update_pvid_pf), > - FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), > -}; > - > static int > fm10k_setup_mbx_service(struct fm10k_hw *hw) > { > - int err; > + int err = 0; > > /* Initialize mailbox lock */ > fm10k_mbx_initlock(hw); > > /* Replace default message handler with new ones */ > - if (hw->mac.type == fm10k_mac_pf) > - err = hw->mbx.ops.register_handlers(&hw->mbx, fm10k_msgdata_pf); > - else > + if (hw->mac.type == fm10k_mac_vf) > err = hw->mbx.ops.register_handlers(&hw->mbx, fm10k_msgdata_vf); > > if (err) { > -- > 1.9.3 >
Hi Bruce, > -----Original Message----- > From: Richardson, Bruce > Sent: Saturday, January 23, 2016 5:32 AM > To: Wang, Xiao W <xiao.w.wang@intel.com> > Cc: Chen, Jing D <jing.d.chen@intel.com>; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 15/16] fm10k: use default mailbox message > handler for pf > > On Thu, Jan 21, 2016 at 06:36:00PM +0800, Wang Xiao W wrote: > > The new share code makes fm10k_msg_update_pvid_pf function static, so > > we can not refer to it now in fm10k_ethdev.c. The registered pf > > handler is almost the same as the default pf handler, removing it has no > impact on mailbox. > > > > Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com> > > What patch makes the function static, as we need to ensure that the build is > not broken by having this patch in the wrong place in the patchset? > > Also, it seems strange having this patch in the middle of a series of base code > updates - perhaps it should go first, so that all base code update patches can > go one after the other. > > /Bruce It's the first patch in the patch set that makes the function static. The 0015.patch and 0016.patch are two extra fix patches made by myself. The 0015 is for the "static fm10k_msg_update_pvid_pf " issue, the 0016 adds back a few macro definitions which are removed in shared code but are needed in dpdk/fm10k, I add these necessary macros into fm10k/base/fm10k_osdep.h which is controlled by dpdk driver. I put the two extra (15/16, 16/16) fix patches last, (15/16) is a change for fm10k_ethdev.c, so I prefix the subject with "fm10k: ", (16/16) is a change for base/fm10k_osdep.h, so I prefix the subject with "fm10k/base: ". Best Regards, Wang, Xiao > > > --- > > drivers/net/fm10k/fm10k_ethdev.c | 17 ++--------------- > > 1 file changed, 2 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/net/fm10k/fm10k_ethdev.c > > b/drivers/net/fm10k/fm10k_ethdev.c > > index e967628..a118cf4 100644 > > --- a/drivers/net/fm10k/fm10k_ethdev.c > > +++ b/drivers/net/fm10k/fm10k_ethdev.c > > @@ -2367,29 +2367,16 @@ static const struct fm10k_msg_data > fm10k_msgdata_vf[] = { > > FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), > > }; > > > > -/* Mailbox message handler in PF */ > > -static const struct fm10k_msg_data fm10k_msgdata_pf[] = { > > - FM10K_PF_MSG_ERR_HANDLER(XCAST_MODES, > fm10k_msg_err_pf), > > - FM10K_PF_MSG_ERR_HANDLER(UPDATE_MAC_FWD_RULE, > fm10k_msg_err_pf), > > - > FM10K_PF_MSG_LPORT_MAP_HANDLER(fm10k_msg_lport_map_p > f), > > - FM10K_PF_MSG_ERR_HANDLER(LPORT_CREATE, > fm10k_msg_err_pf), > > - FM10K_PF_MSG_ERR_HANDLER(LPORT_DELETE, > fm10k_msg_err_pf), > > - > FM10K_PF_MSG_UPDATE_PVID_HANDLER(fm10k_msg_update_pvi > d_pf), > > - FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), > > -}; > > - > > static int > > fm10k_setup_mbx_service(struct fm10k_hw *hw) { > > - int err; > > + int err = 0; > > > > /* Initialize mailbox lock */ > > fm10k_mbx_initlock(hw); > > > > /* Replace default message handler with new ones */ > > - if (hw->mac.type == fm10k_mac_pf) > > - err = hw->mbx.ops.register_handlers(&hw->mbx, > fm10k_msgdata_pf); > > - else > > + if (hw->mac.type == fm10k_mac_vf) > > err = hw->mbx.ops.register_handlers(&hw->mbx, > fm10k_msgdata_vf); > > > > if (err) { > > -- > > 1.9.3 > >
On Mon, Jan 25, 2016 at 02:31:05AM +0000, Wang, Xiao W wrote: > Hi Bruce, > > > -----Original Message----- > > From: Richardson, Bruce > > Sent: Saturday, January 23, 2016 5:32 AM > > To: Wang, Xiao W <xiao.w.wang@intel.com> > > Cc: Chen, Jing D <jing.d.chen@intel.com>; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH 15/16] fm10k: use default mailbox message > > handler for pf > > > > On Thu, Jan 21, 2016 at 06:36:00PM +0800, Wang Xiao W wrote: > > > The new share code makes fm10k_msg_update_pvid_pf function static, so > > > we can not refer to it now in fm10k_ethdev.c. The registered pf > > > handler is almost the same as the default pf handler, removing it has no > > impact on mailbox. > > > > > > Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com> > > > > What patch makes the function static, as we need to ensure that the build is > > not broken by having this patch in the wrong place in the patchset? > > > > Also, it seems strange having this patch in the middle of a series of base code > > updates - perhaps it should go first, so that all base code update patches can > > go one after the other. > > > > /Bruce > > It's the first patch in the patch set that makes the function static. So does this patch not need to go before patch 1, if we can't refer to the function once patch one is applied? /Bruce
> -----Original Message----- > From: Richardson, Bruce > Sent: Wednesday, January 27, 2016 4:17 AM > To: Wang, Xiao W <xiao.w.wang@intel.com> > Cc: Chen, Jing D <jing.d.chen@intel.com>; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 15/16] fm10k: use default mailbox message > handler for pf > > On Mon, Jan 25, 2016 at 02:31:05AM +0000, Wang, Xiao W wrote: > > Hi Bruce, > > > > > -----Original Message----- > > > From: Richardson, Bruce > > > Sent: Saturday, January 23, 2016 5:32 AM > > > To: Wang, Xiao W <xiao.w.wang@intel.com> > > > Cc: Chen, Jing D <jing.d.chen@intel.com>; dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH 15/16] fm10k: use default mailbox > > > message handler for pf > > > > > > On Thu, Jan 21, 2016 at 06:36:00PM +0800, Wang Xiao W wrote: > > > > The new share code makes fm10k_msg_update_pvid_pf function static, > > > > so we can not refer to it now in fm10k_ethdev.c. The registered pf > > > > handler is almost the same as the default pf handler, removing it > > > > has no > > > impact on mailbox. > > > > > > > > Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com> > > > > > > What patch makes the function static, as we need to ensure that the > > > build is not broken by having this patch in the wrong place in the patchset? > > > > > > Also, it seems strange having this patch in the middle of a series > > > of base code updates - perhaps it should go first, so that all base > > > code update patches can go one after the other. > > > > > > /Bruce > > > > It's the first patch in the patch set that makes the function static. > > So does this patch not need to go before patch 1, if we can't refer to the > function once patch one is applied? > > /Bruce OK, got it, I will revise my patch, thanks a lot for your comment. Best Regards, Wang, Xiao
v2: * Put the two extra fix patches ahead of the base code patches. Wang Xiao W (16): fm10k: use default mailbox message handler for pf fm10k/base: add macro definitions that are needed fm10k/base: cleanup namespace pollution and correct typecast fm10k/base: use bitshift for itr_scale fm10k/base: reset max_queues on init_hw_vf failure fm10k/base: document ITR scale workaround in VF TDLEN register fm10k/base: fix checkpatch warning fm10k/base: use BIT macro instead of open-coded bit-shifting of 1 fm10k/base: do not use CamelCase fm10k/base: use memcpy for mac addr copy fm10k/base: allow removal of is_slot_appropriate function fm10k/base: consistently use VLAN ID when referencing vid variables fm10k/base: fix comment per upstream review changes fm10k/base: TLV structures must be 4byte aligned, not 1byte aligned fm10k/base: move constants to the right of binary operators fm10k/base: minor cleanups drivers/net/fm10k/base/fm10k_api.c | 2 + drivers/net/fm10k/base/fm10k_api.h | 2 + drivers/net/fm10k/base/fm10k_mbx.c | 63 +++++++----- drivers/net/fm10k/base/fm10k_mbx.h | 11 +-- drivers/net/fm10k/base/fm10k_osdep.h | 30 ++++++ drivers/net/fm10k/base/fm10k_pf.c | 88 +++++++++-------- drivers/net/fm10k/base/fm10k_pf.h | 18 ++-- drivers/net/fm10k/base/fm10k_tlv.c | 40 ++++---- drivers/net/fm10k/base/fm10k_tlv.h | 9 +- drivers/net/fm10k/base/fm10k_type.h | 182 +++++++---------------------------- drivers/net/fm10k/base/fm10k_vf.c | 32 ++++-- drivers/net/fm10k/fm10k_ethdev.c | 41 +++----- 12 files changed, 220 insertions(+), 298 deletions(-)
Hi, Best Regards, Mark > -----Original Message----- > From: Wang, Xiao W > Sent: Wednesday, January 27, 2016 11:51 AM > To: Chen, Jing D > Cc: dev@dpdk.org; Richardson, Bruce; He, Shaopeng; Wang, Xiao W > Subject: [PATCH v2 00/16] fm10k: update shared code > > v2: > * Put the two extra fix patches ahead of the base code patches. > > Wang Xiao W (16): > fm10k: use default mailbox message handler for pf > fm10k/base: add macro definitions that are needed > fm10k/base: cleanup namespace pollution and correct typecast > fm10k/base: use bitshift for itr_scale > fm10k/base: reset max_queues on init_hw_vf failure > fm10k/base: document ITR scale workaround in VF TDLEN register > fm10k/base: fix checkpatch warning > fm10k/base: use BIT macro instead of open-coded bit-shifting of 1 > fm10k/base: do not use CamelCase > fm10k/base: use memcpy for mac addr copy > fm10k/base: allow removal of is_slot_appropriate function > fm10k/base: consistently use VLAN ID when referencing vid variables > fm10k/base: fix comment per upstream review changes > fm10k/base: TLV structures must be 4byte aligned, not 1byte aligned > fm10k/base: move constants to the right of binary operators > fm10k/base: minor cleanups > > drivers/net/fm10k/base/fm10k_api.c | 2 + > drivers/net/fm10k/base/fm10k_api.h | 2 + > drivers/net/fm10k/base/fm10k_mbx.c | 63 +++++++----- > drivers/net/fm10k/base/fm10k_mbx.h | 11 +-- > drivers/net/fm10k/base/fm10k_osdep.h | 30 ++++++ > drivers/net/fm10k/base/fm10k_pf.c | 88 +++++++++-------- > drivers/net/fm10k/base/fm10k_pf.h | 18 ++-- > drivers/net/fm10k/base/fm10k_tlv.c | 40 ++++---- > drivers/net/fm10k/base/fm10k_tlv.h | 9 +- > drivers/net/fm10k/base/fm10k_type.h | 182 +++++++-------------------------- > -- > drivers/net/fm10k/base/fm10k_vf.c | 32 ++++-- > drivers/net/fm10k/fm10k_ethdev.c | 41 +++----- > 12 files changed, 220 insertions(+), 298 deletions(-) > > -- > 1.9.3 Acked-by : Jing Chen <jing.d.chen@intel.com>
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index e967628..a118cf4 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2367,29 +2367,16 @@ static const struct fm10k_msg_data fm10k_msgdata_vf[] = { FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), }; -/* Mailbox message handler in PF */ -static const struct fm10k_msg_data fm10k_msgdata_pf[] = { - FM10K_PF_MSG_ERR_HANDLER(XCAST_MODES, fm10k_msg_err_pf), - FM10K_PF_MSG_ERR_HANDLER(UPDATE_MAC_FWD_RULE, fm10k_msg_err_pf), - FM10K_PF_MSG_LPORT_MAP_HANDLER(fm10k_msg_lport_map_pf), - FM10K_PF_MSG_ERR_HANDLER(LPORT_CREATE, fm10k_msg_err_pf), - FM10K_PF_MSG_ERR_HANDLER(LPORT_DELETE, fm10k_msg_err_pf), - FM10K_PF_MSG_UPDATE_PVID_HANDLER(fm10k_msg_update_pvid_pf), - FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error), -}; - static int fm10k_setup_mbx_service(struct fm10k_hw *hw) { - int err; + int err = 0; /* Initialize mailbox lock */ fm10k_mbx_initlock(hw); /* Replace default message handler with new ones */ - if (hw->mac.type == fm10k_mac_pf) - err = hw->mbx.ops.register_handlers(&hw->mbx, fm10k_msgdata_pf); - else + if (hw->mac.type == fm10k_mac_vf) err = hw->mbx.ops.register_handlers(&hw->mbx, fm10k_msgdata_vf); if (err) {