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 EF94B43270; Thu, 2 Nov 2023 19:38:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDAAB40262; Thu, 2 Nov 2023 19:38:05 +0100 (CET) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 0DAE140144 for ; Thu, 2 Nov 2023 19:38:04 +0100 (CET) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6b709048f32so1276242b3a.0 for ; Thu, 02 Nov 2023 11:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1698950284; x=1699555084; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=LJTGwtM1as7oIqmYg6n9iuWKEAei6cSMND0JQ/fksvc=; b=2prFLHt3k3xGmLxq76VpaFRN3d7xQi/XNLyiMALldnS+svf4Cw6n7auq6B1gQRS1JF 5lKbkjBO8pFNJ6s6zfnFgfIqowmh07qiuDTZrm3IiBr6jczzpz+Z9Yt4ySFp+tTaV4Sj FvOlxbEuvLG40GH4dSgDyIX38qc/573v6nIp1M0YDYSwPRXHagI2aStIhKh7tSQgfsle Mfk50keMaa1/iB04c+NqAFJJWiVwPOr/QRd0LAe4eGtYSs42wT74ZcBRk09KAFNCIQMf hUQp0hbLLRj4q/wPKYuk7QL5FzOnm3q1q7Ro2XBtED9BCFvr9LSw5mWBzd021NHkxy2s SKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698950284; x=1699555084; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LJTGwtM1as7oIqmYg6n9iuWKEAei6cSMND0JQ/fksvc=; b=XNTtXqQGhlK4hSyOfH0wlCX91XCIEyEnTfbijvz3chLgVWBPIXbDrMobsjQXwjDmkq 85kxUg4piuJ9dp9e4gl30T6DXs1KVSdwDuXFvKUJMvq9sLjff02Mxhj8C0aXiuSzU/jb IqEdT05D5zHkTZ4bS63mxFk/OMQB02JFPfnKzG9fYMho82bO7sWBnS9VTPrgscNdhR0o UdFi61bsWdLKy/eF4yndgUn99rAkhm4am08WAn/eBTxDx9efrvJZ13CG0O1AaPFjokHm lwkFMxdzEV42K7CjW13Pt8U0vFh5fvTjxgHdhjjnciMhALQOxRrv3oRggCGVWC6GZaZP qxiQ== X-Gm-Message-State: AOJu0YwCU0nOTZPjpsZNJLczGhizWiuY7LMHw7YWoi6s519pFlSVTXxM oR+LSjN1A9TwJHCTVi8pGeaEoQ== X-Google-Smtp-Source: AGHT+IF9sRFYvaUlBhigB1Ppjh4I0/rhV31O+Vj5VlWKqlzztkh4wQw1vtHBW3oUA8zWJTTr5xQ5Fw== X-Received: by 2002:a05:6a20:1585:b0:15d:9ee7:180a with SMTP id h5-20020a056a20158500b0015d9ee7180amr19115311pzj.4.1698950284034; Thu, 02 Nov 2023 11:38:04 -0700 (PDT) Received: from fedora ([38.142.2.14]) by smtp.gmail.com with ESMTPSA id 132-20020a63008a000000b0059d219cb359sm72485pga.9.2023.11.02.11.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 11:38:03 -0700 (PDT) Date: Thu, 2 Nov 2023 11:37:59 -0700 From: Stephen Hemminger To: Rahul Gupta Cc: dev@dpdk.org, thomas@monjalon.net, sovaradh@linux.microsoft.com, okaya@kernel.org, sujithsankar@microsoft.com, sowmini.varadhan@microsoft.com, rahulrgupta27@gmail.com, Rahul Gupta Subject: Re: [RFC] eal: RFC to refactor rte_eal_init into sub-functions Message-ID: <20231102113759.341064ba@fedora> In-Reply-To: <1698949164-20287-1-git-send-email-rahulgupt@linux.microsoft.com> References: <1698949164-20287-1-git-send-email-rahulgupt@linux.microsoft.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Thu, 2 Nov 2023 11:19:24 -0700 Rahul Gupta wrote: > From: Rahul Gupta > To: dev@dpdk.org, thomas@monjalon.net > Cc: sovaradh@linux.microsoft.com, okaya@kernel.org, sujithsankar@microsof= t.com, sowmini.varadhan@microsoft.com, rahulrgupta27@gmail.com, Rahul Gup= ta , Rahul Gupta > Subject: [RFC] eal: RFC to refactor rte_eal_init into sub-functions > Date: Thu, 2 Nov 2023 11:19:24 -0700 > X-Mailer: git-send-email 1.8.3.1 >=20 > From: Rahul Gupta >=20 > Initialization often requires rte_eal_init + rte_pktmbuf_pool_create > which can consume a total time of 500-600 ms: > a) For many devices FLR may take a significant chunk of time > (200-250 ms in our use-case), this FLR is triggered during device > probe in rte_eal_init(). > b) rte_pktmbuf_pool_create() can consume upto 300-350 ms for > applications that require huge memory. >=20 > This cost is incurred on each restart (which happens in our use-case > during binary updates for servicing). > This patch provides an optimization using pthreads that appplications > can use and which can save 200-230ms. >=20 > In this patch, rte_eal_init() is refactored into two parts- > a) 1st part is dependent code ie- it=E2=80=99s a perquisite of the FLR and > mempool creation. So this code needs to be executed before any > pthreads. Its named as rte_eal_init_setup() > b) 2nd part of code is independent code ie- it can execute in parallel > to mempool creation in a pthread. Its named as rte_probe_and_ioctl(). >=20 > Existing applications require no changes unless they wish to leverage > the optimization. >=20 > If the application wants to use pthread functionality, it should call- > a) rte_eal_init_setup() then create two or more pthreads- > b) in one pthread call- rte_probe_and_ioctl(), > c) second pthread call- rte_pktmbuf_pool_create() > d) (optional) Other pthreads for any other independent function. >=20 > Signed-off-by: Rahul Gupta These probably marked internal rather than part of API/ABI.