lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YEc/8RxroJzrN3xm@kroah.com>
Date:   Tue, 9 Mar 2021 10:29:21 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Mike Ximing Chen <mike.ximing.chen@...el.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        arnd@...db.de, dan.j.williams@...el.com,
        pierre-louis.bossart@...ux.intel.com,
        Gage Eads <gage.eads@...el.com>
Subject: Re: [PATCH v10 14/20] dlb: add start domain ioctl

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@...el.com>
> Signed-off-by: Mike Ximing Chen <mike.ximing.chen@...el.com>
> Reviewed-by: Björn Töpel <bjorn.topel@...el.com>
> Reviewed-by: Dan Williams <dan.j.williams@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ