From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89E67A00E6 for ; Wed, 7 Aug 2019 04:20:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 319604F91; Wed, 7 Aug 2019 04:20:48 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6A3EE2B9E; Wed, 7 Aug 2019 04:20:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 19:20:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="176818204" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 06 Aug 2019 19:20:44 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 19:20:44 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 6 Aug 2019 19:20:42 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 6 Aug 2019 19:20:42 -0700 Received: from shsmsx106.ccr.corp.intel.com ([169.254.10.204]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.250]) with mapi id 14.03.0439.000; Wed, 7 Aug 2019 10:20:41 +0800 From: "Wang, Xiao W" To: "luqiuwen@iie.ac.cn" , "stable@dpdk.org" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "yskoh@mellanox.com" Thread-Topic: [v2] net/fm10k: fix segment fault at calling fm10k_stats_get() Thread-Index: AQHVTCEMZ1vmzkY4i06/glo8On/CxKbu71rA Date: Wed, 7 Aug 2019 02:20:41 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzg4YzkyNjgtYmU4OC00MDBkLWI3NmMtYWU3NWQ4NTlkN2ZkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTGZSVit2YUdtYXkzc3VWN2ZWQWlPY3JsWnFsMGlHSGxvZk5tbGw0bnpKUmE0Q2o1TlZ1M0pqMThBUUN0NWlKMSJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [v2] net/fm10k: fix segment fault at calling fm10k_stats_get() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi > -----Original Message----- > From: luqiuwen@iie.ac.cn [mailto:luqiuwen@iie.ac.cn] > Sent: Tuesday, August 6, 2019 2:34 PM > To: stable@dpdk.org; dev@dpdk.org > Cc: Zhang, Qi Z ; Wang, Xiao W > ; yskoh@mellanox.com > Subject: [v2] net/fm10k: fix segment fault at calling fm10k_stats_get() >=20 > From 5658ee7d69023cc4b22315cd9f8e10a832aafdb0 Mon Sep 17 00:00:00 > 2001 > From: Lu Qiuwen > Date: Sat, 15 Jun 2019 14:28:01 +0800 > Subject: [PATCH] net/fm10k: fix segment fault at calling fm10k_stats_get(= ) > from secondary process. >=20 > The function pointers in fm10k_stats_get() which setup from primary proce= ss, > when secondary process call these function pointers, a segment fault will > happend. The patch tile is too long, we can simplify it to like "fix stats ops in mu= lti process". Also, the commit log exceeds the maximum length of 80 characters. Also some= typos. devtools/check-git-log.sh can be used to check your commit log format. Since this is a fix patch, a "Fixes" line is needed. Refer to the other pat= ches. As a v2 patch, you need to specify what change you have made to the previou= s v1. I'm OK with the below code change. After the above issue fixed, please add = my ack: Acked-by: Xiao Wang Maybe @Qi can help to reword the commit log when committing the patch? BRs, Xiao >=20 > Signed-off-by: Lu Qiuwen > --- > drivers/net/fm10k/base/fm10k_api.c | 20 ++++++++++++++++---- > drivers/net/fm10k/base/fm10k_pf.c | 4 ++-- > drivers/net/fm10k/base/fm10k_pf.h | 6 ++++++ > drivers/net/fm10k/base/fm10k_vf.c | 4 ++-- > drivers/net/fm10k/base/fm10k_vf.h | 5 +++++ > 5 files changed, 31 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/net/fm10k/base/fm10k_api.c > b/drivers/net/fm10k/base/fm10k_api.c > index c49d20dfb..e7b2fe710 100644 > --- a/drivers/net/fm10k/base/fm10k_api.c > +++ b/drivers/net/fm10k/base/fm10k_api.c > @@ -234,8 +234,14 @@ s32 fm10k_read_mac_addr(struct fm10k_hw *hw) > * */ > void fm10k_update_hw_stats(struct fm10k_hw *hw, struct fm10k_hw_stats > *stats) > { > - if (hw->mac.ops.update_hw_stats) > - hw->mac.ops.update_hw_stats(hw, stats); > + switch (hw->mac.type) { > + case fm10k_mac_pf: > + return fm10k_update_hw_stats_pf(hw, stats); > + case fm10k_mac_vf: > + return fm10k_update_hw_stats_vf(hw, stats); > + default: > + break; > + } > } >=20 > /** > @@ -246,8 +252,14 @@ void fm10k_update_hw_stats(struct fm10k_hw *hw, > struct fm10k_hw_stats *stats) > * */ > void fm10k_rebind_hw_stats(struct fm10k_hw *hw, struct fm10k_hw_stats > *stats) > { > - if (hw->mac.ops.rebind_hw_stats) > - hw->mac.ops.rebind_hw_stats(hw, stats); > + switch (hw->mac.type) { > + case fm10k_mac_pf: > + return fm10k_rebind_hw_stats_pf(hw, stats); > + case fm10k_mac_vf: > + return fm10k_rebind_hw_stats_vf(hw, stats); > + default: > + break; > + } > } >=20 > /** > diff --git a/drivers/net/fm10k/base/fm10k_pf.c > b/drivers/net/fm10k/base/fm10k_pf.c > index db5f4912f..f5b6a9e2e 100644 > --- a/drivers/net/fm10k/base/fm10k_pf.c > +++ b/drivers/net/fm10k/base/fm10k_pf.c > @@ -1511,7 +1511,7 @@ const struct fm10k_msg_data > fm10k_iov_msg_data_pf[] =3D { > * This function collects and aggregates global and per queue hardware > * statistics. > **/ > -STATIC void fm10k_update_hw_stats_pf(struct fm10k_hw *hw, > +void fm10k_update_hw_stats_pf(struct fm10k_hw *hw, > struct fm10k_hw_stats *stats) > { > u32 timeout, ur, ca, um, xec, vlan_drop, loopback_drop, > nodesc_drop; > @@ -1584,7 +1584,7 @@ STATIC void fm10k_update_hw_stats_pf(struct > fm10k_hw *hw, > * This function resets the base for global and per queue hardware > * statistics. > **/ > -STATIC void fm10k_rebind_hw_stats_pf(struct fm10k_hw *hw, > +void fm10k_rebind_hw_stats_pf(struct fm10k_hw *hw, > struct fm10k_hw_stats *stats) > { > DEBUGFUNC("fm10k_rebind_hw_stats_pf"); > diff --git a/drivers/net/fm10k/base/fm10k_pf.h > b/drivers/net/fm10k/base/fm10k_pf.h > index ca125c273..2c22bdd02 100644 > --- a/drivers/net/fm10k/base/fm10k_pf.h > +++ b/drivers/net/fm10k/base/fm10k_pf.h > @@ -184,4 +184,10 @@ extern const struct fm10k_msg_data > fm10k_iov_msg_data_pf[]; > #endif >=20 > s32 fm10k_init_ops_pf(struct fm10k_hw *hw); > + > +void fm10k_update_hw_stats_pf(struct fm10k_hw *hw, > + struct fm10k_hw_stats *stats); > + > +void fm10k_rebind_hw_stats_pf(struct fm10k_hw *hw, > + struct fm10k_hw_stats *stats); > #endif /* _FM10K_PF_H */ > diff --git a/drivers/net/fm10k/base/fm10k_vf.c > b/drivers/net/fm10k/base/fm10k_vf.c > index bd449773a..2f4b5f5d2 100644 > --- a/drivers/net/fm10k/base/fm10k_vf.c > +++ b/drivers/net/fm10k/base/fm10k_vf.c > @@ -526,7 +526,7 @@ const struct fm10k_tlv_attr fm10k_1588_msg_attr[] =3D > { > * > * This function collects and aggregates per queue hardware statistics. > **/ > -STATIC void fm10k_update_hw_stats_vf(struct fm10k_hw *hw, > +void fm10k_update_hw_stats_vf(struct fm10k_hw *hw, > struct fm10k_hw_stats *stats) > { > DEBUGFUNC("fm10k_update_hw_stats_vf"); > @@ -541,7 +541,7 @@ STATIC void fm10k_update_hw_stats_vf(struct > fm10k_hw *hw, > * > * This function resets the base for queue hardware statistics. > **/ > -STATIC void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw, > +void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw, > struct fm10k_hw_stats *stats) > { > DEBUGFUNC("fm10k_rebind_hw_stats_vf"); > diff --git a/drivers/net/fm10k/base/fm10k_vf.h > b/drivers/net/fm10k/base/fm10k_vf.h > index 116c56fcc..d4edd330e 100644 > --- a/drivers/net/fm10k/base/fm10k_vf.h > +++ b/drivers/net/fm10k/base/fm10k_vf.h > @@ -89,4 +89,9 @@ extern const struct fm10k_tlv_attr > fm10k_1588_msg_attr[]; > FM10K_MSG_HANDLER(FM10K_VF_MSG_ID_1588, > fm10k_1588_msg_attr, func) >=20 > s32 fm10k_init_ops_vf(struct fm10k_hw *hw); > + > +void fm10k_update_hw_stats_vf(struct fm10k_hw *hw, > + struct fm10k_hw_stats *stats); > +void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw, > + struct fm10k_hw_stats *stats); > #endif /* _FM10K_VF_H */ > -- > 2.20.1.windows.1 >=20