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 A3996A0C45; Mon, 25 Oct 2021 09:44:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6574D410DA; Mon, 25 Oct 2021 09:44:41 +0200 (CEST) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 80A9940E32 for ; Mon, 25 Oct 2021 09:44:39 +0200 (CEST) Received: by inbox.dpdk.org (Postfix, from userid 33) id 60CB9A0C47; Mon, 25 Oct 2021 09:44:39 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Mon, 25 Oct 2021 07:44:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: other X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: chcchc88@163.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: High X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 Subject: [dpdk-dev] [Bug 835] Previous patch introduced bugs in rte_ipv4_fragment_packet functions 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 Sender: "dev" https://bugs.dpdk.org/show_bug.cgi?id=3D835 Bug ID: 835 Summary: Previous patch introduced bugs in rte_ipv4_fragment_packet functions Product: DPDK Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: critical Priority: High Component: other Assignee: dev@dpdk.org Reporter: chcchc88@163.com CC: konstantin.ananyev@intel.com Target Milestone: --- Overview: The patch 567473433b7e("ip_frag: fix fragmenting IPv4 fragment") introduces a bug and needs to be rolled back. This is because the patch and variables "flag_offset" conflict with each other. >> diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c >> b/lib/ip_frag/rte_ipv4_fragmentation.c >> index 2e7739d..fead5a9 100644 >> --- a/lib/ip_frag/rte_ipv4_fragmentation.c >> +++ b/lib/ip_frag/rte_ipv4_fragmentation.c >> @@ -75,7 +75,7 @@ static inline void __free_fragments(struct rte_mbuf *m= b[], >> uint32_t num) >> uint32_t out_pkt_pos, in_seg_data_pos; >> uint32_t more_in_segs; >> uint16_t fragment_offset, flag_offset, frag_size, header_len; >> - uint16_t frag_bytes_remaining; >> + uint16_t frag_bytes_remaining, not_last_frag; >>=20 >> /* >> * Formal parameter checking. >> @@ -116,7 +116,9 @@ static inline void __free_fragments(struct rte_mbuf >> *mb[], uint32_t num) >> in_seg =3D pkt_in; >> in_seg_data_pos =3D header_len; >> out_pkt_pos =3D 0; >> - fragment_offset =3D 0; >> + fragment_offset =3D (uint16_t)((flag_offset & >> + RTE_IPV4_HDR_OFFSET_MASK) << RTE_IPV4_HDR_FO_SHIFT); >> + not_last_frag =3D (uint16_t)(flag_offset & IPV4_HDR_MF_MASK); >>=20 >> more_in_segs =3D 1; >> while (likely(more_in_segs)) { >> @@ -186,7 +188,8 @@ static inline void __free_fragments(struct rte_mbuf >> *mb[], uint32_t num) >>=20 >> __fill_ipv4hdr_frag(out_hdr, in_hdr, header_len, >> (uint16_t)out_pkt->pkt_len, >> - flag_offset, fragment_offset, more_in_segs); >> + flag_offset, fragment_offset, >> + not_last_frag || more_in_segs); >>=20 >> fragment_offset =3D (uint16_t)(fragment_offset + >> out_pkt->pkt_len - header_len); "flag_offset" or =E2=80=9Cfofs=E2=80=9D contains all the information about = fragment,so this patch is no longer needed. flag_offset =3D rte_cpu_to_be_16(in_hdr->fragment_offset); 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) { rte_memcpy(dst, src, header_len); fofs =3D (uint16_t)(fofs + (dofs >> RTE_IPV4_HDR_FO_SHIFT)); fofs =3D (uint16_t)(fofs | mf << RTE_IPV4_HDR_MF_SHIFT); dst->fragment_offset =3D rte_cpu_to_be_16(fofs); dst->total_length =3D rte_cpu_to_be_16(len); dst->hdr_checksum =3D 0; } Steps to Reproduce: 1) Use a fragment that is not the last fragment to test rte_ipv4_fragment_packet function:MTU is 68,ip pkt_size is 104(not include = ip header len), MF is 1,fragment_offset is 13. 2) Start the test to see the fragmenting results: the values of fragment nu= mber and fragment_offset. Actual Results: fragment number: 3 fragment_offset: 0x201A 0x2020 0x2026 Expected Results: fragment number: 3 fragment_offset: 0x200D 0x2013 0x2019 Build Date & Hardware: Build 2021-10-25 on Linux OS 3.10.0 --=20 You are receiving this mail because: You are the assignee for the bug.=