From: Apeksha Gupta <apeksha.gupta@nxp.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
"david.marchand@redhat.com" <david.marchand@redhat.com>,
"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Sachin Saxena <sachin.saxena@nxp.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v3 2/5] net/enetfec: add UIO support
Date: Fri, 1 Oct 2021 10:30:23 +0000 [thread overview]
Message-ID: <VI1PR04MB6816456B11C92E6D3818A7EDEFAB9@VI1PR04MB6816.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <7fbc1cdf-8974-0012-dd21-c73022559576@intel.com>
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Thursday, September 23, 2021 3:43 PM
> To: Apeksha Gupta <apeksha.gupta@nxp.com>;
> david.marchand@redhat.com; andrew.rybchenko@oktetlabs.ru;
> ferruh.yigit@intel.com
> Cc: dev@dpdk.org; Sachin Saxena <sachin.saxena@nxp.com>; Hemant
> Agrawal <hemant.agrawal@nxp.com>
> Subject: [EXT] Re: [dpdk-dev] [PATCH v3 2/5] net/enetfec: add UIO support
>
> Caution: EXT Email
>
> On 9/9/2021 9:43 PM, Apeksha Gupta wrote:
> > Implemented the fec-uio driver in kernel. enetfec PMD uses
> > UIO interface to interact with "fec-uio" driver implemented in
> > kernel for PHY initialisation and for mapping the allocated memory
> > of register & BD from kernel to DPDK which gives access to
> > non-cacheable memory for BD.
> >
> > Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
> > Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
>
> <...>
>
> > +static struct uio_job enetfec_uio_job;
> > +int count;
> > +
>
> This is a global non-static variable with a very generic name, when DPDK
> application compiled all other dpdk libraries/drivers and applicaiton will have
> access to this variable.
>
> Please make the variable 'static' if possible and add a driver prefix.
[Apeksha] Okay.
>
> <...>
>
> > +config_enetfec_uio(struct enetfec_private *fep)
> > +{
> > + char uio_device_file_name[32];
> > + struct uio_job *uio_job = NULL;
> > +
> > + /* Mapping is done only one time */
> > + if (count > 0) {
> > + printf("Mapped!\n");
> > + return 0;
>
> 'printf' ? Should use logging macros.
[Apeksha] Yes, I agree.
>
>
> > + }
> > +
> > + uio_job = &enetfec_uio_job;
> > +
> > + /* Find UIO device created by ENETFEC-UIO kernel driver */
> > + memset(uio_device_file_name, 0, sizeof(uio_device_file_name));
> > + snprintf(uio_device_file_name, sizeof(uio_device_file_name), "%s%d",
> > + FEC_UIO_DEVICE_FILE_NAME, uio_job->uio_minor_number);
>
> I guess this assumes 'uio_minor_number' is '0', but how can you know? What
> if
> user bind another device first? Implemention your own uio handling is error
> prone.
[Apeksha] I do agree, We will update in v4 patch series.
>
> > +
> > + /* Open device file */
> > + uio_job->uio_fd = open(uio_device_file_name, O_RDWR);
> > + if (uio_job->uio_fd < 0) {
> > + printf("US_UIO: Open Failed\n");
> > + exit(1);
>
> 'exit' ? Exit from all dpdk application because one of the drivers underneath
> failed? Please return an error.
[Apeksha] Okay.
next prev parent reply other threads:[~2021-10-01 10:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 20:43 [dpdk-dev] [PATCH v3 0/5] drivers/net: add NXP ENETFEC driver Apeksha Gupta
2021-09-09 20:43 ` [dpdk-dev] [PATCH v3 1/5] net/enetfec: introduce " Apeksha Gupta
2021-09-23 10:09 ` Ferruh Yigit
2021-10-01 10:22 ` [dpdk-dev] [EXT] " Apeksha Gupta
2021-10-01 14:45 ` Ferruh Yigit
2021-10-05 5:24 ` Apeksha Gupta
2021-10-05 9:29 ` Ferruh Yigit
2021-10-06 9:36 ` Apeksha Gupta
2021-09-09 20:43 ` [dpdk-dev] [PATCH v3 2/5] net/enetfec: add UIO support Apeksha Gupta
2021-09-23 10:13 ` Ferruh Yigit
2021-10-01 10:30 ` Apeksha Gupta [this message]
2021-09-09 20:43 ` [dpdk-dev] [PATCH v3 3/5] net/enetfec: support queue configuration Apeksha Gupta
2021-09-09 20:43 ` [dpdk-dev] [PATCH v3 4/5] net/enetfec: add enqueue and dequeue support Apeksha Gupta
2021-09-09 20:43 ` [dpdk-dev] [PATCH v3 5/5] net/enetfec: add features Apeksha Gupta
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=VI1PR04MB6816456B11C92E6D3818A7EDEFAB9@VI1PR04MB6816.eurprd04.prod.outlook.com \
--to=apeksha.gupta@nxp.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=hemant.agrawal@nxp.com \
--cc=sachin.saxena@nxp.com \
/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).