Skip to content

Commit e5357d6

Browse files
cloftusbruce-richardson
authored andcommitted
net/intel: rename variable in Rx select to improve clarity
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 <[email protected]> Acked-by: Bruce Richardson <[email protected]>
1 parent 123703b commit e5357d6

File tree

1 file changed

+11
-11
lines changed
  • drivers/net/intel/common

1 file changed

+11
-11
lines changed

drivers/net/intel/common/rx.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ ci_rx_path_select(struct ci_rx_path_features req_features,
261261
int default_path)
262262
{
263263
int i, idx = default_path;
264-
const struct ci_rx_path_features *current_features = NULL;
264+
const struct ci_rx_path_features *chosen_path_features = NULL;
265265

266266
for (i = 0; i < num_paths; i++) {
267267
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,
295295
if (path_features->simd_width > req_features.simd_width)
296296
continue;
297297

298-
/* Do not select the path if it is less suitable than the current path. */
299-
if (current_features != NULL) {
300-
/* Do not select paths with lower SIMD width than the current path. */
301-
if (path_features->simd_width < current_features->simd_width)
298+
/* Do not select the path if it is less suitable than the chosen path. */
299+
if (chosen_path_features != NULL) {
300+
/* Do not select paths with lower SIMD width than the chosen path. */
301+
if (path_features->simd_width < chosen_path_features->simd_width)
302302
continue;
303-
/* Do not select paths with more offloads enabled than the current path if
303+
/* Do not select paths with more offloads enabled than the chosen path if
304304
* the SIMD widths are the same.
305305
*/
306-
if (path_features->simd_width == current_features->simd_width &&
306+
if (path_features->simd_width == chosen_path_features->simd_width &&
307307
rte_popcount32(path_features->rx_offloads) >
308-
rte_popcount32(current_features->rx_offloads))
308+
rte_popcount32(chosen_path_features->rx_offloads))
309309
continue;
310310
/* Do not select paths without bulk alloc support if requested and the
311-
* current path already meets this requirement.
311+
* chosen path already meets this requirement.
312312
*/
313313
if (!path_features->extra.bulk_alloc && req_features.extra.bulk_alloc &&
314-
current_features->extra.bulk_alloc)
314+
chosen_path_features->extra.bulk_alloc)
315315
continue;
316316
}
317317

318318
/* Finally, select the path since it has met all the requirements. */
319319
idx = i;
320-
current_features = &infos[idx].features;
320+
chosen_path_features = &infos[idx].features;
321321
}
322322

323323
return idx;

0 commit comments

Comments
 (0)