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 64DDEA046B for ; Tue, 23 Jul 2019 03:12:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 574701BECB; Tue, 23 Jul 2019 03:12:39 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150072.outbound.protection.outlook.com [40.107.15.72]) by dpdk.org (Postfix) with ESMTP id C3B7E1BECB for ; Tue, 23 Jul 2019 03:12:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AWiIv2f62GY6gPFPQ0xKWRrTN+oX/Bh9PwibinNI9oamm5e6qWenu/f4ZalPYnUmGfsy4Q12UncEbMblqO1aHfXsHGCPpXI315obFQRvqEuiHHRmYz2KvLNLKxMHroPDVJBxOVZ586+xOFo+AAw38l79cm0/DJs9FwDlTe6TWZUZE7jk3Ova8/uwoDwRYWqj+IITthmzYx027+3rF5E2x+3qae7V0Q7kwVCnM1AZjeEUCTV4gwKvqvDKordTQVlQhfh+wxCOkrKGeMDi5I3yega0FVCO95+/fVmKUoV6krKZ7Ttf99bLHfh967AcWTkFS5J7J405PaLXkfSsXCm+JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pC8qoA2OPiCDIB3KQ5wM5AmF3wM2eTEcjq8L62C/YWs=; b=MulQNxBk1f8LlaFnhPGUH0HvnB4Hl2nGWG0+jfb1zhb06pFUv7IsVRHrajhz/q+bcpn/LKyzn4CNi7pGite53kP6JrieEfNZnNa8siLWvJnORW21J/YAlkRfu800nEQ2VlXomMKQmtpZslQ1K9t7twi07wz4CsxtbTD7VeWOcOJOlSddGbhgB6digL59ihPtQgJuJIRNcOvvUSZjHadVZuWBMku64zWlc44kzVdQNjjbiRtaeZHadTG9FldS0XKTxshcj5qsMenMppsxDCGZ0bozWxgVF1Q9kkiSpNfvVZlWHXqa4Ogkhd4OnlQVPfRVZ17gIj7noXhr2IvlSMKdZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=mellanox.com;dmarc=pass action=none header.from=mellanox.com;dkim=pass header.d=mellanox.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pC8qoA2OPiCDIB3KQ5wM5AmF3wM2eTEcjq8L62C/YWs=; b=HYcKTleDsAAZ3SvReTZCqNvMhCgVmNmFk1phXJf5XUQkGOUgdxxs0St50DthzWlP3AcnC0J5nLoR0kkuJ5wUugp09ieYEQUt/JkcQfsqVT+otlObtxJi2b8Ko+2YjdQJgF9u90U3c6N1heJrw96yIFB+iSLiqONlmZj29y1NfIE= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3962.eurprd05.prod.outlook.com (52.134.67.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.16; Tue, 23 Jul 2019 01:12:36 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::69c1:c0d7:1fa1:f89f]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::69c1:c0d7:1fa1:f89f%6]) with mapi id 15.20.2094.013; Tue, 23 Jul 2019 01:12:36 +0000 From: Yongseok Koh To: Lu Qiuwen , "Zhang, Qi Z" , "xiao.w.wang@intel.com" CC: dpdk stable Thread-Topic: [dpdk-stable] [PATCH 17.11] net/fm10k: fix segment fault at calling fm10k_stats_get() Thread-Index: AQHVI3ftkjqS/DlYcEWnMp9xK/jwA6bXoHuA Date: Tue, 23 Jul 2019 01:12:35 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 714b8c1c-edc6-4d13-6326-08d70f0ad8f5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB3962; x-ms-traffictypediagnostic: DB3PR0502MB3962: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:849; x-forefront-prvs: 0107098B6C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(199004)(189003)(26005)(478600001)(110136005)(6246003)(25786009)(316002)(6436002)(99286004)(7736002)(91956017)(76116006)(66946007)(446003)(305945005)(186003)(102836004)(2501003)(486006)(71190400001)(71200400001)(66476007)(66446008)(64756008)(66556008)(5660300002)(81156014)(2616005)(81166006)(86362001)(4326008)(33656002)(8936002)(53546011)(476003)(256004)(76176011)(14454004)(6506007)(2906002)(6486002)(6512007)(36756003)(11346002)(229853002)(14444005)(66066001)(3846002)(53936002)(68736007)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3962; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: D9os0naq7liwYDr8X35IxbbxCuJw5CAX0XhcE2KPO4HFWrdv+tKnDYkcLP7+YoEECrhh5MCoSUKFiPqecDCGaIuL/rnDBbuOuehbYGljP8ZnlN9LG76E8fP7zWKNpeGbyz7GPyquBuheKSUcWb/z3rb9HCePyrWGaZXu1Vg5lRzFNxNTQhMAuDO+tB0iKma6mSVmD22vLd4hsmNTiZ0kQQ4h4QCsCO75Rpdw/GIiMr+rynvY8MY+JGH58QUoKGfziIGNR1LRa4iuNCNocU3004h4+AOyWi18TDMzr6+TmI3HG75Ky6tNTVyXHtAsLEe19RrpqYE5n5anKa7jHnezxPzW3uZZab3UcIWlWfuBdPRbl6oxKeyXoFhd6zPoEnRdQfCZVXWYmnfmxIbxLn6DD4gpF0QseBkNMgFrN9NrB2U= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 714b8c1c-edc6-4d13-6326-08d70f0ad8f5 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2019 01:12:35.9784 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yskoh@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3962 Subject: Re: [dpdk-stable] [PATCH 17.11] net/fm10k: fix segment fault at calling fm10k_stats_get() X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, Copying maintainers of fm10k for their review. I'll merge it as soon as it is acked. Thanks, Yongseok > On Jun 15, 2019, at 5:43 AM, Lu Qiuwen wrote: >=20 > From 01ca235ebb510d68efe37a81b434c07bd335fc61 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 wi= ll happend. >=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 | 8 ++++++++ > drivers/net/fm10k/base/fm10k_vf.c | 4 ++-- > drivers/net/fm10k/base/fm10k_vf.h | 6 ++++++ > 5 files changed, 34 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 *st= ats) > { > - 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, stru= ct fm10k_hw_stats *stats) > * */ > void fm10k_rebind_hw_stats(struct fm10k_hw *hw, struct fm10k_hw_stats *st= ats) > { > - 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/f= m10k_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_h= w *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/f= m10k_pf.h > index ca125c273..207942788 100644 > --- a/drivers/net/fm10k/base/fm10k_pf.h > +++ b/drivers/net/fm10k/base/fm10k_pf.h > @@ -184,4 +184,12 @@ extern const struct fm10k_msg_data fm10k_iov_msg_dat= a_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/f= m10k_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/f= m10k_vf.h > index 116c56fcc..e433e8a94 100644 > --- a/drivers/net/fm10k/base/fm10k_vf.h > +++ b/drivers/net/fm10k/base/fm10k_vf.h > @@ -89,4 +89,10 @@ 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 */ > --=20 > 2.20.1.windows.1 >=20 >=20