[27/36] common/sfc_efx/base: simplify to request Rx prefix fields

Message ID 1602596753-32282-28-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: add EF100 support |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Andrew Rybchenko Oct. 13, 2020, 1:45 p.m. UTC
  Introduce an extra variable with required Rx prefix fields mask
to make it easier to request more fields.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/common/sfc_efx/base/rhead_rx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/common/sfc_efx/base/rhead_rx.c b/drivers/common/sfc_efx/base/rhead_rx.c
index d683f280ce..d3d7339b8c 100644
--- a/drivers/common/sfc_efx/base/rhead_rx.c
+++ b/drivers/common/sfc_efx/base/rhead_rx.c
@@ -594,6 +594,7 @@  rhead_rx_qcreate(
 	const efx_nic_cfg_t *encp = efx_nic_cfg_get(enp);
 	efx_mcdi_init_rxq_params_t params;
 	efx_rx_prefix_layout_t erpl;
+	uint32_t fields_mask = 0;
 	efx_rc_t rc;
 
 	_NOTE(ARGUNUSED(id))
@@ -631,8 +632,8 @@  rhead_rx_qcreate(
 	 * which fields are required or may be allow to request so-called
 	 * default Rx prefix (which ID is equal to 0).
 	 */
-	if ((rc = rhead_rx_choose_prefix_id(enp,
-	    (1U << EFX_RX_PREFIX_FIELD_LENGTH), &erpl)) != 0)
+	fields_mask |= 1U << EFX_RX_PREFIX_FIELD_LENGTH;
+	if ((rc = rhead_rx_choose_prefix_id(enp, fields_mask, &erpl)) != 0)
 		goto fail3;
 
 	params.prefix_id = erpl.erpl_id;