From: David Marchand <david.marchand@6wind.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Stephen Hemminger <shemming@brocade.com>
Subject: Re: [dpdk-dev] [PATCH 1/4] eal: provide functions to access PCI config
Date: Wed, 17 Jun 2015 16:44:31 +0200 [thread overview]
Message-ID: <CALwxeUs1UDaqVJpnsHp+bfCBXvOKHKmzdkrXp2g=f8FR04a4fg@mail.gmail.com> (raw)
In-Reply-To: <1434498700-8522-2-git-send-email-stephen@networkplumber.org>
On Wed, Jun 17, 2015 at 1:51 AM, Stephen Hemminger <
stephen@networkplumber.org> wrote:
> From: Stephen Hemminger <shemming@brocade.com>
>
> Some drivers need ability to access PCI config (for example for power
> management). This adds an abstraction to do this for both Linux
> and BSD.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> lib/librte_eal/bsdapp/eal/eal_pci.c | 83
> +++++++++++++++++++++++++
> lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 +
> lib/librte_eal/common/include/rte_pci.h | 28 +++++++++
> lib/librte_eal/linuxapp/eal/eal_pci.c | 50 +++++++++++++++
> lib/librte_eal/linuxapp/eal/eal_pci_init.h | 11 ++++
> lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 14 +++++
> lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 16 +++++
> lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +
> 8 files changed, 206 insertions(+)
>
> diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c
> b/lib/librte_eal/bsdapp/eal/eal_pci.c
> index 61e8921..bf6bc93 100644
> --- a/lib/librte_eal/bsdapp/eal/eal_pci.c
> +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c
> @@ -490,6 +490,89 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver
> *dr, struct rte_pci_device *d
> return 1;
> }
> [snip]
> +
> + if (len == 3 || len > sizeof(pi.pi_data)) {
> + RTE_LOG(ERR, EAL, "%s(): invalid pci read length\n",
> __func__);
> + goto error;
> + }
>
A comment on length 3 would help to understand why it is refused.
diff --git a/lib/librte_eal/common/include/rte_pci.h
> b/lib/librte_eal/common/include/rte_pci.h
> index b4f38bc..62fb0ea 100644
> --- a/lib/librte_eal/common/include/rte_pci.h
> +++ b/lib/librte_eal/common/include/rte_pci.h
> @@ -394,6 +394,34 @@ void rte_eal_pci_register(struct rte_pci_driver
> *driver);
> */
> void rte_eal_pci_unregister(struct rte_pci_driver *driver);
>
> +/**
> + * Read PCI config space.
> + *
> + * @param device
> + * A pointer to a rte_pci_device structure describing the device
> + * to use
> + * @param buf
> + * A data buffer where the bytes should be read into
> + * @param size
> + * The length of the data buffer.
> + */
> +int rte_eal_pci_read_config(const struct rte_pci_device *device,
> + void *buf, size_t len, off_t offset);
> +
>
Parameters do not match the description.
> +/**
> + * Write PCI config space.
> + *
> + * @param device
> + * A pointer to a rte_pci_device structure describing the device
> + * to use
> + * @param buf
> + * A data buffer containing the bytes should be written
> + * @param size
> + * The length of the data buffer.
> + */
> +int rte_eal_pci_write_config(const struct rte_pci_device *device,
> + const void *buf, size_t len, off_t offset);
> +
>
Idem.
The rest looks good to me.
--
David Marchand
next prev parent reply other threads:[~2015-06-17 14:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 23:51 [dpdk-dev] [PATCH 0/4 v5] bnx2x: poll mode driver Stephen Hemminger
2015-06-16 23:51 ` [dpdk-dev] [PATCH 1/4] eal: provide functions to access PCI config Stephen Hemminger
2015-06-17 7:31 ` Panu Matilainen
2015-06-17 14:44 ` David Marchand [this message]
[not found] ` <513c51e29ab6449c99ae70c77e72566c@BRMWP-EXMB11.corp.brocade.com>
2015-07-09 21:08 ` Stephen Hemminger
2015-06-16 23:51 ` [dpdk-dev] [PATCH 2/4] bnx2x: driver core Stephen Hemminger
2015-06-16 23:51 ` [dpdk-dev] [PATCH 3/4] bnx2x: driver support routines Stephen Hemminger
2015-06-16 23:51 ` [dpdk-dev] [PATCH 4/4] bnx2x: enable PMD build Stephen Hemminger
2015-06-17 11:19 ` Yotam Rubin
2015-06-26 0:57 ` [dpdk-dev] [PATCH 0/4 v5] bnx2x: poll mode driver Harish Patil
2015-07-02 12:53 ` Thomas Monjalon
2015-07-08 0:08 [dpdk-dev] [PATCH v3 0/4] " Stephen Hemminger
2015-07-08 0:08 ` [dpdk-dev] [PATCH 1/4] eal: provide functions to access PCI config Stephen Hemminger
2015-07-08 15:04 ` Thomas Monjalon
[not found] ` <d35efa226d95495e804181b2246063d2@HQ1WP-EXMB11.corp.brocade.com>
2015-07-08 16:11 ` Stephen Hemminger
2015-07-08 16:34 ` Thomas Monjalon
2015-07-09 18:15 [dpdk-dev] [PATCH v4 0/4] bnx2x: new poll mode driver Stephen Hemminger
2015-07-09 18:15 ` [dpdk-dev] [PATCH 1/4] eal: provide functions to access PCI config Stephen Hemminger
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='CALwxeUs1UDaqVJpnsHp+bfCBXvOKHKmzdkrXp2g=f8FR04a4fg@mail.gmail.com' \
--to=david.marchand@6wind.com \
--cc=dev@dpdk.org \
--cc=shemming@brocade.com \
--cc=stephen@networkplumber.org \
/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).