From patchwork Tue Oct 17 15:51:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 132763 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EEFFF4318D; Tue, 17 Oct 2023 17:52:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 42F2042D66; Tue, 17 Oct 2023 17:52:34 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id D0CAF4068E; Tue, 17 Oct 2023 17:52:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697557953; x=1729093953; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vGbVvAJNAB/Eqn00sxCiQ9EfWTZqQh2qBhk2PsIXohA=; b=SG0i2KF3Zv2nf81gVuf0kjrKcN9sEPrV/Vx/fsx6Rc21uQxYM1QVUH1i i1NYFdUBPt+Pj+Zj+iOnsfTmxssFqVbB5h5KeQ2dWV1z2W/IUOZ4aGfeJ 7wK8m3By/8hM10r3M35wVkvlHBIbnTdWlSWDfBnna6XmDOyJf+LJIkXrr DJcGWZQ6pNA6pAJR22Fej+DzHwmp6QxQAnFJ4UTjd3mbrvGPJWehz54Ik QTzgBvniXf21fAa1/gKvR7ADzo4mPGUUm+v2PKjvS9XSf87lxNi4soWq+ rj9PjqoQ4gxG7AFsXrBdaCI+jAMFVYT3G8crtTBHjejl3PkCXwL5BCMBO w==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="388673197" X-IronPort-AV: E=Sophos;i="6.03,232,1694761200"; d="scan'208";a="388673197" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 08:52:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,232,1694761200"; d="scan'208";a="4136496" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.41]) by fmviesa001.fm.intel.com with ESMTP; 17 Oct 2023 08:52:35 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , mattias.ronnblom@ericsson.com, stable@dpdk.org Subject: [PATCH v2 2/2] event/dsw: fix missing device pointer Date: Tue, 17 Oct 2023 16:51:49 +0100 Message-Id: <20231017155148.153095-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017155148.153095-1-bruce.richardson@intel.com> References: <20231016151713.711965-1-bruce.richardson@intel.com> <20231017155148.153095-1-bruce.richardson@intel.com> MIME-Version: 1.0 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 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 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 Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- drivers/event/dsw/dsw_evdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c index 785c12f61f..44da3c60d1 100644 --- a/drivers/event/dsw/dsw_evdev.c +++ b/drivers/event/dsw/dsw_evdev.c @@ -440,6 +440,7 @@ dsw_probe(struct rte_vdev_device *vdev) return -EFAULT; dev->dev_ops = &dsw_evdev_ops; + dev->dev = &vdev->device; dev->enqueue = dsw_event_enqueue; dev->enqueue_burst = dsw_event_enqueue_burst; dev->enqueue_new_burst = dsw_event_enqueue_new_burst;