From patchwork Thu Apr 17 08:56:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 14055132 X-Patchwork-Delegate: kuba@kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA57D222590; Thu, 17 Apr 2025 08:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744880283; cv=none; b=TNu/exqXxJqR2kP3XcxvAVuDLFc9MglpuNhNFRGcAcbA21KCqtCg9+66eveJ84+uMyk8c+gDbVymp59pS42KBwPBina/cQoZenChpH+nN/NCdHs74LlmJsXkb1lbi/swb2YyLBXl5SFU8ewBOV3A3P08EkNMWNIAZIdizVU/baQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744880283; c=relaxed/simple; bh=zIn0km++2bJjxdtNcvt3p0b/gp8d2fo9+lm8abcL1Kk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y/Yazc1eoHXzct3SL3OCM9SUUvBUWRky2hwAsYmwCsKsToo6uKIP6tBjPa31CvXk4fXWX3lvGs/Eng0lUMxsbBPE0sugpZW4kqOgOBszh5TKZMRXDurW03W8/Es2BSlnmJvEQ/pX0GaX6yvWj+bGDU0mm/lE3kY6m8mwfc8rajI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=Q8l7BsbB; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="Q8l7BsbB" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 53H8vetsF616119, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1744880260; bh=zIn0km++2bJjxdtNcvt3p0b/gp8d2fo9+lm8abcL1Kk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=Q8l7BsbB3R3dNnPkIZFj1FYcGxtWEdQb+Q2oF8tby54mbj1om/q+aKIgHNRRGPx1G DOcxJJQekq9t4+vqVUy+j6zbLF+pwFcUvD/BGPs4ITSQbZhw5yvzf5myF+q/Up+yaa v4FpQIYFlFbuFG92O4tIDBnHngTq7xJH2Ibc5P1jXZUGlvKMORE4AdbkLwSG9fzEF3 0bQ5ybIJxP1WhRx590J+IPEgygMT5xt4bl86S7UsHDi7qFm/hbmo0BCWCHWhsG2SZ7 aEAnakavejXp3UpdLEhhbONoLOYv54PPlXl4BnBcODhw5CYVN+hj/xV0+G051PL6xO 6pp1Esw9sJ8kg== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 53H8vetsF616119 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Apr 2025 16:57:40 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 17 Apr 2025 16:57:40 +0800 Received: from RTDOMAIN (172.21.210.70) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 17 Apr 2025 16:57:39 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai , "kernel test robot" Subject: [PATCH net v3 1/3] rtase: Modify the condition used to detect overflow in rtase_calc_time_mitigation Date: Thu, 17 Apr 2025 16:56:57 +0800 Message-ID: <20250417085659.5740-2-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250417085659.5740-1-justinlai0215@realtek.com> References: <20250417085659.5740-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Fix the following compile error reported by the kernel test robot by modifying the condition used to detect overflow in rtase_calc_time_mitigation. In file included from include/linux/mdio.h:10:0, from drivers/net/ethernet/realtek/rtase/rtase_main.c:58: In function 'u16_encode_bits', inlined from 'rtase_calc_time_mitigation.constprop' at drivers/net/ ethernet/realtek/rtase/rtase_main.c:1915:13, inlined from 'rtase_init_software_variable.isra.41' at drivers/net/ ethernet/realtek/rtase/rtase_main.c:1961:13, inlined from 'rtase_init_one' at drivers/net/ethernet/realtek/ rtase/rtase_main.c:2111:2: >> include/linux/bitfield.h:178:3: error: call to '__field_overflow' declared with attribute error: value doesn't fit into mask __field_overflow(); \ ^~~~~~~~~~~~~~~~~~ include/linux/bitfield.h:198:2: note: in expansion of macro '____MAKE_OP' ____MAKE_OP(u##size,u##size,,) ^~~~~~~~~~~ include/linux/bitfield.h:200:1: note: in expansion of macro '__MAKE_OP' __MAKE_OP(16) ^~~~~~~~~ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202503182158.nkAlbJWX-lkp@intel.com/ Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module") Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 2aacc1996796..55b8d3666153 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1925,8 +1925,8 @@ static u16 rtase_calc_time_mitigation(u32 time_us) time_us = min_t(int, time_us, RTASE_MITI_MAX_TIME); - msb = fls(time_us); - if (msb >= RTASE_MITI_COUNT_BIT_NUM) { + if (time_us > RTASE_MITI_TIME_COUNT_MASK) { + msb = fls(time_us); time_unit = msb - RTASE_MITI_COUNT_BIT_NUM; time_count = time_us >> (msb - RTASE_MITI_COUNT_BIT_NUM); } else { From patchwork Thu Apr 17 08:56:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 14055133 X-Patchwork-Delegate: kuba@kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A4AB1E32C6; Thu, 17 Apr 2025 08:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744880305; cv=none; b=oAShGPokXU4YpMlm2pzY6LxdIdC9cSvvhWvLHYxx8fB/wF5aEILEhdKsGiUYb6UKWP+pfPKEBNw79L4sGACfUWQPgDhc5wqPa6v834uUmZoPWzgGpGui0bd1mOeVNuNfPp8SgirDmbi2YQl9QuWP00LMTUtd3UE02dEB2yKGVJA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744880305; c=relaxed/simple; bh=D4eEpj/ycymL1dKwAiypTkZdxNwjEWty1bTxfH4ci8o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=L9vsg/p2TojWIk2qQP6t2WuyCawHSpyLZB6zcW/w//4IHaIOfAvMCJCwAYaK2LXC4+rJMUu7tJoG7rZBRSqTJzTHNEnqqejiFV8aIOviGB2uEXds24pjDTYyh0LbbG5wCDwTJJEhV9VYV83UiYNHitnvaw+UMSiTrhi9Sgs56d0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=mV2t4W5l; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="mV2t4W5l" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 53H8w3gV5617659, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1744880283; bh=D4eEpj/ycymL1dKwAiypTkZdxNwjEWty1bTxfH4ci8o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=mV2t4W5lS2/AX8hvkT04l5I0xOB7x886rAX6j953w6kEWoOByudPDZZDt7cAYPKzr nUowBOi6LATprOSZOlekkwdjhO9rSjg9btSjYH7LhhZQe6m5hGy+21evlULT6H+iNM gAZ4gv5YFYzF3ypD+DwOIiTKyuJSALD2IkQfzJeyyr/PcckF5WcE5yPrztGoNzwixG EpKIea3WDtzWR/Ac9gAa97omDIE7nsy82yNXlLyfUBu0BxZQ4ADPsEpSzaXontJRFl t3+ME03yfF0pqEg+e/WKLMc8Ns56Ks4TtHHND7lf+PFT6wmnyZ0TovQfEmHtscgvVa RIGgO0XQ4Hecw== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 53H8w3gV5617659 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Apr 2025 16:58:03 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 17 Apr 2025 16:58:04 +0800 Received: from RTDOMAIN (172.21.210.70) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 17 Apr 2025 16:58:03 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai , "kernel test robot" Subject: [PATCH net v3 2/3] rtase: Increase the size of ivec->name Date: Thu, 17 Apr 2025 16:56:58 +0800 Message-ID: <20250417085659.5740-3-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250417085659.5740-1-justinlai0215@realtek.com> References: <20250417085659.5740-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Fix the following compile warning reported by the kernel test robot by increasing the size of ivec->name. drivers/net/ethernet/realtek/rtase/rtase_main.c: In function 'rtase_open': >> drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:52: warning: '%i' directive output may be truncated writing between 1 and 10 bytes into a region of size between 7 and 22 [-Wformat-truncation=] snprintf(ivec->name, sizeof(ivec->name), "%s_int%i", ^~ drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:45: note: directive argument in the range [0, 2147483647] snprintf(ivec->name, sizeof(ivec->name), "%s_int%i", ^~~~~~~~~~ drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:4: note: 'snprintf' output between 6 and 30 bytes into a destination of size 26 snprintf(ivec->name, sizeof(ivec->name), "%s_int%i", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tp->dev->name, i); ~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202503182158.nkAlbJWX-lkp@intel.com/ Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module") Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase.h b/drivers/net/ethernet/realtek/rtase/rtase.h index 2bbfcad613ab..1e63b5826da1 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase.h +++ b/drivers/net/ethernet/realtek/rtase/rtase.h @@ -259,7 +259,7 @@ union rtase_rx_desc { #define RTASE_VLAN_TAG_MASK GENMASK(15, 0) #define RTASE_RX_PKT_SIZE_MASK GENMASK(13, 0) -#define RTASE_IVEC_NAME_SIZE (IFNAMSIZ + 10) +#define RTASE_IVEC_NAME_SIZE (IFNAMSIZ + 14) struct rtase_int_vector { struct rtase_private *tp; From patchwork Thu Apr 17 08:56:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 14055134 X-Patchwork-Delegate: kuba@kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F49F21ABDB; Thu, 17 Apr 2025 08:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744880329; cv=none; b=NHZYSjvYEaDdLcVFKqo/i5H+U+ZM4tPN0jqAs8RueqI4dEoGjuZdQCdLoZigyEucvs3QWwupRJDLfznp1oEEFsnW/7+0RI4mghaf8cuQ5P/LpQzFtbYSV0dfAIETug4LSVy9DKJE0uEnzk/1vGxv7AKeb0XoCAE28aaokHEXQHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744880329; c=relaxed/simple; bh=4FJsdCfn91/lkxy2lUFnPEV522v97mbzTnQHWoCV0h8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ICMNmVtH9QVotPcR3ynoNbiRtMh9927z7asbLNgijC5rcR8R3WSx7CoXv+IskT8M90c3p+AvflAKCPVJtsAdRJXcHjJqiphflgQgOS988D3NcB9uvyTwTPOuioY0WLHXOUNnAmtkEZHGA1+zv5zEx4R9xtmLwGUSyGOkOXNHWdM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=l8zZgzXB; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="l8zZgzXB" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 53H8wWocD618370, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1744880312; bh=4FJsdCfn91/lkxy2lUFnPEV522v97mbzTnQHWoCV0h8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=l8zZgzXBB6AEiLr0+M2YuGHwO2fp5lqPO38IgbnzZoapjtXpcXxPSFoSvgS5T7XH5 wi8aWjLF2yd/58BOhfVYc7hD/FtMhVEH1O2djMzTVBbCIlveYgu0VuELfg8ZyPTzem 8xVKjuSxA95p9Rrd6W2ihjx6OAah4/ZcEPEUXWQSLf/EXN1tcIXyYZZHtaQxnVWOAn UbyE0LSoQNZaELoAxK2m8Q6owMuA0kvM/EvE/euFAn6BVrmyjZ+GAPnRi/A82YyIFB lH7O3ob2uV0YgXLiiaFLS2SDASr4kcWCV1sxVcSzmERQ76pVITBI+tMyZm9eW8gap/ gnPNUGHHExSWQ== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 53H8wWocD618370 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Apr 2025 16:58:32 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 17 Apr 2025 16:58:33 +0800 Received: from RTDOMAIN (172.21.210.70) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 17 Apr 2025 16:58:32 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai , Andrew Lunn Subject: [PATCH net v3 3/3] rtase: Fix a type error in min_t Date: Thu, 17 Apr 2025 16:56:59 +0800 Message-ID: <20250417085659.5740-4-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250417085659.5740-1-justinlai0215@realtek.com> References: <20250417085659.5740-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Fix a type error in min_t. Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module") Signed-off-by: Justin Lai Reviewed-by: Andrew Lunn --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 55b8d3666153..bc856fb3d6f3 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1923,7 +1923,7 @@ static u16 rtase_calc_time_mitigation(u32 time_us) u8 msb, time_count, time_unit; u16 int_miti; - time_us = min_t(int, time_us, RTASE_MITI_MAX_TIME); + time_us = min_t(u32, time_us, RTASE_MITI_MAX_TIME); if (time_us > RTASE_MITI_TIME_COUNT_MASK) { msb = fls(time_us); @@ -1945,7 +1945,7 @@ static u16 rtase_calc_packet_num_mitigation(u16 pkt_num) u8 msb, pkt_num_count, pkt_num_unit; u16 int_miti; - pkt_num = min_t(int, pkt_num, RTASE_MITI_MAX_PKT_NUM); + pkt_num = min_t(u16, pkt_num, RTASE_MITI_MAX_PKT_NUM); if (pkt_num > 60) { pkt_num_unit = RTASE_MITI_MAX_PKT_NUM_IDX;