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 94F34429C3; Sun, 23 Apr 2023 10:25:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16D664021D; Sun, 23 Apr 2023 10:25:51 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 84C3840156 for ; Sun, 23 Apr 2023 10:25:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682238348; x=1713774348; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xq/oFc2b+PPnFasyGvFWVICWVr5rbMbCPKxyfYFhpMA=; b=lPS8EUyLmyc+EmzKeJwu2z2mawvAvRna6mnK1zvJVMUhr7vDZSCm7Axe Le2PtezP805NRyWHVvygO6SE8dggDtd+ca+NRevu1T92o3sM61e6BErLj /MCR1OxbYyY3CmvuD4tI+g9+Z/LCJ9qHrOx+gpqiDkJcSLEDhWuCbx9/c 8tkeS8HJgFU+oZN4MsoaMBKk01eqe+KDun3fPHycnhp3EI4rXTvShbGIQ GeUYkh8sJd2bYCVlvsXrWE8qur0SJsnxm+7AQ5Aijxjp8cmKoKW33Aw6N adyOa6hFa7vYhQY3EXG5X1qO5vluGlPxyEJ/OfvqA49fykzRr96Xw3tvF w==; X-IronPort-AV: E=McAfee;i="6600,9927,10688"; a="346281815" X-IronPort-AV: E=Sophos;i="5.99,220,1677571200"; d="scan'208";a="346281815" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2023 01:25:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10688"; a="642983412" X-IronPort-AV: E=Sophos;i="5.99,220,1677571200"; d="scan'208";a="642983412" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga003.jf.intel.com with ESMTP; 23 Apr 2023 01:25:47 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 23 Apr 2023 01:25:47 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Sun, 23 Apr 2023 01:25:47 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Sun, 23 Apr 2023 01:25:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RqdC1DXbTjrS0fgGpM2P7Fasr+xRh5dMwdUBLVAuzGdIWuQQ0Ed11pkPwgrKoQcM2inASsxIHNBXubwpLzPMMbU2dYVKLUX48IOf+TYDCe6onKFxRib5iHgBtm8UvEnjHKBM/DDMNjp+IytcImXv91CIp4kORsJl8uNj2ZZOiwrF2G89cErsfkB+4x/YnMRM0rKXn5J1mi1nQ8vvxlkli4Uf/1JR21OKWX2wGksVcUUQr3eIjRN6Ey4Fa6V3Qg4d8UhCayzXEM7FObsj2FHfS/YV9RRMAoHOP3VEqut/eWZW4MfIP7C6aZFxnQNt19EROv6CtJRxBTRz/4vrZimcoQ== 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=nUA+9QPsxEqdPLU/DQknOZjeApIzen/0/Ra2MmEh6pU=; b=ETbwVZTG/zocbjSh7DptMGydidFUCaO1mRqVCBou6DWYdsbsG2EROlGB2ulo3isRNWBNYajQzdWtwv570rplgXSAL9iN0GrQjE17b2fznRmU6gm8ZSw/9lY3bfkVFbXRvV+K0S0rt5GUxuAf6T8NtFxmRgpZkc/2AfvRyjqB1HWLL/Tilf+1WzHJ69nSMFiHsLy2X5e7V8qGClQVH85vVOg7RGiEiaPlf7WgFiiNREOWSOM0xHarUt5UXzMm8CK14pxwJM2UWNw5LUiY7+cEMIO3rs7UFGnLhl7R+152O+y6Y3KEsCxzTz4XMR9SGJc5w93R9YCMyLcQRCTmF+g0tQ== 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 MW3PR11MB4587.namprd11.prod.outlook.com (2603:10b6:303:58::7) by CH3PR11MB7674.namprd11.prod.outlook.com (2603:10b6:610:12b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.32; Sun, 23 Apr 2023 08:25:44 +0000 Received: from MW3PR11MB4587.namprd11.prod.outlook.com ([fe80::3477:981c:fd74:9ed1]) by MW3PR11MB4587.namprd11.prod.outlook.com ([fe80::3477:981c:fd74:9ed1%6]) with mapi id 15.20.6319.032; Sun, 23 Apr 2023 08:25:44 +0000 From: "Wu, Jingjing" To: "Xing, Beilei" CC: "dev@dpdk.org" Subject: RE: [PATCH v4 1/2] common/idpf: move PF specific functions from common init Thread-Topic: [PATCH v4 1/2] common/idpf: move PF specific functions from common init Thread-Index: AQHZaF6UP3bI9lIuwEW4F0HB8BQHKa84qO9g Date: Sun, 23 Apr 2023 08:25:43 +0000 Message-ID: References: <20230404124112.71703-1-beilei.xing@intel.com> <20230406074245.82991-1-beilei.xing@intel.com> <20230406074245.82991-2-beilei.xing@intel.com> In-Reply-To: <20230406074245.82991-2-beilei.xing@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW3PR11MB4587:EE_|CH3PR11MB7674:EE_ x-ms-office365-filtering-correlation-id: 141f30cf-143b-4c34-61b1-08db43d454b9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RdzNJwp5VM/XUzZdMbujMup02WagQHkMXCRMoXLBM6RnOHy59EHU48gPINNb0a07xiGiAxYScaTXPISx1sbKMxDj2hxOuw/PfSebjMEZECk4XysLG+yn+X7mJhKnofno0Hw19yIRreEGOu7vn7H6E0r0YNAXKMq9OK7Rp3mLUKy9MDNXsncHqVRMQELeeRHW5QG0OrkJ1DF7z6n4zJivBCtmJR8YtNR2oTT3Y1rQP02mr7atlMvxsZsd9EerUFaCGFGu2C5XPpVI01pukQc2DO996/Nk2hdfjZ972LaDE0uycfR/UT8Mjas4vfSxixhtvrPZAqWBqp2rPnv3tR/ftrpmo5YDRVbeNpdTg1MtCJQ5xISBozI8mnTwKSwwGo7fB0LIRAI2sR+YB0Z4MS9H+qkOxpLEPeZkyquI+YtrCydLLESp6OsfndpwJcI8e4ZuIJVqzELFFNzVJjpTskX26sGphFnVodjZQlPQ5VJf9kcg8Nq3RohEh90ZMRYzb3IwKApFBYWjZFQtjDGUAol4FjEj0Paq8eRkTVum1S0O0m+GhsZi7CGjszD4NO9ce79+bEZs3Wck7G4gx3Kaw18/HSYxaFtcL4gNsGEHBsDcdRvt5sciPl2UV6dmg8VhEZ94 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW3PR11MB4587.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(39860400002)(396003)(346002)(376002)(366004)(451199021)(66946007)(76116006)(83380400001)(2906002)(6506007)(55016003)(26005)(9686003)(316002)(64756008)(66446008)(66476007)(66556008)(82960400001)(33656002)(71200400001)(4326008)(52536014)(8676002)(6862004)(122000001)(41300700001)(38100700002)(8936002)(5660300002)(38070700005)(7696005)(6636002)(86362001)(478600001)(186003)(53546011); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gEsrvBuD9uJ5JeiuwkR84Yn80GsyH6LzYliTOcWoqZkkS3l9mKxadYhq4D8u?= =?us-ascii?Q?iJTtuk1yx7fzx6H5g0pdollEipC1EaF+XvlJNzJXVB+MFqC6ARAtv5cVIFbc?= =?us-ascii?Q?J2p3XJqkpOI7nmrZv7l47tHc9C8DeKWAbf1duVmWWFXlKhsTUXQ9eysbw+tA?= =?us-ascii?Q?KKZHxD0mPIAxl8Bmyn1ANVTSOT+8l2vLHT+qh41jx2Qw5MXVuM0FoiHexQrO?= =?us-ascii?Q?4fDVf6xjKs3clKDesXE1y9UDjOnt5gZjRNIUi+l9PQpJtBCaamwS+N0uX3p9?= =?us-ascii?Q?I9YRmWSlz/aMbdBs+CSn6JMbtU5f+otwLjiSRJDwTbtF9FYRcPQnGdXqpMMt?= =?us-ascii?Q?HTZKVqYo1GMwk/nr94vqK0LBfc0kVZLDqtpGR+k7iaxPhTYnnQgiAu6BcdNW?= =?us-ascii?Q?Mo/+fTfP5pSWfv0fpP+wjr8f8c2+FfKXGLrgt3Q6h/arlTOqhBCbS1f4Isjf?= =?us-ascii?Q?gcJLLLw0uQI8EQUgE+z2/fQmAsjm8OdI3R+TmBlJhIhoVh76U9zl9j9Ua/TI?= =?us-ascii?Q?+vjKht6dAD5nxM+0a1VspO40e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= =?us-ascii?Q?d+tvf65N5qdDktkGwPTMMPJcxODhB6seZ7OgKQLoK5RlmAPY1cZhC5PX6e/j?= =?us-ascii?Q?LHGFPQ4HI9py5CWKmY/1Xqcawo41jgbtqBhZk/2a5yArtjH2ZSnTZ4F35Rnc?= =?us-ascii?Q?sJsEoU+hyl4oAjE08UT4TCvbX9HoTV9cEqphyVL+?= 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: MW3PR11MB4587.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 141f30cf-143b-4c34-61b1-08db43d454b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2023 08:25:43.6253 (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: KnfUkojG13dMtmVUUA4X+EthYJYKIgxGVZPMERCWHlbENeHphpS9hBxtleZMzk4T8aMUGFU8v3rSPEq1UT1sbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7674 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: Xing, Beilei > Sent: Thursday, April 6, 2023 3:43 PM > To: Wu, Jingjing > Cc: dev@dpdk.org; Xing, Beilei > Subject: [PATCH v4 1/2] common/idpf: move PF specific functions from comm= on init >=20 > From: Beilei Xing >=20 > Move PF reset and PF mailbox initialization functions from > idpf_adapter_init function to xxxx_adapter_ext_init function, > since they're different between PF and VF support. >=20 > Signed-off-by: Beilei Xing > --- > drivers/common/idpf/idpf_common_device.c | 72 +++++------------------- > drivers/common/idpf/idpf_common_device.h | 11 ++++ > drivers/common/idpf/version.map | 5 ++ > drivers/net/cpfl/cpfl_ethdev.c | 51 +++++++++++++++++ > drivers/net/idpf/idpf_ethdev.c | 51 +++++++++++++++++ > 5 files changed, 131 insertions(+), 59 deletions(-) >=20 > diff --git a/drivers/common/idpf/idpf_common_device.c > b/drivers/common/idpf/idpf_common_device.c > index c5e7bbf66c..3b58bdd41e 100644 > --- a/drivers/common/idpf/idpf_common_device.c > +++ b/drivers/common/idpf/idpf_common_device.c > @@ -6,8 +6,8 @@ > #include > #include >=20 > -static void > -idpf_reset_pf(struct idpf_hw *hw) > +void > +idpf_hw_pf_reset(struct idpf_hw *hw) > { > uint32_t reg; >=20 > @@ -15,9 +15,8 @@ idpf_reset_pf(struct idpf_hw *hw) > IDPF_WRITE_REG(hw, PFGEN_CTRL, (reg | PFGEN_CTRL_PFSWR)); > } >=20 > -#define IDPF_RESET_WAIT_CNT 100 > -static int > -idpf_check_pf_reset_done(struct idpf_hw *hw) > +int > +idpf_hw_pf_reset_check(struct idpf_hw *hw) > { > uint32_t reg; > int i; > @@ -33,48 +32,13 @@ idpf_check_pf_reset_done(struct idpf_hw *hw) > return -EBUSY; > } >=20 > -#define CTLQ_NUM 2 > -static int > -idpf_init_mbx(struct idpf_hw *hw) > +int > +idpf_hw_mbx_init(struct idpf_hw *hw, struct idpf_ctlq_create_info *ctlq_= info) > { > - struct idpf_ctlq_create_info ctlq_info[CTLQ_NUM] =3D { > - { > - .type =3D IDPF_CTLQ_TYPE_MAILBOX_TX, > - .id =3D IDPF_CTLQ_ID, > - .len =3D IDPF_CTLQ_LEN, > - .buf_size =3D IDPF_DFLT_MBX_BUF_SIZE, > - .reg =3D { > - .head =3D PF_FW_ATQH, > - .tail =3D PF_FW_ATQT, > - .len =3D PF_FW_ATQLEN, > - .bah =3D PF_FW_ATQBAH, > - .bal =3D PF_FW_ATQBAL, > - .len_mask =3D PF_FW_ATQLEN_ATQLEN_M, > - .len_ena_mask =3D PF_FW_ATQLEN_ATQENABLE_M, > - .head_mask =3D PF_FW_ATQH_ATQH_M, > - } > - }, > - { > - .type =3D IDPF_CTLQ_TYPE_MAILBOX_RX, > - .id =3D IDPF_CTLQ_ID, > - .len =3D IDPF_CTLQ_LEN, > - .buf_size =3D IDPF_DFLT_MBX_BUF_SIZE, > - .reg =3D { > - .head =3D PF_FW_ARQH, > - .tail =3D PF_FW_ARQT, > - .len =3D PF_FW_ARQLEN, > - .bah =3D PF_FW_ARQBAH, > - .bal =3D PF_FW_ARQBAL, > - .len_mask =3D PF_FW_ARQLEN_ARQLEN_M, > - .len_ena_mask =3D PF_FW_ARQLEN_ARQENABLE_M, > - .head_mask =3D PF_FW_ARQH_ARQH_M, > - } > - } > - }; > struct idpf_ctlq_info *ctlq; > int ret; >=20 > - ret =3D idpf_ctlq_init(hw, CTLQ_NUM, ctlq_info); > + ret =3D idpf_ctlq_init(hw, IDPF_CTLQ_NUM, ctlq_info); > if (ret !=3D 0) > return ret; >=20 > @@ -96,6 +60,12 @@ idpf_init_mbx(struct idpf_hw *hw) > return ret; > } You can check the device id if idpf_hw, and then decide how to init ctlq an= d then this function can also be consumed by VF driver. No need to move the= m out from common. The same as other functions. >=20