[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZEvhV7hlVYtHz2Xh@corigine.com>
Date: Fri, 28 Apr 2023 17:08:07 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Wen Gu <guwen@...ux.alibaba.com>
Cc: kgraul@...ux.ibm.com, wenjia@...ux.ibm.com, jaka@...ux.ibm.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, linux-s390@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH net-next v5 5/9] net/smc: Introduce an interface for
getting DMB attribute
On Sun, Apr 23, 2023 at 08:17:47PM +0800, Wen Gu wrote:
> On s390, since all OSs run on a kind of machine level hypervisor which
> is a partitioning hypervisor without paging, the sndbufs and DMBs in
> such case are unable to be mapped to the same physical memory.
>
> However, in other scene, such as communication within the same OS instance
> (loopback) or between guests of a paging hypervisor (eg. KVM), the sndbufs
> and DMBs can be mapped to the same physical memory to avoid memory copy
> from sndbufs to DMBs.
>
> So this patch introduces an interface to smcd_ops for users to judge
> whether DMB-map is available. And for reuse, the interface is designed
> to return DMB attribute, not only mappability.
>
> Signed-off-by: Wen Gu <guwen@...ux.alibaba.com>
...
> diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
> index 8ad4c71..1d97e77 100644
> --- a/net/smc/smc_ism.c
> +++ b/net/smc/smc_ism.c
> @@ -213,6 +213,14 @@ int smc_ism_unregister_dmb(struct smcd_dev *smcd, struct smc_buf_desc *dmb_desc)
> return rc;
> }
>
> +bool smc_ism_dmb_mappable(struct smcd_dev *smcd)
> +{
> + if (smcd->ops->get_dev_dmb_attr &&
> + (smcd->ops->get_dev_dmb_attr(smcd) & (1 << ISM_DMB_MAPPABLE)))
nit: this could use BIT(ISM_DMB_MAPPABLE)
> + return true;
> + return false;
> +}
> +
> int smc_ism_register_dmb(struct smc_link_group *lgr, int dmb_len,
> struct smc_buf_desc *dmb_desc)
> {
...
Powered by blists - more mailing lists