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 DEB234318E; Tue, 17 Oct 2023 18:51:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C95BC402D0; Tue, 17 Oct 2023 18:51:40 +0200 (CEST) Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) by mails.dpdk.org (Postfix) with ESMTP id CE9174003C for ; Tue, 17 Oct 2023 18:51:38 +0200 (CEST) Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-4a4021adbc7so2355675e0c.2 for ; Tue, 17 Oct 2023 09:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697561498; x=1698166298; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=noxpZl/XU8xTXU8ZRKtT1r3URHhoiDLLiyeyw9eJjcg=; b=bOfDm17KYVL8ewke6bQ/a/GFQfNsxgHE5BawnvaNwoFXPx7AED4iRRICDc1OcXb9lO a2MzJ73jl8IW9RdV2S1Pxlv+m+zXg2JvpY2izQUcDB2czaie5Tce5MTo1EY92ZZmTsQn bw3M0BYIJf8p6nAg6m2P22d3P5FV+piERKCJfdlNPay4mDI7RMPQDegNdngd0uUeR5kn iH0Woicv/qqp/xjltvLsQmATQaj2fKszPtcHThndBXfJDEHgN8415xHPKvyhn21dgNFp YIm+OwCnFPDKsZZP226BBqjUrbXLy2lwHFdeCQAR5uOTJMT9e+Dcm30MCS92CyZWjsNx yt+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697561498; x=1698166298; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=noxpZl/XU8xTXU8ZRKtT1r3URHhoiDLLiyeyw9eJjcg=; b=Nm9Te6eRnscWL6T01+1nBsuv4A8PIR/gmGYBFwEP/en+QIkCkE3RbSzUXJ8Mtfwc5b b0tfrC4Ju88BVK0Ggz1t4GU9/LIQWk4jpOh+QXRS2T4waJd6/tBeHq5Sm7Au2+QlzvlH FfiWKTmE5auWG0hYsmRPlR2FdrWdGrlvJarkGHmEne8oFc7LNda7aSA0qucs8z1N+Ogc 1O1a+GogqWlkQmScdXjuyhJ/vfaqzfCUBs7dcHb8fSUxKhnisPZ/P32Tyg5Y6QjWXNjc CLnsdQDkChg9c9n0TmNUJc/TwQ3/DtY8hWfRlJZ/FGKRDaQWJPiJmw0dn7v4HN3qm8hh y2Cw== X-Gm-Message-State: AOJu0Yw8bHZy4H0r5IWLj4AHDDF6yKhoshhGkXokSCJ2MECHl5sdB/A1 C0/r7uJ2Zp3q6tjoZoRiELUymF4p1y1vdo7F4JY= X-Google-Smtp-Source: AGHT+IEkvdsTOs91W9cjFVqch1MaHKFtxT4oFj2++Fb0xif2R3L0BMlevDloRlxRYx2WtsIYG2oI5EALrJiabG95iPA= X-Received: by 2002:a1f:aa97:0:b0:495:bf04:89f8 with SMTP id t145-20020a1faa97000000b00495bf0489f8mr2776304vke.6.1697561498054; Tue, 17 Oct 2023 09:51:38 -0700 (PDT) MIME-Version: 1.0 References: <20231017154532.152741-1-bruce.richardson@intel.com> In-Reply-To: From: Jerin Jacob Date: Tue, 17 Oct 2023 22:21:11 +0530 Message-ID: Subject: Re: [PATCH] event/dsw: fix missing device pointer To: Bruce Richardson , David Marchand Cc: dev@dpdk.org, mattias.ronnblom@ericsson.com 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 Tue, Oct 17, 2023 at 9:45=E2=80=AFPM Bruce Richardson wrote: > > On Tue, Oct 17, 2023 at 09:34:04PM +0530, Jerin Jacob wrote: > > On Tue, Oct 17, 2023 at 9:32=E2=80=AFPM 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 th= e > > > 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 t= he > > > "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 sy= stem") > > > 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 devi= ce > 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. [main]dell[dpdk.org] $ git grep rte_event_pmd_vdev_init drivers/event/dpaa/dpaa_eventdev.c: eventdev =3D rte_event_pmd_vdev_ini= t(name, drivers/event/dpaa2/dpaa2_eventdev.c: eventdev =3D rte_event_pmd_vdev_ini= t(name, drivers/event/dsw/dsw_evdev.c: dev =3D rte_event_pmd_vdev_init(name, sizeof(struct dsw_evdev), drivers/event/octeontx/ssovf_evdev.c: eventdev =3D rte_event_pmd_vdev_init(name, sizeof(struct ssovf_evdev), drivers/event/opdl/opdl_evdev.c: dev =3D rte_event_pmd_vdev_init(nam= e, drivers/event/skeleton/skeleton_eventdev.c: eventdev =3D rte_event_pmd_vdev_init(name, drivers/event/sw/sw_evdev.c: dev =3D 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