From 0f9319cf52f29cfc087cf1d1a006f7d44bf364dd Mon Sep 17 00:00:00 2001 From: Cristian Bercaru Date: Wed, 2 Apr 2014 20:26:50 +0300 Subject: FMD: remove unnecessary buffer pool depletion parameters This patch avoids modifying the structures defined in 'fm_ext.h' and configures all PFC buffer pool depletion parameters in 'CheckNConfigFmPortAdvArgs', between 'FM_PORT_Config' and 'FM_PORT_Init'. Signed-off-by: Cristian Bercaru Change-Id: I7268fa71416cb25f0cb42b56cd89a702996801fa Reviewed-on: http://git.am.freescale.net:8181/10605 Reviewed-by: Mandy Lavi Reviewed-by: Madalin-Cristian Bucur Tested-by: Madalin-Cristian Bucur diff --git a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h index 5bba643..a45682f 100644 --- a/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h +++ b/drivers/net/ethernet/freescale/fman/inc/Peripherals/fm_ext.h @@ -411,6 +411,17 @@ typedef struct t_FmExtPoolParams { } t_FmExtPoolParams; /**************************************************************************//** + @Description A structure for informing the driver about the external + buffer pools allocated in the BM and used by a port or a + storage-profile. +*//***************************************************************************/ +typedef struct t_FmExtPools { + uint8_t numOfPoolsUsed; /**< Number of pools use by this port */ + t_FmExtPoolParams extBufPool[FM_PORT_MAX_NUM_OF_EXT_POOLS]; + /**< Parameters for each port */ +} t_FmExtPools; + +/**************************************************************************//** @Description A structure for defining backup BM Pools. *//***************************************************************************/ typedef struct t_FmBackupBmPools { @@ -447,21 +458,6 @@ typedef struct t_FmBufPoolDepletion { } t_FmBufPoolDepletion; /**************************************************************************//** - @Description A structure for informing the driver about the external - buffer pools allocated in the BM and used by a port or a - storage-profile. -*//***************************************************************************/ -typedef struct t_FmExtPools { - uint8_t numOfPoolsUsed; /**< Number of pools use by this port */ - t_FmExtPoolParams extBufPool[FM_PORT_MAX_NUM_OF_EXT_POOLS]; - /**< Parameters for each port */ - /**< External buffer pool depletion parameters */ -#ifdef CONFIG_FMAN_PFC - t_FmBufPoolDepletion poolDepletion; -#endif -} t_FmExtPools; - -/**************************************************************************//** @Description A Structure for defining Ucode patch for loading. *//***************************************************************************/ typedef struct t_FmFirmwareParams { diff --git a/drivers/net/ethernet/freescale/fman/src/inc/wrapper/lnxwrp_fsl_fman.h b/drivers/net/ethernet/freescale/fman/src/inc/wrapper/lnxwrp_fsl_fman.h index b30ec50..97a7c0c 100644 --- a/drivers/net/ethernet/freescale/fman/src/inc/wrapper/lnxwrp_fsl_fman.h +++ b/drivers/net/ethernet/freescale/fman/src/inc/wrapper/lnxwrp_fsl_fman.h @@ -101,12 +101,6 @@ struct fm_port_pcd_param { struct fm_port_pool_param { uint8_t id; /**< External buffer pool id */ uint16_t size; /**< External buffer pool buffer size */ -#ifdef CONFIG_FMAN_PFC - /**settings.param.portType == e_FM_PORT_TYPE_RX || - p_LnxWrpFmPortDev->settings.param.portType == e_FM_PORT_TYPE_RX_10G) { - t_Error errCode = FM_PORT_ConfigPoolDepletion(p_LnxWrpFmPortDev->h_Dev, - &p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. - extBufPools.poolDepletion); - if (errCode != E_OK) - RETURN_ERROR(MAJOR, errCode, ("FM_PORT_ConfigPoolDepletion() failed")); + p_LnxWrpFmPortDev->settings.param.portType == e_FM_PORT_TYPE_RX_10G) { + memset(&poolDepletion, 0, sizeof(t_FmBufPoolDepletion)); + poolDepletion.singlePoolModeEnable = true; + num_pools = p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. + extBufPools.numOfPoolsUsed; + for (i = 0; i < num_pools; i++) { + id = p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. + extBufPools.extBufPool[i].id; + poolDepletion.poolsToConsiderForSingleMode[id] = true; + } + + for (i = 0; i < CONFIG_FMAN_PFC_COS_COUNT; i++) + poolDepletion.pfcPrioritiesEn[i] = true; + + err = FM_PORT_ConfigPoolDepletion(p_LnxWrpFmPortDev->h_Dev, + &poolDepletion); + if (err != E_OK) + RETURN_ERROR(MAJOR, err, ("FM_PORT_ConfigPoolDepletion() failed")); } #endif @@ -935,10 +949,6 @@ void fm_set_rx_port_params(struct fm_port *port, { t_LnxWrpFmPortDev *p_LnxWrpFmPortDev = (t_LnxWrpFmPortDev *) port; int i; -#ifdef CONFIG_FMAN_PFC - uint8_t pfcv = 0; - uint8_t id; -#endif p_LnxWrpFmPortDev->settings.param.specificParams.rxParams.errFqid = params->errq; @@ -946,14 +956,6 @@ void fm_set_rx_port_params(struct fm_port *port, params->defq; p_LnxWrpFmPortDev->settings.param.specificParams.rxParams.extBufPools. numOfPoolsUsed = params->num_pools; - -#ifdef CONFIG_FMAN_PFC - memset(&(p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. - extBufPools.poolDepletion), 0, sizeof(t_FmBufPoolDepletion)); - p_LnxWrpFmPortDev->settings.param.specificParams.rxParams.extBufPools. - poolDepletion.singlePoolModeEnable = true; -#endif - for (i = 0; i < params->num_pools; i++) { p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. extBufPools.extBufPool[i].id = @@ -961,22 +963,8 @@ void fm_set_rx_port_params(struct fm_port *port, p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. extBufPools.extBufPool[i].size = params->pool_param[i].size; - -#ifdef CONFIG_FMAN_PFC - id = params->pool_param[i].id; - p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. - extBufPools.poolDepletion.poolsToConsiderForSingleMode[id] = true; - pfcv |= params->pool_param[i].pfcv; -#endif } -#ifdef CONFIG_FMAN_PFC - for (i = 0; i < FM_MAX_NUM_OF_PFC_PRIORITIES; i++) - if (pfcv & (1 << i)) - p_LnxWrpFmPortDev->settings.param.specificParams.rxParams. - extBufPools.poolDepletion.pfcPrioritiesEn[i] = true; -#endif - p_LnxWrpFmPortDev->buffPrefixContent.privDataSize = params->priv_data_size; p_LnxWrpFmPortDev->buffPrefixContent.passPrsResult = -- cgit v0.10.2