Skip to content

Commit 28f073b

Browse files
dmertmananguy11
authored andcommitted
ice: Implement support for SRIOV VFs across Active/Active bonds
This patch implements the software flows to handle SRIOV VF communication across an Active/Active link aggregate. The same restrictions apply as are in place for the support of Active/Backup bonds. - the two interfaces must be on the same NIC - the FW LLDP engine needs to be disabled - the DDP package that supports VF LAG must be loaded on device - the two interfaces must have the same QoS config - only the first interface added to the bond will have VF support - the interface with VFs must be in switchdev mode With the additional requirement of - the version of the FW on the NIC needs to have VF Active/Active support This requirement is indicated in the capabilities struct associated with the NVM loaded on the NIC. The balancing of traffic between the two interfaces is done on a queue basis. Taking the queues allocated to all of the VFs as a whole, one half of them will be distributed to each interface. When a link goes down, then the queues allocated to the down interface will migrate to the active port. When the down port comes back up, then the same queues as were originally assigned there will be moved back. Co-developed-by: Marcin Szycik <[email protected]> Signed-off-by: Marcin Szycik <[email protected]> Signed-off-by: Dave Ertman <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent fb2f2a8 commit 28f073b

File tree

8 files changed

+713
-104
lines changed

8 files changed

+713
-104
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ enum ice_feature {
203203
ICE_F_GCS,
204204
ICE_F_ROCE_LAG,
205205
ICE_F_SRIOV_LAG,
206+
ICE_F_SRIOV_AA_LAG,
206207
ICE_F_MBX_LIMIT,
207208
ICE_F_MAX
208209
};

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,6 +2060,10 @@ struct ice_aqc_cfg_txqs {
20602060
#define ICE_AQC_Q_CFG_SRC_PRT_M 0x7
20612061
#define ICE_AQC_Q_CFG_DST_PRT_S 3
20622062
#define ICE_AQC_Q_CFG_DST_PRT_M (0x7 << ICE_AQC_Q_CFG_DST_PRT_S)
2063+
#define ICE_AQC_Q_CFG_MODE_M GENMASK(7, 6)
2064+
#define ICE_AQC_Q_CFG_MODE_SAME_PF 0x0
2065+
#define ICE_AQC_Q_CFG_MODE_GIVE_OWN 0x1
2066+
#define ICE_AQC_Q_CFG_MODE_KEEP_OWN 0x2
20632067
u8 time_out;
20642068
#define ICE_AQC_Q_CFG_TIMEOUT_S 2
20652069
#define ICE_AQC_Q_CFG_TIMEOUT_M (0x1F << ICE_AQC_Q_CFG_TIMEOUT_S)

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,6 +2424,9 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps,
24242424
caps->sriov_lag = number & LIBIE_AQC_BIT_SRIOV_LAG;
24252425
ice_debug(hw, ICE_DBG_INIT, "%s: sriov_lag = %u\n",
24262426
prefix, caps->sriov_lag);
2427+
caps->sriov_aa_lag = number & LIBIE_AQC_BIT_SRIOV_AA_LAG;
2428+
ice_debug(hw, ICE_DBG_INIT, "%s: sriov_aa_lag = %u\n",
2429+
prefix, caps->sriov_aa_lag);
24272430
break;
24282431
case LIBIE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE:
24292432
caps->tx_sched_topo_comp_mode_en = (number == 1);
@@ -4712,24 +4715,24 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
47124715
}
47134716

47144717
/**
4715-
* ice_aq_cfg_lan_txq
4718+
* ice_aq_cfg_lan_txq - send AQ command 0x0C32 to FW
47164719
* @hw: pointer to the hardware structure
47174720
* @buf: buffer for command
47184721
* @buf_size: size of buffer in bytes
47194722
* @num_qs: number of queues being configured
47204723
* @oldport: origination lport
47214724
* @newport: destination lport
4725+
* @mode: cmd_type for move to use
47224726
* @cd: pointer to command details structure or NULL
47234727
*
47244728
* Move/Configure LAN Tx queue (0x0C32)
47254729
*
4726-
* There is a better AQ command to use for moving nodes, so only coding
4727-
* this one for configuring the node.
4730+
* Return: Zero on success, associated error code on failure.
47284731
*/
47294732
int
47304733
ice_aq_cfg_lan_txq(struct ice_hw *hw, struct ice_aqc_cfg_txqs_buf *buf,
47314734
u16 buf_size, u16 num_qs, u8 oldport, u8 newport,
4732-
struct ice_sq_cd *cd)
4735+
u8 mode, struct ice_sq_cd *cd)
47334736
{
47344737
struct ice_aqc_cfg_txqs *cmd;
47354738
struct libie_aq_desc desc;
@@ -4742,10 +4745,12 @@ ice_aq_cfg_lan_txq(struct ice_hw *hw, struct ice_aqc_cfg_txqs_buf *buf,
47424745
if (!buf)
47434746
return -EINVAL;
47444747

4745-
cmd->cmd_type = ICE_AQC_Q_CFG_TC_CHNG;
4748+
cmd->cmd_type = mode;
47464749
cmd->num_qs = num_qs;
47474750
cmd->port_num_chng = (oldport & ICE_AQC_Q_CFG_SRC_PRT_M);
47484751
cmd->port_num_chng |= FIELD_PREP(ICE_AQC_Q_CFG_DST_PRT_M, newport);
4752+
cmd->port_num_chng |= FIELD_PREP(ICE_AQC_Q_CFG_MODE_M,
4753+
ICE_AQC_Q_CFG_MODE_KEEP_OWN);
47494754
cmd->time_out = FIELD_PREP(ICE_AQC_Q_CFG_TIMEOUT_M, 5);
47504755
cmd->blocked_cgds = 0;
47514756

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,
270270
int
271271
ice_aq_cfg_lan_txq(struct ice_hw *hw, struct ice_aqc_cfg_txqs_buf *buf,
272272
u16 buf_size, u16 num_qs, u8 oldport, u8 newport,
273-
struct ice_sq_cd *cd);
273+
u8 mode, struct ice_sq_cd *cd);
274274
int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
275275
void ice_replay_post(struct ice_hw *hw);
276276
struct ice_q_ctx *

0 commit comments

Comments
 (0)