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 3E5334386B; Tue, 9 Jan 2024 02:30:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B015440298; Tue, 9 Jan 2024 02:30:47 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2046.outbound.protection.outlook.com [40.107.6.46]) by mails.dpdk.org (Postfix) with ESMTP id 564074021F for ; Tue, 9 Jan 2024 02:30:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I6fWmOj3QyIBi5ZEvXJplOioe0X+wKRUTLk4KtqUWPl+ptUYnjdZlephHWfrxV82llxbwXfyhRx27CkktlgED2XRj/AG7tEL9fnoTP+akvWldKeD0hlz3D81s2BnsuJ5UkP0uaplC2cFw7FeZDk6cGWrU/LdScbie5x6+8exVvo02ezhKo4mybSpQKt4yAwHE3KJuu4+kddFFuO4PzfxtFrW/tJzyWkSXNqsXC/8VV1KFVvzT28CZv9oUUz0HszbA6IDz5LfPk9DKIjNSWFlLRHLJbLthUI/ApiirpnWfHVRXqUk3ScksIYLiraZQXWBGeMQjr1qMPUqS6nEPRN7qQ== 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=Iuw7SYqLWHPl2vGbJ27OXKmb20UzSDUV7tCrmRmn9E0=; b=TY629HqEX8Ydh305ebjFAasFbZbHBBiHb58mNVHtKTeOdeltfnGw5OoWUutOnofPPIXrf8HOt6BIz1zA9jGvZVzBrSV1jHBIz3YsRRQUtXl8FwPqanPPF+JPCwGNRicHePNGX5BfXbv3q+FQVj0+nUwQZgNQO7GcEiB/Lt452/RvJ1ZfdSiRkiYs5/on/tmHUt3Vk+Tc9Czj8VuT6kpCZzop7E2pdu6L4SC0m7R110e3kKMuPoVMXLlKysuHclcIux6v9fvMgvmb+D6MHna7AVVxRfIRQajX3crvgjRrNHB7nSkdRpuYluRAcP77jduxOUmsb5kH7whT42m7rNL41w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Iuw7SYqLWHPl2vGbJ27OXKmb20UzSDUV7tCrmRmn9E0=; b=P6eP9Sv2gaUZ9f8iFlnqxs0hkeeo3VTmDHAnTF3KQrQxsvGHyW4wgLlZAkldbRY2JgrHeRK10Np1jtgFUbttk82VBdiznJGojOT/sBbP+vCRRADHgD3OfgIbkZjjpUvSv5+LUbHyh7EwaVhmHHiPNG23y+eD2ld8ySVks0IBTzY= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DU0PR08MB9228.eurprd08.prod.outlook.com (2603:10a6:10:41b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Tue, 9 Jan 2024 01:30:44 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::6ee5:b854:81e:c23e]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::6ee5:b854:81e:c23e%7]) with mapi id 15.20.7159.020; Tue, 9 Jan 2024 01:30:44 +0000 From: Honnappa Nagarahalli To: Stephen Hemminger , "dev@dpdk.org" CC: "arshdeep.kaur@intel.com" , "Gowda, Sandesh" , Reshma Pattan , nd , nd Subject: RE: Issues around packet capture when secondary process is doing rx/tx Thread-Topic: Issues around packet capture when secondary process is doing rx/tx Thread-Index: AQHaQdZJ3N/uPiLKaEaRu20mHAQOtrDQsCMA Date: Tue, 9 Jan 2024 01:30:44 +0000 Message-ID: References: <20240107175900.1276c0a5@hermes.local> In-Reply-To: <20240107175900.1276c0a5@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 6DE918685FF3A647B2D9C6DDEECF7FFE.0 x-checkrecipientchecked: true authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBAPR08MB5814:EE_|DU0PR08MB9228:EE_ x-ms-office365-filtering-correlation-id: edee2a24-8785-4f31-ffde-08dc10b29947 nodisclaimer: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RVVVZpgsxAN/+vJnvqrhZpPgA474a4ZtTONz9XrktMW78gb8DrBVNE6wWefotI9uS0gsoigik4JPHJWRM0pQhGzT1opNjNt8UPFet1T1KtnAGEOLaNRVia4M3mIvVs014NyVF5TXscS3UhOlfKmYbxnLG0vx8r2Lc0Lsg0F2NvqGLI4XezxiYBLOPmH+qqIsjaO6ojjYBdnKMDSnekiC9UUHnCZWlZSM9PzTGqXvtwqgqtrxIc0K2Ed3ve3RiLiE2GiAE08zIJxMluHP9cHbBL9+FqVEEVbl0VhWNzyJSNDWSlXHnXvEzhSMZHZeYPSZDD/Hc6+rQpE5ORNgn48iLWmU7N9yF9v+GFMfJrA7OcGDFl10A1QoZnQyR9gKKUYEYCuQd8sovzcoiesP5qMCb7Sw/IM3CTNFkSalMKZRk25MnNopya0ku4nw5pJwRP2EamCRp/QZPqGSGKCKNWC7Bsko9wthqn60rXbFLaM3mxx7PmO4HowPfSAhbBGmGqGMIEg9XMfOPHy1N680NsQKNy9glGPlWY28CdQ2thdxYUa4KRy8RY1i25SV0m8CD0EAWB5wsMcOjts+Jpu17b+sutnpX1i/obepGgdf7Ac71zIrq6rb34Z/3EEgmqFH5zJX x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(376002)(136003)(366004)(39860400002)(396003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(71200400001)(33656002)(478600001)(5660300002)(2906002)(53546011)(6506007)(7696005)(9686003)(8676002)(8936002)(52536014)(4326008)(54906003)(110136005)(316002)(64756008)(66946007)(66446008)(122000001)(76116006)(66476007)(66556008)(55016003)(38100700002)(38070700009)(83380400001)(86362001)(41300700001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?uGq4DxIoZ5q5YJP1FzS4b8m6nfQK3UCHDc0uJ4CpSCGdH0trUxlM0RiO0jL9?= =?us-ascii?Q?CmncEyvCm3YTjnQbEyDzsETjcK+ekKwhlDkm7Fwza/1EIy0ClMyM+p5e4pNy?= =?us-ascii?Q?2Z5+AmAayt0q/gaHi7g7Z2eBTuMcZ2TAYXa22zTXKjYuqtTy+wM607lqSxOL?= =?us-ascii?Q?OrgNI52uYQqOTSwjsf/ynRSarIL03avgHZLXRJYSO8VieKLqQnpcnYmxEmsv?= =?us-ascii?Q?meYYwk50m7pHqjTQUmTa1A/+QsSUiQ7qKbX2J7yxW9kV/dhj93rEZboKlQC8?= =?us-ascii?Q?ASjoL9l8B08s/g0U40zehasn3J9kbFJulNL3mI3rMdn5Gti46agMTuwQ3BR+?= =?us-ascii?Q?nrVg2HIF+yUSN0CzAUzFVv+AnvFpQNiWBH7BCcre8E7yFgFbRtZDjYCpCci0?= =?us-ascii?Q?4exP6sCSZzY8AsoSgXYO8YiWsvIYBZSd28vcvuTzu9ZLg4F4eSnppd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Lx2Bx8xsIK3iuMOPuBAKViTi4WQJi4o?= =?us-ascii?Q?PBloK5xZK+qFJzP7WYELlRP35I/15TOT6U81S6KZZcJaqdZgKWpeYRlx3I9Z?= =?us-ascii?Q?cF8zbm9QRrWVvrPq8T9mgTlb6L5+RvgwFyV7S6lBPBQ+sYGITxL5JTV7gti4?= =?us-ascii?Q?DaZsqpII85ut9oWeYidxARbzLjvJcLLK1TddmZJFmdIL+bL2OFRRM9xDUtc8?= =?us-ascii?Q?AH7dn2x5ZULQN1x4D2xB8tf+8UO34bHOfoZ+VJePMwt/hoatlYmfgMHZ5+fZ?= =?us-ascii?Q?6nWD5YRDT52o5B18kyGDky3YOswyMoGGmYdX6LJV3xzqBieoWVPSShQfpi+K?= =?us-ascii?Q?bsuO+w=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBAPR08MB5814.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: edee2a24-8785-4f31-ffde-08dc10b29947 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2024 01:30:44.1508 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +42gIQMLAjhxdbe24wRuek+VUyMkIUc4Rw5lOpNEZ73SSejE32iVT7sEt9M118J7ozac6l2HZ1niLNYZ8CWj+3QE6kp/4ZVu0rmZa8MS4VE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9228 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: Stephen Hemminger > Sent: Sunday, January 7, 2024 7:59 PM > To: dev@dpdk.org > Cc: arshdeep.kaur@intel.com; Gowda, Sandesh ; > Reshma Pattan > Subject: Issues around packet capture when secondary process is doing rx/= tx >=20 > I have been looking at a problem reported by Sandesh where packet capture > does not work if rx/tx burst is done in secondary process. >=20 > The root cause is that existing rx/tx callback model just doesn't work un= less the > process doing the rx/tx burst calls is the same one that registered the c= allbacks. This is not specific to packet capture. This is a generic problem and we sh= ould look to solve it generically. >=20 > An example sequence would be: > 1. dumpcap (or pdump) as secondary tells pdump in primary to register > callback > 2. secondary process calls rx_burst. > 3. rx_burst sees the callback but it has pointer pdump_rx which is not > necessarily > at same location in primary and secondary process. > 4. indirect function call in secondary to bad location likely causes cra= sh. >=20 > Some possible workarounds. > 1. Keep callback list per-process: messy, but won't crash. Capture won't > work > without other changes. In this primary would register callback= , but > secondaries > would not use them in rx/tx burst. >=20 > 2. Replace use of rx/tx callback in pdump with change to rte_ethdev to > have > a capture flag. (i.e. don't use indirection). Likely ABI prob= lems. > Basically, ignore the rx/tx callback mechanism. This is my pre= ferred > solution. >=20 > 3. Some fix up mechanism (in EAL mp support?) to have each process > fixup > its callback mechanism. Yes, would prefer this. Let the application call additional APIs to registe= r the call backs in secondary process. >=20 > 4. Do something in pdump_init to register the callback in same process > context > (probably need callbacks to be per-process). Would mean callback is > always > on independent of capture being enabled. >=20 > 5. Get rid of indirect function call pointer, and replace it by i= ndex into > a static table of callback functions. Every process would have= same code > (in this case pdump_rx) but at different address. Requires al= l callbacks > to be statically defined at build time. >=20 > The existing rx/tx callback is not safe id rx/tx burst is called from dif= ferent > process than where callback is registered. >=20