* i40e_dcb_setup - setup dcb related config * @dev: device being configured * * Returns 0 on success, negative value on failure */
| 11032 | * Returns 0 on success, negative value on failure |
| 11033 | */ |
| 11034 | static int |
| 11035 | i40e_dcb_setup(struct rte_eth_dev *dev) |
| 11036 | { |
| 11037 | struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); |
| 11038 | struct i40e_dcbx_config dcb_cfg; |
| 11039 | uint8_t tc_map = 0; |
| 11040 | int ret = 0; |
| 11041 | |
| 11042 | if ((pf->flags & I40E_FLAG_DCB) == 0) { |
| 11043 | PMD_INIT_LOG(ERR, "HW doesn't support DCB"); |
| 11044 | return -ENOTSUP; |
| 11045 | } |
| 11046 | |
| 11047 | if (pf->vf_num != 0) |
| 11048 | PMD_INIT_LOG(DEBUG, " DCB only works on pf and vmdq vsis."); |
| 11049 | |
| 11050 | ret = i40e_parse_dcb_configure(dev, &dcb_cfg, &tc_map); |
| 11051 | if (ret) { |
| 11052 | PMD_INIT_LOG(ERR, "invalid dcb config"); |
| 11053 | return -EINVAL; |
| 11054 | } |
| 11055 | ret = i40e_dcb_hw_configure(pf, &dcb_cfg, tc_map); |
| 11056 | if (ret) { |
| 11057 | PMD_INIT_LOG(ERR, "dcb sw configure fails"); |
| 11058 | return -ENOSYS; |
| 11059 | } |
| 11060 | |
| 11061 | return 0; |
| 11062 | } |
| 11063 | |
| 11064 | static int |
| 11065 | i40e_dev_get_dcb_info(struct rte_eth_dev *dev, |
no test coverage detected