From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24DACC433DF for ; Tue, 30 Jun 2020 10:09:08 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id B4FB820771 for ; Tue, 30 Jun 2020 10:09:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b="DLBFZt6Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4FB820771 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=6wind.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 281401BEB3; Tue, 30 Jun 2020 12:09:07 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 949F91023 for ; Tue, 30 Jun 2020 12:09:05 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id l2so17525937wmf.0 for ; Tue, 30 Jun 2020 03:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nV2ps9bjGByeMvaRITlPlVHCVTwR7fDDwrQ3Wy9RcTA=; b=DLBFZt6ZSKO7O+Jsy91c+/K19H96cZxhgP+gIQzhXvM85rYappHEHScQorpN0jbvDz 0rQOyPKvPguWBOZgnY/KVBNnxUcv2695Afxmu4mtKYduJ5dcVW9Op5pHvVUJpwtzIlDR m0vyq/V5jIOZDb5thR0YFC7GQ9hJCpaQBzsHcw3ytV7k8vNqVB2lV3ggRIs65dPUAbQP h00yiZRhyz9XOLXa5+QO/R8qK82vMuaXwsMyVdOYI2AZ1lwTZIKoTsZPSyiEMT0XBN+u WNMC7tw91SkBSUChUK9oyzUSgIm4UHMIf80LaEMjdDW/ixtz9NX9/4ysRHeKKSXhle+p DfNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nV2ps9bjGByeMvaRITlPlVHCVTwR7fDDwrQ3Wy9RcTA=; b=KdMV2ZeJ9gZAa3a+F4ImHjJuvbI5LvE7PZo6bSLJDY4QiynlLopCeEjSwa7y4klI5a b34zIe0DLVDEetKeD9i7kyN0Ae3Qtc3SJna9xl3CE1KsYZHrq1DLo/X0SvZzOScemADP WINhGyL8cFySkGGBqAQHZA+vBGoOqEQDYEScdz5G6o5/Qd9JcNpblV8tk4HvZEXhtrKK 5orhQTMDj2sTfhhd8b5H8YKd4pEQBfOZa48ExdfIJ/cgpq3aSMOhhpPQh2f7kqZlWOgd VC6ndUa1IbW7VOXcWC5VX4lHddYhPaKxsDqscwUx4bpPQP0lxLDfKbJg9iWTeNDkSqNh pS+w== X-Gm-Message-State: AOAM533q7xiunPU9YRYiDi4/pHViV3MDaGHQ1pMdLy3vWtW48TAaKWlv tTGniQmiLY1LnJhUWYFf4PXMJA== X-Google-Smtp-Source: ABdhPJy6GX5Y03UjKmQ9KmdODIqH3SAOWYg01RNkzI7ZNxeg4r0MdZE7iGgBkuCVvq2AY+5PCEWURQ== X-Received: by 2002:a1c:3c83:: with SMTP id j125mr20618976wma.65.1593511745335; Tue, 30 Jun 2020 03:09:05 -0700 (PDT) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id r8sm3019865wrp.40.2020.06.30.03.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 03:09:04 -0700 (PDT) Date: Tue, 30 Jun 2020 12:09:04 +0200 From: Olivier Matz To: David Marchand Cc: dev@dpdk.org, jerinjacobk@gmail.com, bruce.richardson@intel.com, mdr@ashroe.eu, thomas@monjalon.net, arybchenko@solarflare.com, ktraynor@redhat.com, ian.stokes@intel.com, i.maximets@ovn.org, Neil Horman Message-ID: <20200630100904.GG5869@platinum> References: <20200610144506.30505-1-david.marchand@redhat.com> <20200626144736.11011-1-david.marchand@redhat.com> <20200626144736.11011-8-david.marchand@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200626144736.11011-8-david.marchand@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v4 7/9] eal: add lcore init callbacks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jun 26, 2020 at 04:47:34PM +0200, David Marchand wrote: > DPDK components and applications can have their say when a new lcore is > initialized. For this, they can register a callback for initializing and > releasing their private data. > > Signed-off-by: David Marchand [...] > +/** > + * Register callbacks invoked when initializing and uninitializing a lcore. > + * > + * This function calls the init callback with all initialized lcores. > + * Any error reported by the init callback triggers a rollback calling the > + * uninit callback for each lcore. > + * If this step succeeds, the callbacks are put in the lcore callbacks list > + * that will get called for each lcore allocation/release. > + * > + * Note: callbacks execution is serialised under a lock protecting the lcores > + * and callbacks list. > + * > + * @param name > + * A name serving as a small description for this callback. > + * @param init > + * The callback invoked when a lcore_id is initialized. > + * @param uninit > + * The callback invoked when a lcore_id is uninitialized. nit: it could be highlighted that init or uninit can be NULL. > + * @param arg > + * An optional argument that gets passed to the callback when it gets > + * invoked. > + * @return > + * On success, returns an opaque pointer for the registered object. > + * On failure (either memory allocation issue in the function itself or an > + * error is returned by the init callback itself), returns NULL. > + */ > +__rte_experimental > +void * > +rte_lcore_callback_register(const char *name, rte_lcore_init_cb init, > + rte_lcore_uninit_cb uninit, void *arg);