Skip to content

Commit df006dd

Browse files
dmertmananguy11
authored andcommitted
ice: Add initial support framework for LAG
Add the framework and initial implementation for receiving and processing netdev bonding events. This is only the software support and the implementation of the HW offload for bonding support will be coming at a later time. There are some architectural gaps that need to be closed before that happens. Because this is a software only solution that supports in kernel bonding, SR-IOV is not supported with this implementation. Signed-off-by: Dave Ertman <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent c7a2190 commit df006dd

File tree

7 files changed

+570
-0
lines changed

7 files changed

+570
-0
lines changed

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ice-y := ice_main.o \
2424
ice_flow.o \
2525
ice_devlink.o \
2626
ice_fw_update.o \
27+
ice_lag.o \
2728
ice_ethtool.o
2829
ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o
2930
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include "ice_fdir.h"
5757
#include "ice_xsk.h"
5858
#include "ice_arfs.h"
59+
#include "ice_lag.h"
5960

6061
#define ICE_BAR0 0
6162
#define ICE_REQ_DESC_MULTIPLE 32
@@ -453,6 +454,7 @@ struct ice_pf {
453454
__le64 nvm_phy_type_lo; /* NVM PHY type low */
454455
__le64 nvm_phy_type_hi; /* NVM PHY type high */
455456
struct ice_link_default_override_tlv link_dflt_override;
457+
struct ice_lag *lag; /* Link Aggregation information */
456458
};
457459

458460
struct ice_netdev_priv {
@@ -553,11 +555,31 @@ static inline struct ice_vsi *ice_get_ctrl_vsi(struct ice_pf *pf)
553555
return pf->vsi[pf->ctrl_vsi_idx];
554556
}
555557

558+
/**
559+
* ice_set_sriov_cap - enable SRIOV in PF flags
560+
* @pf: PF struct
561+
*/
562+
static inline void ice_set_sriov_cap(struct ice_pf *pf)
563+
{
564+
if (pf->hw.func_caps.common_cap.sr_iov_1_1)
565+
set_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags);
566+
}
567+
568+
/**
569+
* ice_clear_sriov_cap - disable SRIOV in PF flags
570+
* @pf: PF struct
571+
*/
572+
static inline void ice_clear_sriov_cap(struct ice_pf *pf)
573+
{
574+
clear_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags);
575+
}
576+
556577
#define ICE_FD_STAT_CTR_BLOCK_COUNT 256
557578
#define ICE_FD_STAT_PF_IDX(base_idx) \
558579
((base_idx) * ICE_FD_STAT_CTR_BLOCK_COUNT)
559580
#define ICE_FD_SB_STAT_IDX(base_idx) ICE_FD_STAT_PF_IDX(base_idx)
560581

582+
bool netif_is_ice(struct net_device *dev);
561583
int ice_vsi_setup_tx_rings(struct ice_vsi *vsi);
562584
int ice_vsi_setup_rx_rings(struct ice_vsi *vsi);
563585
int ice_vsi_open_ctrl(struct ice_vsi *vsi);

0 commit comments

Comments
 (0)