From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 865B545FF7; Mon, 6 Jan 2025 02:53:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 371C340611; Mon, 6 Jan 2025 02:53:25 +0100 (CET) Received: from lf-2-32.ptr.blmpb.com (lf-2-32.ptr.blmpb.com [101.36.218.32]) by mails.dpdk.org (Postfix) with ESMTP id 17EBB4014F for ; Mon, 6 Jan 2025 02:53:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2403070942; d=yunsilicon.com; t=1736128397; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=tS9iXWxXGlggpne0UvnnL6OJjm4szy4M+uGLzyFb9f0=; b=jArLwLNwELdjfMHjonR5dg2YYvkPA/+BoFrvJdQBtN2rVIEqOjbFKxqRZd7Kft+plqkO6C gQzGMxdacsd+01Va+f802DvXUYexY6nLhDazRUOwzzX6T1OCHKZcPpHlyRntAFwXQbPFUB Tl913apada5jmtV1ty/bI5Rv6QqaYlxfVL8P2Mb5QFD0P7xX0Flpg8IrX/EqCP2w16tZQo WwIf9zwc+J7rSP2dU5Pq+CtqAQFk0oYxTzimGeIwgxND02m0RvWG3PRaA4zkg0U/NVO/7O Sz+D7cXF4B27cChoW+RGFPi4kAY+zKKuoHugryCfazpy2d9gy7F5pwg1HhdHqw== X-Original-From: WanRenyong User-Agent: Mozilla Thunderbird Cc: , , , , , , , , From: "WanRenyong" References: <20250103150404.1529663-1-wanry@yunsilicon.com> <20250103150411.1529663-5-wanry@yunsilicon.com> <20250103110247.2b60ffab@pi5> In-Reply-To: <20250103110247.2b60ffab@pi5> To: "Stephen Hemminger" Subject: Re: [PATCH v4 04/15] net/xsc: add xsc dev ops to support VFIO driver Date: Mon, 6 Jan 2025 09:53:16 +0800 Message-Id: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Received: from [127.0.0.1] ([116.231.104.97]) by smtp.feishu.cn with ESMTPS; Mon, 06 Jan 2025 09:53:14 +0800 X-Lms-Return-Path: Content-Type: text/plain; charset=UTF-8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2025/1/4 3:02, Stephen Hemminger wrote: > On Fri, 03 Jan 2025 23:04:13 +0800 > "WanRenyong" wrote: > >> +static int >> +xsc_vfio_destroy_qp(void *qp) >> +{ >> + int ret; >> + int in_len, out_len, cmd_len; >> + struct xsc_cmd_destroy_qp_mbox_in *in; >> + struct xsc_cmd_destroy_qp_mbox_out *out; >> + struct xsc_vfio_qp *data = (struct xsc_vfio_qp *)qp; >> + >> + in_len = sizeof(struct xsc_cmd_destroy_qp_mbox_in); >> + out_len = sizeof(struct xsc_cmd_destroy_qp_mbox_out); >> + cmd_len = RTE_MAX(in_len, out_len); >> + >> + in = malloc(cmd_len); >> + if (in == NULL) { >> + rte_errno = ENOMEM; >> + PMD_DRV_LOG(ERR, "Failed to alloc qp destroy cmd memory"); >> + return -rte_errno; >> + } >> + memset(in, 0, cmd_len); > If this data structure needs to be shared between primary and secondary process, > then it needs to be allocated with rte_malloc(). If it does not need to be > shared, then it can come from heap with malloc(). no, this data structure is not shared between primary and secondary process. it is a temporary memory to initial mailbox data structure. -- Thanks, WanRenyong