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 7FDB4A00C2; Thu, 16 Jun 2022 17:11:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CEEA4014F; Thu, 16 Jun 2022 17:11:03 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id EA75440141 for ; Thu, 16 Jun 2022 17:11:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655392261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z+WWyz/JHdaD+M6I8dGsDp70xK2MrxdmBemIubVu8CU=; b=aRCO0s8E2EqhNKTEWv92/nd3rN6+D4TzXCTDXMo8GPVGbaaQW1wJVGn6msfdKa6ea+dRHo 9pXwslI6NBwz+6QGCEhn7NmlTJfR0U4CKymmETJmtKO+bw4lbQlGQlyJhMDoGL229IZuQt OCUia/fpctNLIIVBP+dEwVgxQj4QmpI= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-208-wll5uMknOSWppQ1TINrUTA-1; Thu, 16 Jun 2022 11:11:00 -0400 X-MC-Unique: wll5uMknOSWppQ1TINrUTA-1 Received: by mail-lj1-f198.google.com with SMTP id z10-20020a05651c022a00b00255a0bf5ccfso265840ljn.13 for ; Thu, 16 Jun 2022 08:10:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Z+WWyz/JHdaD+M6I8dGsDp70xK2MrxdmBemIubVu8CU=; b=Hr8dukNEadXkXcLGGUUsIlu84SNdNNXxwOo7TZ8YjdFiPoyWeP4FRz2DMuXAD1opf+ TIojtAX1MiUFA2CxYksBIFgVjojw8X8xXkXqQbs0u/NUF5KKfOCh/rdqSo6fG5dU615h 1qT4ypgykz65/k325rGj3FhcnUaqaepDba+QO/6Nih8gTC3TAyFl5r6c/U+yUJZVV0uW wVsBv7QL6F5wCRznTlfAKGE9nQbYxtiHORX/DQv4DTUHO8xfCOgisgKaYUMUkAISKE6I GuHZK7iw1DXUVnJ/kbPxTeS6+IDiWRPVUoIDwVm9b0vn4tp3NctJEYK1R2HXlCxMxZfw NpjQ== X-Gm-Message-State: AJIora9DEm1CXVnDjnop7AicjzJvS38esERc7XM13CdxGwMJxa4wppYA EC94rcTax/rqHTsKR/e49DALqBIGKoNYXZkOqU/wkPnW+VbNLW0Nzdcy9PoBeA73GuMNI3lezy5 kT7wIg+O6WdxhcIZwU0M= X-Received: by 2002:a2e:6e0c:0:b0:255:98fb:cb45 with SMTP id j12-20020a2e6e0c000000b0025598fbcb45mr2881745ljc.55.1655392258238; Thu, 16 Jun 2022 08:10:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sLjaPyhuUWKFzW8JQGzf0YzuUB3xAxzDBRjn78hLvTftyNXTHjcavEUJr2oVu+jqtZdBeYcOzzGKiGdcBy7Fc= X-Received: by 2002:a2e:6e0c:0:b0:255:98fb:cb45 with SMTP id j12-20020a2e6e0c000000b0025598fbcb45mr2881715ljc.55.1655392257677; Thu, 16 Jun 2022 08:10:57 -0700 (PDT) MIME-Version: 1.0 References: <1649649325-1942-1-git-send-email-chcchc88@163.com> <1649993210-1854-1-git-send-email-chcchc88@163.com> In-Reply-To: <1649993210-1854-1-git-send-email-chcchc88@163.com> From: David Marchand Date: Thu, 16 Jun 2022 17:10:46 +0200 Message-ID: Subject: Re: [PATCH v7] ip_frag: add IPv4 options fragment and test data To: Huichao Cai , Konstantin Ananyev Cc: dev , Thomas Monjalon , Stephen Hemminger Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, Apr 15, 2022 at 5:27 AM Huichao Cai wrote: > > According to RFC791,the options may appear or not in datagrams. > They must be implemented by all IP modules (host and gateways). > What is optional is their transmission in any particular datagram, > not their implementation.So we have to deal with it during the > fragmenting process.Add some test data for the IPv4 header optional > field fragmenting. > > Signed-off-by: Huichao Cai gcc-12 raises warnings on both the unit test code and the library code. See below. > --- > app/test/test_ipfrag.c | 219 +++++++++++++++++++++++++++++= +++--- > lib/ip_frag/rte_ipv4_fragmentation.c | 70 ++++++++++- > lib/net/rte_ip.h | 6 + > 3 files changed, 272 insertions(+), 23 deletions(-) > > diff --git a/app/test/test_ipfrag.c b/app/test/test_ipfrag.c > index 1ced25a..610a86b 100644 > --- a/app/test/test_ipfrag.c > +++ b/app/test/test_ipfrag.c > @@ -18,10 +18,50 @@ > #define NUM_MBUFS 128 > #define BURST 32 > > +uint8_t expected_first_frag_ipv4_opts_copied[] =3D { > + 0x07, 0x0b, 0x04, 0x00, > + 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x83, > + 0x07, 0x04, 0xc0, 0xa8, > + 0xe3, 0x96, 0x00, 0x00, > +}; > + > +uint8_t expected_sub_frag_ipv4_opts_copied[] =3D { > + 0x83, 0x07, 0x04, 0xc0, > + 0xa8, 0xe3, 0x96, 0x00, > +}; > + > +uint8_t expected_first_frag_ipv4_opts_nocopied[] =3D { > + 0x07, 0x0b, 0x04, 0x00, > + 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, > +}; > + > +uint8_t expected_sub_frag_ipv4_opts_nocopied[0]; > + > +struct test_opt_data { > + bool is_first_frag; /**< offset is 0 */ > + bool opt_copied; /**< ip option copied flag */ > + uint16_t len; /**< option data len */ > + uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ > +}; > + > static struct rte_mempool *pkt_pool, > *direct_pool, > *indirect_pool; > > +static inline void > +hex_to_str(uint8_t *hex, uint16_t len, char *str) > +{ > + int i; > + > + for (i =3D 0; i < len; i++) { > + sprintf(str, "%02x", hex[i]); > + str +=3D 2; > + } > + *str =3D 0; > +} > + > static int > setup_buf_pool(void) > { > @@ -88,23 +128,67 @@ static void ut_teardown(void) > { > } > > +static inline void > +test_get_ipv4_opt(bool is_first_frag, bool opt_copied, > + struct test_opt_data *expected_opt) > +{ > + if (is_first_frag) { > + if (opt_copied) { > + expected_opt->len =3D > + sizeof(expected_first_frag_ipv4_opts_copi= ed); > + rte_memcpy(expected_opt->data, > + expected_first_frag_ipv4_opts_copied, > + sizeof(expected_first_frag_ipv4_opts_copi= ed)); > + } else { > + expected_opt->len =3D > + sizeof(expected_first_frag_ipv4_opts_noco= pied); > + rte_memcpy(expected_opt->data, > + expected_first_frag_ipv4_opts_nocopied, > + sizeof(expected_first_frag_ipv4_opts_noco= pied)); > + } > + } else { > + if (opt_copied) { > + expected_opt->len =3D > + sizeof(expected_sub_frag_ipv4_opts_copied= ); > + rte_memcpy(expected_opt->data, > + expected_sub_frag_ipv4_opts_copied, > + sizeof(expected_sub_frag_ipv4_opts_copied= )); > + } else { > + expected_opt->len =3D > + sizeof(expected_sub_frag_ipv4_opts_nocopi= ed); > + rte_memcpy(expected_opt->data, > + expected_sub_frag_ipv4_opts_nocopied, > + sizeof(expected_sub_frag_ipv4_opts_nocopi= ed)); > + } > + } > +} > + > static void > -v4_allocate_packet_of(struct rte_mbuf *b, int fill, > - size_t s, int df, uint8_t mf, uint16_t off, > - uint8_t ttl, uint8_t proto, uint16_t pktid) > +v4_allocate_packet_of(struct rte_mbuf *b, int fill, size_t s, > + int df, uint8_t mf, uint16_t off, uint8_t ttl, uint8_t proto, > + uint16_t pktid, bool have_opt, bool is_first_frag, bool opt_copie= d) > { > /* Create a packet, 2k bytes long */ > b->data_off =3D 0; > char *data =3D rte_pktmbuf_mtod(b, char *); > - rte_be16_t fragment_offset =3D 0; /**< fragmentation offset */ > + rte_be16_t fragment_offset =3D 0; /* fragmentation offset */ > + uint16_t iph_len; > + struct test_opt_data opt; > + > + opt.len =3D 0; > + > + if (have_opt) > + test_get_ipv4_opt(is_first_frag, opt_copied, &opt); FAILED: app/test/dpdk-test.p/test_ipfrag.c.o ccache gcc -Iapp/test/dpdk-test.p -Iapp/test -I../app/test -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/x86/include -I../lib/eal/x86/include -Ilib/kvargs -I../lib/kvargs -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/ring -I../lib/ring -Ilib/rcu -I../lib/rcu -Ilib/mempool -I../lib/mempool -Ilib/mbuf -I../lib/mbuf -Ilib/net -I../lib/net -Ilib/meter -I../lib/meter -Ilib/ethdev -I../lib/ethdev -Ilib/pci -I../lib/pci -Ilib/cmdline -I../lib/cmdline -Ilib/hash -I../lib/hash -Ilib/timer -I../lib/timer -Ilib/acl -I../lib/acl -Ilib/bbdev -I../lib/bbdev -Ilib/bitratestats -I../lib/bitratestats -Ilib/bpf -I../lib/bpf -Ilib/cfgfile -I../lib/cfgfile -Ilib/compressdev -I../lib/compressdev -Ilib/cryptodev -I../lib/cryptodev -Ilib/distributor -I../lib/distributor -Ilib/efd -I../lib/efd -Ilib/eventdev -I../lib/eventdev -Ilib/gpudev -I../lib/gpudev -Ilib/gro -I../lib/gro -Ilib/gso -I../lib/gso -Ilib/ip_frag -I../lib/ip_frag -Ilib/jobstats -I../lib/jobstats -Ilib/kni -I../lib/kni -Ilib/latencystats -I../lib/latencystats -Ilib/lpm -I../lib/lpm -Ilib/member -I../lib/member -Ilib/pcapng -I../lib/pcapng -Ilib/power -I../lib/power -Ilib/rawdev -I../lib/rawdev -Ilib/regexdev -I../lib/regexdev -Ilib/dmadev -I../lib/dmadev -Ilib/rib -I../lib/rib -Ilib/reorder -I../lib/reorder -Ilib/sched -I../lib/sched -Ilib/security -I../lib/security -Ilib/stack -I../lib/stack -Ilib/vhost -I../lib/vhost -Ilib/ipsec -I../lib/ipsec -Ilib/fib -I../lib/fib -Ilib/port -I../lib/port -Ilib/pdump -I../lib/pdump -Ilib/table -I../lib/table -Ilib/pipeline -I../lib/pipeline -Ilib/flow_classify -I../lib/flow_classify -Ilib/graph -I../lib/graph -Ilib/node -I../lib/node -Idrivers/bus/pci -I../drivers/bus/pci -I../drivers/bus/pci/linux -Idrivers/bus/vdev -I../drivers/bus/vdev -Idrivers/mempool/ring -I../drivers/mempool/ring -Idrivers/mempool/stack -I../drivers/mempool/stack -Idrivers/event/skeleton -I../drivers/event/skeleton -Idrivers/net/bonding -I../drivers/net/bonding -Idrivers/net/ring -I../drivers/net/ring -Idrivers/net/null -I../drivers/net/null -Idrivers/crypto/scheduler -I../drivers/crypto/scheduler -fdiagnostics-color=3Dalways -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -Wextra -Werror -O3 -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-zero-length-bounds -D_GNU_SOURCE -march=3Dnative -DALLOW_EXPERIMENTAL_API -Wno-format-truncation -fno-strict-aliasing -DALLOW_INTERNAL_API -MD -MQ app/test/dpdk-test.p/test_ipfrag.c.o -MF app/test/dpdk-test.p/test_ipfrag.c.o.d -o app/test/dpdk-test.p/test_ipfrag.c.o -c ../app/test/test_ipfrag.c In file included from /usr/lib/gcc/x86_64-redhat-linux/12/include/immintrin.h:43, from /usr/lib/gcc/x86_64-redhat-linux/12/include/x86intrin.h:32, from ../lib/eal/x86/include/rte_vect.h:31, from ../lib/eal/x86/include/rte_memcpy.h:17, from ../lib/mempool/rte_mempool.h:46, from ../lib/mbuf/rte_mbuf.h:38, from ../lib/net/rte_ip.h:32, from ../app/test/test_ipfrag.c:12: In function =E2=80=98_mm256_loadu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:346:9, inlined from =E2=80=98rte_mov128=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:369:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:445:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98v4_allocate_packet_of=E2=80=99 at ../app/test/tes= t_ipfrag.c:230:2, inlined from =E2=80=98test_ip_frag=E2=80=99 at ../app/test/test_ipfrag.= c:402:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript =E2=80=98__m256i_u[1]=E2=80=99 is partly outside array boun= ds of =E2=80=98struct test_opt_data[1]=E2=80=99 [-Werror=3Darray-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipfrag.c: In function =E2=80=98test_ip_frag=E2=80=99: ../app/test/test_ipfrag.c:187:30: note: at offset 36 into object =E2=80=98o= pt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ In function =E2=80=98_mm256_loadu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:346:9, inlined from =E2=80=98rte_mov128=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:370:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:445:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98v4_allocate_packet_of=E2=80=99 at ../app/test/tes= t_ipfrag.c:230:2, inlined from =E2=80=98test_ip_frag=E2=80=99 at ../app/test/test_ipfrag.= c:402:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript 2 is outside array bounds of =E2=80=98struct test_opt_data[= 1]=E2=80=99 [-Werror=3Darray-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipfrag.c: In function =E2=80=98test_ip_frag=E2=80=99: ../app/test/test_ipfrag.c:187:30: note: at offset 68 into object =E2=80=98o= pt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ In function =E2=80=98_mm256_loadu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:346:9, inlined from =E2=80=98rte_mov128=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:371:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:445:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98v4_allocate_packet_of=E2=80=99 at ../app/test/tes= t_ipfrag.c:230:2, inlined from =E2=80=98test_ip_frag=E2=80=99 at ../app/test/test_ipfrag.= c:402:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript 3 is outside array bounds of =E2=80=98struct test_opt_data[= 1]=E2=80=99 [-Werror=3Darray-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipfrag.c: In function =E2=80=98test_ip_frag=E2=80=99: ../app/test/test_ipfrag.c:187:30: note: at offset 100 into object =E2=80=98opt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ In function =E2=80=98_mm256_loadu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:346:9, inlined from =E2=80=98rte_mov64=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:358:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:452:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98v4_allocate_packet_of=E2=80=99 at ../app/test/tes= t_ipfrag.c:230:2, inlined from =E2=80=98test_ip_frag=E2=80=99 at ../app/test/test_ipfrag.= c:402:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript =E2=80=98__m256i_u[1]=E2=80=99 is partly outside array boun= ds of =E2=80=98const void[44]=E2=80=99 [-Werror=3Darray-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipfrag.c: In function =E2=80=98test_ip_frag=E2=80=99: ../app/test/test_ipfrag.c:57:17: note: at offset 36 into object =E2=80=98da= ta=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ ../app/test/test_ipfrag.c:57:17: note: at offset [37, 40] into object =E2=80=98data=E2=80=99 of size 40 ../app/test/test_ipfrag.c:187:30: note: at offset 168 into object =E2=80=98opt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ ../app/test/test_ipfrag.c:57:17: note: at offset 36 into object =E2=80=98da= ta=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ In function =E2=80=98_mm256_loadu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:346:9, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:457:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98v4_allocate_packet_of=E2=80=99 at ../app/test/tes= t_ipfrag.c:230:2, inlined from =E2=80=98test_ip_frag=E2=80=99 at ../app/test/test_ipfrag.= c:402:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript [2, 2051] is outside array bounds of =E2=80=98const void[44= ]=E2=80=99 [-Werror=3Darray-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipfrag.c: In function =E2=80=98test_ip_frag=E2=80=99: ../app/test/test_ipfrag.c:57:17: note: at offset [4, 40] into object =E2=80=98data=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ ../app/test/test_ipfrag.c:57:17: note: at offset [5, 40] into object =E2=80=98data=E2=80=99 of size 40 ../app/test/test_ipfrag.c:187:30: note: at offset [136, 200] into object =E2=80=98opt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ ../app/test/test_ipfrag.c:57:17: note: at offset [4, 40] into object =E2=80=98data=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ ../app/test/test_ipfrag.c:57:17: note: at offset [5, 40] into object =E2=80=98data=E2=80=99 of size 40 ../app/test/test_ipfrag.c:187:30: note: at offset [136, 200] into object =E2=80=98opt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ ../app/test/test_ipfrag.c:57:17: note: at offset [4, 40] into object =E2=80=98data=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ In function =E2=80=98_mm256_loadu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:346:9, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:458:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98v4_allocate_packet_of=E2=80=99 at ../app/test/tes= t_ipfrag.c:230:2, inlined from =E2=80=98test_ip_frag=E2=80=99 at ../app/test/test_ipfrag.= c:402:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript [2, 2052] is outside array bounds of =E2=80=98const void[44= ]=E2=80=99 [-Werror=3Darray-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipfrag.c: In function =E2=80=98test_ip_frag=E2=80=99: ../app/test/test_ipfrag.c:57:17: note: at offset [5, 40] into object =E2=80=98data=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ ../app/test/test_ipfrag.c:57:17: note: at offset [6, 40] into object =E2=80=98data=E2=80=99 of size 40 ../app/test/test_ipfrag.c:187:30: note: at offset [137, 201] into object =E2=80=98opt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ ../app/test/test_ipfrag.c:57:17: note: at offset [5, 40] into object =E2=80=98data=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ ../app/test/test_ipfrag.c:57:17: note: at offset [6, 40] into object =E2=80=98data=E2=80=99 of size 40 ../app/test/test_ipfrag.c:187:30: note: at offset [137, 201] into object =E2=80=98opt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ ../app/test/test_ipfrag.c:57:17: note: at offset [5, 40] into object =E2=80=98data=E2=80=99 of size 40 57 | uint8_t data[RTE_IPV4_HDR_OPT_MAX_LEN]; /**< option data */ | ^~~~ In function =E2=80=98_mm256_loadu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:346:9, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:438:3, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98v4_allocate_packet_of=E2=80=99 at ../app/test/tes= t_ipfrag.c:230:2, inlined from =E2=80=98test_ip_frag=E2=80=99 at ../app/test/test_ipfrag.= c:402:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript =E2=80=98__m256i_u[0]=E2=80=99 is partly outside array boun= ds of =E2=80=98struct test_opt_data[1]=E2=80=99 [-Werror=3Darray-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipfrag.c: In function =E2=80=98test_ip_frag=E2=80=99: ../app/test/test_ipfrag.c:187:30: note: at offset [21, 36] into object =E2=80=98opt=E2=80=99 of size 44 187 | struct test_opt_data opt; | ^~~ cc1: all warnings being treated as errors ninja: build stopped: subcommand failed. > > - memset(data, fill, sizeof(struct rte_ipv4_hdr) + s); > + iph_len =3D sizeof(struct rte_ipv4_hdr) + opt.len; > + memset(data, fill, iph_len + s); > > struct rte_ipv4_hdr *hdr =3D (struct rte_ipv4_hdr *)data; > > - hdr->version_ihl =3D 0x45; /* standard IP header... */ > + hdr->version_ihl =3D 0x40; /* ipv4 */ > + hdr->version_ihl +=3D (iph_len / 4); > hdr->type_of_service =3D 0; > - b->pkt_len =3D s + sizeof(struct rte_ipv4_hdr); > + b->pkt_len =3D s + iph_len; > b->data_len =3D b->pkt_len; > hdr->total_length =3D rte_cpu_to_be_16(b->pkt_len); > hdr->packet_id =3D rte_cpu_to_be_16(pktid); > @@ -131,6 +215,8 @@ static void ut_teardown(void) > hdr->hdr_checksum =3D 0; > hdr->src_addr =3D rte_cpu_to_be_32(0x8080808); > hdr->dst_addr =3D rte_cpu_to_be_32(0x8080404); > + > + rte_memcpy(hdr + 1, opt.data, opt.len); > } > > static void > @@ -187,6 +273,45 @@ static void ut_teardown(void) > } > } > > +static inline void > +test_get_frag_opt(struct rte_mbuf **mb, int32_t num, > + struct test_opt_data *opt, int ipv, bool opt_copied) > +{ > + int32_t i; > + > + for (i =3D 0; i < num; i++) { > + if (ipv =3D=3D 4) { > + struct rte_ipv4_hdr *iph =3D > + rte_pktmbuf_mtod(mb[i], struct rte_ipv4_hdr *= ); > + uint16_t header_len =3D (iph->version_ihl & > + RTE_IPV4_HDR_IHL_MASK) * > + RTE_IPV4_IHL_MULTIPLIER; > + uint16_t opt_len =3D header_len - > + sizeof(struct rte_ipv4_hdr); > + > + opt->opt_copied =3D opt_copied; > + > + if ((rte_be_to_cpu_16(iph->fragment_offset) & > + RTE_IPV4_HDR_OFFSET_MASK) =3D=3D 0) > + opt->is_first_frag =3D true; > + else > + opt->is_first_frag =3D false; > + > + if (likely(opt_len <=3D RTE_IPV4_HDR_OPT_MAX_LEN)= ) { > + char *iph_opt =3D rte_pktmbuf_mtod_offset= (mb[i], > + char *, sizeof(struct rte_ipv4_hdr)); > + opt->len =3D opt_len; > + rte_memcpy(opt->data, iph_opt, opt_len); > + } else { > + opt->len =3D RTE_IPV4_HDR_OPT_MAX_LEN; > + memset(opt->data, RTE_IPV4_HDR_OPT_EOL, > + sizeof(opt->data)); > + } > + opt++; > + } > + } > +} > + > static int > test_ip_frag(void) > { > @@ -206,32 +331,52 @@ static void ut_teardown(void) > uint16_t pkt_id; > int expected_frags; > uint16_t expected_fragment_offset[BURST]; > + bool have_opt; > + bool is_first_frag; > + bool opt_copied; > } tests[] =3D { > {4, 1280, 1400, 0, 0, 0, 64, IPPROTO_ICMP, RND_ID, = 2, > - {0x2000, 0x009D}}, > + {0x2000, 0x009D}, false}, > {4, 1280, 1400, 0, 0, 0, 64, IPPROTO_ICMP, 0, = 2, > - {0x2000, 0x009D}}, > + {0x2000, 0x009D}, false}, > {4, 600, 1400, 0, 0, 0, 64, IPPROTO_ICMP, RND_ID, = 3, > - {0x2000, 0x2048, 0x0090}}, > + {0x2000, 0x2048, 0x0090}, false}, > {4, 4, 1400, 0, 0, 0, 64, IPPROTO_ICMP, RND_ID, -EINV= AL}, > {4, 600, 1400, 1, 0, 0, 64, IPPROTO_ICMP, RND_ID, -ENOTS= UP}, > {4, 600, 1400, 0, 0, 0, 0, IPPROTO_ICMP, RND_ID, = 3, > - {0x2000, 0x2048, 0x0090}}, > + {0x2000, 0x2046, 0x008C}, true, true, true}, > + /* The first fragment */ > + {4, 68, 104, 0, 1, 0, 0, IPPROTO_ICMP, RND_ID, = 5, > + {0x2000, 0x2003, 0x2006, 0x2009, 0x200C}, true, true, t= rue}, > + /* The middle fragment */ > {4, 68, 104, 0, 1, 13, 0, IPPROTO_ICMP, RND_ID, = 3, > - {0x200D, 0x2013, 0x2019}}, > - > + {0x200D, 0x2012, 0x2017}, true, false, true}, > + /* The last fragment */ > + {4, 68, 104, 0, 0, 26, 0, IPPROTO_ICMP, RND_ID, = 3, > + {0x201A, 0x201F, 0x0024}, true, false, true}, > + /* The first fragment */ > + {4, 68, 104, 0, 1, 0, 0, IPPROTO_ICMP, RND_ID, = 4, > + {0x2000, 0x2004, 0x2008, 0x200C}, true, true, false}, > + /* The middle fragment */ > + {4, 68, 104, 0, 1, 13, 0, IPPROTO_ICMP, RND_ID, = 3, > + {0x200D, 0x2013, 0x2019}, true, false, false}, > + /* The last fragment */ > + {4, 68, 104, 0, 0, 26, 0, IPPROTO_ICMP, RND_ID, = 3, > + {0x201A, 0x2020, 0x0026}, true, false, false}, > {6, 1280, 1400, 0, 0, 0, 64, IPPROTO_ICMP, RND_ID, = 2, > - {0x0001, 0x04D0}}, > + {0x0001, 0x04D0}, false}, > {6, 1300, 1400, 0, 0, 0, 64, IPPROTO_ICMP, RND_ID, = 2, > - {0x0001, 0x04E0}}, > + {0x0001, 0x04E0}, false}, > {6, 4, 1400, 0, 0, 0, 64, IPPROTO_ICMP, RND_ID, -EINV= AL}, > {6, 1300, 1400, 0, 0, 0, 0, IPPROTO_ICMP, RND_ID, = 2, > - {0x0001, 0x04E0}}, > + {0x0001, 0x04E0}, false}, > }; > > for (i =3D 0; i < RTE_DIM(tests); i++) { > int32_t len =3D 0; > uint16_t fragment_offset[BURST]; > + struct test_opt_data opt_res[BURST]; > + struct test_opt_data opt_exp; > uint16_t pktid =3D tests[i].pkt_id; > struct rte_mbuf *pkts_out[BURST]; > struct rte_mbuf *b =3D rte_pktmbuf_alloc(pkt_pool); > @@ -250,7 +395,10 @@ static void ut_teardown(void) > tests[i].set_of, > tests[i].ttl, > tests[i].proto, > - pktid); > + pktid, > + tests[i].have_opt, > + tests[i].is_first_frag, > + tests[i].opt_copied); > } else if (tests[i].ipv =3D=3D 6) { > v6_allocate_packet_of(b, 0x41414141, > tests[i].pkt_size, > @@ -275,17 +423,20 @@ static void ut_teardown(void) > if (len > 0) { > test_get_offset(pkts_out, len, > fragment_offset, tests[i].ipv); > + if (tests[i].have_opt) > + test_get_frag_opt(pkts_out, len, opt_res, > + tests[i].ipv, tests[i].opt_copied= ); > test_free_fragments(pkts_out, len); > } > > - printf("%zd: checking %d with %d\n", i, len, > + printf("[check frag number]%zd: checking %d with %d\n", i= , len, > tests[i].expected_frags); > RTE_TEST_ASSERT_EQUAL(len, tests[i].expected_frags, > "Failed case %zd.\n", i); > > if (len > 0) { > for (j =3D 0; j < (size_t)len; j++) { > - printf("%zd-%zd: checking %d with %d\n", > + printf("[check offset]%zd-%zd: checking %= d with %d\n", > i, j, fragment_offset[j], > rte_cpu_to_be_16( > tests[i].expected_fragment_offset= [j])); > @@ -294,6 +445,36 @@ static void ut_teardown(void) > tests[i].expected_fragment_offset= [j]), > "Failed case %zd.\n", i); > } > + > + if (tests[i].have_opt && (tests[i].ipv =3D=3D 4))= { > + for (j =3D 0; j < (size_t)len; j++) { > + char opt_res_str[2 * > + RTE_IPV4_HDR_OPT_MAX_LEN = + 1]; > + char opt_exp_str[2 * > + RTE_IPV4_HDR_OPT_MAX_LEN = + 1]; > + > + test_get_ipv4_opt( > + opt_res[j].is_first_frag, > + opt_res[j].opt_copied, > + &opt_exp); > + hex_to_str(opt_res[j].data, > + opt_res[j].len, > + opt_res_str); > + hex_to_str(opt_exp.data, > + opt_exp.len, > + opt_exp_str); > + > + printf( > + "[check ipv4 option]%zd-%= zd: checking (len:%u)%s with (len:%u)%s\n", > + i, j, > + opt_res[j].len, opt_res_s= tr, > + opt_exp.len, opt_exp_str)= ; > + RTE_TEST_ASSERT_SUCCESS( > + strcmp(opt_res_st= r, > + opt_exp_s= tr), > + "Failed case %zd.\n", i); > + } > + } > } > > } > diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c b/lib/ip_frag/rte_ipv4_= fragmentation.c > index 2e7739d..a562424 100644 > --- a/lib/ip_frag/rte_ipv4_fragmentation.c > +++ b/lib/ip_frag/rte_ipv4_fragmentation.c > @@ -22,6 +22,8 @@ > > #define IPV4_HDR_FO_ALIGN (1 << RTE_IPV4_HD= R_FO_SHIFT) > > +#define IPV4_HDR_MAX_LEN 60 > + > static inline void __fill_ipv4hdr_frag(struct rte_ipv4_hdr *dst, > const struct rte_ipv4_hdr *src, uint16_t header_len, > uint16_t len, uint16_t fofs, uint16_t dofs, uint32_t mf) > @@ -41,6 +43,49 @@ static inline void __free_fragments(struct rte_mbuf *m= b[], uint32_t num) > rte_pktmbuf_free(mb[i]); > } > > +static inline uint16_t __create_ipopt_frag_hdr(uint8_t *iph, > + uint16_t ipopt_len, uint8_t *ipopt_frag_hdr) > +{ > + uint16_t len =3D ipopt_len; > + struct rte_ipv4_hdr *iph_opt =3D (struct rte_ipv4_hdr *)ipopt_fra= g_hdr; > + > + ipopt_len =3D 0; > + rte_memcpy(ipopt_frag_hdr, iph, sizeof(struct rte_ipv4_hdr)); > + ipopt_frag_hdr +=3D sizeof(struct rte_ipv4_hdr); > + > + uint8_t *p_opt =3D iph + sizeof(struct rte_ipv4_hdr); > + > + while (len > 0) { > + if (unlikely(*p_opt =3D=3D RTE_IPV4_HDR_OPT_NOP)) { > + len--; > + p_opt++; > + continue; > + } else if (unlikely(*p_opt =3D=3D RTE_IPV4_HDR_OPT_EOL)) > + break; > + > + if (unlikely(p_opt[1] < 2 || p_opt[1] > len)) > + break; > + > + if (RTE_IPV4_HDR_OPT_COPIED(*p_opt)) { > + rte_memcpy(ipopt_frag_hdr + ipopt_len, > + p_opt, p_opt[1]); > + ipopt_len +=3D p_opt[1]; > + } > + > + len -=3D p_opt[1]; > + p_opt +=3D p_opt[1]; > + } > + > + len =3D RTE_ALIGN_CEIL(ipopt_len, RTE_IPV4_IHL_MULTIPLIER); > + memset(ipopt_frag_hdr + ipopt_len, > + RTE_IPV4_HDR_OPT_EOL, len - ipopt_len); > + ipopt_len =3D len; > + iph_opt->ihl =3D (sizeof(struct rte_ipv4_hdr) + ipopt_len) / > + RTE_IPV4_IHL_MULTIPLIER; > + > + return ipopt_len; > +} > + > /** > * IPv4 fragmentation. > * > @@ -76,6 +121,8 @@ static inline void __free_fragments(struct rte_mbuf *m= b[], uint32_t num) > uint32_t more_in_segs; > uint16_t fragment_offset, flag_offset, frag_size, header_len; > uint16_t frag_bytes_remaining; > + uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; > + uint16_t ipopt_len; > > /* > * Formal parameter checking. > @@ -118,6 +165,10 @@ static inline void __free_fragments(struct rte_mbuf = *mb[], uint32_t num) > out_pkt_pos =3D 0; > fragment_offset =3D 0; > > + ipopt_len =3D header_len - sizeof(struct rte_ipv4_hdr); > + if (unlikely(ipopt_len > RTE_IPV4_HDR_OPT_MAX_LEN)) > + return -EINVAL; > + > more_in_segs =3D 1; > while (likely(more_in_segs)) { > struct rte_mbuf *out_pkt =3D NULL, *out_seg_prev =3D NULL= ; > @@ -188,10 +239,21 @@ static inline void __free_fragments(struct rte_mbuf= *mb[], uint32_t num) > (uint16_t)out_pkt->pkt_len, > flag_offset, fragment_offset, more_in_segs); > > - fragment_offset =3D (uint16_t)(fragment_offset + > - out_pkt->pkt_len - header_len); > - > - out_pkt->l3_len =3D header_len; > + if (unlikely((fragment_offset =3D=3D 0) && (ipopt_len) && > + ((flag_offset & RTE_IPV4_HDR_OFFSET_MASK) =3D= =3D 0))) { > + ipopt_len =3D __create_ipopt_frag_hdr((uint8_t *)= in_hdr, > + ipopt_len, ipopt_frag_hdr); > + fragment_offset =3D (uint16_t)(fragment_offset + > + out_pkt->pkt_len - header_len); > + out_pkt->l3_len =3D header_len; > + > + header_len =3D sizeof(struct rte_ipv4_hdr) + ipop= t_len; > + in_hdr =3D (struct rte_ipv4_hdr *)ipopt_frag_hdr; > + } else { > + fragment_offset =3D (uint16_t)(fragment_offset + > + out_pkt->pkt_len - header_len); > + out_pkt->l3_len =3D header_len; > + } FAILED: lib/librte_ip_frag.a.p/ip_frag_rte_ipv4_fragmentation.c.o ccache gcc -Ilib/librte_ip_frag.a.p -Ilib -I../lib -Ilib/ip_frag -I../lib/ip_frag -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/x86/include -I../lib/eal/x86/include -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/ethdev -I../lib/ethdev -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/meter -I../lib/meter -Ilib/hash -I../lib/hash -Ilib/rcu -I../lib/rcu -fdiagnostics-color=3Dalways -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -Wextra -Werror -O3 -g -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-zero-length-bounds -D_GNU_SOURCE -fPIC -march=3Dnative -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=3Dlib.ip_frag -MD -MQ lib/librte_ip_frag.a.p/ip_frag_rte_ipv4_fragmentation.c.o -MF lib/librte_ip_frag.a.p/ip_frag_rte_ipv4_fragmentation.c.o.d -o lib/librte_ip_frag.a.p/ip_frag_rte_ipv4_fragmentation.c.o -c ../lib/ip_frag/rte_ipv4_fragmentation.c In file included from /usr/lib/gcc/x86_64-redhat-linux/12/include/immintrin.h:43, from /usr/lib/gcc/x86_64-redhat-linux/12/include/x86intrin.h:32, from ../lib/eal/x86/include/rte_vect.h:31, from ../lib/eal/x86/include/rte_memcpy.h:17, from ../lib/ip_frag/rte_ipv4_fragmentation.c:8: In function =E2=80=98_mm256_storeu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:347:2, inlined from =E2=80=98rte_mov128=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:369:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:445:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98__create_ipopt_frag_hdr=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:68:4, inlined from =E2=80=98rte_ipv4_fragment_packet=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:242:16: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript =E2=80=98__m256i_u[1]=E2=80=99 is partly outside array boun= ds of =E2=80=98uint8_t[60]=E2=80=99 {aka =E2=80=98unsigned char[60]=E2=80=99} [-W= error=3Darray-bounds] 935 | *__P =3D __A; | ~~~~~^~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c: In function =E2=80=98rte_ipv4_frag= ment_packet=E2=80=99: ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [52, 60] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 122 | uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; | ^~~~~~~~~~~~~~ In function =E2=80=98_mm256_storeu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:347:2, inlined from =E2=80=98rte_mov128=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:370:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:445:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98__create_ipopt_frag_hdr=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:68:4, inlined from =E2=80=98rte_ipv4_fragment_packet=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:242:16: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript [2, 3] is outside array bounds of =E2=80=98uint8_t[60]=E2= =80=99 {aka =E2=80=98unsigned char[60]=E2=80=99} [-Werror=3Darray-bounds] 935 | *__P =3D __A; | ~~~~~^~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c: In function =E2=80=98rte_ipv4_frag= ment_packet=E2=80=99: ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [84, 124] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 122 | uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; | ^~~~~~~~~~~~~~ In function =E2=80=98_mm256_storeu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:347:2, inlined from =E2=80=98rte_mov128=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:371:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:445:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98__create_ipopt_frag_hdr=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:68:4, inlined from =E2=80=98rte_ipv4_fragment_packet=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:242:16: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript [3, 4] is outside array bounds of =E2=80=98uint8_t[60]=E2= =80=99 {aka =E2=80=98unsigned char[60]=E2=80=99} [-Werror=3Darray-bounds] 935 | *__P =3D __A; | ~~~~~^~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c: In function =E2=80=98rte_ipv4_frag= ment_packet=E2=80=99: ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [116, 156] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 122 | uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; | ^~~~~~~~~~~~~~ In function =E2=80=98_mm256_storeu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:347:2, inlined from =E2=80=98rte_mov64=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:358:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:452:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98__create_ipopt_frag_hdr=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:68:4, inlined from =E2=80=98rte_ipv4_fragment_packet=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:242:16: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript =E2=80=98__m256i_u[1]=E2=80=99 is partly outside array boun= ds of =E2=80=98void[60]=E2=80=99 [-Werror=3Darray-bounds] 935 | *__P =3D __A; | ~~~~~^~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c: In function =E2=80=98rte_ipv4_frag= ment_packet=E2=80=99: ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [180, 240] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 122 | uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; | ^~~~~~~~~~~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [52, 60] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 In function =E2=80=98_mm256_storeu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:347:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:457:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98__create_ipopt_frag_hdr=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:68:4, inlined from =E2=80=98rte_ipv4_fragment_packet=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:242:16: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript [2, 7] is outside array bounds of =E2=80=98void[60]=E2=80= =99 [-Werror=3Darray-bounds] 935 | *__P =3D __A; | ~~~~~^~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c: In function =E2=80=98rte_ipv4_frag= ment_packet=E2=80=99: ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [148, 272] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 122 | uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; | ^~~~~~~~~~~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [148, 272] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [20, 60] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 In function =E2=80=98_mm256_storeu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:347:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:458:4, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98__create_ipopt_frag_hdr=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:68:4, inlined from =E2=80=98rte_ipv4_fragment_packet=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:242:16: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript [2, 8] is outside array bounds of =E2=80=98void[60]=E2=80= =99 [-Werror=3Darray-bounds] 935 | *__P =3D __A; | ~~~~~^~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c: In function =E2=80=98rte_ipv4_frag= ment_packet=E2=80=99: ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [149, 273] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 122 | uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; | ^~~~~~~~~~~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [149, 273] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [21, 60] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 In function =E2=80=98_mm256_storeu_si256=E2=80=99, inlined from =E2=80=98rte_mov32=E2=80=99 at ../lib/eal/x86/include/rte_= memcpy.h:347:2, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/include/rte_memcpy.h:438:3, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:851:10, inlined from =E2=80=98__create_ipopt_frag_hdr=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:68:4, inlined from =E2=80=98rte_ipv4_fragment_packet=E2=80=99 at ../lib/ip_frag/rte_ipv4_fragmentation.c:242:16: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript =E2=80=98__m256i_u[1]=E2=80=99 is partly outside array boun= ds of =E2=80=98uint8_t[60]=E2=80=99 {aka =E2=80=98unsigned char[60]=E2=80=99} [-W= error=3Darray-bounds] 935 | *__P =3D __A; | ~~~~~^~~~~ ../lib/ip_frag/rte_ipv4_fragmentation.c: In function =E2=80=98rte_ipv4_frag= ment_packet=E2=80=99: ../lib/ip_frag/rte_ipv4_fragmentation.c:122:17: note: at offset [37, 60] into object =E2=80=98ipopt_frag_hdr=E2=80=99 of size 60 122 | uint8_t ipopt_frag_hdr[IPV4_HDR_MAX_LEN]; | ^~~~~~~~~~~~~~ cc1: all warnings being treated as errors --=20 David Marchand