* DPDK callback to register the virtual device. * * @param vdev * Pointer to the virtual device. * * @return * 0 on success, negative error value otherwise. */
| 3206 | * 0 on success, negative error value otherwise. |
| 3207 | */ |
| 3208 | static int |
| 3209 | rte_pmd_mrvl_probe(struct rte_vdev_device *vdev) |
| 3210 | { |
| 3211 | struct rte_kvargs *kvlist; |
| 3212 | struct mrvl_ifnames ifnames; |
| 3213 | int ret = -EINVAL; |
| 3214 | uint32_t i, ifnum, cfgnum; |
| 3215 | const char *params; |
| 3216 | |
| 3217 | params = rte_vdev_device_args(vdev); |
| 3218 | if (!params) |
| 3219 | return -EINVAL; |
| 3220 | |
| 3221 | kvlist = rte_kvargs_parse(params, valid_args); |
| 3222 | if (!kvlist) |
| 3223 | return -EINVAL; |
| 3224 | |
| 3225 | ifnum = rte_kvargs_count(kvlist, MRVL_IFACE_NAME_ARG); |
| 3226 | if (ifnum > RTE_DIM(ifnames.names)) |
| 3227 | goto out_free_kvlist; |
| 3228 | |
| 3229 | ifnames.idx = 0; |
| 3230 | rte_kvargs_process(kvlist, MRVL_IFACE_NAME_ARG, |
| 3231 | mrvl_get_ifnames, &ifnames); |
| 3232 | |
| 3233 | |
| 3234 | /* |
| 3235 | * The below system initialization should be done only once, |
| 3236 | * on the first provided configuration file |
| 3237 | */ |
| 3238 | if (!mrvl_cfg) { |
| 3239 | cfgnum = rte_kvargs_count(kvlist, MRVL_CFG_ARG); |
| 3240 | MRVL_LOG(INFO, "Parsing config file!"); |
| 3241 | if (cfgnum > 1) { |
| 3242 | MRVL_LOG(ERR, "Cannot handle more than one config file!"); |
| 3243 | goto out_free_kvlist; |
| 3244 | } else if (cfgnum == 1) { |
| 3245 | rte_kvargs_process(kvlist, MRVL_CFG_ARG, |
| 3246 | mrvl_get_cfg, &mrvl_cfg); |
| 3247 | } |
| 3248 | } |
| 3249 | |
| 3250 | if (mrvl_dev_num) |
| 3251 | goto init_devices; |
| 3252 | |
| 3253 | MRVL_LOG(INFO, "Perform MUSDK initializations"); |
| 3254 | |
| 3255 | ret = rte_mvep_init(MVEP_MOD_T_PP2, kvlist); |
| 3256 | if (ret) |
| 3257 | goto out_free_kvlist; |
| 3258 | |
| 3259 | ret = mrvl_init_pp2(); |
| 3260 | if (ret) { |
| 3261 | MRVL_LOG(ERR, "Failed to init PP!"); |
| 3262 | rte_mvep_deinit(MVEP_MOD_T_PP2); |
| 3263 | goto out_free_kvlist; |
| 3264 | } |
| 3265 |
nothing calls this directly
no test coverage detected