From patchwork Tue Oct 17 15:45:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 132761 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 851054318D; Tue, 17 Oct 2023 17:45:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AFC440273; Tue, 17 Oct 2023 17:45:46 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id CB9B440270 for ; Tue, 17 Oct 2023 17:45:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697557545; x=1729093545; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7PQupnugzE3A5x+htO6mWWiKZS6g8B0kYIANnihTNI8=; b=D2cEmfx7oPsc1tTMpOPNvSk+5HGzbnATFd81x5Y7MCqGxOy+rEeX6lw/ i7NsIYcDXbsam1OpklEBEQLnXqEfSQr1pgyZzsdTjUVGhYv3SWf8paqJ/ RRam5Av4zEZn0Tzoe1+qiwdtLkP63Adm6t7drauFmYmfwc5t5mY+yywFN CAEMWtOHbK44lJVvQjzgR/56GwwsqqRLteCcC++q0KJt//FPBS2/vAYz8 PMc60cQ+RtjbY6J5cZ1G8VOdKrLd3Ll0AynDGEr2T2In03dljm4wU0AGV 9ZCiIOaHxhiwpdOxxobtF45QTitkJ4wNfatcLn8BGu76jUBOqf0ROHfCX A==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="365161532" X-IronPort-AV: E=Sophos;i="6.03,232,1694761200"; d="scan'208";a="365161532" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 08:45:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="899953823" X-IronPort-AV: E=Sophos;i="6.03,232,1694761200"; d="scan'208";a="899953823" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.41]) by fmsmga001.fm.intel.com with ESMTP; 17 Oct 2023 08:43:38 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , mattias.ronnblom@ericsson.com Subject: [PATCH] event/dsw: fix missing device pointer Date: Tue, 17 Oct 2023 16:45:32 +0100 Message-Id: <20231017154532.152741-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 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 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 --- 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;