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 8F05445B3C; Tue, 15 Oct 2024 04:33:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A80DC4060F; Tue, 15 Oct 2024 04:33:18 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 98F4340653 for ; Tue, 15 Oct 2024 04:33:17 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2e221a7e7baso3191046a91.0 for ; Mon, 14 Oct 2024 19:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728959597; x=1729564397; 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=d6CR/ADqiQ2Dxpd4+HZO14fvj/Wa7ThbZfNJ8yqesxw=; b=S51+1ZZAmreP7bBau0SPj8oGjE+hZZNE8foQb2oS98dF6gqnWXby1d38sn5bvcT3Pp qtG4d8kOR2Gphc9afGrgAOOojI30v6ZI5bS0UtkU4LU61rI3uEtdU2G0pZQzZ+6pn3Oo 4PqRBzP2bAaV0bYN+7E9CBuPtpuQ3DoiQUA0Oef/IUI03IfQWNMK+C46FPfdRipWsA4z KiJedWHt336OvIvRYYDG9pANc/GYp5619pbWX3A8Wei8AwjgnBAyo/VLEKfzO34V576t EWkHjUDi22iYSwjNxejfI9KB62F6D+s3br7l+90ddW87INnVroavCp8pXXVAs/ElwlHE vlZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728959597; x=1729564397; 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=d6CR/ADqiQ2Dxpd4+HZO14fvj/Wa7ThbZfNJ8yqesxw=; b=d5BCABiq1yNSGUnPpKDQ1RWoX6PXq3KvDWaMhcNQ66q2Q0Kh9MEa92KUcm4eQ3ao9+ 5gATtClDi9CVmquVsKt/+VlUNhffMdbMHAh6O2PwQzkJQP4THXOk6yGTJDCrdGVYYLU2 sE4kBBSOC+tz/dviH4tqKEZsEIzcQpSTu4jpy5XFuWl+hSfzOuQC2PrVSwf/kaYHOSih wk5doKO1tGZgGGehHxPljgS+U8pRdsOqvOoe43VVYNuR1WrLD1HYOq2yQBdQPdJQxNK9 1HWqIBgIFiylddQ/7eU1cIFVl0+PuYaZRNjg2Tc7dBAZS2PDRy68pg1MiPmVgXpkM5YB NQaA== X-Gm-Message-State: AOJu0YyCX9FL8VgE5txU2nxJ4HSboqXjVBVrYhzznmq0ya/MOwb66yWp SebjLBzqbzGVBs8VQaKBe81jZ8OQKePVrw+W7wjApZqDJWxFJpyljoCxHjnRbCg= X-Google-Smtp-Source: AGHT+IG6bnHnvsbzu9sBHl6OO0Ug6OSqUVCQN3McAfQrcuQsIzWGehNSfQ/NA9zIOPvFUyPa6//LXw== X-Received: by 2002:a17:90a:ee85:b0:2e2:b204:90c5 with SMTP id 98e67ed59e1d1-2e2f0d9d834mr17015131a91.33.1728959596729; Mon, 14 Oct 2024 19:33:16 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e2b41f8377sm7355854a91.1.2024.10.14.19.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 19:33:16 -0700 (PDT) Date: Mon, 14 Oct 2024 19:27:26 -0700 From: Stephen Hemminger To: vanshika.shukla@nxp.com Cc: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , Anatoly Burakov , Jun Yang Subject: Re: [v3 13/43] bus/fslmc: get MC VFIO group FD directly Message-ID: <20241014192726.24c878db@hermes.local> In-Reply-To: <20241014120126.170790-14-vanshika.shukla@nxp.com> References: <20240918075056.1838654-2-vanshika.shukla@nxp.com> <20241014120126.170790-1-vanshika.shukla@nxp.com> <20241014120126.170790-14-vanshika.shukla@nxp.com> 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 Mon, 14 Oct 2024 17:30:56 +0530 vanshika.shukla@nxp.com wrote: > +static int > +fslmc_vfio_open_group_fd(int iommu_group_num) > +{ > + int vfio_group_fd; > + char filename[PATH_MAX]; > + struct rte_mp_msg mp_req, *mp_rep; > + struct rte_mp_reply mp_reply = {0}; > + struct timespec ts = {.tv_sec = 5, .tv_nsec = 0}; > + struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param; > + > + /* if primary, try to open the group */ > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { > + /* try regular group format */ > + snprintf(filename, sizeof(filename), > + VFIO_GROUP_FMT, iommu_group_num); > + vfio_group_fd = open(filename, O_RDWR); > + if (vfio_group_fd <= 0) { > + DPAA2_BUS_ERR("Open VFIO group(%s) failed(%d)", > + filename, vfio_group_fd); > + } > + > + return vfio_group_fd; > + } > + /* if we're in a secondary process, request group fd from the primary > + * process via mp channel. > + */ > + p->req = SOCKET_REQ_GROUP; > + p->group_num = iommu_group_num; > + strcpy(mp_req.name, EAL_VFIO_MP); Later versions of checkpatch complain that strcpy() should not be used. Instead use strlcpy.