net/intel: rename variable in Rx select to improve clarity
PATCH 1/1 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".
--- drivers/net/intel/common/rx.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/net/intel/common/rx.h +11 -11
@@ -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;
Signature · 1 line
2.34.1
Quoted 5 lines · Ciara Loftus
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"
Quoted 8 lines
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]>--- drivers/net/intel/common/rx.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
Applied to dpdk-next-net-intel.
Thanks,
/Bruce