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 5265A42A7B; Sat, 6 May 2023 10:52:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E42E040DFD; Sat, 6 May 2023 10:52:40 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2113.outbound.protection.outlook.com [40.107.223.113]) by mails.dpdk.org (Postfix) with ESMTP id 27934406B8 for ; Sat, 6 May 2023 10:52:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ArhmNoeIBS3VWwLsMBhcO9QKq67ZFiRxnTtdGcAxdUSLmlxrvwhXJZBC8wa2eQhmPnp/BMtfhDP9e5cunLzNgZYXxs6caBepuXmR4cZgSvVt6ddVy0uBs9haJNdaI5Km55IIZUlGBAtqduRSiqmKkbNy+17FOMEhcQSPyv07vPfaPjO9UKT0eVRTpYxFdHVmbJrz5YCl1DDQARzJQF+kH17p0laa2Mt8fechEUA/N8h3Sc52rQIVvBe5FI+nLnOJECnt6tpDin7v3K4DZDO8kZo3UOZxfGPyufpnOQqA57VuEOwij+BAyDM9J0S0xeiCC6a7GfIVZB1At68OGv1Uug== 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=DEJ6x2Q1kTFSkPAgWewT4RnjVRTaipK6BlJaslMHiPQ=; b=mVf2uajLeGulfaBBnE1eGlM1EoxCmqq19QFBb/RzV9AmXPcQy4642eVGE6zsIWVJoNZnn551m1dQpDDeEuzgRkcLgLvcu23NpSTJMvkpgMI4ubmEsD7Ao0dc6HfPPVBCe0P4K5o2i7U6jjtqld4QtgTczwCBRheeXaBTGtES6kBCLdwK74B9PhnYbB/hNEhKkROtmg426Pb/kxFQg/OxkIyvrCvQPL4INEAoWmeWBBFfWlaI9+Qj7b3oO81GQAkPCAhrNvXwW9MZt0i46tqsOVRFgm+g8MA3ysTlkQu2o5nGEIlhamL9XH5Ygu/T72l4/zb8DRAbMI/gPK4LrW+Y4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DEJ6x2Q1kTFSkPAgWewT4RnjVRTaipK6BlJaslMHiPQ=; b=Z4IFNU/tGtp0LCFlX4ytn5P99sHgL6jX34U6cGPt+qhuAyfpAJMGUB+8tiOm62lyva5yEO0iGXElXQrFOeaa5BQljvoL8w83/kD1hkGglFCIzMqWND2mex2UARNKgPXrP4Iv4xmRDiqKcOj3mIJf+3EjkC0RJwdm18SRSAoAmVY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB5594.namprd13.prod.outlook.com (2603:10b6:510:130::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.29; Sat, 6 May 2023 08:52:34 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994%6]) with mapi id 15.20.6363.029; Sat, 6 May 2023 08:52:34 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Peng Zhang , Chaoyong He Subject: [PATCH] app/pdump: make dpdk-pdump can run multiple simultaneously Date: Sat, 6 May 2023 16:52:06 +0800 Message-Id: <20230506085206.475810-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SJ0PR03CA0194.namprd03.prod.outlook.com (2603:10b6:a03:2ef::19) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5594:EE_ X-MS-Office365-Filtering-Correlation-Id: 711fd38c-3add-438a-b6a9-08db4e0f3c06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dYifMfMlbmRhLE+ZfnRUtywpQDO33oyGug+ZvuZXSk6qsfCNjZLfCoe1zVYj6LscrCi72j8N4yGspR+WiOaJ0hHQVI1A7abVWQQCGUqCGzLzxVXhMGckZpdOnsvtv/mL7tfU4BYEciS165k+2VX4RIywHw9x5+osj00KgscWQza6UHcIa5aXjQAReeW0v+r1QSpj6SlzBJ2fS9wY265Ng4EraXnWjceMaL+D4K95c0Opo9AwAQu1EZW8Y+a2PkWRvUjsvHHUkwwHEsKyJ7w4giGVbG/eFOF7sOzPDFhj/Y6kGW9G0jjqw7ezR+bnJ5MIUcJnZ8XAUTwhQR3DCWeGgnGmudK4AX/NYOOM7SNsV1r9k/+d5ixFpCfy7fZeHlHhn61BGabrwipOGLDDQuFOSTjmprl0EtvsRR6mFTDC4I16IVDV9aYnOfLwfQmJAnArj9JLFWI57dy9Oqu6zOWaAGbQu56Bv0fhOTCCJ4GorwE3pGB5qhW6TTT3OVLi9wPgDgRiSMLkogh25oDytA76zSgnY5VUOTBNiDYMfV/OCEkSINYqDX9AJQJghWlxq96M8DXQxlj10FZwbuV2rF4ZxMFUGHkTd1NAjqbm2GCkxCnYilQsB2nrPNnJ5wIRRRdGzzHC+iQMS8+soLasDr4dYGsx6GjXjH3erYroCa6ycfU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(396003)(376002)(346002)(39840400004)(136003)(451199021)(54906003)(478600001)(86362001)(6512007)(6506007)(26005)(1076003)(107886003)(36756003)(186003)(52116002)(6666004)(6486002)(316002)(41300700001)(66476007)(66556008)(6916009)(4326008)(66946007)(8676002)(8936002)(44832011)(5660300002)(2906002)(83380400001)(38100700002)(38350700002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K1VaTEtxZmYrUUxaQnpXaVh5M2d2NkxiZVV3elVKL3BmMWYwZDk2bEl2TVdU?= =?utf-8?B?VlpHS1BBc3pvSG1yWmRyRWZROTJLRUxFL3pVK0dWMVFtMkRYOEw0cmZGYlh0?= =?utf-8?B?bVYwSWYrcnFkVVFSYjFXcTNpeVFxck1SczhwSDRJVlFvcG4zZmJxa0U0ZWEz?= =?utf-8?B?MHZ4U29FZGZKL3cwNFBKWGw3Q2VYa1R0aUMvV0NZSnpHdm1DYVZ5cmtvZG9N?= =?utf-8?B?WE14S1p4YVNza1FYV3ZnWDJHZ3dPZ2hjUGptY2ZrVi81MW96NmNKUHoweDkz?= =?utf-8?B?WG9nK0Z0UExIdUZGNFZWa2lUcGZlOURTWmJWTUM0Ym9Fb3c1ODJFaC9HQTV1?= =?utf-8?B?cS9UdHdWM09Jd25waWRITGUzaGJSaG1zdEx1Sk0wK1JXVkIySHlJUnR5U2xQ?= =?utf-8?B?eExZbmFzeS9EM0RnK3FXSXZFUW00Z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-Network-Message-Id: 711fd38c-3add-438a-b6a9-08db4e0f3c06 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2023 08:52:34.4798 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: maHmsYra6RWYn4hrfAfJMIl3zPPYkN2HWEnyTbf/OZMlMwFvmSOT5sMHZ2R163G0/SWJ4424NzEUDSdkAvOswsBCbvtDi0cEPfJUIu5Thv4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5594 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 From: Peng Zhang The pdump doesn't support start the multiple separate process for different queues or ports to monitor the packets, because it apply the same name for memory space. This commit will use the device_id, port and queue to name the memory space and it will support this function. Adjust the value of RTE_MEMZONE_NAMESIZE to adapt the name length. Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Niklas Söderlund --- app/pdump/main.c | 37 +++++++++++++++++++++++------------ lib/eal/include/rte_memzone.h | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index c6cf9d9c87..d5d73b57f5 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -42,15 +42,15 @@ #define PDUMP_MSIZE_ARG "mbuf-size" #define PDUMP_NUM_MBUFS_ARG "total-num-mbufs" -#define VDEV_NAME_FMT "net_pcap_%s_%d" +#define VDEV_NAME_FMT "net_pcap_%s_%s_p%d_q%d_%d" #define VDEV_PCAP_ARGS_FMT "tx_pcap=%s" #define VDEV_IFACE_ARGS_FMT "tx_iface=%s" #define TX_STREAM_SIZE 64 -#define MP_NAME "pdump_pool_%d" +#define MP_NAME "pdump_pool_%s_p%d_q%d_%d" -#define RX_RING "rx_ring_%d" -#define TX_RING "tx_ring_%d" +#define RX_RING "rx_ring_%s_p%d_q%d_%d" +#define TX_RING "tx_ring_%s_p%d_q%d_%d" #define RX_STR "rx" #define TX_STR "tx" @@ -633,11 +633,14 @@ create_mp_ring_vdev(void) char vdev_name[SIZE]; char vdev_args[SIZE]; char ring_name[SIZE]; + const char *device_name; char mempool_name[SIZE]; for (i = 0; i < num_tuples; i++) { pt = &pdump_t[i]; - snprintf(mempool_name, SIZE, MP_NAME, i); + device_name = pt->device_id != NULL ? pt->device_id : "dev"; + snprintf(mempool_name, SIZE, MP_NAME, device_name, pt->port, + pt->queue, i); mbuf_pool = rte_mempool_lookup(mempool_name); if (mbuf_pool == NULL) { /* create mempool */ @@ -658,7 +661,8 @@ create_mp_ring_vdev(void) if (pt->dir == RTE_PDUMP_FLAG_RXTX) { /* if captured packets has to send to the same vdev */ /* create rx_ring */ - snprintf(ring_name, SIZE, RX_RING, i); + snprintf(ring_name, SIZE, RX_RING, device_name, + pt->port, pt->queue, i); pt->rx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); if (pt->rx_ring == NULL) { @@ -669,7 +673,8 @@ create_mp_ring_vdev(void) } /* create tx_ring */ - snprintf(ring_name, SIZE, TX_RING, i); + snprintf(ring_name, SIZE, TX_RING, device_name, + pt->port, pt->queue, i); pt->tx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); if (pt->tx_ring == NULL) { @@ -681,7 +686,8 @@ create_mp_ring_vdev(void) /* create vdevs */ snprintf(vdev_name, sizeof(vdev_name), - VDEV_NAME_FMT, RX_STR, i); + VDEV_NAME_FMT, RX_STR, device_name, + pt->port, pt->queue, i); (pt->rx_vdev_stream_type == IFACE) ? snprintf(vdev_args, sizeof(vdev_args), VDEV_IFACE_ARGS_FMT, pt->rx_dev) : @@ -711,7 +717,8 @@ create_mp_ring_vdev(void) pt->tx_vdev_id = portid; else { snprintf(vdev_name, sizeof(vdev_name), - VDEV_NAME_FMT, TX_STR, i); + VDEV_NAME_FMT, TX_STR, device_name, + pt->port, pt->queue, i); (pt->rx_vdev_stream_type == IFACE) ? snprintf(vdev_args, sizeof(vdev_args), VDEV_IFACE_ARGS_FMT, pt->tx_dev) : @@ -741,7 +748,8 @@ create_mp_ring_vdev(void) } else if (pt->dir == RTE_PDUMP_FLAG_RX) { /* create rx_ring */ - snprintf(ring_name, SIZE, RX_RING, i); + snprintf(ring_name, SIZE, RX_RING, device_name, + pt->port, pt->queue, i); pt->rx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); if (pt->rx_ring == NULL) { @@ -751,7 +759,8 @@ create_mp_ring_vdev(void) } snprintf(vdev_name, sizeof(vdev_name), - VDEV_NAME_FMT, RX_STR, i); + VDEV_NAME_FMT, RX_STR, device_name, + pt->port, pt->queue, i); (pt->rx_vdev_stream_type == IFACE) ? snprintf(vdev_args, sizeof(vdev_args), VDEV_IFACE_ARGS_FMT, pt->rx_dev) : @@ -778,7 +787,8 @@ create_mp_ring_vdev(void) } else if (pt->dir == RTE_PDUMP_FLAG_TX) { /* create tx_ring */ - snprintf(ring_name, SIZE, TX_RING, i); + snprintf(ring_name, SIZE, TX_RING, device_name, + pt->port, pt->queue, i); pt->tx_ring = rte_ring_create(ring_name, pt->ring_size, rte_socket_id(), 0); if (pt->tx_ring == NULL) { @@ -788,7 +798,8 @@ create_mp_ring_vdev(void) } snprintf(vdev_name, sizeof(vdev_name), - VDEV_NAME_FMT, TX_STR, i); + VDEV_NAME_FMT, TX_STR, device_name, + pt->port, pt->queue, i); (pt->tx_vdev_stream_type == IFACE) ? snprintf(vdev_args, sizeof(vdev_args), VDEV_IFACE_ARGS_FMT, pt->tx_dev) : diff --git a/lib/eal/include/rte_memzone.h b/lib/eal/include/rte_memzone.h index 5302caa437..b8c7a86517 100644 --- a/lib/eal/include/rte_memzone.h +++ b/lib/eal/include/rte_memzone.h @@ -47,7 +47,7 @@ extern "C" { */ struct rte_memzone { -#define RTE_MEMZONE_NAMESIZE 32 /**< Maximum length of memory zone name.*/ +#define RTE_MEMZONE_NAMESIZE 64 /**< Maximum length of memory zone name.*/ char name[RTE_MEMZONE_NAMESIZE]; /**< Name of the memory zone. */ rte_iova_t iova; /**< Start IO address. */ -- 2.39.1