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 EF72E4318D; Tue, 17 Oct 2023 17:52:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2F5A40273; Tue, 17 Oct 2023 17:52:08 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id C38B340270; Tue, 17 Oct 2023 17:52:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697557927; x=1729093927; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JHnS94DpTEhb5DsFVUbbjHgnXfJuJxzBr41GQol/DkI=; b=mo1usySVfmnO/JZ3Tw7IGcjv3fjp7i8DWxX/R3jqzDYm+r9gki18ZUWc nWRhNQpj4gOiGjvLmqYk7jO2Qm+fWdEIMBb0CZcrD403aFlT5TH8LEGYH KmviXVjkw9eqdk1V9hWGiBsbYYNfYIs8PqtM6+yzhu2SRaDYCu2Q/PAyd uIzoEv5reXBLQmfFB/RRamxBz7bK0XOysfVD7PLfQk+DhEYuV4zTB+IUW yB3G6zFJIgkqziYdx4J2OY/X28sundqqZkVW1tuU9/DnQseYAY+K7xL+G NNiEXix1W1D4uM/EVwSnfLc8xB6yRB8QbUIsjdaMCmtPocCF275jLNkKt A==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="388673094" X-IronPort-AV: E=Sophos;i="6.03,232,1694761200"; d="scan'208";a="388673094" 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:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,232,1694761200"; d="scan'208";a="4136249" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.41]) by fmviesa001.fm.intel.com with ESMTP; 17 Oct 2023 08:52:09 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , stable@dpdk.org, Harry van Haaren Subject: [PATCH v2 1/2] event/sw: fix missing device pointer Date: Tue, 17 Oct 2023 16:51:47 +0100 Message-Id: <20231017155148.153095-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231016151713.711965-1-bruce.richardson@intel.com> References: <20231016151713.711965-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 SW 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: aaa4a221da26 ("event/sw: add new software-only eventdev driver") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Acked-by: Harry van Haaren --- drivers/event/sw/sw_evdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index 6d1816b76d..bf166a8cfc 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -1080,6 +1080,7 @@ sw_probe(struct rte_vdev_device *vdev) SW_LOG_ERR("eventdev vdev init() failed"); return -EFAULT; } + dev->dev = &vdev->device; dev->dev_ops = &evdev_sw_ops; dev->enqueue = sw_event_enqueue; dev->enqueue_burst = sw_event_enqueue_burst; -- 2.39.2