Commit 88f62aea authored by Dave Ertman's avatar Dave Ertman Committed by David S. Miller

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: default avatarDave Ertman <david.m.ertman@intel.com>
Tested-by: default avatarLeszek Kaliszczuk <leszek.kaliszczuk@intel.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d4e7592b
...@@ -471,7 +471,6 @@ enum ice_pf_flags { ...@@ -471,7 +471,6 @@ enum ice_pf_flags {
ICE_FLAG_FD_ENA, ICE_FLAG_FD_ENA,
ICE_FLAG_PTP_SUPPORTED, /* PTP is supported by NVM */ ICE_FLAG_PTP_SUPPORTED, /* PTP is supported by NVM */
ICE_FLAG_PTP, /* PTP is enabled by software */ ICE_FLAG_PTP, /* PTP is enabled by software */
ICE_FLAG_AUX_ENA,
ICE_FLAG_ADV_FEATURES, ICE_FLAG_ADV_FEATURES,
ICE_FLAG_TC_MQPRIO, /* support for Multi queue TC */ ICE_FLAG_TC_MQPRIO, /* support for Multi queue TC */
ICE_FLAG_CLS_FLOWER, ICE_FLAG_CLS_FLOWER,
...@@ -891,7 +890,6 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf) ...@@ -891,7 +890,6 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf)
{ {
if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) { if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) {
set_bit(ICE_FLAG_RDMA_ENA, pf->flags); set_bit(ICE_FLAG_RDMA_ENA, pf->flags);
set_bit(ICE_FLAG_AUX_ENA, pf->flags);
set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags);
} }
} }
...@@ -904,6 +902,5 @@ static inline void ice_clear_rdma_cap(struct ice_pf *pf) ...@@ -904,6 +902,5 @@ static inline void ice_clear_rdma_cap(struct ice_pf *pf)
{ {
ice_unplug_aux_dev(pf); ice_unplug_aux_dev(pf);
clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);
clear_bit(ICE_FLAG_AUX_ENA, pf->flags);
} }
#endif /* _ICE_H_ */ #endif /* _ICE_H_ */
...@@ -79,7 +79,7 @@ int ice_add_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset) ...@@ -79,7 +79,7 @@ int ice_add_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset)
dev = ice_pf_to_dev(pf); dev = ice_pf_to_dev(pf);
if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) if (!ice_is_rdma_ena(pf))
return -EINVAL; return -EINVAL;
vsi = ice_get_main_vsi(pf); vsi = ice_get_main_vsi(pf);
...@@ -241,7 +241,7 @@ EXPORT_SYMBOL_GPL(ice_get_qos_params); ...@@ -241,7 +241,7 @@ EXPORT_SYMBOL_GPL(ice_get_qos_params);
*/ */
static int ice_reserve_rdma_qvector(struct ice_pf *pf) static int ice_reserve_rdma_qvector(struct ice_pf *pf)
{ {
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) { if (ice_is_rdma_ena(pf)) {
int index; int index;
index = ice_get_res(pf, pf->irq_tracker, pf->num_rdma_msix, 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) ...@@ -279,7 +279,7 @@ int ice_plug_aux_dev(struct ice_pf *pf)
/* if this PF doesn't support a technology that requires auxiliary /* if this PF doesn't support a technology that requires auxiliary
* devices, then gracefully exit * devices, then gracefully exit
*/ */
if (!ice_is_aux_ena(pf)) if (!ice_is_rdma_ena(pf))
return 0; return 0;
iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); iadev = kzalloc(sizeof(*iadev), GFP_KERNEL);
......
...@@ -733,14 +733,14 @@ bool ice_is_safe_mode(struct ice_pf *pf) ...@@ -733,14 +733,14 @@ bool ice_is_safe_mode(struct ice_pf *pf)
} }
/** /**
* ice_is_aux_ena * ice_is_rdma_ena
* @pf: pointer to the PF struct * @pf: pointer to the PF struct
* *
* returns true if AUX devices/drivers are supported, false otherwise * returns true if RDMA is currently supported, false otherwise
*/ */
bool ice_is_aux_ena(struct ice_pf *pf) bool ice_is_rdma_ena(struct ice_pf *pf)
{ {
return test_bit(ICE_FLAG_AUX_ENA, pf->flags); return test_bit(ICE_FLAG_RDMA_ENA, pf->flags);
} }
/** /**
......
...@@ -100,7 +100,7 @@ void ice_set_q_vector_intrl(struct ice_q_vector *q_vector); ...@@ -100,7 +100,7 @@ void ice_set_q_vector_intrl(struct ice_q_vector *q_vector);
int ice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set); int ice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set);
bool ice_is_safe_mode(struct ice_pf *pf); bool ice_is_safe_mode(struct ice_pf *pf);
bool ice_is_aux_ena(struct ice_pf *pf); bool ice_is_rdma_ena(struct ice_pf *pf);
bool ice_is_dflt_vsi_in_use(struct ice_sw *sw); bool ice_is_dflt_vsi_in_use(struct ice_sw *sw);
bool ice_is_vsi_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi); bool ice_is_vsi_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi);
......
...@@ -3699,11 +3699,8 @@ static void ice_set_pf_caps(struct ice_pf *pf) ...@@ -3699,11 +3699,8 @@ static void ice_set_pf_caps(struct ice_pf *pf)
struct ice_hw_func_caps *func_caps = &pf->hw.func_caps; struct ice_hw_func_caps *func_caps = &pf->hw.func_caps;
clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);
clear_bit(ICE_FLAG_AUX_ENA, pf->flags); if (func_caps->common_cap.rdma)
if (func_caps->common_cap.rdma) {
set_bit(ICE_FLAG_RDMA_ENA, pf->flags); set_bit(ICE_FLAG_RDMA_ENA, pf->flags);
set_bit(ICE_FLAG_AUX_ENA, pf->flags);
}
clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
if (func_caps->common_cap.dcb) if (func_caps->common_cap.dcb)
set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
...@@ -3831,7 +3828,7 @@ static int ice_ena_msix_range(struct ice_pf *pf) ...@@ -3831,7 +3828,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)
v_left -= needed; v_left -= needed;
/* reserve vectors for RDMA auxiliary driver */ /* reserve vectors for RDMA auxiliary driver */
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) { if (ice_is_rdma_ena(pf)) {
needed = num_cpus + ICE_RDMA_NUM_AEQ_MSIX; needed = num_cpus + ICE_RDMA_NUM_AEQ_MSIX;
if (v_left < needed) if (v_left < needed)
goto no_hw_vecs_left_err; goto no_hw_vecs_left_err;
...@@ -3872,7 +3869,7 @@ static int ice_ena_msix_range(struct ice_pf *pf) ...@@ -3872,7 +3869,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)
int v_remain = v_actual - v_other; int v_remain = v_actual - v_other;
int v_rdma = 0, v_min_rdma = 0; int v_rdma = 0, v_min_rdma = 0;
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) { if (ice_is_rdma_ena(pf)) {
/* Need at least 1 interrupt in addition to /* Need at least 1 interrupt in addition to
* AEQ MSIX * AEQ MSIX
*/ */
...@@ -3906,7 +3903,7 @@ static int ice_ena_msix_range(struct ice_pf *pf) ...@@ -3906,7 +3903,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)
dev_notice(dev, "Enabled %d MSI-X vectors for LAN traffic.\n", dev_notice(dev, "Enabled %d MSI-X vectors for LAN traffic.\n",
pf->num_lan_msix); pf->num_lan_msix);
if (test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) if (ice_is_rdma_ena(pf))
dev_notice(dev, "Enabled %d MSI-X vectors for RDMA.\n", dev_notice(dev, "Enabled %d MSI-X vectors for RDMA.\n",
pf->num_rdma_msix); pf->num_rdma_msix);
} }
...@@ -4732,7 +4729,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) ...@@ -4732,7 +4729,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
/* ready to go, so clear down state bit */ /* ready to go, so clear down state bit */
clear_bit(ICE_DOWN, pf->state); clear_bit(ICE_DOWN, pf->state);
if (ice_is_aux_ena(pf)) { if (ice_is_rdma_ena(pf)) {
pf->aux_idx = ida_alloc(&ice_aux_ida, GFP_KERNEL); pf->aux_idx = ida_alloc(&ice_aux_ida, GFP_KERNEL);
if (pf->aux_idx < 0) { if (pf->aux_idx < 0) {
dev_err(dev, "Failed to allocate device ID for AUX driver\n"); dev_err(dev, "Failed to allocate device ID for AUX driver\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment