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 1092C43193; Wed, 18 Oct 2023 07:18:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFA4B4025F; Wed, 18 Oct 2023 07:18:43 +0200 (CEST) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by mails.dpdk.org (Postfix) with ESMTP id 816694003C for ; Wed, 18 Oct 2023 07:18:41 +0200 (CEST) Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-66d190a8f87so37087306d6.0 for ; Tue, 17 Oct 2023 22:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697606321; x=1698211121; 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=lB0lRnXrIMHOlZBjaESfD1mZg98d6M2s8Pjo9qnl7j0=; b=T7L9fof1i3i5t4qRBB+SPb8T/gfPBajWPYkrS8nd0GS4cSDAbcIYzr4ymqdug/voN2 qa8tHcCvwBrCWoPVKznLybHEVXvhxAWUYjeBf5EF4A+8k9hFwUFtr6t8FyfVPirypmsi ldRvr6GtScS+WlFCD61CaWE5E/Ryan2ziQiMJ9gkTEgQmfTOpS8XDPbkB7HrHMbYJhX7 HguXRTu1AXagM3DF7uepxXpcs4Sl2WlH4rhLj6R8ZNRB1MvXcIz2wpBoWNBPwvVgbkcO gYEtb4HVmoBvGTGga0GO3+zXt7Napbzrr1IOY13PxwiNRW3gLVfuUPBLUsCKt2TscMZh TsJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697606321; x=1698211121; 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=lB0lRnXrIMHOlZBjaESfD1mZg98d6M2s8Pjo9qnl7j0=; b=fIAwvUbk029R02/Nb8iwRqnqJul/CGi01Y9Vg5EeEFWc6oc9y16tnPuK/CiSwSfhEm 9FCpjrfMYBCRAVLkiuz29AwI9cJ+mPVFNLlC0tze8XIj8wLzVBxBaJJbcAToMCo2qZ1G 85jLCopyuGPMu+eePkn++7My3s452yBgYJOaQcdotgPm0GCgDlpodQn3j0CvYUWYKnFv gQ43p3YtZO4btve7bAZHDpwwHdlK1ILFlqJc7HSfTed48CRmzI8Rp2mKf+LfnHaa9CWm 97U02Ckjk/8NUjc3dAnC4r6xWPmX+Ifgp7lHFh3UfGp92utrxl0N7lriVh7Po+M5D2hC Ugrg== X-Gm-Message-State: AOJu0YwuPd065Jy0Qywy54vHv4aaco33W9ZhXcquigBYJN0kvdLaG52G UIl8h3U6uWrn+/A88QdddO9A3IHTkvaMc/QzFzE= X-Google-Smtp-Source: AGHT+IE8Upf1p4RzwL63G6G5iF+GNTQbDTG40D2yDyAZ62f3hZat7v1vJVk0uC+n8A41/j5I/edM5vnpThaeuVDMg3I= X-Received: by 2002:a05:6214:230f:b0:66d:326a:ee4b with SMTP id gc15-20020a056214230f00b0066d326aee4bmr5114480qvb.33.1697606320635; Tue, 17 Oct 2023 22:18:40 -0700 (PDT) MIME-Version: 1.0 References: <20231017154532.152741-1-bruce.richardson@intel.com> In-Reply-To: From: Jerin Jacob Date: Wed, 18 Oct 2023 10:48:14 +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 10:21=E2=80=AFPM Jerin Jacob wrote: > > 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 = 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 cause= d > > > > crashes getting "rte_dev_name". Initializing the dev pointer inside= the > > > > "eventdev" struct in the device probe function fixes this by ensuri= ng 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 de= vice > > 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. > > [main]dell[dpdk.org] $ git grep rte_event_pmd_vdev_init > drivers/event/dpaa/dpaa_eventdev.c: eventdev =3D rte_event_pmd_vdev_i= nit(name, > drivers/event/dpaa2/dpaa2_eventdev.c: eventdev =3D rte_event_pmd_vdev_i= nit(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(n= ame, > 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