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 C06154595A; Wed, 11 Sep 2024 05:57:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54C9742FA1; Wed, 11 Sep 2024 05:57:10 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 588A042F0F for ; Wed, 11 Sep 2024 05:57:08 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2068a7c9286so58806505ad.1 for ; Tue, 10 Sep 2024 20:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726027027; x=1726631827; 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=mX7B/LLTfjYRv6d/Nyo4XaLem7Z2gF6G/UdafYq0Q+4=; b=gbhW4iEGLKQ8OZZ28agGNcyHzRBvZK5T1KmeYnC8Q/rBvgm430MRWsux9mgfxMsodu 71zzUHYJuoKGRFCzKP4ENLK9grURTzt4xqIHwpmDJrg9TY2Q8YvoO68RHdqOEWZXKfRd 48jaLCtH++S7G0e7N7/8QGCsEyrk8LC1BChBB96eriCJjERnOcgtYkWDNVVMq/pbeKz5 RW2gGgNAtVNO/aWzVI6YU2v/qCjzbBt9t3ATQ4VpDPw3gi3ko27QVWCJSLfs7kM7kzWb w1i3IshlvOVPHF9WdLOFZRj6drWoOn1JaM3ijQvgeSbbbatkR6nzvG4nZ0cPTsZIu5YG Rbtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726027027; x=1726631827; 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=mX7B/LLTfjYRv6d/Nyo4XaLem7Z2gF6G/UdafYq0Q+4=; b=g4oq3YJcvdIYaTjpMp/ohOIkTVbXAdRnMErHUGmzfC5uhAreXXR2kaBLhpLx1Bqev4 NO6WkCBJJqlgPEid9gdp6dRh8fygtKGtfn2Zu4maoEDmvkgBheXlBp/Hja2zb+uFQolW bjt/WttwOi2BcuIPk8HIp79moa7sNcAVu3DIWWs3dGUKMxTxJBEIzLRzft6yKUZ4tzeH uDBuMkqUkPVGW28f36JhXy3ckrUY5f3XNisxMKvytt5lSJeCm2u9skoCKuyguc+mgdSE Z/k9mKRBsTIITz4WPLqmncOgqaVySD7YI+dCAgcHr26KitUl6uvgc2IgUUSH5gKN6Dqi Q1bg== X-Gm-Message-State: AOJu0YyY2pqt/eFRCduJYewtNEky8B2VzUqeNn7flJVzNGwB4Gx6T2x0 GsNmVvgoV6vVpQfGAXkRhqaA5akBMbHvwgdVZpbP14h9ob6UMuA+Zn5AcanQfXA= X-Google-Smtp-Source: AGHT+IF2pLEZgEWxMheLm2AC6/xd2YVH2TnVM5QYqN5qxf6NmjIVTbprauGWH+bpO4mWn5ZmXOeFcQ== X-Received: by 2002:a17:902:f789:b0:205:5a3f:76b5 with SMTP id d9443c01a7336-2074c6103fcmr45914145ad.28.1726027027410; Tue, 10 Sep 2024 20:57:07 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710f4be4bsm55228775ad.299.2024.09.10.20.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 20:57:07 -0700 (PDT) Date: Tue, 10 Sep 2024 20:49:51 -0700 From: Stephen Hemminger To: "WanRenyong" Cc: , , Subject: Re: [PATCH v2 05/19] net/xsc: add ioctl command interface Message-ID: <20240910204951.5baa3116@hermes.local> In-Reply-To: <20240911020740.3950704-6-wanry@yunsilicon.com> References: <20240911020740.3950704-6-wanry@yunsilicon.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 Wed, 11 Sep 2024 10:07:26 +0800 "WanRenyong" wrote: > + if (data_in != NULL && in_len > 0) > + rte_memcpy(hdr + 1, data_in, in_len); > + > + ret = ioctl(dev->ctrl_fd, cmd, hdr); > + if (ret == 0) { > + if (hdr->attr.error != 0) > + ret = hdr->attr.error; > + else if (data_out != NULL && out_len > 0) > + rte_memcpy(data_out, hdr + 1, out_len); Don't need to use rte_memcpy() here. Better to use regular memcpy() which has more checking