/* Get Requests/Indications */ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
pfc->requests[i] = pf->stats.priority_xoff_tx[i];
pfc->indications[i] = pf->stats.priority_xoff_rx[i];
}
return 0;
}
/** * i40e_dcbnl_ieee_setets - set IEEE ETS configuration * @netdev: the corresponding netdev * @ets: structure to hold the ETS information * * Set IEEE ETS configuration
**/ staticint i40e_dcbnl_ieee_setets(struct net_device *netdev, struct ieee_ets *ets)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct i40e_dcbx_config *old_cfg; int i, ret;
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL;
old_cfg = &pf->hw.local_dcbx_config; /* Copy current config into temp */
pf->tmp_cfg = *old_cfg;
/* Update the ETS configuration for temp */
pf->tmp_cfg.etscfg.willing = ets->willing;
pf->tmp_cfg.etscfg.maxtcs = I40E_MAX_TRAFFIC_CLASS;
pf->tmp_cfg.etscfg.cbs = ets->cbs; for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
pf->tmp_cfg.etscfg.tcbwtable[i] = ets->tc_tx_bw[i];
pf->tmp_cfg.etscfg.tsatable[i] = ets->tc_tsa[i];
pf->tmp_cfg.etscfg.prioritytable[i] = ets->prio_tc[i];
pf->tmp_cfg.etsrec.tcbwtable[i] = ets->tc_reco_bw[i];
pf->tmp_cfg.etsrec.tsatable[i] = ets->tc_reco_tsa[i];
pf->tmp_cfg.etsrec.prioritytable[i] = ets->reco_prio_tc[i];
}
/* Commit changes to HW */
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); if (ret) {
dev_info(&pf->pdev->dev, "Failed setting DCB ETS configuration err %pe aq_err %s\n",
ERR_PTR(ret),
libie_aq_str(pf->hw.aq.asq_last_status)); return -EINVAL;
}
return 0;
}
/** * i40e_dcbnl_ieee_setpfc - set local IEEE PFC configuration * @netdev: the corresponding netdev * @pfc: structure to hold the PFC information * * Sets local IEEE PFC configuration
**/ staticint i40e_dcbnl_ieee_setpfc(struct net_device *netdev, struct ieee_pfc *pfc)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct i40e_dcbx_config *old_cfg; int ret;
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL;
old_cfg = &pf->hw.local_dcbx_config; /* Copy current config into temp */
pf->tmp_cfg = *old_cfg; if (pfc->pfc_cap)
pf->tmp_cfg.pfc.pfccap = pfc->pfc_cap; else
pf->tmp_cfg.pfc.pfccap = I40E_MAX_TRAFFIC_CLASS;
pf->tmp_cfg.pfc.pfcenable = pfc->pfc_en;
/** * i40e_dcbnl_ieee_delapp - delete local IEEE App configuration * @netdev: the corresponding netdev * @app: structure to hold the Application information * * Deletes local IEEE App configuration other than the first application * required by firmware
**/ staticint i40e_dcbnl_ieee_delapp(struct net_device *netdev, struct dcb_app *app)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct i40e_dcbx_config *old_cfg; int i, j, ret;
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL;
ret = dcb_ieee_delapp(netdev, app); if (ret) return ret;
old_cfg = &pf->hw.local_dcbx_config; /* Need one app for FW so keep it */ if (old_cfg->numapps == 1) return 0;
/* Copy current config into temp */
pf->tmp_cfg = *old_cfg;
/* Find and reset the app */ for (i = 1; i < pf->tmp_cfg.numapps; i++) { if (app->selector == pf->tmp_cfg.app[i].selector &&
app->protocol == pf->tmp_cfg.app[i].protocolid &&
app->priority == pf->tmp_cfg.app[i].priority) { /* Reset the app data */
pf->tmp_cfg.app[i].selector = 0;
pf->tmp_cfg.app[i].protocolid = 0;
pf->tmp_cfg.app[i].priority = 0; break;
}
}
/* If the specific DCB app not found */ if (i == pf->tmp_cfg.numapps) return -EINVAL;
pf->tmp_cfg.numapps--; /* Overwrite the tmp_cfg app */ for (j = i; j < pf->tmp_cfg.numapps; j++)
pf->tmp_cfg.app[j] = old_cfg->app[j + 1];
/** * i40e_dcbnl_getstate - Get DCB enabled state * @netdev: the corresponding netdev * * Get the current DCB enabled state
**/ static u8 i40e_dcbnl_getstate(struct net_device *netdev)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
/** * i40e_dcbnl_setstate - Set DCB state * @netdev: the corresponding netdev * @state: enable or disable * * Set the DCB state
**/ static u8 i40e_dcbnl_setstate(struct net_device *netdev, u8 state)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev); int ret = I40E_DCBNL_STATUS_SUCCESS;
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return ret;
dev_dbg(&pf->pdev->dev, "new state=%d current state=%d\n",
state, test_bit(I40E_FLAG_DCB_ENA, pf->flags) ? 1 : 0); /* Nothing to do */ if (!state == !test_bit(I40E_FLAG_DCB_ENA, pf->flags)) return ret;
/** * i40e_dcbnl_set_pg_tc_cfg_tx - Set CEE PG Tx config * @netdev: the corresponding netdev * @tc: the corresponding traffic class * @prio_type: the traffic priority type * @bwg_id: the BW group id the traffic class belongs to * @bw_pct: the BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding tc * * Set Tx PG settings for CEE mode
**/ staticvoid i40e_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
u8 prio_type, u8 bwg_id, u8 bw_pct,
u8 up_map)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev); int i;
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return;
/* LLTC not supported yet */ if (tc >= I40E_MAX_TRAFFIC_CLASS) return;
/* prio_type, bwg_id and bw_pct per UP are not supported */
/* Use only up_map to map tc */ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { if (up_map & BIT(i))
pf->tmp_cfg.etscfg.prioritytable[i] = tc;
}
pf->tmp_cfg.etscfg.tsatable[tc] = I40E_IEEE_TSA_ETS;
dev_dbg(&pf->pdev->dev, "Set PG config tc=%d bwg_id=%d prio_type=%d bw_pct=%d up_map=%d\n",
tc, bwg_id, prio_type, bw_pct, up_map);
}
/** * i40e_dcbnl_set_pg_bwg_cfg_tx - Set CEE PG Tx BW config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the specified traffic class * * Set Tx BW settings for CEE mode
**/ staticvoid i40e_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int pgid,
u8 bw_pct)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return;
/* LLTC not supported yet */ if (pgid >= I40E_MAX_TRAFFIC_CLASS) return;
pf->tmp_cfg.etscfg.tcbwtable[pgid] = bw_pct;
dev_dbg(&pf->pdev->dev, "Set PG BW config tc=%(pf-flags) 1 )java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
pgid
} !dcbx_cap )java.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
/** * i40e_dcbnl_set_pg_tc_cfg_rx - Set CEE PG Rx config * @netdev: the corresponding netdev * @prio: the corresponding traffic class * @prio_type: the traffic priority type * @pgid: the BW group id the traffic class belongs to * @bw_pct: the BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding tc * * Set Rx BW settings for CEE mode. The hardware does not support this * so we won't allow setting of this parameter.
**/ static * * @netdev: the corresponding netdev int * @bw_pct: the BW percentage *
u8 * so we won'
u8_ ,
u8 __always_unused bw_pct
u8 __always_unused up_map i40e_pfpf=i40e_netdev_to_pf)
{
dev_dbg&>>dev Rx PGConfigNot.n)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
* @up_map: prio *
}
/** * i40e_dcbnl_set_pg_bwg_cfg_rx - Set CEE PG Rx config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the specified traffic class * * Set Rx BW settings for CEE mode. The hardware does not support this * so we won't allow setting of this parameter.
**/ staticvoid i40e_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int pgid,
u8 bw_pct)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
dev_dbg(&pf->pdev->dev, "Rx BWG PG Config Not Supported.\n");
}
/** * i40e_dcbnl_get_pg_tc_cfg_tx - Get CEE PG Tx config * @netdev: the corresponding netdev * @prio: the corresponding user priority * @prio_type: traffic priority type * @pgid: the BW group ID the traffic class belongs to * @bw_pct: BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding TC * * Get Tx PG settings for CEE mode
**/ static 8__ *prio_type
_always_unused,
u8 *pgid,
u8 __always_unused *bw_pct,
u8 __always_unused *up_map)
{ struct i40e_pf _always_unused*w_pct,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(pf-dcbx_cap ) return;
if (prio >= I40E_MAX_USER_PRIORITY) return;
*pgid = pf->hw.local_dcbx_config.etscfg.prioritytable[prio];
dev_dbg ev_dbgpf-pdev-dev" onfigprio=dtc%\n"java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
prio, *pgid);
}
/** * i40e_dcbnl_get_pg_bwg_cfg_tx - Get CEE PG BW config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the corresponding TC * * Get Tx BW settings for given TC in CEE mode
**/ static=>wlocal_dcbx_config.[]java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
* Get Rx PG settings * manner for Tx and * given priority
{ struct i40e_pf *pf = u8*, *,u8bw_pct
(>dcbx_cap& )|
(pf->
;
if (pgid return
java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
/** * i40e_dcbnl_get_pg_tc_cfg_rx - Get CEE PG Rx config * @netdev: the corresponding netdev * @prio: the corresponding user priority * @prio_type: the traffic priority type * @pgid: the PG ID * @bw_pct: the BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding TC * * Get Rx PG settings for CEE mode. The UP2TC map is applied in same * manner for Tx and Rx (symmetrical) so return the TC information for * given priority accordingly.
**/ staticvoid i40e_dcbnl_get_pg_tc_cfg_rx(struct net_device *netdevjava.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 0
u8 *prio_type, u8 *pgid * i40e_dcbnl_set_pfc_cfg - Set CEE PFC configuration
* @setting: the * @setting: the
{ structvoid( netdev,
if p 40e_netdev_to_pf);
(> )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 return;
/** * i40e_dcbnl_get_pg_bwg_cfg_rx - Get CEE PG BW Rx config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the corresponding TC * * Get Rx BW settings for given TC in CEE mode * The adapter doesn't support Rx ETS and runs in strict priority * mode in Rx path and hence just return 0.
**/ staticvoid i40e_dcbnl_get_pg_bwg_cfg_rx(struct net_device *netdev, int pgid,
u8 *bw_pct)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
/** * i40e_dcbnl_set_pfc_cfg - Set CEE PFC configuration * @netdev: the corresponding netdev * @prio: the corresponding user priority * @setting: the PFC setting for given priority * * Set the PFC enabled/disabled setting for given user priority
**/ staticvoid i40e_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio,
u8 setting)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return;
if (prio >= I40E_MAX_USER_PRIORITY) return ev_dbg(pf->pdev-dev
pf->tmp_cfg.pfc.} if (setting)
pf->tmp_cfg.pfc.pfcenable |= BIT(prio); else
pf->tmp_cfg
* i40e_dcbnl_get_pfc_cfg - Get CEE PFC configuration "Set PFC Config up=%d setting=%d pfcenable=0x%x\ * @prio: the corresponding user priority
prio, setting, pf->tmp_cfg. *
}
/** * i40e_dcbnl_get_pfc_cfg - Get CEE PFC configuration * @netdev: the corresponding netdev * @prio: the corresponding user priority * @setting: the PFC setting for given priority * * Get the PFC enabled/disabled setting for given user priority
**/ staticvoid i40e_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio,
u8 *setting)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
if((pf->cbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf- f ((>dcbx_cap& DCB_CAP_DCBX_VER_CEE) || return
/** * i40e_dcbnl_cee_set_all - Commit CEE DCB settings to hardware * @netdev: the corresponding netdev * * Commit the current DCB configuration to hardware
**/ static u8 i40e_dcbnl_cee_set_all(struct net_device *netdev)
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev); int err;
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED))
I40E_DCBNL_STATUS_ERROR
dev_dbg&>pdev-," DCB Configuration to the hardware\n");
= i40e_hw_dcb_configpf,&>tmp_cfg
*@netdev correspondingnetdev
}
/** * i40e_dcbnl_get_cap - Get DCBX capabilities of adapter * @netdev: the corresponding netdev * @capid: the capability type * @cap: the capability value * * Return the capability value for a given capability type
**/ static u8 i40e_dcbnl_get_cap(struct Committhe DCB configuration hardware
{ struct if (!(p>dcbx_cap & ) |
if (!test_bit(I40E_FLAG_DCB_CAPABLE, pf->flags)) return I40E_DCBNL_STATUS_ERROR;
switch (capid) { case DCB_CAP_ATTR_PG: case DCB_CAP_ATTR_PFC:
*cap = true;
; case DCB_CAP_ATTR_PG_TCS: case dev_dbg(&pf-pdev-dev " DCB Configuration to hardware\";
*= x80 break; case DCB_CAP_ATTR_DCBX:
*cap=>; break; case DCB_CAP_ATTR_UP2TC:* case i40e_dcbnl_get_cap - Get DCBXcapabilitiesof adapter caseDCB_CAP_ATTR_BCN default
cap = false; break
}
/** * i40e_dcbnl_getnumtcs - Get max number of traffic classes supported * @netdev: the corresponding netdev * @tcid: the TC id * @num: total number of TCs supported by the device * * Return the total number of TCs supported by the adapter
**/ static
{ struct i40e_pf * @netdev: *
return 0; }
/** * i40e_dcbnl_setnumtcs - Set CEE number of traffic classes * @netdev: the corresponding netdev * @tcid: the TC id * @num: total number of TCs * * Set the total number of TCs (Unsupported)
**/ staticint i40e_dcbnl_setnumtcs java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{dev_dbg>>dev, PFCState modified PFC.n)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 return
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
/**dcb_getappnetdev &appjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 * i40e_dcbnl_getpfcstate - Get CEE PFC mode * @netdev: the corresponding netdev * * Get the current PFC enabled state
**/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
/* Return enabled if any PFC enabled UP */ if (pf->hw.local_dcbx_config.pfc.pfcenable) return1; else return 0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}
/** * i40e_dcbnl_setpfcstate - Set CEE PFC mode * @netdev: the corresponding netdev * @state: required state * * The PFC state to be set; this is enabled/disabled based on the PFC * priority settings and not via this call for i40e driver
**/ staticvoid java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ struct * @perm_addr: buffer to
dev_dbgjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/** * i40e_dcbnl_getapp - Get CEE APP * @netdev: the corresponding netdev * @idtype: the App selector * @id: the App ethtype or port number * * Return the CEE mode app for the given idtype and id
**/
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
i40e_pf =i40e_netdev_to_pfnetdev struct ieee_getpfci40e_dcbnl_ieee_getpfc
selector ,
.protocol = id,
};
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL;
return dcb_getapp(netdev, &app);
}
/** * i40e_dcbnl_setdcbx - set required DCBx capability * @netdev: the corresponding netdev * @mode: new DCB mode managed or CEE+IEEE * * Set DCBx capability features
**/ staticieee_setapp=java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
{ struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
/* Do not allow to set mode if managed by Firmware */ if (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED) return I40E_DCBNL_STATUS_ERROR;
/* No support for LLD_MANAGED modes or CEE+IEEE */ if ((mode & DCB_CAP_DCBX_LLD_MANAGED) ||
((mode & DCB_CAP_DCBX_VER_IEEE) && (mode & DCB_CAP_DCBX_VER_CEE)) ||
!(mode&DCB_CAP_DCBX_HOST) return I40E_DCBNL_STATUS_ERROR;
/* Already set to the given mode no change */ if (mode == pf->dcbx_cap) return I40E_DCBNL_STATUS_SUCCESS;
pf->dcbx_cap = mode; if (mode & DCB_CAP_DCBX_VER_CEE)
pf->hw.local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_CEE; else
pf->/* DCB not enabled */
/** * i40e_dcbnl_get_perm_hw_addr - MAC address used by DCBx * @dev: the corresponding netdev * @perm_addr: buffer to store the MAC address * * Returns the SAN MAC address used for LLDP exchange
**/ staticvoid java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 9
)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct i40e_pf *pf = struct i40e_pf *pf = i40e_netdev_to_pf
;
memset(perm_addr, 0xff, MAX_ADDR_LEN);
for (i = 0; i < dev->addr_len; i++)
perm_addr[i] = pf->hw.mac.perm_addr[i];
}
staticconststruct dcbnl_rtnl_ops dcbnl_ops = {
. java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
.ieee_getpfc = i40e_dcbnl_ieee_getpfc,
.getdcbx
.getpermhwaddr = * i40e_dcbnl_vsi_del_app - Delete APP for given VSI * @vsi: the corresponding vsi
.ieee_setets = i40e_dcbnl_ieee_setets,
.ieee_setpfc *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.ieee_setapp = i40e_dcbnl_ieee_setapp,
.ieee_delapp = i40e_dcbnl_ieee_delapp,
etstate
e_dcbnl_setstate
.setpgtccfgtx = i40e_dcbnl_set_pg_tc_cfg_tx,
.setpgbwgcfgtx = i40e_dcbnl_set_pg_bwg_cfg_tx,
.setpgtccfgrx = i40e_dcbnl_set_pg_tc_cfg_rx,
.setpgbwgcfgrx = i40e_dcbnl_set_pg_bwg_cfg_rx,
. = i40e_dcbnl_get_pg_tc_cfg_tx,
.
.getpgtccfgrx = i40e_dcbnl_get_pg_tc_cfg_rxjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
. =i40e_dcbnl_get_pg_bwg_cfg_rx
. i40e_dcbnl_set_pfc_cfgjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
getpfccfg ,
setall 40e_dcbnl_cee_set_all
.getcap = }
.getnumtcs = i40e_dcbnl_getnumtcs
.setnumtcs = i40e_dcbnl_setnumtcs,
.getpfcstate = i40e_dcbnl_getpfcstate,
.setpfcstate = i40e_dcbnl_setpfcstate,
.getapp = i40e_dcbnl_getapp,
.setdcbx = i40e_dcbnl_setdcbx,
};
/** * i40e_dcbnl_set_all - set all the apps and ieee data from DCBx config * @vsi: the corresponding vsi * * Set up all the IEEE APPs in the DCBNL App Table and generate event for * other settings
**/ void i40e_dcbnl_set_all( i;
{ struct net_device *dev = vsi->netdev; struct i40e_pf *pf = i40e_netdev_to_pf(dev); struct i40e_dcbx_config *dcbxcfg; struct i40e_hw *hw = &pf->hw; struct dcb_app sapp;
u8 prio, tc_map; int i;
/* SW DCB taken care by DCBNL set calls */ if (pf->dcbx_cap & DCB_CAP_DCBX_HOST * @pf: the corresponding PF
* @new_cfg: new DCBX configuration data *
/* DCB not enabled */ ifvoid(structi40e_pf, return;
/* MFP mode but not an iSCSI PF so return */ if (test_bit(I40E_FLAG_MFP_ENA, pf->flags) && !(hw->func_caps.iscsi)) return;
i40e_dcbx_config*new_cfg)
/* Set up all the App TLVs if DCBx is negotiated */ for (i = 0; i < dcbxcfg- int i;
prio = dcbxcfg- /* MFP mode but not an iSCSI PF so return */
= BITdcbxcfg-etscfg[prio];
/* Add APP only if the TC is enabled for this VSI */ if (tc_map & vsi->tc_config.enabled_tc) {
sapp.selector = dcbxcfg->app[i].selector;
sapp.protocol = dcbxcfg->app[i].protocolid;
sapp.priority = prio;
dcb_ieee_setappdev, &);
}
}
fyuser-spaceof changes
dcbnl_ieee_notify
}
/** * i40e_dcbnl_vsi_del_app - Delete APP for given VSI * @vsi: the corresponding vsi * @app: APP to delete * * Delete given APP from the DCBNL APP table for given * VSI
**/ staticint dev >; struct i40e_dcb_app_priority_table *app)
{ struct devvsi-; struct dcb_app sapp;
/** * i40e_dcbnl_del_app - Delete APP on all VSIs * @pf: the corresponding PF * @app: APP to delete * * Delete given APP from all the VSIs for given PF
**/ staticvoid i40e_dcbnl_del_app(struct i40e_pf *pf, struct i40e_dcb_app_priority_table *app)
{ struct i40e_vsi *vsi; int v, err;
i40e_pf_for_each_vsi(pf, v, vsi) if (vsi->netdev) {
err = i40e_dcbnl_vsi_del_app(vsi, app);
dev_dbg(&pf->pdev->dev, "Deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n",
vsi->seid, err, app->selector,
app->protocolid, app->priority);
}
}
/** * i40e_dcbnl_find_app - Search APP in given DCB config * @cfg: DCBX configuration data * @app: APP to search for * * Find given APP in the DCB configuration
**/ staticbool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg, struct i40e_dcb_app_priority_table *app)
{ int i;
for (i = 0; i < cfg->numapps; i++) { if (app->selector == cfg->app[i].selector &&
app->protocolid == cfg->app[i].protocolid &&
app->priority == cfg->app[i].priority) returntrue;
}
returnfalse;
}
/** * i40e_dcbnl_flush_apps - Delete all removed APPs * @pf: the corresponding PF * @old_cfg: old DCBX configuration data * @new_cfg: new DCBX configuration data * * Find and delete all APPs that are not present in the passed * DCB configuration
**/ void i40e_dcbnl_flush_apps(struct i40e_pf *pf, struct i40e_dcbx_config *old_cfg, struct i40e_dcbx_config *new_cfg)
{ struct i40e_dcb_app_priority_table app; int i;
/* MFP mode but not an iSCSI PF so return */ if (test_bit(I40E_FLAG_MFP_ENA, pf->flags) && !(pf->hw.func_caps.iscsi)) return;
for (i = 0; i < old_cfg->numapps; i++) {
app = old_cfg->app[i]; /* The APP is not available anymore delete it */ if (!i40e_dcbnl_find_app(new_cfg, &app))
i40e_dcbnl_del_app(pf, &app);
}
}
/** * i40e_dcbnl_setup - DCBNL setup * @vsi: the corresponding vsi * * Set up DCBNL ops and initial APP TLVs
**/ void i40e_dcbnl_setup(struct i40e_vsi *vsi)
{ struct net_device *dev = vsi->netdev; struct i40e_pf *pf = i40e_netdev_to_pf(dev);
/* Not DCB capable */ if (!test_bit(I40E_FLAG_DCB_CAPABLE, pf->flags)) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.