src/dpdk/drivers/net/i40e/i40e_ethdev.c
static int
i40e_dcb_setup(struct rte_eth_dev *dev)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	struct i40e_dcbx_config dcb_cfg;
	uint8_t tc_map = 0;
	int ret = 0;

	if ((pf->flags & I40E_FLAG_DCB) == 0) {
		PMD_INIT_LOG(ERR, "HW doesn't support DCB");
		return -ENOTSUP;
	}

	if (pf->vf_num != 0)
		PMD_INIT_LOG(DEBUG, " DCB only works on pf and vmdq vsis.");

	ret = i40e_parse_dcb_configure(dev, &dcb_cfg, &tc_map);
	if (ret) {
		PMD_INIT_LOG(ERR, "invalid dcb config");
		return -EINVAL;
	}
	ret = i40e_dcb_hw_configure(pf, &dcb_cfg, tc_map);
	if (ret) {
		PMD_INIT_LOG(ERR, "dcb sw configure fails");
		return -ENOSYS;
	}

	return 0;
}
/*
 * i40e_dcb_setup - setup dcb related config
 * @dev: device being configured
 *
 * Returns 0 on success, negative value on failure
 */
setup dcb related config
@dev: device being configured

Returns 0 on success, negative value on failure
setup dcb related config @dev : device being configured Returns 0 on success negative value on failure
static int
i40e_dcb_setup(struct rte_eth_dev *dev)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	struct i40e_dcbx_config dcb_cfg;
	uint8_t tc_map = 0;
	int ret = 0;
	if ((pf->flags & I40E_FLAG_DCB) == 0) {
		PMD_INIT_LOG(ERR, "HW doesn't support DCB");
		return -ENOTSUP;
	}
	if (pf->vf_num != 0)
		PMD_INIT_LOG(DEBUG, " DCB only works on pf and vmdq vsis.");
	ret = i40e_parse_dcb_configure(dev, &dcb_cfg, &tc_map);
	if (ret) {
		PMD_INIT_LOG(ERR, "invalid dcb config");
		return -EINVAL;
	}
	ret = i40e_dcb_hw_configure(pf, &dcb_cfg, tc_map);
	if (ret) {
		PMD_INIT_LOG(ERR, "dcb sw configure fails");
		return -ENOSYS;
	}
	return 0;
}
static int i40e_dcb_setup ( struct rte_eth_dev * dev ) { struct i40e_pf * pf = I40E_DEV_PRIVATE_TO_PF ( dev -> data -> dev_private ) ; struct i40e_dcbx_config dcb_cfg ; uint8_t tc_map = 0 ; int ret = 0 ; if ( ( pf -> flags & I40E_FLAG_DCB ) == 0 ) { PMD_INIT_LOG ( ERR , " " ) ; return - ENOTSUP ; } if ( pf -> vf_num != 0 ) PMD_INIT_LOG ( DEBUG , " " ) ; ret = i40e_parse_dcb_configure ( dev , & dcb_cfg , & tc_map ) ; if ( ret ) { PMD_INIT_LOG ( ERR , " " ) ; return - EINVAL ; } ret = i40e_dcb_hw_configure ( pf , & dcb_cfg , tc_map ) ; if ( ret ) { PMD_INIT_LOG ( ERR , " " ) ; return - ENOSYS ; } return 0 ; }
i40e_dcb_setup - setup dcb related config
 @dev: device being configured
i40e_dcb_setup - setup dcb related config @dev : device being configured