src/dpdk/drivers/net/i40e/i40e_ethdev.c
static bool
i40e_get_swr_pm_cfg(struct i40e_hw *hw, uint32_t *value)
{
#define I40E_GL_SWR_PM_EF_DEVICE(dev) \
		.device_id = (dev),   \
		.val = I40E_GL_SWR_PM_UP_THR_EF_VALUE

#define I40E_GL_SWR_PM_SF_DEVICE(dev) \
		.device_id = (dev),   \
		.val = I40E_GL_SWR_PM_UP_THR_SF_VALUE

	static const struct {
		uint16_t device_id;
		uint32_t val;
	} swr_pm_table[] = {
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_SFP_XL710) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_KX_C) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T4) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_SFP_X722) },

		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_KX_B) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_A) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_B) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2_A) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_B) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_SFP28) },
	};
	uint32_t i;

	if (value == NULL) {
		PMD_DRV_LOG(ERR, "value is NULL");
		return false;
	}

	for (i = 0; i < RTE_DIM(swr_pm_table); i++) {
		if (hw->device_id == swr_pm_table[i].device_id) {
			*value = swr_pm_table[i].val;

			PMD_DRV_LOG(DEBUG, "Device 0x%x with GL_SWR_PM_UP_THR "
				    "value - 0x%08x",
				    hw->device_id, *value);
			return true;
		}
	}

	return false;
}
/*
 * GL_SWR_PM_UP_THR:
 * The value is not impacted from the link speed, its value is set according
 * to the total number of ports for a better pipe-monitor configuration.
 */
The value is not impacted from the link speed, its value is set according
to the total number of ports for a better pipe-monitor configuration.
The value is not impacted from the link speed its value is set according to the total number of ports for a better pipe - monitor configuration .
static bool
i40e_get_swr_pm_cfg(struct i40e_hw *hw, uint32_t *value)
{
#define I40E_GL_SWR_PM_EF_DEVICE(dev) \
		.device_id = (dev),   \
		.val = I40E_GL_SWR_PM_UP_THR_EF_VALUE
#define I40E_GL_SWR_PM_SF_DEVICE(dev) \
		.device_id = (dev),   \
		.val = I40E_GL_SWR_PM_UP_THR_SF_VALUE
	static const struct {
		uint16_t device_id;
		uint32_t val;
	} swr_pm_table[] = {
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_SFP_XL710) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_KX_C) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T4) },
		{ I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_SFP_X722) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_KX_B) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_A) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_B) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2_A) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_B) },
		{ I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_SFP28) },
	};
	uint32_t i;
	if (value == NULL) {
		PMD_DRV_LOG(ERR, "value is NULL");
		return false;
	}
	for (i = 0; i < RTE_DIM(swr_pm_table); i++) {
		if (hw->device_id == swr_pm_table[i].device_id) {
			*value = swr_pm_table[i].val;
			PMD_DRV_LOG(DEBUG, "Device 0x%x with GL_SWR_PM_UP_THR "
				    "value - 0x%08x",
				    hw->device_id, *value);
			return true;
		}
	}
	return false;
}
static bool i40e_get_swr_pm_cfg ( struct i40e_hw * hw , uint32_t * value ) { #define I40E_GL_SWR_PM_EF_DEVICE ( dev )  \
		.device_id = (dev),   \
		.val = I40E_GL_SWR_PM_UP_THR_EF_VALUE #define I40E_GL_SWR_PM_SF_DEVICE ( dev )  \
		.device_id = (dev),   \
		.val = I40E_GL_SWR_PM_UP_THR_SF_VALUE static const struct { uint16_t device_id ; uint32_t val ; } swr_pm_table [ ] = { { I40E_GL_SWR_PM_EF_DEVICE ( I40E_DEV_ID_SFP_XL710 ) } , { I40E_GL_SWR_PM_EF_DEVICE ( I40E_DEV_ID_KX_C ) } , { I40E_GL_SWR_PM_EF_DEVICE ( I40E_DEV_ID_10G_BASE_T ) } , { I40E_GL_SWR_PM_EF_DEVICE ( I40E_DEV_ID_10G_BASE_T4 ) } , { I40E_GL_SWR_PM_EF_DEVICE ( I40E_DEV_ID_SFP_X722 ) } , { I40E_GL_SWR_PM_SF_DEVICE ( I40E_DEV_ID_KX_B ) } , { I40E_GL_SWR_PM_SF_DEVICE ( I40E_DEV_ID_QSFP_A ) } , { I40E_GL_SWR_PM_SF_DEVICE ( I40E_DEV_ID_QSFP_B ) } , { I40E_GL_SWR_PM_SF_DEVICE ( I40E_DEV_ID_20G_KR2 ) } , { I40E_GL_SWR_PM_SF_DEVICE ( I40E_DEV_ID_20G_KR2_A ) } , { I40E_GL_SWR_PM_SF_DEVICE ( I40E_DEV_ID_25G_B ) } , { I40E_GL_SWR_PM_SF_DEVICE ( I40E_DEV_ID_25G_SFP28 ) } , } ; uint32_t i ; if ( value == NULL ) { PMD_DRV_LOG ( ERR , " " ) ; return false ; } for ( i = 0 ; i < RTE_DIM ( swr_pm_table ) ; i ++ ) { if ( hw -> device_id == swr_pm_table [ i ] . device_id ) { * value = swr_pm_table [ i ] . val ; PMD_DRV_LOG ( DEBUG , " " " " , hw -> device_id , * value ) ; return true ; } } return false ; }
GL_SWR_PM_UP_THR:
 The value is not impacted from the link speed, its value is set according
 to the total number of ports for a better pipe-monitor configuration.
GL_SWR_PM_UP_THR : The value is not impacted from the link speed its value is set according to the total number of ports for a better pipe - monitor configuration .