DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Ciara Loftus <ciara.loftus@intel.com>
Subject: [PATCH] net/intel: rename variable in Rx select to improve clarity
Date: Thu, 13 Nov 2025 10:30:12 +0000	[thread overview]
Message-ID: <20251113103012.3782264-1-ciara.loftus@intel.com> (raw)

The common rx path selection function contains logic that compares two
rx paths:
1. the path selected as most suitable so far aka "current path"
2. a candidate path that has not yet been selected aka "path"

This naming could cause confusion, as the candidate path could also be
considered the "current path". To rectify this, rename "current path" to
"chosen path".

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/intel/common/rx.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/intel/common/rx.h b/drivers/net/intel/common/rx.h
index 9fa3cdc64d..ea7fb98b47 100644
--- a/drivers/net/intel/common/rx.h
+++ b/drivers/net/intel/common/rx.h
@@ -261,7 +261,7 @@ ci_rx_path_select(struct ci_rx_path_features req_features,
 			int default_path)
 {
 	int i, idx = default_path;
-	const struct ci_rx_path_features *current_features = NULL;
+	const struct ci_rx_path_features *chosen_path_features = NULL;
 
 	for (i = 0; i < num_paths; i++) {
 		const struct ci_rx_path_features *path_features = &infos[i].features;
@@ -295,29 +295,29 @@ ci_rx_path_select(struct ci_rx_path_features req_features,
 		if (path_features->simd_width > req_features.simd_width)
 			continue;
 
-		/* Do not select the path if it is less suitable than the current path. */
-		if (current_features != NULL) {
-			/* Do not select paths with lower SIMD width than the current path. */
-			if (path_features->simd_width < current_features->simd_width)
+		/* Do not select the path if it is less suitable than the chosen path. */
+		if (chosen_path_features != NULL) {
+			/* Do not select paths with lower SIMD width than the chosen path. */
+			if (path_features->simd_width < chosen_path_features->simd_width)
 				continue;
-			/* Do not select paths with more offloads enabled than the current path if
+			/* Do not select paths with more offloads enabled than the chosen path if
 			 * the SIMD widths are the same.
 			 */
-			if (path_features->simd_width == current_features->simd_width &&
+			if (path_features->simd_width == chosen_path_features->simd_width &&
 					rte_popcount32(path_features->rx_offloads) >
-					rte_popcount32(current_features->rx_offloads))
+					rte_popcount32(chosen_path_features->rx_offloads))
 				continue;
 			/* Do not select paths without bulk alloc support if requested and the
-			 * current path already meets this requirement.
+			 * chosen path already meets this requirement.
 			 */
 			if (!path_features->extra.bulk_alloc && req_features.extra.bulk_alloc &&
-					current_features->extra.bulk_alloc)
+					chosen_path_features->extra.bulk_alloc)
 				continue;
 		}
 
 		/* Finally, select the path since it has met all the requirements. */
 		idx = i;
-		current_features = &infos[idx].features;
+		chosen_path_features = &infos[idx].features;
 	}
 
 	return idx;
-- 
2.34.1


             reply	other threads:[~2025-11-13 10:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 10:30 Ciara Loftus [this message]
2025-11-13 14:38 ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251113103012.3782264-1-ciara.loftus@intel.com \
    --to=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).