From patchwork Tue Jun 18 02:56:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heng Qi X-Patchwork-Id: 13701712 X-Patchwork-Delegate: kuba@kernel.org Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B4C919ADBE; Tue, 18 Jun 2024 02:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718679412; cv=none; b=me2XtYjcseBt0JvY+lKbloJZpPImgbFofQ1RjM8l2Bjet650PzWPpfb41Fmby1ps60hcXf3MyP6zBDZnzvrnPFYIsh8+Z4B4ZPaRPeFRPO0tdOaJkvkerYa5gQFEEQcTd6H+ho+h8Z6djSLDh5bZIcBXtk+Zwvs3urEQgSPTjno= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718679412; c=relaxed/simple; bh=5nFbI7Upd2hpda5RW2EE/j0+rNTNKwpdyiOklTx6Nug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=E9TBoWhi7RxKB3zYtgKjvNpiMDqraa+LnMD4xs+Z9idm0EQcXBRynA8mWmmvuQgfdqlkw7Ph0gYSsQivaS74lYoZm9epdSgoMvMjX6jvh4ikDgo/FRcbX9QOg78VHDvxQzT5Mn+Ugula3hSKqTjTGQB4Ewq7MvMdOSw5usrHCpg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=D/rovX7O; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="D/rovX7O" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1718679408; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=8pxCpWS62jn7IeclhGIjU+cXuR/s1kYqZ8blq+PFmUc=; b=D/rovX7Ok9n5TdcOfhS2QKygWl6WSwihSKeMiX/xQxNbbjwJxPoG/BuQ6SR+Pmbnn2OJA6A74U2cltiUgCxq7EVztcPuPuDOjh0KjRCgoVOS1a8/xsJLoXDjn3KhTMs2l4ciGDHvSggSija+2LgKKwzgXEmU/aduV7sLOqAaaAI= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033022160150;MF=hengqi@linux.alibaba.com;NM=1;PH=DS;RN=31;SR=0;TI=SMTPD_---0W8iG1aT_1718679405; Received: from localhost(mailfrom:hengqi@linux.alibaba.com fp:SMTPD_---0W8iG1aT_1718679405) by smtp.aliyun-inc.com; Tue, 18 Jun 2024 10:56:46 +0800 From: Heng Qi To: netdev@vger.kernel.org, virtualization@lists.linux.dev Cc: Jakub Kicinski , "David S . Miller" , Paolo Abeni , Eric Dumazet , Jason Wang , "Michael S . Tsirkin" , Brett Creeley , Ratheesh Kannoth , Alexander Lobakin , Xuan Zhuo , Tal Gilboa , Jonathan Corbet , linux-doc@vger.kernel.org, Maxime Chevallier , Jiri Pirko , Paul Greenwalt , Ahmed Zaki , Vladimir Oltean , Kory Maincent , Andrew Lunn , justinstitt@google.com, donald.hunter@gmail.com, =?utf-8?q?Eugenio_P=C3=A9r?= =?utf-8?q?ez?= , Andrew Morton , Dragos Tatulea , Rahul Rameshbabu , Heiner Kallweit , Przemek Kitszel , awel Dembicki Subject: [PATCH RESEND net-next v14 1/5] linux/dim: move useful macros to .h file Date: Tue, 18 Jun 2024 10:56:40 +0800 Message-Id: <20240618025644.25754-2-hengqi@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20240618025644.25754-1-hengqi@linux.alibaba.com> References: <20240618025644.25754-1-hengqi@linux.alibaba.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Useful macros will be used effectively elsewhere. These will be utilized in subsequent patches. Signed-off-by: Heng Qi Reviewed-by: Simon Horman --- include/linux/dim.h | 7 +++++++ lib/dim/net_dim.c | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/linux/dim.h b/include/linux/dim.h index f343bc9aa2ec..43398f5eade2 100644 --- a/include/linux/dim.h +++ b/include/linux/dim.h @@ -10,6 +10,13 @@ #include #include +/* Number of DIM profiles and period mode. */ +#define NET_DIM_PARAMS_NUM_PROFILES 5 +#define NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE 256 +#define NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE 128 +#define NET_DIM_DEF_PROFILE_CQE 1 +#define NET_DIM_DEF_PROFILE_EQE 1 + /* * Number of events between DIM iterations. * Causes a moderation of the algorithm run. diff --git a/lib/dim/net_dim.c b/lib/dim/net_dim.c index 4e32f7aaac86..67d5beb34dc3 100644 --- a/lib/dim/net_dim.c +++ b/lib/dim/net_dim.c @@ -11,12 +11,6 @@ * There are different set of profiles for RX/TX CQs. * Each profile size must be of NET_DIM_PARAMS_NUM_PROFILES */ -#define NET_DIM_PARAMS_NUM_PROFILES 5 -#define NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE 256 -#define NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE 128 -#define NET_DIM_DEF_PROFILE_CQE 1 -#define NET_DIM_DEF_PROFILE_EQE 1 - #define NET_DIM_RX_EQE_PROFILES { \ {.usec = 1, .pkts = NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE,}, \ {.usec = 8, .pkts = NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE,}, \