From patchwork Thu Feb 6 16:08:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151047 X-Patchwork-Delegate: bruce.richardson@intel.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 892C1461AD; Thu, 6 Feb 2025 17:09:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D45FF40E49; Thu, 6 Feb 2025 17:09:03 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id C1F864029A for ; Thu, 6 Feb 2025 17:09:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858142; x=1770394142; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=0hf9Ssg4SEJ3gAFBJJufI07NWh1Tgvt3crHtMLEl/lU=; b=GnLfNmp2Wahwbwylseff9VJ0aQGWOK3TtvSRt5/X2M2gk49T+By1cR+U zjSvf9JKCSzX0heBanJMpTkhnKtPXf0Nxw2PLENLihKoCuN3FZKhbJbCG P4Yf93symX3khB+UCRDK73QXnGUNJwz9EqUcfwmCZQfGn+TX+axQ2L7iW E3E72dwEDwddO+U3bFy1qnfg484JB8qMJslD9np+IX8vun/jXnoG3kcTm EA/UYegRevvduRFG4gZI8ccXOD/tYfIA0LbGyNyRzme1i4ZRIReQwTs1X wb3q64ksF0veOEUVPno8g9FgUXvk+Id27tGPM1OqvvNQzVTMnOe4XiTbZ g==; X-CSE-ConnectionGUID: XvhSvUVNQrO+sHdWV+F/fg== X-CSE-MsgGUID: SNZmmSoSQnGk1Kvxyt4Xnw== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860708" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860708" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:01 -0800 X-CSE-ConnectionGUID: Zbxpn9iWTwWP7g6h3yP1xw== X-CSE-MsgGUID: mUJZzmagR5WQ7BHfcVhmpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166609" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:00 -0800 From: Anatoly Burakov To: dev@dpdk.org, Thomas Monjalon , Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 01/24] net/igc/base: fix deadlock in i225 Date: Thu, 6 Feb 2025 16:08:24 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Dima Ruinskiy Currently, when writing GPY PHY registers, semaphor is acquired before writing. However, if writing fails, semaphor is not released, causing a deadlock down the line. Fix the issue by removing premature return. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Dima Ruinskiy Signed-off-by: Anatoly Burakov --- .mailmap | 1 + drivers/net/intel/igc/base/igc_phy.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index 9209a716e0..3faff80f0e 100644 --- a/.mailmap +++ b/.mailmap @@ -358,6 +358,7 @@ Dhruv Tripathi Diana Wang Didier Pallard Dilshod Urazov +Dima Ruinskiy Ding Zhi Diogo Behrens Dirk-Holger Lenz diff --git a/drivers/net/intel/igc/base/igc_phy.c b/drivers/net/intel/igc/base/igc_phy.c index 2906bae21a..ddc2b6ecc1 100644 --- a/drivers/net/intel/igc/base/igc_phy.c +++ b/drivers/net/intel/igc/base/igc_phy.c @@ -4148,8 +4148,6 @@ s32 igc_write_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 data) if (ret_val) return ret_val; ret_val = igc_write_phy_reg_mdic(hw, offset, data); - if (ret_val) - return ret_val; hw->phy.ops.release(hw); } else { ret_val = igc_write_xmdio_reg(hw, (u16)offset, dev_addr, @@ -4182,8 +4180,6 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data) if (ret_val) return ret_val; ret_val = igc_read_phy_reg_mdic(hw, offset, data); - if (ret_val) - return ret_val; hw->phy.ops.release(hw); } else { ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr, From patchwork Thu Feb 6 16:08:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151048 X-Patchwork-Delegate: bruce.richardson@intel.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 9A879461AD; Thu, 6 Feb 2025 17:09:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0D6140E54; Thu, 6 Feb 2025 17:09:06 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id C508140E44 for ; Thu, 6 Feb 2025 17:09:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858146; x=1770394146; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=7mCVJcUfvNRTl9/Ola8c7q+2eDEeRNtuegwzEIH/HhA=; b=ged/x/VwyDrlVi/DBp2fU7chOi2pAjwV+qOBLDGykvE/MoaI6JyVts8u uHQMm0+Gq7ZqwkNq/lJOrs/WEl8iwd4cp/gzv+gq3+rYUBn63aAbmuuSF uRKxsVGrWVwZEecs3YBO1Qc8xO5lyOnH2pjkqfLyW4Xgt4luFVqznZ4TW qc5Y3wkxo7BE3L9/UVVOi2244GCTYVClw2w0mjzz3Hnlkqsfu216BWTna /i+auiDL8l5CgDilv6YPdK644kbogMbc6jq8NxtZKB2FRqSfmqQOiQTsQ SxN+IGx7tzfjWQod5goxMVBWebE3x49fX82bmQOrMiBZ3Ev9AuCDgI6Qe Q==; X-CSE-ConnectionGUID: As3Gm0OnQU2rJljyxT9FVw== X-CSE-MsgGUID: 6aIre8L4QjmX2Sev9/hT8w== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860713" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860713" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:03 -0800 X-CSE-ConnectionGUID: nF6FJb10STac1NH+pfHe5w== X-CSE-MsgGUID: Rl+pzFAiS5qY8sXaDyjSYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166623" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:01 -0800 From: Anatoly Burakov To: dev@dpdk.org, Ferruh Yigit , Alvin Zhang Subject: [PATCH v1 02/24] net/igc/base: fix infinite loop Date: Thu, 6 Feb 2025 16:08:25 +0000 Message-ID: <2681cc33ab04cc2655605f73dc12ef7470187428.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Dima Ruinskiy When the driver fails to acquire HW semaphore, there is nothing that can be done to address it, so just leave to avoid an infinite loop. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Dima Ruinskiy Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_i225.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c index 17a1573064..8f01f8d918 100644 --- a/drivers/net/intel/igc/base/igc_i225.c +++ b/drivers/net/intel/igc/base/igc_i225.c @@ -333,8 +333,15 @@ void igc_release_swfw_sync_i225(struct igc_hw *hw, u16 mask) DEBUGFUNC("igc_release_swfw_sync_i225"); - while (igc_get_hw_semaphore_i225(hw) != IGC_SUCCESS) - ; /* Empty */ + /* Releasing the resource requires first getting the HW semaphore. + * If we fail to get the semaphore, there is nothing we can do, + * except log an error and quit. We are not allowed to hang here + * indefinitely, as it may cause denial of service or system crash. + */ + if (igc_get_hw_semaphore_i225(hw) != IGC_SUCCESS) { + DEBUGOUT("Failed to release SW_FW_SYNC.\n"); + return; + } swfw_sync = IGC_READ_REG(hw, IGC_SW_FW_SYNC); swfw_sync &= ~mask; From patchwork Thu Feb 6 16:08:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151050 X-Patchwork-Delegate: bruce.richardson@intel.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 32FA6461AD; Thu, 6 Feb 2025 17:09:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 205AA40ECF; Thu, 6 Feb 2025 17:09:11 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 5FBB840E72 for ; Thu, 6 Feb 2025 17:09:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858149; x=1770394149; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=ygZopxf56w9FNMeCDmenh5JT4IJ/qyRLt/pMyK0taLI=; b=krp6fwNfdoXHNchmih4sGOTNG4wif8Rt2RgdylhD9FJfCRYiY5FGSa6Q dj4m3pL4qTTZ6ys5m8tDBRWvxGgvlpW2sKPd42v5nJDmUutF/Ig0rXhVq 4JiWERXZ0ENJ6s96JEq/1lVLF2amzKHi/ahFDYoxIbUdSjXJ/TWdApB3E yTGU1QOiKHlFENu111Leq6lQz+8YP+7Eu+RPm6/AMw2WEvH8eQQC4Fmol ED8dDHfzXfaJnjK2HnBvVgBC7HnNgyGu8+I0fsvGx+b0avZ/vK8Ik4p2M NA0ySVQxvfqByX/ytFOrrAzYTroxGcXMKgIUjc1l71Oh31azXzkrf92MM A==; X-CSE-ConnectionGUID: g18JQzA5RoGLDynmyo6u1Q== X-CSE-MsgGUID: N2yq5aM6RDCcU+dSfKU7lA== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860714" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860714" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:06 -0800 X-CSE-ConnectionGUID: DdbUvRRGSPyhAbSpcYJdaQ== X-CSE-MsgGUID: S+vti9r5Qem2hb+rEpgHUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166640" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:03 -0800 From: Anatoly Burakov To: dev@dpdk.org, Ferruh Yigit , Alvin Zhang Subject: [PATCH v1 03/24] net/igc/base: fix bitwise op type mismatch Date: Thu, 6 Feb 2025 16:08:26 +0000 Message-ID: <7d0d5ba85d3bbf68cc08be40c7208437607f7e6b.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Przemyslaw Ciesielski Static analysis has found type mismatch between mask and register value. Fix the bitwise operation type to avoid potential issues. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Przemyslaw Ciesielski Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_i225.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c index 8f01f8d918..1277f59885 100644 --- a/drivers/net/intel/igc/base/igc_i225.c +++ b/drivers/net/intel/igc/base/igc_i225.c @@ -344,7 +344,7 @@ void igc_release_swfw_sync_i225(struct igc_hw *hw, u16 mask) } swfw_sync = IGC_READ_REG(hw, IGC_SW_FW_SYNC); - swfw_sync &= ~mask; + swfw_sync &= ~(u32)mask; IGC_WRITE_REG(hw, IGC_SW_FW_SYNC, swfw_sync); igc_put_hw_semaphore_generic(hw); From patchwork Thu Feb 6 16:08:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151049 X-Patchwork-Delegate: bruce.richardson@intel.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 D7820461AD; Thu, 6 Feb 2025 17:09:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22B9840E72; Thu, 6 Feb 2025 17:09:10 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id E8AE84029A for ; Thu, 6 Feb 2025 17:09:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858149; x=1770394149; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=QJJe80Ve+hAb/BhoHb6JWDFpP6R15pBiewir3way0lw=; b=Vss4xNWznJ3KdXFWdbPnA5o4YzdgvYa47UPRm6K4wjnlrVE9a6fZAp04 BXXt6ulw4We5erNx3B/PgtJqA066bapRuMfy3TMS+a0WBOBIg5WUjy0BO xp8s7USbehsHD3jGY0M0qlIUeBJ6IgpE01rgTciobBk1M04RsqIAnkDhb 0/Amy38c1YHuynXzZCyr/sSknTTC+3obxJdmij2rvaY7gJeBOp8dLcs+D 1Y0cruWKJggu4s6e3pTx76kNQmxgEi1/ic8+R+BjoJI58amnKQrLqRQ3W tCDHuQBYJKVS4XApRvuEzzsqcsk4th61C5e6MmzakHQ//bl1D9RLUeHPl g==; X-CSE-ConnectionGUID: N4dp9fYATOePbtymzWxPtA== X-CSE-MsgGUID: 8wCvFJu5S7CuEKN2iqVfXw== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860715" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860715" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:06 -0800 X-CSE-ConnectionGUID: K9c//MP+T8+62NBw4bji/A== X-CSE-MsgGUID: 1kV6opCTR5CbZl3UR41l/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166661" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:05 -0800 From: Anatoly Burakov To: dev@dpdk.org, Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 04/24] net/igc/base: increase PHY power up delay Date: Thu, 6 Feb 2025 16:08:27 +0000 Message-ID: <194882f1b3168225d05b1a8b647c5dea84f481a2.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Sasha Neftin PHY specification for i225 requires 300 microsecond delay after power up sequence, so increase the delay after power up to 300 microseconds. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Sasha Neftin Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_phy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/intel/igc/base/igc_phy.c b/drivers/net/intel/igc/base/igc_phy.c index ddc2b6ecc1..706f037f0e 100644 --- a/drivers/net/intel/igc/base/igc_phy.c +++ b/drivers/net/intel/igc/base/igc_phy.c @@ -3523,6 +3523,7 @@ void igc_power_up_phy_copper(struct igc_hw *hw) hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg); mii_reg &= ~MII_CR_POWER_DOWN; hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); + usec_delay(300); } /** From patchwork Thu Feb 6 16:08:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151051 X-Patchwork-Delegate: bruce.richardson@intel.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 08D14461AD; Thu, 6 Feb 2025 17:09:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E9B440ED9; Thu, 6 Feb 2025 17:09:12 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 8341C4029A for ; Thu, 6 Feb 2025 17:09:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858150; x=1770394150; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=lmHpNwOd73Jr8FFXLunxCyGl12wFTwC7GBcMCJslrKk=; b=IWkus7W/QUIFW1Tqolymyqe1wH/hVOmOSIXlhnBIQzOxzvcLk7IdmPcr yr5NENP6V+DZDd70RVssLnY9VtzxeTCOoiFmNyVGQwLC6UyZP/xzd7A92 zXFmpJJ89vayyihjnF4aB5EQLRoZXaDfpHXqlGRXP3DZhYfdAMJnpecXI 08IpY91YyqDFkUZN6RwZXi+qKEIBq/ch7blwcYul47DLL6xNAKUOJum2y AqQ0/qcoHFFJjbOSbak/eCwdwOIk7d5Xk+oCVj8GnBuOWFWQGO4BQ+DfX ohfUUdcu6G/oJfYgKZ8bql40jupzy/0yYZnxQR01pjeP+lTQCC7naw+WP Q==; X-CSE-ConnectionGUID: Fj5lxDO4Tgywc3Q4042pQQ== X-CSE-MsgGUID: QfHWf+5vR5GTdLCCszI9xA== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860718" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860718" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:08 -0800 X-CSE-ConnectionGUID: 7I5zJxRoQVayMm6dJqf9Fg== X-CSE-MsgGUID: YE6EgJZ9QdyK0dS/4Z5KiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166676" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:06 -0800 From: Anatoly Burakov To: dev@dpdk.org, Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 05/24] net/igc/base: reset loop variable Date: Thu, 6 Feb 2025 16:08:28 +0000 Message-ID: <6538bb0ae11e2ae5c9787f925a8cf63251638f6c.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Sasha Neftin When writing to Shadow RAM, we set rev_val on success, but since the value is already set to success initially, it is possible for none of the writes to be successful, yet ret_val will still be set to success. Fix it by resetting the ret_val to failure before every loop iteration. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Sasha Neftin Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_i225.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c index 1277f59885..003c060215 100644 --- a/drivers/net/intel/igc/base/igc_i225.c +++ b/drivers/net/intel/igc/base/igc_i225.c @@ -565,6 +565,7 @@ static s32 __igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, } for (i = 0; i < words; i++) { + ret_val = -IGC_ERR_NVM; eewr = ((offset + i) << IGC_NVM_RW_ADDR_SHIFT) | (data[i] << IGC_NVM_RW_REG_DATA) | IGC_NVM_RW_REG_START; From patchwork Thu Feb 6 16:08:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151052 X-Patchwork-Delegate: bruce.richardson@intel.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 C58D6461AD; Thu, 6 Feb 2025 17:09:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 915F940EE6; Thu, 6 Feb 2025 17:09:13 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 2F9F840E96 for ; Thu, 6 Feb 2025 17:09:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858150; x=1770394150; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=0OgAHM7c3u/VbAAu2K9MBr/5NL/6r7Lm/BI3AOjsFZU=; b=T9jPsElRuITdodi1Xpe41igTsBOYNCfyP0ahnsjSwF42Z+Tw8rMBNHGM D0P93ltzJSSmQ7mpjRf5GHG6EhgDnbFZ44ohK5JKm1BWyR1BW+Fd84vVo okf6FUZffPVzscHb/OdpuS7D3WjowDt4UkSDWMgp4oHf+taf+5o1tBno2 BQ7Nowxf7VQy5Xri7W+mfJclWnsaiX0DhVs/WaiC2J3CgnFTqxCKk5Vfj khSVG7aUSJfnPFdMYEaujkIBdyrWvtHncCZIi+jq3AKwBsn5og8dI4WZ9 uNHyHyTu4cVHgAQb1HXqjzc717EAI1bsc20bFd/QGgniqrx2v+wmXdBLi Q==; X-CSE-ConnectionGUID: dRETniApQKy+co3tX0/cnw== X-CSE-MsgGUID: hu5d2vJ3SrK8WW4w/47u0w== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860720" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860720" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:09 -0800 X-CSE-ConnectionGUID: kYnx0quMS0CIiRDhBaZ0Mg== X-CSE-MsgGUID: ADsJ+TqeThOibRnyCb4NoQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166690" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:08 -0800 From: Anatoly Burakov To: dev@dpdk.org, Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 06/24] net/igc/base: fix LTR for i225 Date: Thu, 6 Feb 2025 16:08:29 +0000 Message-ID: <6b671dbcfb6eb8aa802926d494c6808351ae1cae.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Sasha Neftin i225 specification recommends minus 1 microsecond from a value calculated for a LTR. Fix the calculation to match spec. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Sasha Neftin Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_i225.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c index 003c060215..e701d00f80 100644 --- a/drivers/net/intel/igc/base/igc_i225.c +++ b/drivers/net/intel/igc/base/igc_i225.c @@ -1071,7 +1071,9 @@ static s32 igc_set_ltr_i225(struct igc_hw *hw, bool link) scale_max = (ltr_max / 1024) < 1024 ? IGC_LTRMAXV_SCALE_1024 : IGC_LTRMAXV_SCALE_32768; ltr_min /= scale_min == IGC_LTRMINV_SCALE_1024 ? 1024 : 32768; + ltr_min -= 1; ltr_max /= scale_max == IGC_LTRMAXV_SCALE_1024 ? 1024 : 32768; + ltr_max -= 1; /* Only write the LTR thresholds if they differ from before. */ ltrv = IGC_READ_REG(hw, IGC_LTRMINV); From patchwork Thu Feb 6 16:08:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151053 X-Patchwork-Delegate: bruce.richardson@intel.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 A12A6461AD; Thu, 6 Feb 2025 17:09:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B044740F16; Thu, 6 Feb 2025 17:09:14 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 93B9A40ED3 for ; Thu, 6 Feb 2025 17:09:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858152; x=1770394152; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=cbemJGSjxAR7opooj1muviIvcEFbc5BdcMfvgzO2FaA=; b=AkhviqI0ZIg0Ix5vPpKuZ8vJLcCoPmNNKDC2WT9urZ89L4OGIRlNYBvG U8hYnvAvOoHLCuV9WxLhEC7Ll4CzWfBykIOOAdPTy6T2MFaVBHvqcJH16 zvtQEZGjgUaKqNCMwgwCMXBPsT8xNBrjuuQdIjEzUD48FhPkx7arGdP2w fsMFaDBOpk7A0Bb6tO+VdgiQNGFk22s7j8bfgPr7WZ7ImBl7XfxrgTdgu j0xBIC7A0ORmBPbbQY0ZnpgYlQR01zsexNL6uvQJSZH+MQiRtFGYysjGI lKRdTtJ0VvE1BNLNqQECtxnYU+2UtHKOjSesbkea1lHJkBVPe+yqTJFBh Q==; X-CSE-ConnectionGUID: 4RaR/7sJTRahy3BA4vwRPg== X-CSE-MsgGUID: hxug8uniQx25NYJWLR6XAg== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860721" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860721" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:10 -0800 X-CSE-ConnectionGUID: EOqzXE9SSN67BY4FDbAz0w== X-CSE-MsgGUID: y5xKRYVeQ7+RK5ytE8lozA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166723" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:09 -0800 From: Anatoly Burakov To: dev@dpdk.org, Ferruh Yigit , Alvin Zhang Subject: [PATCH v1 07/24] net/igc/base: fix typo in LTR calculation Date: Thu, 6 Feb 2025 16:08:30 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Dima Ruinskiy The LTR maximum value was incorrectly written using the scale from the LTR minimum value. This would cause incorrect values to be sent, in cases where the initial calculation lead to different min/max scales. Fix the typo to correctly calculate the LTR maximum value. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Dima Ruinskiy Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_i225.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c index e701d00f80..c7c2ec8ffe 100644 --- a/drivers/net/intel/igc/base/igc_i225.c +++ b/drivers/net/intel/igc/base/igc_i225.c @@ -1086,7 +1086,7 @@ static s32 igc_set_ltr_i225(struct igc_hw *hw, bool link) ltrv = IGC_READ_REG(hw, IGC_LTRMAXV); if (ltr_max != (ltrv & IGC_LTRMAXV_LTRV_MASK)) { ltrv = IGC_LTRMAXV_LSNP_REQ | ltr_max | - (scale_min << IGC_LTRMAXV_SCALE_SHIFT); + (scale_max << IGC_LTRMAXV_SCALE_SHIFT); IGC_WRITE_REG(hw, IGC_LTRMAXV, ltrv); } } From patchwork Thu Feb 6 16:08:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151054 X-Patchwork-Delegate: bruce.richardson@intel.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 344DA461AD; Thu, 6 Feb 2025 17:09:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3ECC41060; Thu, 6 Feb 2025 17:09:15 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id BCA4C40EDC for ; Thu, 6 Feb 2025 17:09:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858153; x=1770394153; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=eLTCxsCVs1b5VTG/aDOFFmVO4vQFPlMQUHDjvha0QGU=; b=T0EeWZMsHpwvhnmn3twkF5j6bcK/JxzQhs5rtdgbg4oKr4YusFcoSdzB MybuBJ3EYxclU+UPlgeRbtO9pMNHI2toRbqIPjK5hKAPBSaH2sbBbZlEi F30vs8yB27MHUriERa40IZBTbpqvipZD8fcs6qeYr1JFzjplutGguxy0M CaBSknu05EwGqK8bkfMoW9hjCBq7fKImeDg6s3/IXX4s0u/7yVxIZ+E1a No+QoY8ef2KEkvjpkiG7WOEduVLLzBbMVN8ZhJdpS6HuQst+zNMnntN2q HedmDWTL8ZyIr4xR13c5YKBnEih5h+9CgJNJe8xAEVQKtHcfY7mNB4R2t g==; X-CSE-ConnectionGUID: qZ3v2atjSZyARu9bVn+yxQ== X-CSE-MsgGUID: KgPvH+IvQHm27jcx4wzDHg== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860723" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860723" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:12 -0800 X-CSE-ConnectionGUID: bbWwVAxyS9GJ7L0Zen2Y2g== X-CSE-MsgGUID: 5EZsp4iKQ0ScZBTrqUmXNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166732" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:10 -0800 From: Anatoly Burakov To: dev@dpdk.org, Ferruh Yigit , Alvin Zhang Subject: [PATCH v1 08/24] net/igc/base: fix unused value Date: Thu, 6 Feb 2025 16:08:31 +0000 Message-ID: <107cc06be82c038a1d340d4b4ebfe52d2674e607.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Dima Ruinskiy Static analysis has reported that when there is no get link status callback function, the value set in the if condition is not used and gets overwritten in the "out" section of the code. Fix by not seting the variable. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Dima Ruinskiy Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_i225.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c index c7c2ec8ffe..23c68a3948 100644 --- a/drivers/net/intel/igc/base/igc_i225.c +++ b/drivers/net/intel/igc/base/igc_i225.c @@ -1114,10 +1114,8 @@ s32 igc_check_for_link_i225(struct igc_hw *hw) * changed. The get_link_status flag is set upon receiving * a Link Status Change or Rx Sequence Error interrupt. */ - if (!mac->get_link_status) { - ret_val = IGC_SUCCESS; + if (!mac->get_link_status) goto out; - } /* First we want to see if the MII Status Register reports * link. If so, then we want to get the current speed/duplex From patchwork Thu Feb 6 16:08:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151055 X-Patchwork-Delegate: bruce.richardson@intel.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 9CFA2461AD; Thu, 6 Feb 2025 17:09:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1809840FDE; Thu, 6 Feb 2025 17:09:17 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 1689A40EF1 for ; Thu, 6 Feb 2025 17:09:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858154; x=1770394154; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=wzonepda94RIkQrMNXeHca2qDdCmpyO4tEIhMhvSMUE=; b=nwsdqat67wT4B0+LC51P4P4PzKNniDUiRxMGB7UiofVdvNPpCk/CQroa P9/5bCdHCBCR+36YNQc5k+rv5DWljGJl66ToXPpnhPhIoyHAk+tsgm/yh XY22POtqDwNGOhXHB6r95rMA1/RxJHxo9ZN9jNiEhHLYUFFDS0PDs8Rty mvJxGdOlk8kMFq5WP5mWPbGfEOcxdNHB7BFGWVHPfKZ4iq7WZ9+a1sAgy 6aPtIVfclvZfb9KNZVqslYU/JOti8exVYrrT6fBzCO6zzqjvTxSLgrZ9B zFcX9BhraVmYY+t/APxF9KvVLO14VSKW4U1R0Cshd7/lgAwSP0mrwPJto g==; X-CSE-ConnectionGUID: oWFUdhWDR7K7gcB8sY9qbg== X-CSE-MsgGUID: o4ApCu7eS3iN1Ri48Efj0w== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860724" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860724" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:13 -0800 X-CSE-ConnectionGUID: NOe6OTurQq+GquAIR0mu5A== X-CSE-MsgGUID: 69aEmRhoQl6isn9SJYnYZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166739" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:12 -0800 From: Anatoly Burakov To: dev@dpdk.org, Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 09/24] net/igc/base: fix semaphore timeout value Date: Thu, 6 Feb 2025 16:08:32 +0000 Message-ID: <5c9fdb9467947a1f77eae339a33844907be9033d.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Pawel Malinowski According to datasheet software ownership of SWSM.SWESMBI bit should not exceed 100ms. Current implementation caused incorrect timeout counter values, where each iteration equals 50us delay. Because of that driver was allowed to wait for semaphore even for 1,5s. This might trigger DPC timeout. This implementation hardcodes value to 2000, which multiplied by 50us, gives 100ms of possible wait time. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Pawel Malinowski Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_defines.h | 1 + drivers/net/intel/igc/base/igc_i225.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/intel/igc/base/igc_defines.h b/drivers/net/intel/igc/base/igc_defines.h index 280570b157..3cb2f430c5 100644 --- a/drivers/net/intel/igc/base/igc_defines.h +++ b/drivers/net/intel/igc/base/igc_defines.h @@ -525,6 +525,7 @@ /* SW Semaphore Register */ #define IGC_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */ #define IGC_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */ +#define IGC_SWSM_TIMEOUT 2000 /* Driver Semaphore max timeout counter */ #define IGC_SWSM_DRV_LOAD 0x00000008 /* Driver Loaded Bit */ #define IGC_SWSM2_LOCK 0x00000002 /* Secondary driver semaphore bit */ diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c index 23c68a3948..7352ba240a 100644 --- a/drivers/net/intel/igc/base/igc_i225.c +++ b/drivers/net/intel/igc/base/igc_i225.c @@ -388,7 +388,7 @@ s32 igc_setup_copper_link_i225(struct igc_hw *hw) static s32 igc_get_hw_semaphore_i225(struct igc_hw *hw) { u32 swsm; - s32 timeout = hw->nvm.word_size + 1; + s32 timeout = IGC_SWSM_TIMEOUT; s32 i = 0; DEBUGFUNC("igc_get_hw_semaphore_i225"); From patchwork Thu Feb 6 16:08:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151056 X-Patchwork-Delegate: bruce.richardson@intel.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 B0F0B461AD; Thu, 6 Feb 2025 17:10:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64790410D4; Thu, 6 Feb 2025 17:09:18 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 7946140FB5 for ; Thu, 6 Feb 2025 17:09:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858156; x=1770394156; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/eXq3nBwZHgDAR+4l0uCTxC3ito6aXO3ibqbl/kr+8w=; b=ilh2rXbfvRr4p0kIUIF0wrtV2l7Ti7oQBpTf5K9bY8QHdLHCIjP+2bRU 2vu5sPaW97vAV43VjAAhjBFP7cykJo/7yyLEgMPKJNwqFSZVbkDAs83Qv OXJlNvn/U3E7ZaEKOlazFWCjs5gUSd/KY8fAN+Br8ekhzFJaXSsbiPAcY etmGsoMc+5Ub84AyVVeb8hYW4h8SakYqMgIw+p9TbIQEMWavF3yHenAlG l4CU4fiSBxx6E4+QdAdlqyp561Pg7pPAACerRgmrdrmZJsGF8dr88DI6S 17A8wlquJfEiaBKM4x5vjU85yOX6Lui0C6hfW39p4Cyw4oR7eHW+IkDhV A==; X-CSE-ConnectionGUID: sdKkv6FsT2CTsPiMIfUTnw== X-CSE-MsgGUID: k9nuhndeTQO/NS9fRTQMWw== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860727" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860727" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:15 -0800 X-CSE-ConnectionGUID: GMrW/QihTdiQeiakdDJNKA== X-CSE-MsgGUID: Bn7ieBq1R3ih1H0tB34emg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166742" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:13 -0800 From: Anatoly Burakov To: dev@dpdk.org, Thomas Monjalon , Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 10/24] net/igc/base: fix iterator type Date: Thu, 6 Feb 2025 16:08:33 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Amir Avivi Fix static analysis warning about comparison between types of incompatible width, which might lead to an infinite loop due to overflow. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Amir Avivi Signed-off-by: Anatoly Burakov --- .mailmap | 1 + drivers/net/intel/igc/base/igc_phy.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 3faff80f0e..23ec118ebc 100644 --- a/.mailmap +++ b/.mailmap @@ -84,6 +84,7 @@ Amaranath Somalapuram Amine Kherbouche Amin Tootoonchian Ami Sabo +Amir Avivi Amit Bernstein Amit Gupta Amit Prakash Shukla diff --git a/drivers/net/intel/igc/base/igc_phy.c b/drivers/net/intel/igc/base/igc_phy.c index 706f037f0e..dd56b994af 100644 --- a/drivers/net/intel/igc/base/igc_phy.c +++ b/drivers/net/intel/igc/base/igc_phy.c @@ -2366,7 +2366,8 @@ s32 igc_phy_has_link_generic(struct igc_hw *hw, u32 iterations, u32 usec_interval, bool *success) { s32 ret_val = IGC_SUCCESS; - u16 i, phy_status; + u16 phy_status; + u32 i; DEBUGFUNC("igc_phy_has_link_generic"); From patchwork Thu Feb 6 16:08:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151057 X-Patchwork-Delegate: bruce.richardson@intel.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 4FF13461AD; Thu, 6 Feb 2025 17:10:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89A7E410E6; Thu, 6 Feb 2025 17:09:19 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id E1C1140E41 for ; Thu, 6 Feb 2025 17:09:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858157; x=1770394157; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=NrkprsQHEdVfbV0axmDkPA4fiUYReRoVnCmO3vdLZh0=; b=DqK7GWJ2sxeAwx+Ud1vi6CoU5saXbONJN7iqGG39h0VVekV9qtMw5bff FWGjPlABfKlQuUxu6AI+NYfTLvXjE3Vzq9O/UQ3TBiqtm886wMnZozSGy FEBR+u9kcD4A9rPZy4r/tu8TmUhDAVhJ/ZLNkEGtjrJX1ZCbtPdols2oZ anSk5sylCwXeqT1uEyhSH/yOx+mwE/E0gyNhpAoKilAAYXTru2M6z1EcP Im/k+iMjv3gpoPWn8iztQmObE/AkUsR0KI2nmM5S+0GFxgegXrDYadxbJ y41WxWu2QdJETN+BDxNasq0ogMJqoWeA4tW58bauEMlZEOY6vvBLgRVYL A==; X-CSE-ConnectionGUID: fZLbokRGSTGsI98us7/JLA== X-CSE-MsgGUID: MBz6BufNRSqoG7LffeB8nA== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860733" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860733" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:16 -0800 X-CSE-ConnectionGUID: W0ondnBSQlWvZS2s8qqHow== X-CSE-MsgGUID: NTvdEjtuTUSl+XkOSBDIbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166751" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:15 -0800 From: Anatoly Burakov To: dev@dpdk.org, Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 11/24] net/igc/base: fix MAC addr hash bit shift Date: Thu, 6 Feb 2025 16:08:34 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Aleksandr Loktionov In e1000_hash_mc_addr_generic() the expression: "mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]" shift by more than 7 bits always yields zero, so hash becomes not so different. Add initialization with bit_shift = 1, and add a loop condition to ensure bit_shift will be always in [1..8] range. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Aleksandr Loktionov Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/igc/base/igc_mac.c b/drivers/net/intel/igc/base/igc_mac.c index 3cd6506e5e..c69f8ac73b 100644 --- a/drivers/net/intel/igc/base/igc_mac.c +++ b/drivers/net/intel/igc/base/igc_mac.c @@ -486,7 +486,7 @@ static int igc_rar_set_generic(struct igc_hw *hw, u8 *addr, u32 index) u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr) { u32 hash_value, hash_mask; - u8 bit_shift = 0; + u8 bit_shift = 1; DEBUGFUNC("igc_hash_mc_addr_generic"); @@ -496,7 +496,7 @@ u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr) /* For a mc_filter_type of 0, bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ - while (hash_mask >> bit_shift != 0xFF) + while (hash_mask >> bit_shift != 0xFF && bit_shift < 4) bit_shift++; /* The portion of the address that is used for the hash table From patchwork Thu Feb 6 16:08:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151058 X-Patchwork-Delegate: bruce.richardson@intel.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 46884461AD; Thu, 6 Feb 2025 17:10:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8141410EA; Thu, 6 Feb 2025 17:09:20 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 880C1410DF for ; Thu, 6 Feb 2025 17:09:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858159; x=1770394159; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=vJQt4keHron1t+4dgwI3U2e+HLPw2sLxU21rMIJbkss=; b=GL/84nqwIsQ1FCMbs9DaZiZos5UlFYPKj/DrMijnN4rHV7SVlaQZppLr SsF9+GOVhgeYv13fFFzBUR1pFcO+4nZbuMq85FpSzXDXy+onTeez33a+e LFSkrdEIQ/OCgLwgUSoneAxdePX9tdU4QmhArazVIdFdGZNpPOJHWkh89 sYGPjXCMenvPW+h7szsOlXqe9zj1FZJj0TvK7r3vOMysPbik8bzach4AT +LRrDCa/IfcXlPZtoSKqsfpkC7GlHHNAS8R4C1T7asx8P0BU+AAUiCRJe zprEios7QWlukvPEhOCLzsfMaWN/Qf8r1qdt3XbqpKG5mPD/59iAjzkt4 g==; X-CSE-ConnectionGUID: rTlCc1FLSsKcrCv9fO9Viw== X-CSE-MsgGUID: dRJ1Tz8jTS+0OCCk4/qsdg== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860744" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860744" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:18 -0800 X-CSE-ConnectionGUID: 6EpI5PsUSzOgDm6ATKzXIg== X-CSE-MsgGUID: B/Q9BWoARpmUeoiloN9Cug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166758" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:16 -0800 From: Anatoly Burakov To: dev@dpdk.org, Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 12/24] net/igc/base: fix data type in MAC hash Date: Thu, 6 Feb 2025 16:08:35 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Barbara Skobiej One of the bit shifts in MAC hash calculation triggers a static analysis warning about a potential overflow. Fix the data type to avoid this. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Barbara Skobiej Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_mac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/igc/base/igc_mac.c b/drivers/net/intel/igc/base/igc_mac.c index c69f8ac73b..cfb74a6443 100644 --- a/drivers/net/intel/igc/base/igc_mac.c +++ b/drivers/net/intel/igc/base/igc_mac.c @@ -539,8 +539,10 @@ u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr) break; } - hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | - (((u16)mc_addr[5]) << bit_shift))); + hash_value = (u32)mc_addr[4]; + hash_value = hash_value >> (8 - bit_shift); + hash_value |= (((u32)mc_addr[5]) << bit_shift); + hash_value &= hash_mask; return hash_value; } From patchwork Thu Feb 6 16:08:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151059 X-Patchwork-Delegate: bruce.richardson@intel.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 6E1F0461AD; Thu, 6 Feb 2025 17:10:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D05241133; Thu, 6 Feb 2025 17:09:23 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id D0F13410E7 for ; Thu, 6 Feb 2025 17:09:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858160; x=1770394160; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=vvZ+5HtEF+uD4XlFXoLgzuApT1pzq+WxXgOAmMCe020=; b=Pqszm1togteyihOA3X9dkhExSGPu5062fHI1O1Mbr/T7wfo4lXzmhkKA r1GoSjEASEi64Si/eRaGiGnVRzJQeuZIVrTiBetQoQz2PlLwyhK3cBHty Hj8wVNPXyl7koGvv9bt5aOdPEJ/BL0NmAUDGeXKPLGmCCygDLOz2SPOXY iqyGiidfuxzpfEFK+Xtf/a1tTDhHuu64AhPmIT4ejmgbBzh8PZxE90jBV 2+AROPj7idIfFHFXxzG7FUc2KgYteNZyopNPUmNoC646mmdzME4V+8pyo IChiIwzUUM+Qj5BFjle3HyOYjesFvoBGT+mNw2KaGH4wMIrGtondOWt8O A==; X-CSE-ConnectionGUID: z44R1iFVQMSCJSX+q8SlcQ== X-CSE-MsgGUID: 01ymyiChTO6Efq26+E7ekg== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860750" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860750" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:19 -0800 X-CSE-ConnectionGUID: Xkaz/dVqTGq8nwDadNcZCg== X-CSE-MsgGUID: on/wRSclSySkXgTHdN5Mbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166776" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:18 -0800 From: Anatoly Burakov To: dev@dpdk.org, Alvin Zhang , Ferruh Yigit Subject: [PATCH v1 13/24] net/igc/base: fix static analysis warning Date: Thu, 6 Feb 2025 16:08:36 +0000 Message-ID: <9cd682fbcac1564e48e4fcadea6e29f0ec84e073.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Przemyslaw Ciesielski There is a static analysis warning due to wrong data types being used for NVM read data shifts. Fix it via explicit type cast. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Cc: stable@dpdk.org Signed-off-by: Przemyslaw Ciesielski Signed-off-by: Anatoly Burakov --- drivers/net/intel/igc/base/igc_nvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/igc/base/igc_nvm.c b/drivers/net/intel/igc/base/igc_nvm.c index a7c901ab56..d37a3ffb0e 100644 --- a/drivers/net/intel/igc/base/igc_nvm.c +++ b/drivers/net/intel/igc/base/igc_nvm.c @@ -926,14 +926,14 @@ s32 igc_read_pba_num_generic(struct igc_hw *hw, u32 *pba_num) DEBUGOUT("NVM Not Supported\n"); return -IGC_NOT_IMPLEMENTED; } - *pba_num = (u32)(nvm_data << 16); + *pba_num = ((u32)nvm_data << 16); ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); if (ret_val) { DEBUGOUT("NVM Read Error\n"); return ret_val; } - *pba_num |= nvm_data; + *pba_num |= (u32)nvm_data; return IGC_SUCCESS; } From patchwork Thu Feb 6 16:08:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151060 X-Patchwork-Delegate: bruce.richardson@intel.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 73586461AD; Thu, 6 Feb 2025 17:10:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC73941140; Thu, 6 Feb 2025 17:09:24 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id C6883410E7 for ; Thu, 6 Feb 2025 17:09:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858161; x=1770394161; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=6C+/1VxdEgqUaWvwWlNJg5oshNpuBlSd7RfXOShcyUc=; b=eBFVEICSq5CamYOYjKp1/kwyLHFfObS21HOCTuyVtexr+iglMg4WJuzK sZIC5MjyAIiF/WdY6+YMqtQYmZvWyBY0eINFhVAwUUA9ezXP7HVvfjnS6 TecY1fFgyLGFq49LQQtKwCsMniRMQCNBYuqdYmOYbMtuc9G8iwQblZnDS wnrEG2C05SyfGZlCk5wDriSRksMkDwXQ8isI5+mP07rEvUGqx+V1fl520 Yr6Id+y5GJpxMmFzekynZzIUV8GaqXC00Fty2I3c7Nt38bNaTsGuaioV1 lkk0sv+nC86jTKBFzmg4eBwKa0/og4JiwSAaviQ4izgTJzVnd6EvdN1CO A==; X-CSE-ConnectionGUID: lreLahqkShuRZabjdYASFA== X-CSE-MsgGUID: 3cCY6z2kRuyL5AR5naALpQ== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860753" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860753" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:20 -0800 X-CSE-ConnectionGUID: 434hrBJ+RL68z2yOI+V6xQ== X-CSE-MsgGUID: HEn+bXJkSTCpzeIWMn1iFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166779" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:19 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 14/24] net/e1000/base: fix semaphore timeout value Date: Thu, 6 Feb 2025 16:08:37 +0000 Message-ID: <8d40b53efd125862541d424e4e5515a3edb857e2.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Pawel Malinowski According to datasheet software ownership of SWSM.SWESMBI bit should not exceed 100ms. Current implementation caused incorrect timeout counter values, where each iteration equals 50us delay. Because of that driver was allowed to wait for semaphore even for 1,5s. This might trigger DPC timeout. This implementation hardcodes value to 2000, which multiplied by 50us, gives 100ms of possible wait time. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Pawel Malinowski Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_defines.h | 1 + drivers/net/intel/e1000/base/e1000_mac.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/intel/e1000/base/e1000_defines.h b/drivers/net/intel/e1000/base/e1000_defines.h index 3fbb6c8ea4..97cc2797b2 100644 --- a/drivers/net/intel/e1000/base/e1000_defines.h +++ b/drivers/net/intel/e1000/base/e1000_defines.h @@ -504,6 +504,7 @@ /* SW Semaphore Register */ #define E1000_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */ #define E1000_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */ +#define E1000_SWSM_TIMEOUT 2000 /* Driver Semaphore max timeout counter */ #define E1000_SWSM_DRV_LOAD 0x00000008 /* Driver Loaded Bit */ #define E1000_SWSM2_LOCK 0x00000002 /* Secondary driver semaphore bit */ diff --git a/drivers/net/intel/e1000/base/e1000_mac.c b/drivers/net/intel/e1000/base/e1000_mac.c index d3b3a6bac9..cf0a9f21e1 100644 --- a/drivers/net/intel/e1000/base/e1000_mac.c +++ b/drivers/net/intel/e1000/base/e1000_mac.c @@ -1688,7 +1688,7 @@ s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw E1000_UNUSED s32 e1000_get_hw_semaphore_generic(struct e1000_hw *hw) { u32 swsm; - s32 timeout = hw->nvm.word_size + 1; + s32 timeout = E1000_SWSM_TIMEOUT; s32 i = 0; DEBUGFUNC("e1000_get_hw_semaphore_generic"); From patchwork Thu Feb 6 16:08:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151061 X-Patchwork-Delegate: bruce.richardson@intel.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 D80F6461AD; Thu, 6 Feb 2025 17:10:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3095B410FB; Thu, 6 Feb 2025 17:09:26 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 3B32E41104 for ; Thu, 6 Feb 2025 17:09:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858162; x=1770394162; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=vsyJij3QpZRs8gEuh7k4Xf4RINCQPQOvQ73rh5O54mA=; b=kczYvEtncAwT7cMDnKTs6h7GU8g3fYyTB4TZkiGwgzIbksqAUNLvN/Ig EQErp6Tos0gz6s1rkVV3T84eZrC4KqRBfGCaBzAGEs0UjrNUD8qUC4dGn ThxXSFZhu0Bpm7TQOP4DxNUpUX9t3n35O70m3n8DMowqTvTh0sZ6OOjYQ a8W08BN2gkbkWhFGqj5BDhi+W+TXCe60BVrHyU0WpihEjjoQ3SspHAv5E hsV/AEi6D4wxAHzdfMhFfJXgxOLJuK58/VHKFX3vS1e7x2d+i04/xFFOL UHNQlNiHaOM69l+ZJVungIfua4bicnn9eLrbeZ+Wg7yBe7YNGau3kEe9i g==; X-CSE-ConnectionGUID: E6Tdc050QEur0c+ziwJxlQ== X-CSE-MsgGUID: 9wj5H2G4RLi0MR/5sKNEIA== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860755" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860755" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:21 -0800 X-CSE-ConnectionGUID: +lYnkyhtQaKypKAfuOg9cQ== X-CSE-MsgGUID: G9zPQy8lTUCFnHRbN4o8dQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166782" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:20 -0800 From: Anatoly Burakov To: dev@dpdk.org, Markos Chandras Subject: [PATCH v1 15/24] net/e1000/base: correct mPHY access logic Date: Thu, 6 Feb 2025 16:08:38 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 The original code had incorrect indentation, and the fix was applied to follow the indentation, i.e. adding brackets making the indentation valid. However, the actual issue was incorrect indentation and not missing braces, so the fix was incorrect. This fix restores the original logic and corrects indentation. Fixes: d5e39d1ca460 ("net/e1000/base: fix build with gcc 6") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_phy.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/intel/e1000/base/e1000_phy.c b/drivers/net/intel/e1000/base/e1000_phy.c index 62d0be5080..208fb3f81b 100644 --- a/drivers/net/intel/e1000/base/e1000_phy.c +++ b/drivers/net/intel/e1000/base/e1000_phy.c @@ -4134,13 +4134,12 @@ s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data) *data = E1000_READ_REG(hw, E1000_MPHY_DATA); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, - E1000_MPHY_DIS_ACCESS); - } + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); return E1000_SUCCESS; } @@ -4200,13 +4199,12 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data, E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, - E1000_MPHY_DIS_ACCESS); - } + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); return E1000_SUCCESS; } From patchwork Thu Feb 6 16:08:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151062 X-Patchwork-Delegate: bruce.richardson@intel.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 8A894461AD; Thu, 6 Feb 2025 17:10:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EC4E41148; Thu, 6 Feb 2025 17:09:27 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 34F3E41104 for ; Thu, 6 Feb 2025 17:09:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858163; x=1770394163; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pfZqtRs8SYJeBQLP+WEPF8AfBUKZCbjrDIx0iGCc74g=; b=DzuOUO9DpYQPqrAEswE/9ugzfQh4ZCdOCG9oPPfJaJT0OFYA+WyZt55G rewKu8Ec1qMJRKzDvfhAIMvvUDEE1Kmza2+VdDe8XtvkrvkTBSBph2Kko eBxtRxCqgIsyMdXEQhEI3/QcD7unK3Sv2Oxz6N9Pkgh5nqnbqU0Ew+yez VGoeHxzVKjtyDxFxsGuns2b5xD9UsPY5iISm/qoOzMyWjQWzoloUPkY8X dxMLJv05ln+FJHcDXYmOHsjexBqG8ZI2tkPpXUiZty2kOAoskJZ0h4feL l2KElOTzJDFO/JiHUtJfDtJBGughlbDVx52Ut6fiFBMmMl8vDkln1N83N g==; X-CSE-ConnectionGUID: K86ESHukTz63NSXHQnLewQ== X-CSE-MsgGUID: C6qSnfGxSuuNuT3mZu3lxQ== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860759" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860759" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:23 -0800 X-CSE-ConnectionGUID: AkEDZJ0nRTm/qLEVKpTdDw== X-CSE-MsgGUID: 3cSiC8NKT1W9aroo1aVJvg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166793" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:22 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 16/24] net/e1000/base: fix iterator type Date: Thu, 6 Feb 2025 16:08:39 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Amir Avivi Fix static analysis warning about comparison between types of incompatible width, which might lead to an infinite loop due to overflow. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Amir Avivi Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/intel/e1000/base/e1000_phy.c b/drivers/net/intel/e1000/base/e1000_phy.c index 208fb3f81b..b4aba9e4e3 100644 --- a/drivers/net/intel/e1000/base/e1000_phy.c +++ b/drivers/net/intel/e1000/base/e1000_phy.c @@ -2333,7 +2333,8 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, u32 usec_interval, bool *success) { s32 ret_val = E1000_SUCCESS; - u16 i, phy_status; + u16 phy_status; + u32 i; DEBUGFUNC("e1000_phy_has_link_generic"); From patchwork Thu Feb 6 16:08:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151063 X-Patchwork-Delegate: bruce.richardson@intel.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 26216461AD; Thu, 6 Feb 2025 17:10:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F0FE411F3; Thu, 6 Feb 2025 17:09:28 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id CC35640E4F for ; Thu, 6 Feb 2025 17:09:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858165; x=1770394165; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=n0q/biA6YQw81NkXtYtg/XxtSwH375HIv4hjyB2Ur3o=; b=EvJNUEZTQ3nIfh6e66nJU8NlAZg+65RILgdWs1urfZvWFN5mA97E+0gb MK0YxTP/5rzYQghphjEBvnDE399lRthhzlnt64dc/E8TWxlDno7qWmMzL TmPDr0+qwiZ7j2vrcll74ecnMIMSAjCR6jgYz+AP1Kv5Aj5W6cDuk+5Y+ m50ZSBU34BcAzRZloaQJYShIllHkSjAyC7MdO5cy6h94DramIRCcueP4X txf/B3bThOALVJodwQemRY+mfoKvO0OGzsk0rFOgY0QeqoRLDCMwVDiAs VE9g2M7lJehh3Pb7Oz5xhe5pAdBPBDdpgR2uel3aOcZS/crvYqbctckaM Q==; X-CSE-ConnectionGUID: JBKEX6M/S5KlCV/x9EUFow== X-CSE-MsgGUID: 7t2ILYN4TsCq7K3XjTZmJw== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860761" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860761" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:24 -0800 X-CSE-ConnectionGUID: bJF5lF5HRQ+wKvP65KqoFA== X-CSE-MsgGUID: csq+AQsfRIWMBY0zLaQhdg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166796" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:23 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 17/24] net/e1000/base: fix MAC addr hash bit shift Date: Thu, 6 Feb 2025 16:08:40 +0000 Message-ID: <2875edd08be71a243a1a0666616ec806b85dbe66.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Aleksandr Loktionov In e1000_hash_mc_addr_generic() the expression: "mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]" shift by more than 7 bits always yields zero, so hash becomes not so different. Add initialization with bit_shift = 1, and add a loop condition to ensure bit_shift will be always in [1..8] range. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Aleksandr Loktionov Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_mac.c | 4 ++-- drivers/net/intel/e1000/base/e1000_vf.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/intel/e1000/base/e1000_mac.c b/drivers/net/intel/e1000/base/e1000_mac.c index cf0a9f21e1..2b8482e114 100644 --- a/drivers/net/intel/e1000/base/e1000_mac.c +++ b/drivers/net/intel/e1000/base/e1000_mac.c @@ -488,7 +488,7 @@ int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr) { u32 hash_value, hash_mask; - u8 bit_shift = 0; + u8 bit_shift = 1; DEBUGFUNC("e1000_hash_mc_addr_generic"); @@ -498,7 +498,7 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr) /* For a mc_filter_type of 0, bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ - while (hash_mask >> bit_shift != 0xFF) + while (hash_mask >> bit_shift != 0xFF && bit_shift < 4) bit_shift++; /* The portion of the address that is used for the hash table diff --git a/drivers/net/intel/e1000/base/e1000_vf.c b/drivers/net/intel/e1000/base/e1000_vf.c index 44ebe07ee4..3d0383fcbb 100644 --- a/drivers/net/intel/e1000/base/e1000_vf.c +++ b/drivers/net/intel/e1000/base/e1000_vf.c @@ -331,7 +331,7 @@ STATIC int e1000_rar_set_vf(struct e1000_hw *hw, u8 *addr, STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) { u32 hash_value, hash_mask; - u8 bit_shift = 0; + u8 bit_shift = 1; DEBUGFUNC("e1000_hash_mc_addr_generic"); @@ -342,7 +342,7 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) * The bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ - while (hash_mask >> bit_shift != 0xFF) + while (hash_mask >> bit_shift != 0xFF && bit_shift < 4) bit_shift++; hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | From patchwork Thu Feb 6 16:08:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151064 X-Patchwork-Delegate: bruce.richardson@intel.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 AE32B461AD; Thu, 6 Feb 2025 17:10:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C38BE415D7; Thu, 6 Feb 2025 17:09:29 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 8CD1540E4F for ; Thu, 6 Feb 2025 17:09:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858166; x=1770394166; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=zrMcnOuDGuCWe1CpOXR0MgiFSCNHOgk7185geHx3HRU=; b=SgxMz7oRIL4X2W06bot01JZpS5kGgoGBVND8GYiIak6NIgpsSCFAvGoX Zv0anUe6yhrG5TRKk+P7ktigERyickZwqNckD4ZhBBKobcS0XZY1Wsdjr FWSPX1xt7NUdEklGIOBCnKy7mYMk3dZxm55aTsiUl3Np4Mrkw7wZZ0F0W md1Wr2HYoeStcihSheXlqA8+giGM7H7oCs/DO3czLQFGV60QCHrDjXbD7 mZFiaXbCPgnSjcttzW2bw8JzgwQK1o6OxfjdeGGJble8vDf3z7rStuq3m iZh8gGE1CTqNn3yCzVe8z/OTJg8/XGfoi7y/PJFZ18InwAfnzocmJd+wU w==; X-CSE-ConnectionGUID: gKna+pP1SgKz9/+aqzXCRw== X-CSE-MsgGUID: cjFmMb55SSCcdgxdsFY9rQ== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860762" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860762" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:25 -0800 X-CSE-ConnectionGUID: 0sH4SsaQTWildFoKnCxBRQ== X-CSE-MsgGUID: XeqwHYuGSoq5Ls9w5L0qTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166805" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:24 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 18/24] net/e1000/base: fix data type in MAC hash Date: Thu, 6 Feb 2025 16:08:41 +0000 Message-ID: <6740ac1e585f684668ec5da5e1fd72d0f6619e0a.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Barbara Skobiej One of the bit shifts in MAC hash calculation triggers a static analysis warning about a potential overflow. Fix the data type to avoid this. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Barbara Skobiej Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_mac.c | 6 ++++-- drivers/net/intel/e1000/base/e1000_vf.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/intel/e1000/base/e1000_mac.c b/drivers/net/intel/e1000/base/e1000_mac.c index 2b8482e114..5bb77d9e09 100644 --- a/drivers/net/intel/e1000/base/e1000_mac.c +++ b/drivers/net/intel/e1000/base/e1000_mac.c @@ -541,8 +541,10 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr) break; } - hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | - (((u16) mc_addr[5]) << bit_shift))); + hash_value = (u32)mc_addr[4]; + hash_value = hash_value >> (8 - bit_shift); + hash_value |= (((u32)mc_addr[5]) << bit_shift); + hash_value &= hash_mask; return hash_value; } diff --git a/drivers/net/intel/e1000/base/e1000_vf.c b/drivers/net/intel/e1000/base/e1000_vf.c index 3d0383fcbb..fc30357c17 100644 --- a/drivers/net/intel/e1000/base/e1000_vf.c +++ b/drivers/net/intel/e1000/base/e1000_vf.c @@ -345,8 +345,10 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) while (hash_mask >> bit_shift != 0xFF && bit_shift < 4) bit_shift++; - hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | - (((u16) mc_addr[5]) << bit_shift))); + hash_value = (u32)mc_addr[4]; + hash_value = hash_value >> (8 - bit_shift); + hash_value |= (((u32)mc_addr[5]) << bit_shift); + hash_value &= hash_mask; return hash_value; } From patchwork Thu Feb 6 16:08:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151065 X-Patchwork-Delegate: bruce.richardson@intel.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 E51B0461AD; Thu, 6 Feb 2025 17:10:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F16C942708; Thu, 6 Feb 2025 17:09:30 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id F237540E4F for ; Thu, 6 Feb 2025 17:09:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858167; x=1770394167; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=4erTgB5p4VXsHcp7eMRINQ+iaHDxswtSmJxKL+Z6WP4=; b=awjfL896Dzg+IcI8FfGhoBrbOP9fMeLgqVbJjhvHwtZjk6EY8Aaq/vLK BKUOUrEtx+baMIhf+XRi/5IZhVsc1A6t/qBlj6E8YGBi60mZB+7AeEzy5 ag9PWVQJqNb/9Ixxz5G+r4TqyopVQy6z98aWJv/7IZ3xn8kSzUQfAQRpw RIAV2Ssp6cNtahWkGLF0kunLXsCr2pjQ0ivJrlII1idKUAiO8vVxnbzGD 5WFs4sEwh0LXG34PFokHPecCsUSqdua0y/YPAOKJW+b3gMclPau+PqJUl FqmgZ7TjlCbnqYy5g/N84VJAgk0zxjweanRdeqe4n5UqG0XTxMvix0rcw w==; X-CSE-ConnectionGUID: qbvk/jerTGi3zQ2khIaNxg== X-CSE-MsgGUID: 4tH+/oGSSBaZ7MtF18JsaQ== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860763" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860763" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:26 -0800 X-CSE-ConnectionGUID: J0B0xbu1SX+cXwaxbY31eg== X-CSE-MsgGUID: ftp+NbqlTZqFMaHf1BQNTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166816" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:25 -0800 From: Anatoly Burakov To: dev@dpdk.org, Thomas Monjalon Subject: [PATCH v1 19/24] net/e1000/base: fix uninitialized variable usage Date: Thu, 6 Feb 2025 16:08:42 +0000 Message-ID: <70f58a17a0fbec2fcd22c4e94802c7f036a7effe.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Jakub Buchocki Static analysis has detected potential usage of uninitialized values inside the array. Fix the warning by initializing array. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Jakub Buchocki Signed-off-by: Anatoly Burakov --- .mailmap | 1 + drivers/net/intel/e1000/base/e1000_vf.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 23ec118ebc..8ffd20cba5 100644 --- a/.mailmap +++ b/.mailmap @@ -619,6 +619,7 @@ Jacek Piasecki Jacek Siuda Jack Bond-Preston Jacob Keller +Jakub Buchocki Jakub Chylkowski Jakub Grajciar Jakub Neruda diff --git a/drivers/net/intel/e1000/base/e1000_vf.c b/drivers/net/intel/e1000/base/e1000_vf.c index fc30357c17..472b921b6f 100644 --- a/drivers/net/intel/e1000/base/e1000_vf.c +++ b/drivers/net/intel/e1000/base/e1000_vf.c @@ -376,7 +376,7 @@ STATIC void e1000_write_msg_read_ack(struct e1000_hw *hw, void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count) { - u32 msgbuf[E1000_VFMAILBOX_SIZE]; + u32 msgbuf[E1000_VFMAILBOX_SIZE] = {0}; u16 *hash_list = (u16 *)&msgbuf[1]; u32 hash_value; u32 i; From patchwork Thu Feb 6 16:08:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151066 X-Patchwork-Delegate: bruce.richardson@intel.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 EC1DC461AD; Thu, 6 Feb 2025 17:11:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D41F04270A; Thu, 6 Feb 2025 17:09:32 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 05B454114B for ; Thu, 6 Feb 2025 17:09:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858168; x=1770394168; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=gQS6Iqaj0UfiuRARmBKdPVYViEmDt6BK34rvepludkc=; b=TvJdiyM0/vP8P2AEH+R++DhbMgdmddGrNFZ6edDcU7/alrlBRX8UitFw 5KjYssaZhPpvjj4jgW8PSpZ9a0DSISuYP977YkO2slbatZ5Tr9FrQ5naB a4i6CFbnNVk9RNP82R73Pu6ZEn1fckt4BQKcNy/PVHQ3JbzGUEqlPArb5 +l0T4Ez/v+VO2H9nB9dwNyFXF83oe8oOG//Uwk2ujUmcurILy8PpbzgQb 6w60H4UULodl8OHmpwn5eixMD+F5KZl5MtHzkDCz0qKrW3qDgw5qWo5Lw Jtp/RZLTUUUPQHyjrC5H4f7GbgmSC3vp45G9Xo8TfexdEF97WljSaNhCJ Q==; X-CSE-ConnectionGUID: x91tzo9uShK1XT0hY6osBA== X-CSE-MsgGUID: Ld+O6Qb7QqShNVBkdgQS5A== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860766" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860766" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:27 -0800 X-CSE-ConnectionGUID: DmaIQB2URHGYM4Me2jCA3A== X-CSE-MsgGUID: kDdVHS6TTBqvQKr55VWahQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166819" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:27 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 20/24] net/e1000/base: fix static analysis warning Date: Thu, 6 Feb 2025 16:08:43 +0000 Message-ID: <890d3900ac086b69c94ae5c6f5ec4c099b671cef.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Przemyslaw Ciesielski There is a static analysis warning due to wrong data types being used for SW/FW semaphore masking. Fix it via explicit type cast. Fixes: 5a32a257f957 ("e1000: more NICs in base driver") Cc: stable@dpdk.org Signed-off-by: Przemyslaw Ciesielski Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_80003es2lan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/intel/e1000/base/e1000_80003es2lan.c b/drivers/net/intel/e1000/base/e1000_80003es2lan.c index 243bc6fe3e..3516ff2246 100644 --- a/drivers/net/intel/e1000/base/e1000_80003es2lan.c +++ b/drivers/net/intel/e1000/base/e1000_80003es2lan.c @@ -426,7 +426,7 @@ STATIC void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask) ; /* Empty */ swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); - swfw_sync &= ~mask; + swfw_sync &= ~(u32)mask; E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); e1000_put_hw_semaphore_generic(hw); From patchwork Thu Feb 6 16:08:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151067 X-Patchwork-Delegate: bruce.richardson@intel.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 19CDF461AD; Thu, 6 Feb 2025 17:11:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9869A42792; Thu, 6 Feb 2025 17:09:34 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 096CC410E8 for ; Thu, 6 Feb 2025 17:09:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858169; x=1770394169; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=DZ4Cc5cBTVjxRA/SBLK0H0z704obdprj+pf92o8zV8w=; b=Is2GY+Z8M7F+07Arkd0VnHzjlrf+6KJnRxxwA9kCR/M7f1P6mCbwRg/9 DdO65gznZOS2N9OpJjrBQ+oczVW+8tSoJQldi+p4t48W1gYBGFOR1q30U E3N15auwBwf7lLahLt0uxQi6UoiKt4rWU13+E4NYDJOnJxS8SnmGbb59c vk6Qo4uuXQUT3o278E2VwuDBsN7tyK4jWNr1/yG8wmMhWU2jrkEnrPsL2 UERO3RXLK/Eee0YHv3lwsm4vcGkH3xUNPEJU0sdq8xTseRgJkRhYjpe5m GgQCOoPrI+Cp08GYwQRZF1kXuqaTWGEyMX64DWflX5h2Hj6RUbCRxa9Qz A==; X-CSE-ConnectionGUID: I5VB108uTWyZRMTkXwuVCw== X-CSE-MsgGUID: CMeEoe1BRXWTVwuf4fNPCQ== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860770" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860770" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:28 -0800 X-CSE-ConnectionGUID: nTQTmBPxTqatOTb93zPulw== X-CSE-MsgGUID: t/6LcX3QTlGZtHOgYHLQBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166823" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:28 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 21/24] net/e1000/base: fix static analysis warning Date: Thu, 6 Feb 2025 16:08:44 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Przemyslaw Ciesielski There is a static analysis warning due to wrong data types being used for NVM read data shifts. Fix it via explicit type cast. Fixes: 38db3f7f50bd ("e1000: update base driver") Cc: stable@dpdk.org Signed-off-by: Przemyslaw Ciesielski Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_nvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/e1000/base/e1000_nvm.c b/drivers/net/intel/e1000/base/e1000_nvm.c index 430fecaf6d..d171bea649 100644 --- a/drivers/net/intel/e1000/base/e1000_nvm.c +++ b/drivers/net/intel/e1000/base/e1000_nvm.c @@ -935,14 +935,14 @@ s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num) DEBUGOUT("NVM Not Supported\n"); return -E1000_NOT_IMPLEMENTED; } - *pba_num = (u32)(nvm_data << 16); + *pba_num = ((u32)nvm_data << 16); ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); if (ret_val) { DEBUGOUT("NVM Read Error\n"); return ret_val; } - *pba_num |= nvm_data; + *pba_num |= (u32)nvm_data; return E1000_SUCCESS; } From patchwork Thu Feb 6 16:08:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151068 X-Patchwork-Delegate: bruce.richardson@intel.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 81134461AD; Thu, 6 Feb 2025 17:11:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E15A142799; Thu, 6 Feb 2025 17:09:35 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 392F64161A for ; Thu, 6 Feb 2025 17:09:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858170; x=1770394170; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=9gmzmfhLD1qwaxcpoGqZMrV7UNULtVQ4ryn4AkUmWY0=; b=aL1OV34nXqPwnNuf2IsPYBjBbxcM9AkWWCfZMtJlEjBzCRfGyNbp0jkd u1iTY8LTOhbV5mCrXHe1d1d/6WmdXPCFg8DXVInvcN/f7fVc3k0Be1UxK iLSNMtGVngSbdpM/Rn+5Z2e+tIAo7EGiMhL7+kl4cu5h2LWUFzfIVTwUU VCgLcj+y8NJvildGQv/XtBlD4f+ir33ze6lJU7hInxyH+gu+XyXgICAhL ibB/i7kibgQ4bjD0qjEPQOpIDe4MjLSGu3wPEj7+cXpUEBtkd8dohelI8 BNKzkeDrTaQbztIcWjBic6ilM3v3Uej55BbIaVlwv5GQMzFzTztRhyWqJ Q==; X-CSE-ConnectionGUID: wYnPzqyMSCqgwU4c5FtvnA== X-CSE-MsgGUID: iP5+Al/kSh+Dgw2cEXtC5Q== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860771" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860771" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:30 -0800 X-CSE-ConnectionGUID: fI1gT463SZ2lBuz07k5JVQ== X-CSE-MsgGUID: +VDgYl/tS+mGKtsSa/jJNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166830" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:29 -0800 From: Anatoly Burakov To: dev@dpdk.org Subject: [PATCH v1 22/24] net/e1000/base: fix reset for 82580 Date: Thu, 6 Feb 2025 16:08:45 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Barbara Skobiej Fix setting device reset status bit in e1000_reset_hw_82580() function for 82580 by first reading the register value, and then setting the device reset bit. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Barbara Skobiej Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_82575.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/e1000/base/e1000_82575.c b/drivers/net/intel/e1000/base/e1000_82575.c index 53900cf8f1..948c80f2fa 100644 --- a/drivers/net/intel/e1000/base/e1000_82575.c +++ b/drivers/net/intel/e1000/base/e1000_82575.c @@ -2280,7 +2280,7 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw) s32 ret_val = E1000_SUCCESS; /* BH SW mailbox bit in SW_FW_SYNC */ u16 swmbsw_mask = E1000_SW_SYNCH_MB; - u32 ctrl; + u32 ctrl, status; bool global_device_reset = hw->dev_spec._82575.global_device_reset; DEBUGFUNC("e1000_reset_hw_82580"); @@ -2345,7 +2345,8 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw) } /* clear global device reset status bit */ - E1000_WRITE_REG(hw, E1000_STATUS, E1000_STAT_DEV_RST_SET); + status = E1000_READ_REG(hw, E1000_STATUS); + E1000_WRITE_REG(hw, E1000_STATUS, status | E1000_STAT_DEV_RST_SET); /* Clear any pending interrupt events. */ E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); From patchwork Thu Feb 6 16:08:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151069 X-Patchwork-Delegate: bruce.richardson@intel.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 1DD5C461AD; Thu, 6 Feb 2025 17:11:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18BF64279A; Thu, 6 Feb 2025 17:09:37 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 022474270A for ; Thu, 6 Feb 2025 17:09:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858172; x=1770394172; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=deNV6SRIoMUqOUXo18TTd1kufZFjXN7Qia89G3wVBf8=; b=GkfKBQvpz+0Z+QfNmgfu6gSxNQepcuERCGMLa8Zh49sJQlsOC3FmFHEP qum1En99ocOrQaQfk64Bsk8D1g8rLW0gu1L2PTbqhl/cW2S6+3YdlRmy6 9p/H3QpsbJ+qJvC1exsL/1BroZeZEQChpFsBtkvI2sAZ6ymHNr0Umelj9 v51h/yXJJLwaugiEYa60FtPbTEGq20hoMP4rTQanSH3shsNWXaYvOQXX0 VA9ituHAVxsdSvYmTetDbV2nPPItbnIZwAFRH/C3/cMvSv2ufQButtitz +JQeoWBOO45KX8iWrbnx2x47hPqYjnsYI/arJypQxcsOh+2/+mLSixUuy w==; X-CSE-ConnectionGUID: WbY90a6bT4+xJaglamb1Ug== X-CSE-MsgGUID: HGMCT30WTSyb6w2RfGrPPg== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860773" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860773" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:31 -0800 X-CSE-ConnectionGUID: 1Owe/fL0Sg6tz/SUgg1WwQ== X-CSE-MsgGUID: Y2rTA3RiQhmNdc+y6cz/Ug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166840" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:30 -0800 From: Anatoly Burakov To: dev@dpdk.org, Wenzhuo Lu Subject: [PATCH v1 23/24] net/e1000/base: fix unchecked return Date: Thu, 6 Feb 2025 16:08:46 +0000 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Dima Ruinskiy Static analysis has detected a write that is not checked for errors, leading to ignored error return value. Add a check. Fixes: edcdb3c5f71b ("e1000/base: fix link flap on 82579") Cc: stable@dpdk.org Signed-off-by: Dima Ruinskiy Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/intel/e1000/base/e1000_ich8lan.c b/drivers/net/intel/e1000/base/e1000_ich8lan.c index 14f86b7bdc..f5f91a148c 100644 --- a/drivers/net/intel/e1000/base/e1000_ich8lan.c +++ b/drivers/net/intel/e1000/base/e1000_ich8lan.c @@ -962,6 +962,8 @@ s32 e1000_set_eee_pchlan(struct e1000_hw *hw) data &= ~I82579_LPI_100_PLL_SHUT; ret_val = e1000_write_emi_reg_locked(hw, I82579_LPI_PLL_SHUT, data); + if (ret_val) + goto release; } /* R/Clr IEEE MMD 3.1 bits 11:10 - Tx/Rx LPI Received */ From patchwork Thu Feb 6 16:08:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 151070 X-Patchwork-Delegate: bruce.richardson@intel.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 CC197461AD; Thu, 6 Feb 2025 17:11:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 425E34279D; Thu, 6 Feb 2025 17:09:38 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 71E9B4275B for ; Thu, 6 Feb 2025 17:09:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738858174; x=1770394174; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=4nKZdbDC+mWV9Tw9MJ803PVlnohXWQZS85kI8MjQJGY=; b=UM7Jp/4Vy8a2wgMXxZAwfP00zgvaEH3jFroKkWJm5PJbmZXD+xIP3wTw 9OJwdNKuxbhgJR1e2tMg77dcXBYmr0vwwLNc5SNDfVsVIFg7FnMLZIW4a lPwaGCaZ+UJyw/i2wYumoh3x5UJFMjkWrh8oihb4yYHatA5m/yLdcu7P0 Njhp9rSjzoeSjQpte+hDjNEFF+c/lNyG4sTwNWXdLJPL63qGBATTTeqLH T5nbEMzJ+smZUoxgeZwvYjyiqPeQpB3wGd3VFF1tGFRDcbjwF0gsQ1wzH q1YEKmh209FbGhBOyMEsD7KxuqUcX+wgJJrMgmbvRLo2tnVMFjT1pexQV g==; X-CSE-ConnectionGUID: g1Yg3Tj3QsiLCy+IE8C57Q== X-CSE-MsgGUID: xZMxULbgQaCh6X/2M0lYDA== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50860777" X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="50860777" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2025 08:09:33 -0800 X-CSE-ConnectionGUID: DMQI9He/R2G7HQPrMGmL3Q== X-CSE-MsgGUID: yFtqJG9RSeuizza/Tcgugw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,264,1732608000"; d="scan'208";a="111166850" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa007.fm.intel.com with ESMTP; 06 Feb 2025 08:09:31 -0800 From: Anatoly Burakov To: dev@dpdk.org, Sasha Neftin , Jeff Kirsher , Wei Zhao , Guinan Sun Subject: [PATCH v1 24/24] net/e1000/base: skip MANC check for 82575 Date: Thu, 6 Feb 2025 16:08:47 +0000 Message-ID: <63259ddf726a037a6e9efb484b3ec53a8aa340d5.1738858026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: 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 From: Carolyn Wyborny On 82575, driver is not supposed to check if managegement control is enabled, and flush the Rx FIFO unconditionally. Fixes: 44dddd14059f ("net/e1000/base: remove duplicated codes") Cc: stable@dpdk.org Signed-off-by: Carolyn Wyborny Signed-off-by: Anatoly Burakov --- drivers/net/intel/e1000/base/e1000_base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/intel/e1000/base/e1000_base.c b/drivers/net/intel/e1000/base/e1000_base.c index 3ec32e7240..e10bc6907a 100644 --- a/drivers/net/intel/e1000/base/e1000_base.c +++ b/drivers/net/intel/e1000/base/e1000_base.c @@ -132,7 +132,8 @@ void e1000_rx_fifo_flush_base(struct e1000_hw *hw) rfctl |= E1000_RFCTL_IPV6_EX_DIS; E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - if (!(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) + if (hw->mac.type != e1000_82575 || + !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) return; /* Disable all Rx queues */