netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Mike Ximing Chen <mike.ximing.chen@intel.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	arnd@arndb.de, dan.j.williams@intel.com,
	pierre-louis.bossart@linux.intel.com,
	Gage Eads <gage.eads@intel.com>
Subject: Re: [PATCH v10 14/20] dlb: add start domain ioctl
Date: Tue, 9 Mar 2021 10:29:21 +0100	[thread overview]
Message-ID: <YEc/8RxroJzrN3xm@kroah.com> (raw)
In-Reply-To: <20210210175423.1873-15-mike.ximing.chen@intel.com>

On Wed, Feb 10, 2021 at 11:54:17AM -0600, Mike Ximing Chen wrote:
> Add ioctl to start a domain. Once a scheduling domain and its resources
> have been configured, this ioctl is called to allow the domain's ports to
> begin enqueueing to the device. Once started, the domain's resources cannot
> be configured again until after the domain is reset.
> 
> This ioctl instructs the DLB device to start load-balancing operations.
> It corresponds to rte_event_dev_start() function in DPDK' eventdev library.
> 
> Signed-off-by: Gage Eads <gage.eads@intel.com>
> Signed-off-by: Mike Ximing Chen <mike.ximing.chen@intel.com>
> Reviewed-by: Björn Töpel <bjorn.topel@intel.com>
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  drivers/misc/dlb/dlb_ioctl.c    |   3 +
>  drivers/misc/dlb/dlb_main.h     |   4 ++
>  drivers/misc/dlb/dlb_pf_ops.c   |   9 +++
>  drivers/misc/dlb/dlb_resource.c | 116 ++++++++++++++++++++++++++++++++
>  drivers/misc/dlb/dlb_resource.h |   4 ++
>  include/uapi/linux/dlb.h        |  22 ++++++
>  6 files changed, 158 insertions(+)
> 
> diff --git a/drivers/misc/dlb/dlb_ioctl.c b/drivers/misc/dlb/dlb_ioctl.c
> index 6a311b969643..9b05344f03c8 100644
> --- a/drivers/misc/dlb/dlb_ioctl.c
> +++ b/drivers/misc/dlb/dlb_ioctl.c
> @@ -51,6 +51,7 @@ DLB_DOMAIN_IOCTL_CALLBACK_TEMPLATE(create_ldb_queue)
>  DLB_DOMAIN_IOCTL_CALLBACK_TEMPLATE(create_dir_queue)
>  DLB_DOMAIN_IOCTL_CALLBACK_TEMPLATE(get_ldb_queue_depth)
>  DLB_DOMAIN_IOCTL_CALLBACK_TEMPLATE(get_dir_queue_depth)
> +DLB_DOMAIN_IOCTL_CALLBACK_TEMPLATE(start_domain)
>  
>  /*
>   * Port creation ioctls don't use the callback template macro.
> @@ -322,6 +323,8 @@ long dlb_domain_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
>  		return dlb_domain_ioctl_get_dir_port_pp_fd(dlb, dom, arg);
>  	case DLB_IOC_GET_DIR_PORT_CQ_FD:
>  		return dlb_domain_ioctl_get_dir_port_cq_fd(dlb, dom, arg);
> +	case DLB_IOC_START_DOMAIN:
> +		return dlb_domain_ioctl_start_domain(dlb, dom, arg);
>  	default:
>  		return -ENOTTY;
>  	}
> diff --git a/drivers/misc/dlb/dlb_main.h b/drivers/misc/dlb/dlb_main.h
> index 477974e1a178..2f3096a45b1e 100644
> --- a/drivers/misc/dlb/dlb_main.h
> +++ b/drivers/misc/dlb/dlb_main.h
> @@ -63,6 +63,10 @@ struct dlb_device_ops {
>  			       struct dlb_create_dir_port_args *args,
>  			       uintptr_t cq_dma_base,
>  			       struct dlb_cmd_response *resp);
> +	int (*start_domain)(struct dlb_hw *hw,
> +			    u32 domain_id,
> +			    struct dlb_start_domain_args *args,
> +			    struct dlb_cmd_response *resp);
>  	int (*get_num_resources)(struct dlb_hw *hw,
>  				 struct dlb_get_num_resources_args *args);
>  	int (*reset_domain)(struct dlb_hw *hw, u32 domain_id);
> diff --git a/drivers/misc/dlb/dlb_pf_ops.c b/drivers/misc/dlb/dlb_pf_ops.c
> index 02a188aa5a60..ce9d29b94a55 100644
> --- a/drivers/misc/dlb/dlb_pf_ops.c
> +++ b/drivers/misc/dlb/dlb_pf_ops.c
> @@ -160,6 +160,14 @@ dlb_pf_create_dir_port(struct dlb_hw *hw, u32 id,
>  				       resp, false, 0);
>  }
>  
> +static int
> +dlb_pf_start_domain(struct dlb_hw *hw, u32 id,
> +		    struct dlb_start_domain_args *args,
> +		    struct dlb_cmd_response *resp)
> +{
> +	return dlb_hw_start_domain(hw, id, args, resp, false, 0);
> +}
> +
>  static int dlb_pf_get_num_resources(struct dlb_hw *hw,
>  				    struct dlb_get_num_resources_args *args)
>  {
> @@ -232,6 +240,7 @@ struct dlb_device_ops dlb_pf_ops = {
>  	.create_dir_queue = dlb_pf_create_dir_queue,
>  	.create_ldb_port = dlb_pf_create_ldb_port,
>  	.create_dir_port = dlb_pf_create_dir_port,
> +	.start_domain = dlb_pf_start_domain,

Why do you have a "callback" when you only ever call one function?  Why
is that needed at all?

thanks,

greg k-h

  reply	other threads:[~2021-03-09  9:30 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 17:54 [PATCH v10 00/20] dlb: introduce DLB device driver Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 01/20] dlb: add skeleton for DLB driver Mike Ximing Chen
2021-02-18  7:34   ` Chen, Mike Ximing
2021-02-18  7:52     ` gregkh
2021-02-18 15:37       ` Chen, Mike Ximing
2021-03-07 13:59       ` Chen, Mike Ximing
2021-02-10 17:54 ` [PATCH v10 02/20] dlb: initialize device Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 03/20] dlb: add resource and device initialization Mike Ximing Chen
2021-03-09  9:24   ` Greg KH
2021-03-10  1:33     ` Chen, Mike Ximing
2021-03-10  8:13       ` Greg KH
2021-03-10 20:26         ` Chen, Mike Ximing
2021-02-10 17:54 ` [PATCH v10 04/20] dlb: add device ioctl layer and first three ioctls Mike Ximing Chen
2021-03-09  9:26   ` Greg KH
2021-03-10  1:34     ` Chen, Mike Ximing
2021-02-10 17:54 ` [PATCH v10 05/20] dlb: add scheduling domain configuration Mike Ximing Chen
2021-03-09  9:28   ` Greg KH
2021-03-10  1:35     ` Chen, Mike Ximing
2021-02-10 17:54 ` [PATCH v10 06/20] dlb: add domain software reset Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 07/20] dlb: add low-level register reset operations Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 08/20] dlb: add runtime power-management support Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 09/20] dlb: add queue create, reset, get-depth ioctls Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 10/20] dlb: add register operations for queue management Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 11/20] dlb: add ioctl to configure ports and query poll mode Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 12/20] dlb: add register operations for port management Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 13/20] dlb: add port mmap support Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 14/20] dlb: add start domain ioctl Mike Ximing Chen
2021-03-09  9:29   ` Greg KH [this message]
2021-03-10  2:45     ` Chen, Mike Ximing
2021-03-10  8:14       ` Greg KH
2021-03-10 20:19         ` Dan Williams
2021-03-10 20:26         ` Chen, Mike Ximing
2021-02-10 17:54 ` [PATCH v10 15/20] dlb: add queue map, unmap, and pending unmap operations Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 16/20] dlb: add port map/unmap state machine Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 17/20] dlb: add static queue map register operations Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 18/20] dlb: add dynamic " Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 19/20] dlb: add queue unmap " Mike Ximing Chen
2021-02-10 17:54 ` [PATCH v10 20/20] dlb: queue map/unmap workqueue Mike Ximing Chen
2021-03-10  9:02 ` [PATCH v10 00/20] dlb: introduce DLB device driver Greg KH
2021-03-12  7:18   ` Dan Williams
2021-03-12 21:55     ` Chen, Mike Ximing
2021-03-13  1:39       ` Dan Williams
2021-03-15 20:04         ` Chen, Mike Ximing
2021-03-15 20:08         ` Chen, Mike Ximing
2021-03-15 20:18         ` Chen, Mike Ximing
2021-03-16  9:01           ` Greg KH
2021-05-12 19:07             ` Dan Williams
2021-05-14 14:33               ` Greg KH
2021-07-16  1:04                 ` Chen, Mike Ximing

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=YEc/8RxroJzrN3xm@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=dan.j.williams@intel.com \
    --cc=davem@davemloft.net \
    --cc=gage.eads@intel.com \
    --cc=kuba@kernel.org \
    --cc=mike.ximing.chen@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.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).