Skip to content

Commit 88f62ae

Browse files
dmertmandavem330
authored andcommitted
ice: Simplify tracking status of RDMA support
The status of support for RDMA is currently being tracked with two separate status flags. This is unnecessary with the current state of the driver. Simplify status tracking down to a single flag. Rename the helper function to denote the RDMA specific status and universally use the helper function to test the status bit. Signed-off-by: Dave Ertman <[email protected]> Tested-by: Leszek Kaliszczuk <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d4e7592 commit 88f62ae

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ enum ice_pf_flags {
471471
ICE_FLAG_FD_ENA,
472472
ICE_FLAG_PTP_SUPPORTED, /* PTP is supported by NVM */
473473
ICE_FLAG_PTP, /* PTP is enabled by software */
474-
ICE_FLAG_AUX_ENA,
475474
ICE_FLAG_ADV_FEATURES,
476475
ICE_FLAG_TC_MQPRIO, /* support for Multi queue TC */
477476
ICE_FLAG_CLS_FLOWER,
@@ -891,7 +890,6 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf)
891890
{
892891
if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) {
893892
set_bit(ICE_FLAG_RDMA_ENA, pf->flags);
894-
set_bit(ICE_FLAG_AUX_ENA, pf->flags);
895893
set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags);
896894
}
897895
}
@@ -904,6 +902,5 @@ static inline void ice_clear_rdma_cap(struct ice_pf *pf)
904902
{
905903
ice_unplug_aux_dev(pf);
906904
clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);
907-
clear_bit(ICE_FLAG_AUX_ENA, pf->flags);
908905
}
909906
#endif /* _ICE_H_ */

drivers/net/ethernet/intel/ice/ice_idc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int ice_add_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset)
7979

8080
dev = ice_pf_to_dev(pf);
8181

82-
if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags))
82+
if (!ice_is_rdma_ena(pf))
8383
return -EINVAL;
8484

8585
vsi = ice_get_main_vsi(pf);
@@ -241,7 +241,7 @@ EXPORT_SYMBOL_GPL(ice_get_qos_params);
241241
*/
242242
static int ice_reserve_rdma_qvector(struct ice_pf *pf)
243243
{
244-
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) {
244+
if (ice_is_rdma_ena(pf)) {
245245
int index;
246246

247247
index = ice_get_res(pf, pf->irq_tracker, pf->num_rdma_msix,
@@ -279,7 +279,7 @@ int ice_plug_aux_dev(struct ice_pf *pf)
279279
/* if this PF doesn't support a technology that requires auxiliary
280280
* devices, then gracefully exit
281281
*/
282-
if (!ice_is_aux_ena(pf))
282+
if (!ice_is_rdma_ena(pf))
283283
return 0;
284284

285285
iadev = kzalloc(sizeof(*iadev), GFP_KERNEL);

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,14 +733,14 @@ bool ice_is_safe_mode(struct ice_pf *pf)
733733
}
734734

735735
/**
736-
* ice_is_aux_ena
736+
* ice_is_rdma_ena
737737
* @pf: pointer to the PF struct
738738
*
739-
* returns true if AUX devices/drivers are supported, false otherwise
739+
* returns true if RDMA is currently supported, false otherwise
740740
*/
741-
bool ice_is_aux_ena(struct ice_pf *pf)
741+
bool ice_is_rdma_ena(struct ice_pf *pf)
742742
{
743-
return test_bit(ICE_FLAG_AUX_ENA, pf->flags);
743+
return test_bit(ICE_FLAG_RDMA_ENA, pf->flags);
744744
}
745745

746746
/**

drivers/net/ethernet/intel/ice/ice_lib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void ice_set_q_vector_intrl(struct ice_q_vector *q_vector);
100100
int ice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set);
101101

102102
bool ice_is_safe_mode(struct ice_pf *pf);
103-
bool ice_is_aux_ena(struct ice_pf *pf);
103+
bool ice_is_rdma_ena(struct ice_pf *pf);
104104
bool ice_is_dflt_vsi_in_use(struct ice_sw *sw);
105105

106106
bool ice_is_vsi_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi);

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3699,11 +3699,8 @@ static void ice_set_pf_caps(struct ice_pf *pf)
36993699
struct ice_hw_func_caps *func_caps = &pf->hw.func_caps;
37003700

37013701
clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);
3702-
clear_bit(ICE_FLAG_AUX_ENA, pf->flags);
3703-
if (func_caps->common_cap.rdma) {
3702+
if (func_caps->common_cap.rdma)
37043703
set_bit(ICE_FLAG_RDMA_ENA, pf->flags);
3705-
set_bit(ICE_FLAG_AUX_ENA, pf->flags);
3706-
}
37073704
clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
37083705
if (func_caps->common_cap.dcb)
37093706
set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
@@ -3831,7 +3828,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)
38313828
v_left -= needed;
38323829

38333830
/* reserve vectors for RDMA auxiliary driver */
3834-
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) {
3831+
if (ice_is_rdma_ena(pf)) {
38353832
needed = num_cpus + ICE_RDMA_NUM_AEQ_MSIX;
38363833
if (v_left < needed)
38373834
goto no_hw_vecs_left_err;
@@ -3872,7 +3869,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)
38723869
int v_remain = v_actual - v_other;
38733870
int v_rdma = 0, v_min_rdma = 0;
38743871

3875-
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) {
3872+
if (ice_is_rdma_ena(pf)) {
38763873
/* Need at least 1 interrupt in addition to
38773874
* AEQ MSIX
38783875
*/
@@ -3906,7 +3903,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)
39063903
dev_notice(dev, "Enabled %d MSI-X vectors for LAN traffic.\n",
39073904
pf->num_lan_msix);
39083905

3909-
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags))
3906+
if (ice_is_rdma_ena(pf))
39103907
dev_notice(dev, "Enabled %d MSI-X vectors for RDMA.\n",
39113908
pf->num_rdma_msix);
39123909
}
@@ -4732,7 +4729,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
47324729

47334730
/* ready to go, so clear down state bit */
47344731
clear_bit(ICE_DOWN, pf->state);
4735-
if (ice_is_aux_ena(pf)) {
4732+
if (ice_is_rdma_ena(pf)) {
47364733
pf->aux_idx = ida_alloc(&ice_aux_ida, GFP_KERNEL);
47374734
if (pf->aux_idx < 0) {
47384735
dev_err(dev, "Failed to allocate device ID for AUX driver\n");

0 commit comments

Comments
 (0)