From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 129F6A0547; Thu, 16 Jun 2022 04:51:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA05741133; Thu, 16 Jun 2022 04:51:21 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id EB7D0410D0 for ; Thu, 16 Jun 2022 04:51:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655347880; x=1686883880; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=sbFFPnWbjgsUQGYY382n4qdhXqXaOWPuDGYY5/oM5OQ=; b=W6X9p2Mb+e1OndAE/sRbymAf5JXajRgxkoESWmS6rPidhH/0lQUmOaUm EDtPhvYhC3BisCT3nDspyesfP2QMAO4m6aDiSyBUNWNnQHx1ySvrx4sP3 D5rE7Q6x52aaTcyTgjJWoWXJV5oQBubMNSZMdn2NSTGmekIpvGZCZO8qg 6lf/OadKX2CJ0BtDXyJQrMA/gaNXdmxNsixhYPllgzJFJR8mpnVvDB9FH 73Ni3woGZHUvI+xW0/Bw1vhuHMJMDvndBEHjB2I7NB5FSi2rmmNVDnao/ bzM/UdLqmSq1kSc7dA7Q1MVwhV0waFZbYG/GU2RHRhbC5V+A+Q5QsKw5c A==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="304590422" X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="304590422" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 19:50:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="727699093" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga001.fm.intel.com with ESMTP; 15 Jun 2022 19:50:01 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 15 Jun 2022 19:50:00 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 15 Jun 2022 19:50:00 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.46) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 15 Jun 2022 19:50:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nn3qNA/1rhO5SsN6hzUncNDoPpYccyO/8tKp06QhiqnBIStS0uvg4BUhyU+6wzRdsHI+GEsqRzVnmdVw32b0SninkuNjOQUN/NYeU0US48bDYt0lvpEcNymKjM3ELhqMxfp1d5m6n/pJMo59874b87jvA8wWFZFc8RxVNcVC6JEuuHp2lxl+NPDqZrCuUarToVONGAvTR7al0We1KRTkOmrILn/1se+1rGaCcitYWt5Oku3Wp9XsyK0RNL/30PkeJRMKfryTQthcybLhRy+9Bc8osLtywouH8h1ML963rQ8TCCqyV7x1/WANGI338bx0ftD4TT14qM/rp1tHDRWZuA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LvEB6hXm5HVujdxs8f1nvMOpY/VasYsbObH/iHraSQg=; b=ZqfvQDmj0lyxuS35TJEBeQnS8tzwWE6QDzuFZTc6WNKV/jWkteN70xjDuir5eS9cys1mzJ1wSH2/yyDzrQZP5P6vMNIM+vzgdgFBYilrUn6uQVx7HcWbn+hblWUFUGy4rMRO/G4+j2ETC/dhMi54ub+B5Cz/0XwCPMO9ltmEAfpioksHOT9b4On/Spw13kjbyVjYIU+fpXtH186/f/ruGi5ABBUaoQaMD6DSP4IqewmsW9DKyqXuHoVI+/GRhciewxbkPjMOGFRO9vGzsDUMNx+tuvuuqOk3c8RDyzDJav5gtIF1G1QhAX7k+pQUVl4ABIhiTBCdOQxC958lRGe78g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3723.namprd11.prod.outlook.com (2603:10b6:5:13f::25) by BY5PR11MB4136.namprd11.prod.outlook.com (2603:10b6:a03:192::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Thu, 16 Jun 2022 02:49:58 +0000 Received: from DM6PR11MB3723.namprd11.prod.outlook.com ([fe80::6c06:3a8c:2ad:5e61]) by DM6PR11MB3723.namprd11.prod.outlook.com ([fe80::6c06:3a8c:2ad:5e61%4]) with mapi id 15.20.5332.022; Thu, 16 Jun 2022 02:49:58 +0000 From: "Guo, Junfeng" To: "Zeng, ZhichaoX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Su, Simei" Subject: RE: [PATCH] net/igc: fix segmentation fault in secondary dpdk-symmetric_mp Thread-Topic: [PATCH] net/igc: fix segmentation fault in secondary dpdk-symmetric_mp Thread-Index: AQHYgIsMVdz++odLIUawSBYXind1pq1RVPuQ Date: Thu, 16 Jun 2022 02:49:58 +0000 Message-ID: References: <20220615073915.13309-1-zhichaox.zeng@intel.com> In-Reply-To: <20220615073915.13309-1-zhichaox.zeng@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0e575e5f-3ba3-4d7a-1234-08da4f42e6aa x-ms-traffictypediagnostic: BY5PR11MB4136:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7DrbTMkX70z6oel37kH1RdT/ReVmegjxWezHzipNfKX56Zhd3rBxRnlTOV3/331tHjY7Z+K7+FppBaNhysfKscap3xJc/Vsy5coGfomR+eBperDYIeuz4vy8tr467pEx+tycD6gW0ZS4WZoigUud40Svx7jnJwy4S3IkhES5gVfDWaT/PG/db5bs2NmcfQwEDTy774wAn+vbqhxUWpm+Z8Us1Co5pglT6WCm7x0Cz0YbjPy9wXb6UC41zbw1Dtv4yacWrx66DC9DeRpwJDqQMXV8j7TBF+kmSlwJmO/DyCOeshzCg2ATJuCbxYgnnTzbL5kw7wsj/v0XnSSeEa5xUsh3WlpkM0pYRJPGh6XHeRSXRh4lI3fu2pYVRIUQS2wvbmBaJvcanJ67nAvOfilY3weMROcZq2JjBGJNIEVQtbDeVLabByNkDMjwUkfM1j/QtSfDpoPB0r44C79xTJISM5kMxNB6sDYbHlRovUS53r83nxiREtjKawMZhOF87tYfor9eoXTzVe5AUGu+g7XpjRZqwVMg1qD2GlwsopJ4GiSpYo6hEcUshKc/JeBgEfrDN3tI8QEG+/VMd4CasHayHIAWaP7mvJbhj/+ktTrD1VKP0Yjkqkgr37iDjIRQYs3x+DnFBMGyhavjOZ3yvnYfH9AKPIYHTy2WnIYWETNx9DPnL4jdRZsItyfF5D7w4Q1+abe0f4y3wxqjn5AEw49DGw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3723.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(38100700002)(110136005)(38070700005)(54906003)(26005)(66556008)(9686003)(76116006)(66446008)(186003)(66476007)(316002)(107886003)(64756008)(66946007)(7696005)(2906002)(8676002)(86362001)(71200400001)(53546011)(122000001)(52536014)(6506007)(5660300002)(83380400001)(508600001)(8936002)(33656002)(55016003)(82960400001)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?zoWrf/uvcx/FPJImdl4TnJfvTgsk5EiKWWsOHqUOhHfiDX1FmSv8k1c9Hc5L?= =?us-ascii?Q?P+KeNhChZlhKlpiPuO0TtUulhxlq0phvC8IZflnVV+aSoonkI/GRiqbrlzNe?= =?us-ascii?Q?lhX7U838Uk31pva9+rCKkOeNVxqF15pJJIHXh5BBu25ZaLNyavCkeX/5UN/O?= =?us-ascii?Q?ld4i/UHOw3JiXYkEmeHjFMbqoaOswE2+TPOFVQ1I5WHhSxfV8ZdgNRdk88WG?= =?us-ascii?Q?fq4lcR4jbpS2djEBpXUa3Z7ECzwWyDKYeXNUiVK7vkY8eJUUHeHptiKf0K/q?= =?us-ascii?Q?ad+2cuVj2RKFJvjLwup2ietqQHv5/dxkNCDTRNALz0k1nzs1QI5KhLCStL0D?= =?us-ascii?Q?9kSKpAQFQeH97jEBfW0ydODSSob1WxJNxpRdM3W8x3mzSRm9Jqki/8YAp6sX?= =?us-ascii?Q?j6zk1KYnSdY8c1a8RS3uia54IPynwwAgoHncX+ch26ni54mbFGWNpTdpJaTs?= =?us-ascii?Q?YiE0XWz+FF0Uma/tjuMAcIN7a+a8cbvvfDTIYTjYIskVUUpnIH/UszkOJ5Vc?= =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j7vv9J9cBrI+ahLjXvS+n?= =?us-ascii?Q?7VNH6CJBlh0zzeJh3PLjlMVQGQXX+Kfo3Xx7pKKXRf+xAZcW0kfGunljKfcB?= =?us-ascii?Q?LCT9Er30/3Xmju5aO3aeMpgHqP7pWlZHUoGru+kaLlAUdzbeY23nIoe+baIT?= =?us-ascii?Q?cKk70qc8vGgb/q0VRi0Avxba9DYdz68HP1piSAttbJWFpx6qPs1xoNAYer9g?= =?us-ascii?Q?28BxQ6mHKLwPlCFi8zLgJMQV25miydyt0nGsBrD57ZD+0A9bIDHMIQYrTc6k?= =?us-ascii?Q?wiGv1id69JjrZF1NFC3UbR4KxmuZyDz2ecDM80hp6mhFmGX46pTEM6C1Z/Oy?= =?us-ascii?Q?fRDJpU9l+A=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3723.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e575e5f-3ba3-4d7a-1234-08da4f42e6aa X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jun 2022 02:49:58.2062 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vUEM0k0CbpGtZocwvmp6JSgs5bfDLHBlPfWaDMP+sx32o3YXLmgDSPBA3G7qyZCjLVXzevaE4jj7a+X9xEMiiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4136 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Zeng, ZhichaoX > Sent: Wednesday, June 15, 2022 15:39 > To: dev@dpdk.org > Cc: Yang, Qiming ; Zeng, ZhichaoX > ; Guo, Junfeng ; Su, > Simei > Subject: [PATCH] net/igc: fix segmentation fault in secondary dpdk- > symmetric_mp >=20 > From: Zhichao Zeng >=20 > In the secondary dpdk-symmetric_mp process, the > "smp_port_init" was skipped, which cause some function > pointers not to be initialized, and a segmentation fault > occurred when calling these function pointers. >=20 > This patch assigns initial values to rx_pkt_burst, > tx_pkt_burst and tx_pkt_prepare pointers to avoid > calling null function pointer. >=20 > Signed-off-by: Zhichao Zeng > --- > drivers/net/igc/igc_ethdev.c | 3 +++ > drivers/net/igc/igc_ethdev.h | 5 +++++ > drivers/net/igc/igc_txrx.c | 6 +++--- > 3 files changed, 11 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c > index b9933b395d..dd4a028ea1 100644 > --- a/drivers/net/igc/igc_ethdev.c > +++ b/drivers/net/igc/igc_ethdev.c > @@ -1234,6 +1234,9 @@ eth_igc_dev_init(struct rte_eth_dev *dev) > dev->rx_queue_count =3D eth_igc_rx_queue_count; > dev->rx_descriptor_status =3D eth_igc_rx_descriptor_status; > dev->tx_descriptor_status =3D eth_igc_tx_descriptor_status; > + dev->rx_pkt_burst =3D &igc_recv_pkts; > + dev->tx_pkt_burst =3D &igc_xmit_pkts; > + dev->tx_pkt_prepare =3D ð_igc_prep_pkts; Maybe the parameter & are not needed here? you can double check for this wh= en build. >=20 > /* > * for secondary processes, we don't initialize any further as > primary > diff --git a/drivers/net/igc/igc_ethdev.h b/drivers/net/igc/igc_ethdev.h > index f56cad79e9..2fa3d51bba 100644 > --- a/drivers/net/igc/igc_ethdev.h > +++ b/drivers/net/igc/igc_ethdev.h > @@ -263,6 +263,11 @@ struct igc_adapter { > #define IGC_DEV_PRIVATE_FLOW_LIST(_dev) \ > (&((struct igc_adapter *)(_dev)->data->dev_private)->flow_list) >=20 > +uint16_t igc_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, > uint16_t nb_pkts); > +uint16_t igc_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, > uint16_t nb_pkts); > +uint16_t eth_igc_prep_pkts(__rte_unused void *tx_queue, struct > rte_mbuf **tx_pkts, > + > uint16_t nb_pkts); > + These functions are tx/rx related, it would be better to put them into igc_= txrx.h. > static inline void > igc_read_reg_check_set_bits(struct igc_hw *hw, uint32_t reg, uint32_t > bits) > { > diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c > index e48d5df11a..753ac8a411 100644 > --- a/drivers/net/igc/igc_txrx.c > +++ b/drivers/net/igc/igc_txrx.c > @@ -345,7 +345,7 @@ rx_desc_get_pkt_info(struct igc_rx_queue *rxq, > struct rte_mbuf *rxm, > rxm->packet_type =3D rx_desc_pkt_info_to_pkt_type(pkt_info); > } >=20 > -static uint16_t > +uint16_t > igc_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t > nb_pkts) > { > struct igc_rx_queue * const rxq =3D rx_queue; > @@ -1397,7 +1397,7 @@ eth_igc_rx_queue_setup(struct rte_eth_dev > *dev, > } >=20 > /* prepare packets for transmit */ > -static uint16_t > +uint16_t > eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf > **tx_pkts, > uint16_t nb_pkts) > { > @@ -1604,7 +1604,7 @@ tx_desc_cksum_flags_to_olinfo(uint64_t > ol_flags) > return tmp; > } >=20 > -static uint16_t > +uint16_t > igc_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t > nb_pkts) > { > struct igc_tx_queue * const txq =3D tx_queue; > -- > 2.25.1