From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 2E7E73BB69F for ; Tue, 15 Sep 2026 12:55:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789476948; cv=none; b=AFMNOF8YMJE8Ia+bav6nEEJdf7SdhjbxP/DoiXYzmsTtUHVPSoAij0u2AS0QjgWRHu/UqezTQgwr7MQD3gD8yboFqdgM1QnaZAfwji3dSf93EOowBpKxrQ7IcMK+acKR9s8l0zhrci5PK1JRN1q/vNYwLOCazOZimhLB04j3lLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789476948; c=relaxed/simple; bh=lGVnIQv9TtpdjxowxbaaH8QKjUMRQwGbViMg10Lb1h4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nF71XPuEMYBJ0rlCzsR/WfmV/p0d5OpwzeVO1ccc7MI4igOewv03cUDuS3UEKws8Lo7WbP+XqdwIaNvKkGPq3Oj+SryVriFHI+UR7zoBTClMeME18g2wKW8A3dhTq0rYKvj47nuiaUIdBN3edVoPc5SlPAsbzqUvGJ1TaIhMPH4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SMUNj4TA; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SMUNj4TA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1789476946; x=1821012946; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lGVnIQv9TtpdjxowxbaaH8QKjUMRQwGbViMg10Lb1h4=; b=SMUNj4TARKCLT3Ly6yiaKqFdpTIUEmIl7oci3aACDXMb87phYUE7Z+GG Cfpk9YiQqfeujNMWgCphA/sstYTxPr3pqbnwJ1z5RilJVUQGsr0/qKNla 1WdBtiGTkTgtpWN3I3mkAqEk4csQAIMRBjZWX3/5bYm0MPvTAgj6kUekw hIoRkm4en/rkJsSA0sijAUZCZoLsSwCxvLvBjwfnA7Hi046+bz8eqtVfw PoRZ5SXYXfxoC5jTgGoj9+OyPSQ1wthylm1xtIU/Lqv2se0gTNDjIVz8g e+GSHmrWblkfh7pIsW2Mjif33I3Fw8RVO1PC7SzD+VSUKjBlljnQCdJZt A==; X-CSE-ConnectionGUID: FHFsqDdxRQyFyzCVEPgnnQ== X-CSE-MsgGUID: pvqpJobxTxK6rQv8Y2iu/w== X-IronPort-AV: E=McAfee;i="6800,10657,11905"; a="89853133" X-IronPort-AV: E=Sophos;i="6.27,103,1787036400"; d="scan'208";a="89853133" Received: from fmviesa011.fm.intel.com ([10.60.135.151]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2026 05:55:46 -0700 X-CSE-ConnectionGUID: l+pfQBX3QyeJL1fJvPhYHg== X-CSE-MsgGUID: 67vQhP6bQTaQHDuaNwzrbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,103,1787036400"; d="scan'208";a="1225245" Received: from amlin-019-225.igk.intel.com ([10.102.19.225]) by fmviesa011.fm.intel.com with ESMTP; 15 Sep 2026 05:55:44 -0700 From: Aleksandr Loktionov To: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com, aleksandr.loktionov@intel.com Cc: netdev@vger.kernel.org, Simon Horman Subject: [PATCH iwl-next 4/4] ixgbe: add IXGBE_ITR_ADAPTIVE_MASK_USECS constant Date: Tue, 15 Sep 2026 14:55:38 +0200 Message-ID: <20260915125538.3975870-5-aleksandr.loktionov@intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260915125538.3975870-1-aleksandr.loktionov@intel.com> References: <20260915125538.3975870-1-aleksandr.loktionov@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alexander Duyck ixgbe_set_itr() clears the mode flag (IXGBE_ITR_ADAPTIVE_LATENCY, bit 7) with the open-coded complement expression ~IXGBE_ITR_ADAPTIVE_LATENCY. This is equivalent to keeping only bits [6:0], i.e. the usecs sub-field. Add IXGBE_ITR_ADAPTIVE_MASK_USECS = IXGBE_ITR_ADAPTIVE_LATENCY - 1 = 0x7F to name this mask explicitly and replace the open-coded AND-NOT operation with the cleaner AND form. The two expressions are arithmetically identical; the change improves readability. Signed-off-by: Alexander Duyck Reviewed-by: Simon Horman Signed-off-by: Aleksandr Loktionov --- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 1a7fd90..594ccb2 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h @@ -478,6 +478,7 @@ static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring) #define IXGBE_ITR_ADAPTIVE_MAX_USECS 84 #define IXGBE_ITR_ADAPTIVE_LATENCY 0x80 #define IXGBE_ITR_ADAPTIVE_BULK 0x00 +#define IXGBE_ITR_ADAPTIVE_MASK_USECS (IXGBE_ITR_ADAPTIVE_LATENCY - 1) struct ixgbe_ring_container { struct ixgbe_ring *ring; /* pointer to linked list of rings */ diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 7fb2ab4..8d3627c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -2962,7 +2962,7 @@ static void ixgbe_set_itr(struct ixgbe_q_vector *q_vector) new_itr = min(q_vector->rx.itr, q_vector->tx.itr); /* Clear latency flag if set, shift into correct position */ - new_itr &= ~IXGBE_ITR_ADAPTIVE_LATENCY; + new_itr &= IXGBE_ITR_ADAPTIVE_MASK_USECS; new_itr <<= 2; if (new_itr != q_vector->itr) { -- 2.52.0