DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Parav Pandit <parav@nvidia.com>,
	Ray Kinsella <mdr@ashroe.eu>, Wang Haiyue <haiyue.wang@intel.com>,
	"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [dpdk-dev] [RFC v2] bus/auxiliary: introduce auxiliary bus
Date: Thu, 10 Jun 2021 06:30:39 +0000	[thread overview]
Message-ID: <DM4PR12MB53738485E9B64FADE9D8A615A1359@DM4PR12MB5373.namprd12.prod.outlook.com> (raw)
In-Reply-To: <2237980.2ZMkXp7bNk@thomas>


> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, June 8, 2021 3:53 PM
> To: Xueming(Steven) Li <xuemingl@nvidia.com>
> Cc: dev@dpdk.org; Parav Pandit <parav@nvidia.com>; Ray Kinsella <mdr@ashroe.eu>; Wang Haiyue <haiyue.wang@intel.com>;
> andrew.rybchenko@oktetlabs.ru
> Subject: Re: [dpdk-dev] [RFC v2] bus/auxiliary: introduce auxiliary bus
> 
> 10/05/2021 15:47, Xueming Li:
> > Auxiliary [1] provides a way to split function into child-devices
> 
> Auxiliary -> Auxiliary bus
> 
> > representing sub-domains of functionality. Each auxiliary_device
> 
> auxiliary_device -> auxiliary device
> 
> > represents a part of its parent functionality.
> >
> > Auxiliary device is identified by unique device name, sysfs path:
> >   /sys/bus/auxiliary/devices/<name>
> >
> > [1] kernel auxiliary bus document:
> > https://www.kernel.org/doc/html/latest/driver-api/auxiliary_bus.html
> >
> > Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> [...]
> > +++ b/drivers/bus/auxiliary/auxiliary_common.c
> [...]
> > +int auxiliary_bus_logtype;
> 
> You don't need to declare this variable, it is done in a macro.
> 
> > +
> > +static struct rte_devargs *
> > +auxiliary_devargs_lookup(const char *name) {
> > +	struct rte_devargs *devargs;
> > +
> > +	RTE_EAL_DEVARGS_FOREACH("auxiliary", devargs) {
> 
> "auxiliary" should be defined as a macro.
> 
> [...]
> > +/*
> > + * Test whether the auxiliary device exist  */ __rte_weak bool
> 
> The comment should explain it is a stub for OS not supporting auxiliary bus.
> 
> > +auxiliary_dev_exists(const char *name) {
> > +	RTE_SET_USED(name);
> > +	return false;
> > +}
> > +
> > +/*
> > + * Scan the content of the auxiliary bus, and the devices in the
> > +devices
> > + * list
> > + */
> 
> Same here about the stub comment.
> 
> > +__rte_weak int
> > +auxiliary_scan(void)
> > +{
> > +	return 0;
> > +}
> > +
> 
> Please insert a comment here.
> 
> > +void
> > +auxiliary_on_scan(struct rte_auxiliary_device *aux_dev) {
> > +	aux_dev->device.devargs = auxiliary_devargs_lookup(aux_dev->name);
> > +}
> > +
> > +/*
> > + * Match the auxiliary Driver and Device using driver function.
> 
> driver and device do not need capital letters
> 
> > + */
> > +bool
> > +auxiliary_match(const struct rte_auxiliary_driver *aux_drv,
> > +		const struct rte_auxiliary_device *aux_dev) {
> > +	if (aux_drv->match == NULL)
> > +		return false;
> > +	return aux_drv->match(aux_dev->name); }
> > +
> > +/*
> > + * Call the probe() function of the driver.
> > + */
> > +static int
> > +rte_auxiliary_probe_one_driver(struct rte_auxiliary_driver *dr,
> > +			       struct rte_auxiliary_device *dev)
> > +{
> > +	enum rte_iova_mode iova_mode;
> > +	int ret;
> > +
> > +	if ((dr == NULL) || (dev == NULL))
> > +		return -EINVAL;
> > +
> > +	/* The device is not blocked; Check if driver supports it */
> 
> Please keep all the comments more uniform by starting with a capital
> and ends with a point.
> 
> [...]
> > +RTE_REGISTER_BUS(auxiliary, auxiliary_bus.bus);
> > +RTE_LOG_REGISTER(auxiliary_bus_logtype, bus.auxiliary, NOTICE);
> 
> Please replace with RTE_LOG_REGISTER_DEFAULT.
> 
> [...]
> > +++ b/drivers/bus/auxiliary/linux/auxiliary.c
> [...]
> > +/**
> > + * @file
> > + * Linux auxiliary probing.
> > + */
> 
> No need of doxygen comment in a .c file.
> 
> [...]
> > +++ b/drivers/bus/auxiliary/meson.build
> > @@ -0,0 +1,11 @@
> > +# SPDX-License-Identifier: BSD-3-Clause
> > +# Copyright 2021 Mellanox Technologies, Ltd
> > +
> > +headers = files('rte_bus_auxiliary.h')
> > +sources = files('auxiliary_common.c',
> > +	'auxiliary_params.c')
> > +if is_linux
> > +	sources += files('linux/auxiliary.c')
> > +endif
> > +deps += ['kvargs']
> 
> Please change the indent with spaces
> and check with devtools/check-meson.py
> 
> [...]
> > +++ b/drivers/bus/auxiliary/private.h
> [...]
> > +/* Auxiliary bus iterators */
> > +#define FOREACH_DEVICE_ON_AUXILIARYBUS(p)	\
> 
> Please avoid tabs at the end of the line.
> A space is enough before the backslash.
> 
> > +		TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next)
> > +
> > +#define FOREACH_DRIVER_ON_AUXILIARYBUS(p)	\
> > +		TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next)
> > +
> > +/**
> > + * Test whether the auxiliary device exist
> > + *
> > + * @param name
> > + *  Auxiliary device name
> > + * @return
> > + *  true on exists, false otherwise
> > + */
> > +bool auxiliary_dev_exists(const char *name);
> 
> Given it is not an API, no need of doxygen.
> And the function is so simple that no need of comment at all.
> 
> [...]
> > +++ b/drivers/bus/auxiliary/rte_bus_auxiliary.h
> > +#ifndef _RTE_BUS_AUXILIARY_H_
> > +#define _RTE_BUS_AUXILIARY_H_
> 
> No need of underscores before and after.
> (yes I know a lot of DPDK files use such scheme)
> 
> > +
> > +/**
> > + * @file
> > + *
> > + * RTE Auxiliary Bus Interface.
> 
> No need of RTE, it has no meaning here.
> 
> > + */
> > +
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif
> > +
> > +#include <stdio.h>
> > +#include <stdlib.h>
> > +#include <limits.h>
> > +#include <errno.h>
> > +#include <sys/queue.h>
> > +#include <stdint.h>
> > +#include <inttypes.h>
> > +
> > +#include <rte_debug.h>
> > +#include <rte_interrupts.h>
> > +#include <rte_dev.h>
> > +#include <rte_bus.h>
> > +#include <rte_kvargs.h>
> > +
> > +/* Forward declarations */
> > +struct rte_auxiliary_driver;
> > +struct rte_auxiliary_bus;
> > +struct rte_auxiliary_device;
> > +
> > +/**
> > + * Match function for the driver to decide if device can be handled.
> > + *
> > + * @param name
> > + *   Pointer to the auxiliary device name.
> > + * @return
> > + *   Whether the driver can handle the auxiliary device.
> > + */
> > +typedef bool(*rte_auxiliary_match_t) (const char *name);
> 
> I disagree with the earlier comment asking for typedef pointer
> (based on one of my patches).
> Actually Andrew's suggestion makes sense:
> 	http://mails.dpdk.org/archives/dev/2021-June/210665.html
> 
> [...]
> > +++ b/drivers/bus/auxiliary/version.map
> > +DPDK_21 {
> > +	local: *;
> > +};
> 
> We don't need this empty section.
> 
> > +
> > +EXPERIMENTAL {
> > +	global:
> > +
> 
> As asked by Ray, we should add this line:
> 	# added in 21.08
> 
> > +	rte_auxiliary_register;
> > +	rte_auxiliary_unregister;
> > +};
> 
> Release notes are missing.
> 

Thanks for all the good catches, will update and reflect in next version.

  parent reply	other threads:[~2021-06-10  6:30 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 13:01 [dpdk-dev] [RFC] " Xueming Li
2021-04-12  8:29 ` Xueming(Steven) Li
2021-04-13  3:23 ` [dpdk-dev] [PATCH v1] " Xueming Li
2021-04-13  8:49   ` Thomas Monjalon
2021-04-14  2:59   ` Wang, Haiyue
2021-04-14  8:17     ` Thomas Monjalon
2021-04-14  8:30       ` Wang, Haiyue
2021-04-14 15:49       ` Xueming(Steven) Li
2021-04-14 15:39     ` Xueming(Steven) Li
2021-04-14 16:13       ` Wang, Haiyue
2021-04-15  7:35   ` Wang, Haiyue
2021-04-15  7:46     ` Xueming(Steven) Li
2021-04-15  7:51       ` Wang, Haiyue
2021-04-15  7:55         ` Xueming(Steven) Li
2021-04-15  7:59           ` Thomas Monjalon
2021-04-15  8:06             ` Wang, Haiyue
2021-05-10 13:47   ` [dpdk-dev] [RFC v2] " Xueming Li
2021-05-11  9:47     ` Kinsella, Ray
2021-06-10  3:30       ` Xueming(Steven) Li
2021-06-08  7:53     ` Thomas Monjalon
2021-06-08  8:41       ` Wang, Haiyue
2021-06-10  6:29         ` Xueming(Steven) Li
2021-06-10 15:16           ` Wang, Haiyue
2021-06-10  6:30       ` Xueming(Steven) Li [this message]
2021-06-13  8:19     ` [dpdk-dev] [PATCH v3 1/2] devargs: add common key definition Xueming Li
2021-06-13  8:19     ` [dpdk-dev] [PATCH v3 2/2] bus/auxiliary: introduce auxiliary bus Xueming Li
2021-06-13 12:58     ` [dpdk-dev] [PATCH v4 1/2] devargs: add common key definition Xueming Li
2021-06-21  8:08       ` Thomas Monjalon
2021-06-23  0:03       ` [dpdk-dev] [PATCH v5 " Xueming Li
2021-06-24 10:05         ` Thomas Monjalon
2021-06-23  0:03       ` [dpdk-dev] [PATCH v5 2/2] bus/auxiliary: introduce auxiliary bus Xueming Li
2021-06-24 16:18         ` Thomas Monjalon
2021-06-25  3:26           ` Xueming(Steven) Li
2021-06-25 12:03             ` Thomas Monjalon
2021-06-25 11:47         ` [dpdk-dev] [PATCH v6 1/2] devargs: add common key definition Xueming Li
2021-07-04 15:51           ` Andrew Rybchenko
2021-07-05  5:36           ` [dpdk-dev] [PATCH v7 " Xueming Li
2021-07-05  5:36           ` [dpdk-dev] [PATCH v7 2/2] bus/auxiliary: introduce auxiliary bus Xueming Li
2021-07-05  6:47             ` Xueming(Steven) Li
2021-07-05  6:45           ` [dpdk-dev] [PATCH v8 1/2] devargs: add common key definition Xueming Li
2021-07-05  9:26             ` Xueming(Steven) Li
2021-07-05  6:45           ` [dpdk-dev] [PATCH v8 2/2] bus/auxiliary: introduce auxiliary bus Xueming Li
2021-07-05  9:19             ` Andrew Rybchenko
2021-07-05  9:30               ` Xueming(Steven) Li
2021-07-05  9:35                 ` Andrew Rybchenko
2021-07-05 14:57                   ` Thomas Monjalon
2021-07-05 15:06                     ` Andrew Rybchenko
2021-07-05 16:47             ` Thomas Monjalon
2021-06-25 11:47         ` [dpdk-dev] [PATCH v6 " Xueming Li
2021-07-04 16:13           ` Andrew Rybchenko
2021-07-05  5:47             ` Xueming(Steven) Li
2021-08-04  9:50           ` Kinsella, Ray
2021-08-04  9:56             ` Xueming(Steven) Li
2021-08-04 10:00           ` Kinsella, Ray
     [not found]             ` <DM4PR12MB5373DBD9E73E5E0E8505C129A1F19@DM4PR12MB5373.namprd12.prod.outlook.com>
     [not found]               ` <97d5d1b3-40c3-09ac-2978-83c984b30af0@ashroe.eu>
     [not found]                 ` <DM4PR12MB53736410D2C07101F872363EA1F19@DM4PR12MB5373.namprd12.prod.outlook.com>
2021-08-04 12:14                   ` Kinsella, Ray
2021-08-04 13:00                     ` Xueming(Steven) Li
2021-08-04 13:12                       ` Thomas Monjalon
2021-08-04 13:53                         ` Kinsella, Ray
2021-08-04 14:13                           ` Thomas Monjalon
2021-06-13 12:58     ` [dpdk-dev] [PATCH v4 " Xueming Li
2021-06-21 16:11       ` Thomas Monjalon
2021-06-22 23:50         ` Xueming(Steven) Li
2021-06-23  8:15           ` Thomas Monjalon
2021-06-23 14:52             ` Xueming(Steven) Li
2021-06-24  6:37               ` Thomas Monjalon
2021-06-24  8:42                 ` Xueming(Steven) Li
2021-06-23  8:21           ` Thomas Monjalon
2021-06-23 13:54             ` Xueming(Steven) Li
2021-06-25  4:34 ` [dpdk-dev] [RFC] " Stephen Hemminger
2021-06-25 11:24   ` Xueming(Steven) Li

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=DM4PR12MB53738485E9B64FADE9D8A615A1359@DM4PR12MB5373.namprd12.prod.outlook.com \
    --to=xuemingl@nvidia.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=parav@nvidia.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).