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 5FAD943196; Wed, 18 Oct 2023 08:29:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4ED3340289; Wed, 18 Oct 2023 08:29:37 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id EE0CF4027C for ; Wed, 18 Oct 2023 08:29:35 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id BCBCCF786 for ; Wed, 18 Oct 2023 08:29:35 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 9DFB1F785; Wed, 18 Oct 2023 08:29:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.6 X-Spam-Score: -1.5 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 025DAF07A; Wed, 18 Oct 2023 08:29:33 +0200 (CEST) Message-ID: Date: Wed, 18 Oct 2023 08:29:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] event/dsw: fix missing device pointer Content-Language: en-US To: Jerin Jacob , Bruce Richardson , David Marchand Cc: dev@dpdk.org, mattias.ronnblom@ericsson.com References: <20231017154532.152741-1-bruce.richardson@intel.com> From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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 2023-10-18 07:18, Jerin Jacob wrote: > On Tue, Oct 17, 2023 at 10:21 PM Jerin Jacob wrote: >> >> On Tue, Oct 17, 2023 at 9:45 PM Bruce Richardson >> wrote: >>> >>> On Tue, Oct 17, 2023 at 09:34:04PM +0530, Jerin Jacob wrote: >>>> On Tue, Oct 17, 2023 at 9:32 PM Bruce Richardson >>>> wrote: >>>>> >>>>> After calling rte_event_dev_info_get() the ".dev" field of the info >>>>> structure should have a pointer to the underlying device, allowing the >>>>> user to e.g. get the device name using using rte_dev_name(info.dev). >>>>> >>>>> The distributed software eventdev info structure did not return a >>>>> correct device pointer, though, instead returning NULL, which caused >>>>> crashes getting "rte_dev_name". Initializing the dev pointer inside the >>>>> "eventdev" struct in the device probe function fixes this by ensuring we >>>>> have a valid pointer to return in info_get calls. >>>>> >>>>> Fixes: 46a186b1f0c5 ("event/dsw: add device registration and build system") >>>>> Cc: mattias.ronnblom@ericsson.com >>>>> >>>>> Signed-off-by: Bruce Richardson >>>> >>>> Is this issue for all "vdev" devices? if so, Please check for >>>> drivers/event/skeleton too. >>>> >>> Yes, good point, looks like event/skeleton also returns NULL for the device >>> pointer. >>> >>> I'll do up a v3 with the extra patch in it. >> >> Looks there are more vdev devuces. Can we have common PMD function or >> extend rte_event_pmd_vdev_init or so. > > > @Richardson, Bruce I will be on vacation from Friday, So would like to > give PR for rc2 before that. > > Adding helper function in rc2 may be risky, Could you fix all vdev > mentioned below. > Helper work, I think, we can take in next release. > I agree. Thanks Bruce! > >> >> [main]dell[dpdk.org] $ git grep rte_event_pmd_vdev_init >> drivers/event/dpaa/dpaa_eventdev.c: eventdev = rte_event_pmd_vdev_init(name, >> drivers/event/dpaa2/dpaa2_eventdev.c: eventdev = rte_event_pmd_vdev_init(name, >> drivers/event/dsw/dsw_evdev.c: dev = rte_event_pmd_vdev_init(name, >> sizeof(struct dsw_evdev), >> drivers/event/octeontx/ssovf_evdev.c: eventdev = >> rte_event_pmd_vdev_init(name, sizeof(struct ssovf_evdev), >> drivers/event/opdl/opdl_evdev.c: dev = rte_event_pmd_vdev_init(name, >> drivers/event/skeleton/skeleton_eventdev.c: eventdev = >> rte_event_pmd_vdev_init(name, >> drivers/event/sw/sw_evdev.c: dev = rte_event_pmd_vdev_init(name, >> lib/eventdev/eventdev_pmd_vdev.h:rte_event_pmd_vdev_init(const char >> *name, size_t dev_private_size, >> lib/eventdev/version.map: rte_event_pmd_vdev_init; >> >> >>> /Bruce