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 68BC141B82; Mon, 30 Jan 2023 17:50:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F40CE40DF6; Mon, 30 Jan 2023 17:50:16 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 11EA840C35 for ; Mon, 30 Jan 2023 17:50:15 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id cq16-20020a17090af99000b0022c9791ac39so3681445pjb.4 for ; Mon, 30 Jan 2023 08:50:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; 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=bjo2bDI9xdoXV6mqrVQ+DeOch2vLNBYL/ku3YFtmCJw=; b=gn4uJe4IdNjx7kI+qhs2LTQ/lMw+wz4HIftnPwqKTk0cqTmCOk0CnkJi77Ppsouz8h z4tyJdznYO8Mmj3R3YEmnCsPucTNKNWEO18EUQ4DiAhKE8tfw9e46HfZ+dJx0pwT1BLc smSEuBgaHaWOMMkpeAsEdCmb9vDOMxFFEoAQsHnQ40kYkEvJz2xrK7zOOuMApDiVetMJ EcC09uh/cbIm6jXyC8dhC1iiLONUZZych9BR55V7vBUy0kSJvtd21DrIKagEF0wAmeTR 2zRnRvpnFSWZCTd+6z5hyfS2O10IPagjYwQVnywiDxwCYMEo/loVvtAngcxuEU2Eqxpn LA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=bjo2bDI9xdoXV6mqrVQ+DeOch2vLNBYL/ku3YFtmCJw=; b=ftN4H/T6bu17AjqcS9i5FDdBhMK8RxVL2sFt0j4lt+TKudkNHbU5m47JOd0AfLNkoW RNlz8uuXZpXFhJojCnF1imx2RyE4uNPPiP5zahwR2cJjv7gkxXwraf6/NMtNauMaFihl Ui9IadeVY/QHmROfJ9EfaUbpj2EpisA3OFKIhADY2vLrD/g3bwNoRkBeh4DZs5FcR7xJ VVMPeKWrymqyYloaHhpLYa15yXXfOX1v8IPpUCGadRr2QKctaX4VvmbLiR3cSkmQ+T9a Aszl3DLR62LWENxDZcHxi8mLRpuh5iyebZjcM7QeF8nTmTSu271GtDWHxcZaQ8HViNBb wzFg== X-Gm-Message-State: AFqh2ko7ww0+PQrz7aAhkD9r163Rn+gJwMzW3pQOu57n1+XV4+GJr+3T 6T/Iq63nsL+ZjqEo+hmncH83ZQ== X-Google-Smtp-Source: AMrXdXtwNYvAYY4kEHfciBO3Pgn8j5ls7SBlXLCpFV5SS0PPtEqKsBritO/j8v77BKT3kaIbcY6cDw== X-Received: by 2002:a17:90a:4a95:b0:225:c3ab:3137 with SMTP id f21-20020a17090a4a9500b00225c3ab3137mr54200418pjh.44.1675097415178; Mon, 30 Jan 2023 08:50:15 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id d9-20020a17090a628900b002260cff0b2dsm7310994pjj.26.2023.01.30.08.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 08:50:15 -0800 (PST) Date: Mon, 30 Jan 2023 08:50:13 -0800 From: Stephen Hemminger To: Rongwei Liu Cc: , , , , Aman Singh , Yuying Zhang , Ferruh Yigit , "Andrew Rybchenko" , Olivier Matz , , Subject: Re: [PATCH v3 1/8] ethdev: add IPv6 routing extension header definition Message-ID: <20230130085013.02e4faf8@hermes.local> In-Reply-To: <20230130035941.1495874-2-rongweil@nvidia.com> References: <5da6632a-0976-dc1f-facb-f778c8aad8e6@oktetlabs.ru> <20230130035941.1495874-1-rongweil@nvidia.com> <20230130035941.1495874-2-rongweil@nvidia.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, 30 Jan 2023 05:59:33 +0200 Rongwei Liu wrote: > +static size_t > +rte_flow_item_ipv6_routing_ext_conv(void *buf, const void *data) > +{ > + struct rte_flow_item_ipv6_routing_ext *dst = buf; > + const struct rte_flow_item_ipv6_routing_ext *src = data; > + size_t len; > + > + if (src->hdr.hdr_len) > + len = src->hdr.hdr_len << 3; > + else > + len = src->hdr.segments_left << 4; > + if (dst == NULL) > + return 0; > + rte_memcpy((void *)((uintptr_t)(dst->hdr.segments)), src->hdr.segments, len); > + return len; Why use rte_memcpy for such a small size? Please just use normal memcpy which will cause more compiler and static scan checking. That cast is unnecessary in C because "segments" is an array and any valid pointer type can be passed as void *.