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: <29152592-ac41-546d-aeb6-867c6de2c860@oracle.com>
Date: Wed, 10 May 2023 12:40:45 -0700
From: michael.christie@...cle.com
To: Chris Leech <cleech@...hat.com>, Lee Duncan <lduncan@...e.com>,
        linux-scsi@...r.kernel.org, open-iscsi@...glegroups.com,
        netdev@...r.kernel.org
Subject: Re: [PATCH 06/11] iscsi: set netns for tcp and iser hosts

On 5/6/23 4:29 PM, Chris Leech wrote:
> @@ -656,6 +646,8 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
>  		if (!(ib_dev->attrs.kernel_cap_flags & IBK_SG_GAPS_REG))
>  			shost->virt_boundary_mask = SZ_4K - 1;
>  
> +		iscsi_host_set_netns(shost, ep->netns);
> +
>  		if (iscsi_host_add(shost, ib_dev->dev.parent)) {
>  			mutex_unlock(&iser_conn->state_mutex);
>  			goto free_host;
> @@ -663,6 +655,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
>  		mutex_unlock(&iser_conn->state_mutex);
>  	} else {
>  		shost->can_queue = min_t(u16, cmds_max, ISER_DEF_XMIT_CMDS_MAX);
> +		iscsi_host_set_netns(shost, net);

Just a nit, but use a consistent coding style. Do you like newlines before/after
like above or not like here.

>  		if (iscsi_host_add(shost, NULL))
>  			goto free_host;
>  	}
> @@ -694,6 +687,34 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
>  	return NULL;
>  }
>  
> +/**
> + * iscsi_iser_session_create() - create an iscsi-iser session
> + * @ep:             iscsi end-point handle
> + * @cmds_max:       maximum commands in this session
> + * @qdepth:         session command queue depth
> + * @initial_cmdsn:  initiator command sequnce number
> + *
> + * Allocates and adds a scsi host, expose DIF support if
> + * exists, and sets up an iscsi session.

Maybe you want these comments for __iscsi_iser_session_create so you can
describe the ep vs a net args. Or it's just odd to have it for only the
ep function.


> @@ -3106,14 +3128,21 @@ static int
>  iscsi_if_create_session(struct iscsi_internal *priv, struct iscsi_endpoint *ep,
>  			struct iscsi_uevent *ev, pid_t pid,
>  			uint32_t initial_cmdsn,	uint16_t cmds_max,
> -			uint16_t queue_depth)
> +			uint16_t queue_depth, struct net *net)
>  {
>  	struct iscsi_transport *transport = priv->iscsi_transport;
>  	struct iscsi_cls_session *session;
>  	struct Scsi_Host *shost;
>  
> -	session = transport->create_session(ep, cmds_max, queue_depth,
> -					    initial_cmdsn);
> +	if (ep) {
> +		session = transport->create_session(ep, cmds_max, queue_depth,
> +						    initial_cmdsn);
> +	} else {
> +		session = transport->create_session_net(net, cmds_max,
> +							queue_depth,
> +							initial_cmdsn);
> +	}


No {}s are neede here and above. It will also match the other code you
adding.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ