- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/driver", PCI_DEVICES,
- desc->busdev);
-
- size = readlink(tmp_str, link, sizeof(link));
-
- if (size == -1)
- tmp_str[0] = '\0';
-
- if (size == sizeof(link))
- tmp_str[0] = '\0';
-
- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/resource0", PCI_DEVICES,
- desc->busdev);
-
- desc->device = open(tmp_str, O_RDWR);
- if (desc->device == -1)
- return -1;
-
- if (nfp6000_set_model(desc, cpp) < 0)
- return -1;
- if (nfp6000_set_interface(desc, cpp) < 0)
- return -1;
- if (nfp6000_set_serial(desc, cpp) < 0)
- return -1;
- if (nfp6000_set_barsz(desc) < 0)
- return -1;
+ /* Just support for one secondary process */
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ ret = nfp_acquire_secondary_process_lock(desc);
+ if (ret)
+ goto error;
+ }