* Check requested device level configuration. * Receive and transmit configuration is checked in corresponding * modules. */
| 150 | * modules. |
| 151 | */ |
| 152 | static int |
| 153 | sfc_check_conf(struct sfc_adapter *sa) |
| 154 | { |
| 155 | const struct rte_eth_conf *conf = &sa->eth_dev->data->dev_conf; |
| 156 | int rc = 0; |
| 157 | |
| 158 | sa->port.phy_adv_cap = |
| 159 | sfc_phy_cap_from_link_speeds(conf->link_speeds) & |
| 160 | sa->port.phy_adv_cap_mask; |
| 161 | if ((sa->port.phy_adv_cap & ~(1 << EFX_PHY_CAP_AN)) == 0) { |
| 162 | sfc_err(sa, "No link speeds from mask %#x are supported", |
| 163 | conf->link_speeds); |
| 164 | rc = EINVAL; |
| 165 | } |
| 166 | |
| 167 | #if !EFSYS_OPT_LOOPBACK |
| 168 | if (conf->lpbk_mode != 0) { |
| 169 | sfc_err(sa, "Loopback not supported"); |
| 170 | rc = EINVAL; |
| 171 | } |
| 172 | #endif |
| 173 | |
| 174 | if (conf->dcb_capability_en != 0) { |
| 175 | sfc_err(sa, "Priority-based flow control not supported"); |
| 176 | rc = EINVAL; |
| 177 | } |
| 178 | |
| 179 | if ((conf->intr_conf.lsc != 0) && |
| 180 | (sa->intr.type != EFX_INTR_LINE) && |
| 181 | (sa->intr.type != EFX_INTR_MESSAGE)) { |
| 182 | sfc_err(sa, "Link status change interrupt not supported"); |
| 183 | rc = EINVAL; |
| 184 | } |
| 185 | |
| 186 | if (conf->intr_conf.rxq != 0 && |
| 187 | (sa->priv.dp_rx->features & SFC_DP_RX_FEAT_INTR) == 0) { |
| 188 | sfc_err(sa, "Receive queue interrupt not supported"); |
| 189 | rc = EINVAL; |
| 190 | } |
| 191 | |
| 192 | return rc; |
| 193 | } |
| 194 | |
| 195 | /* |
| 196 | * Find out maximum number of receive and transmit queues which could be |
no test coverage detected