[dpdk-dev] [PATCH v1] baseband/fpga_5gnr_fec: add companion PF config App

Chautru, Nicolas nicolas.chautru at intel.com
Thu Jul 16 21:59:18 CEST 2020


> From: David Marchand <david.marchand at redhat.com>
> On Sat, Jul 11, 2020 at 12:28 AM Nicolas Chautru <nicolas.chautru at intel.com>
> wrote:
> 
> [snip]
> 
> > +#define SYS_DIR "/sys/bus/pci/devices"
> > +#define CUR_DIR "."
> > +#define PREV_DIR ".."
> > +
> > +#define DRIVER_LINK  "driver"
> > +#define DEVICE_FILE  "device"
> > +#define VENDOR_FILE  "vendor"
> > +#define BAR0_FILE    "resource0"
> > +#define MAX_VFS_FILE "max_vfs"
> > +
> > +#define PCI_STR_SIZE 15
> > +#define DEV_STR_SIZE 10
> > +#define NULL_PAD     2
> > +
> > +/* Function Pointer for device specific configuration file */ typedef
> > +int (*configuration)(void *bar0addr, const char *arg_cfg_filename);
> > +
> > +typedef struct hw_device {
> > +       const char *device_name;
> > +       char *config_file;
> > +       int vendor_id;
> > +       int device_id;
> > +       char pci_address[PCI_STR_SIZE];
> > +       bool driver_found;
> > +       configuration conf;
> > +       char *num_vfs;
> > +       int config_all;
> > +} hw_device;
> > +
> > +static int
> > +enable_vfs(const char *pci_addr, char *num_vfs) {
> > +       char maxvfspath[PATH_MAX];
> > +       char fs_num_vfs[4] = {0, 0, 0, 0};
> > +       int maxvfsfd;
> > +
> > +       snprintf(maxvfspath, sizeof(maxvfspath),
> > +                       "%s/%s/%s", SYS_DIR, pci_addr, MAX_VFS_FILE);
> > +       maxvfsfd = open(maxvfspath, O_RDWR | O_SYNC);
> 
> You should stop relying on igb_uio (reminder: it is going to move out of the
> dpdk tree in 20.11) and use vfio vf token that got merged in 20.08.
> 

Thanks David. 
We will keep the VF creation externally so that to any avoid such dependency on which kernel variant ends up being used. 
The VF creation was kept here as an option for ease of use but not really required as non device specific. 
The main feature is purely configuration from MMIO write. 




More information about the dev mailing list