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 89CE445EED; Thu, 19 Dec 2024 17:15:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 242BE40265; Thu, 19 Dec 2024 17:15:38 +0100 (CET) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id B20C04025F for ; Thu, 19 Dec 2024 17:15:36 +0100 (CET) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-728eedfca37so1111683b3a.2 for ; Thu, 19 Dec 2024 08:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734624936; x=1735229736; 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=Fc4UXjarA7KORyhjMRZYEOJtYEk8PrIDge5oVWAzXPw=; b=InieUy5r+3huPb6UhaHfMEg+2BkFRB9hKuU74k1/6OEppVOn/tUuRKoo0xcNvq9/7B jF07jO5b8RRC7rjCCvf40/V6hMTMbPu5YVh2SuO7SkrQEgDjQ8LeuYPNFx7K0PK5jARw 0U98Y/6MADZGef6TcDeX9guqP5670TD0uiP8IDPjwYRoJNd5/aho6bdtpOKUYMXBcFYK vtp2DrDF9k8bjWDb677OMYJrt66DpPIKGY6l32aDq6OsrcsSWVvfHwjVJBJvomcMraKr fseaBwn8RGPAiDQJrR2i8ulKPS2FjkSQbqGqnwYHLGKklGRRvwByaxPCoHWz4AfkHXJF j9tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734624936; x=1735229736; 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=Fc4UXjarA7KORyhjMRZYEOJtYEk8PrIDge5oVWAzXPw=; b=to566h+sekVOqpL+akmuRWb+QzkakH/x7MHagq+yt0JIR3yMvg8uiXUqNIHbXDqTOr /xyL1bZFQh/Fs74N2xZGxGgCqYpn94jziA99sNiRUEJN47vxwaeY5lORTlo45T7gy5Ny VmwxIeyNFEbNjEiQ5AUj2e6V8jbWcji8bE7DyCKAtVmQWMpCY+b8/T9tYZQpVSM81TAW GJehO+49aeR3ehNOkGSsSm/hoeKt+KEI8S+UOgaftuFcAbeL4ImbIsACYfLCLZcTVNif oaRA1ZWwK6tTRGoIrXNO6mC+4h/JqzyO4DbvXgeCWJ69HGbbTElnVHSgd9laWFeoYQNB vfPA== X-Gm-Message-State: AOJu0YyBhTOIajrDAPvabVKi3CvzWpz0Kqpm0E+PKxQqWAPtXy5RNItK Wzv0VqbvVnxNaMiY5RdmQHqOmsUnVO2SC+BYXLZ/zv7OKVMhRpkHvvbsHrs9IpY= X-Gm-Gg: ASbGnctJdG2fu0qjQafTzhfDfJ3NmtIdvybivD8pYThMMml6qHOVP9DRVAe9MBUKi3H r0G5eFAqnfsYyhVmwteOe0tKiumIS/wO/h79Mbxa46jA6jmu6phOIo8yL5tgdTXhHLT0HkEu5H0 8YyR7aIAVLrcgZDnBWJF+FdIyLXvYuL1qRY5oq4t+Apq7qmedDediVsdtljc0nQZ8sE8oTm+izA Azn89QUztpHWksphDx8AopLBtG7ZxGyLr49cdNr5Me+WupgZKz1NUhvlpkV1LLa5L5xJbSldLtO EH8hR8QH/eaiWsNozhAGNVagfT2irEIlqw== X-Google-Smtp-Source: AGHT+IFA1UmTe2CPxfpKYGXFEsg5a/8RF5qgAG9Ifx/izDGdUVOPrdWpCfFaP6gMYPGBP9HGuMkEuQ== X-Received: by 2002:a05:6a20:914e:b0:1e1:bf32:7d3a with SMTP id adf61e73a8af0-1e5c763cbb2mr6525024637.26.1734624935656; Thu, 19 Dec 2024 08:15:35 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842aba72f14sm1358990a12.8.2024.12.19.08.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 08:15:35 -0800 (PST) Date: Thu, 19 Dec 2024 08:15:32 -0800 From: Stephen Hemminger To: Yunjian Wang Cc: , , , , , , Subject: Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading Message-ID: <20241219081532.345c7536@hermes.local> In-Reply-To: <91dc12662805a3867413940f856ba9454b91c579.1734588243.git.wangyunjian@huawei.com> References: <91dc12662805a3867413940f856ba9454b91c579.1734588243.git.wangyunjian@huawei.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 Thu, 19 Dec 2024 14:38:28 +0800 Yunjian Wang wrote: > - hdr = (struct virtio_net_hdr *)((uintptr_t)buf_vec[0].buf_addr); > + rte_memcpy((void *)(uintptr_t)&tmp_hdr, > + (void *)(uintptr_t)buf_vec[0].buf_addr, > + sizeof(struct virtio_net_hdr)); > } Do not introduce more rte_memcpy of a fixed size. You don't need that many casts! Why can you not use a structure assignment here.