From: David Marchand <david.marchand@redhat.com>
To: Nicolas Chautru <nicolas.chautru@intel.com>
Cc: dev <dev@dpdk.org>, Akhil Goyal <akhil.goyal@nxp.com>,
Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH v1] baseband/fpga_5gnr_fec: add companion PF config App
Date: Thu, 16 Jul 2020 11:40:10 +0200 [thread overview]
Message-ID: <CAJFAV8z89Qh61tKG1Lgg8OHrY9hp5sbs-SHggnrJ_4o4o61Ceg@mail.gmail.com> (raw)
In-Reply-To: <1594419966-230753-2-git-send-email-nicolas.chautru@intel.com>
On Sat, Jul 11, 2020 at 12:28 AM Nicolas Chautru
<nicolas.chautru@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.
--
David Marchand
next prev parent reply other threads:[~2020-07-16 9:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 22:26 [dpdk-dev] [PATCH v1] BBDEV FPGA PF Config app Nicolas Chautru
2020-07-10 22:26 ` [dpdk-dev] [PATCH v1] baseband/fpga_5gnr_fec: add companion PF config App Nicolas Chautru
2020-07-16 8:56 ` Akhil Goyal
2020-07-16 18:14 ` Chautru, Nicolas
2020-07-16 9:40 ` David Marchand [this message]
2020-07-16 19:59 ` Chautru, Nicolas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJFAV8z89Qh61tKG1Lgg8OHrY9hp5sbs-SHggnrJ_4o4o61Ceg@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=akhil.goyal@nxp.com \
--cc=dev@dpdk.org \
--cc=nicolas.chautru@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).