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 9DADF45FD9; Fri, 3 Jan 2025 20:02:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28E00402B4; Fri, 3 Jan 2025 20:02:52 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 5078C4021E for ; Fri, 3 Jan 2025 20:02:51 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2ee8aa26415so17733534a91.1 for ; Fri, 03 Jan 2025 11:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1735930970; x=1736535770; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=g+2ner7ch825kCpb7yKDGYiKe1dRslmrKQ0F6AUXEmA=; b=gThgbl6qcssvzE+uu2TvvrLj/RMst66HxW/G0KpRdsqmpU6ISzE1RuXHJfaT1N0huN PfOG7uW084D484Gl9zuTEocHpcw1UxEGsPmbZcZfMPuDw3f1qqESA3YPbsyljfyP9UJd 6IqgT/1KvEeU2AcuELCzLDeN+EzsTPECuPurLpoShC64TFvuppAirwaSRJaNtQzJIsg4 Yu/kfpt6O4xHhXEPU0BJtsYBVYKVYqHJRgby4lsga8P1aReO/vQyhfQGXPv67Rnk2bGF E2Oppd7sHmeA0JHTBYa4liDLv1Dleh4P8gQvamwgoezNEiYYzowzbxdXFqtrXpRJZt1/ JXJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735930970; x=1736535770; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g+2ner7ch825kCpb7yKDGYiKe1dRslmrKQ0F6AUXEmA=; b=RvAIbWKsVpjxmry1ZIR1rwl4nMhjANLSC7Wp05I24dKzntE63bkpXI8ixrWxYwXEeT KQk9N5dqmt/Fet5FPuAb6f/48DYXz8JNOisoomlYbK4AzGD8tZ4n6WTSjLgWmGLmBUK9 TAvCTaW6IA3I/Sv3Q2MUosQiPl3V5bGODRNC75f+7+Q/5J02Hb4VW3vCj7jx2VlbxTYO 4cS+TxptVQ1f1nqCk0BAvytlaxhfpQoZHQDu8Q3gjrgJIB8xHVmhCP6K2swbdcStHpYq 0QcRO7trT1JHeo3LsaqwAXkGfH6tDTYbe4yuDOxytPJzmgttP0lXLtiK1PubwXlIlCuG NoKw== X-Gm-Message-State: AOJu0YwEYd8A1oEM96aUZVmcRzuICbgH7uwHC5eypdavwba/rdOQkaA7 5nKE4Qwv1Cd6P/AV9tbjMVZSO6gyPkDU8Z5HNcvUylkd0/8X4Fe9eJ+xNPddcN8= X-Gm-Gg: ASbGnct/ucMk32Uxi/Nd6BftuWHRMjkdbUIgBrHiC0iEuo4Bhe4XUFLU1GwKh8jykhu 29rVmkTL/uMqvqV9//luuFqm00r6eYchOiOWxt11o6YnJCY4MCHheKWxk0l6qD3cOb4Gvcqeh6c z9cWhy70rZgl0g/vnRSbFjcKh/CMJrjwKnY084Kl1anqFS/La4mxWxYF5rOCHWbBn+lHe5uM0mR aYHTC2GHr+ETo1iM6pHw3100JUwLtVZA+h1gyLrZDo8YhxGSAFs8G6UZhO9ETLU+f4qZAqfXYWD 78gfdial X-Google-Smtp-Source: AGHT+IH/wHQS6T2eArqvdRps+Afo2pAI3W4N0UrWk9H8wrNKU4Jxb2PA8aX5Eq6922gUdXJ4T5ddvA== X-Received: by 2002:a17:90a:f94d:b0:2ea:4a6b:79d1 with SMTP id 98e67ed59e1d1-2f452e149bbmr73681680a91.11.1735930970543; Fri, 03 Jan 2025 11:02:50 -0800 (PST) Received: from pi5 (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9cdde7sm248895135ad.149.2025.01.03.11.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 11:02:50 -0800 (PST) Date: Fri, 3 Jan 2025 11:02:47 -0800 From: Stephen Hemminger To: "WanRenyong" Cc: , , , , , , , , , Subject: Re: [PATCH v4 04/15] net/xsc: add xsc dev ops to support VFIO driver Message-ID: <20250103110247.2b60ffab@pi5> In-Reply-To: <20250103150411.1529663-5-wanry@yunsilicon.com> References: <20250103150404.1529663-1-wanry@yunsilicon.com> <20250103150411.1529663-5-wanry@yunsilicon.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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().