From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0BE6DA04E7; Wed, 11 Nov 2020 01:11:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C2C52B93; Wed, 11 Nov 2020 01:11:28 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 9A56CDED for ; Wed, 11 Nov 2020 01:11:26 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1059) id F16B320C27FA; Tue, 10 Nov 2020 16:11:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F16B320C27FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1605053485; bh=qL3VsbG88uli4V+ZLbJGvZrIunahCpylMe06nFF86C0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mh4iiMEetGjd4JBp9HxXrDoERf7BjMtSs6Xumn4GAsjjJQJaAylh5W9r85peQUQZ/ /5bPLV+ptI/fYT/g+5sKIZ4UrG6LQoznYTWmEWQhaxrzLYQIZaciemEqM94FVhVIS9 zP/yzoIIANz1jArmxSJFcGmc059MhibcKYElb9dg= Date: Tue, 10 Nov 2020 16:11:25 -0800 From: Narcisa Ana Maria Vasile To: Ophir Munk Cc: dev@dpdk.org, Raslan Darawsheh , Matan Azrad , Tal Shnaiderman , Thomas Monjalon Message-ID: <20201111001125.GG9449@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20201027232335.31427-1-ophirmu@nvidia.com> <20201027232335.31427-28-ophirmu@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201027232335.31427-28-ophirmu@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v1 27/72] common/mlx5/windows: add OS alloc/dealloc pd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Oct 27, 2020 at 11:22:50PM +0000, Ophir Munk wrote: > From: Tal Shnaiderman > > Implement Windows API mlx5_os_alloc_pd() and mlx5_os_dealloc_pd(). They > are equivalent to the Linux implementation. > > Signed-off-by: Tal Shnaiderman > Acked-by: Matan Azrad > --- > drivers/common/mlx5/rte_common_mlx5_exports.def | 3 +- > drivers/common/mlx5/windows/mlx5_common_os.c | 47 +++++++++++++++++++++++++ > drivers/common/mlx5/windows/mlx5_common_os.h | 3 ++ > drivers/common/mlx5/windows/mlx5_win_ext.h | 6 ++++ > 4 files changed, 58 insertions(+), 1 deletion(-) > > diff --git a/drivers/common/mlx5/rte_common_mlx5_exports.def b/drivers/common/mlx5/rte_common_mlx5_exports.def > + * @return > + * The mlx5_pd if pd is valid, NULL and errno otherwise. > + */ > +void * > +mlx5_os_alloc_pd(void *ctx) > +{ > + struct mlx5_pd *ppd = mlx5_malloc(MLX5_MEM_ZERO, > + sizeof(struct mlx5_pd), 0, SOCKET_ID_ANY); > + if (!ppd) > + return NULL; > + > + struct mlx5_devx_obj *obj = mlx5_devx_cmd_alloc_pd(ctx); > + if (!obj) Free ppd here, to avoid memory leak. > + return NULL; > + > + ppd->obj = obj; > + ppd->pdn = obj->id; > + ppd->devx_ctx = ctx; > + return ppd; > +} > +