X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_eal%2Fbsdapp%2Feal%2Feal_pci.c;h=374b68f2262ecaee514932b0d8a3dc7f8db0d226;hb=8b25d1ad5d2264bdfc2818c7bda74ee2697df6db;hp=2d16d782d82ee79fab9f004a3f1a4bd6dc8eaf84;hpb=97f17497d162afdb82c8704bf097f0fee3724b2e;p=deb_dpdk.git diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 2d16d782..374b68f2 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -278,6 +278,11 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) /* get subsystem_device id */ dev->id.subsystem_device_id = conf->pc_subdevice; + /* get class id */ + dev->id.class_id = (conf->pc_class << 16) | + (conf->pc_subclass << 8) | + (conf->pc_progif); + /* TODO: get max_vfs */ dev->max_vfs = 0; @@ -422,7 +427,7 @@ int rte_eal_pci_read_config(const struct rte_pci_device *dev, goto error; } - fd = open("/dev/pci", O_RDONLY); + fd = open("/dev/pci", O_RDWR); if (fd < 0) { RTE_LOG(ERR, EAL, "%s(): error opening /dev/pci\n", __func__); goto error; @@ -466,7 +471,7 @@ int rte_eal_pci_write_config(const struct rte_pci_device *dev, memcpy(&pi.pi_data, buf, len); - fd = open("/dev/pci", O_RDONLY); + fd = open("/dev/pci", O_RDWR); if (fd < 0) { RTE_LOG(ERR, EAL, "%s(): error opening /dev/pci\n", __func__); goto error;