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 A18AC45EFA; Fri, 20 Dec 2024 17:15:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 315C240156; Fri, 20 Dec 2024 17:15:47 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id B1BED4003C for ; Fri, 20 Dec 2024 17:15:45 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-72739105e02so2301694b3a.0 for ; Fri, 20 Dec 2024 08:15:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734711345; x=1735316145; 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=lFewkTqkTgo42fOAiZgEQl6LuzVnfCA5fWXjvaP8xZk=; b=XhA+JFkf97WRFjwxd4un997SEtEOtAiczUKQ+UZWPcg9pCgDr0e2pE66uxHk+pihaV O131r0gsrUVk6O28BJSz0GlQfRYpAdlZp92w+v9ixfCgoTP184KDt7maXw9vLDJizZ5M xueKWxQ1Jcrz57S3+wSFDpf4qh9M9mxjRetXSVNDhqrRn0TsREXdOPab+Pixy9jNe179 HLO6wLv0/6OtoZztXPpvLsJPlPt9tpDGx8oDKmbxUzRrbEwbt0pSETMWy+IPH4YIL/ge SB6rWmPN0iwdwY2RjSwXia9lAyQ7ZxsfJ/2tTFUfWmLr24tRQdUk+A9VMzdyI57buIlb 83Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734711345; x=1735316145; 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=lFewkTqkTgo42fOAiZgEQl6LuzVnfCA5fWXjvaP8xZk=; b=XiS1VHRLVT9i6UspGevLZ8nUVLNS+44rIXyuBgjfI2r5U3XVgPT1XQvfSMwo19D8Wp cKbavRKZXc3vH+v3etRBvmUIS4ylkPv50blHumQ5CHe4UkPAibO3aPmQLrpbc/I50A51 KY4nnH8CfvSFMMU8T9SonwD6a3jOXN4PTU3ERV059aKUcOs3CtZLliZDMj76TyDE2TBT Cr3vBg9kPKveQNewsfd4OB3SGXFEmFvQmG6oswz4RtTA61GUm0oCpVy3iiEaeP8ak411 mLoVUIG4eA9N1HEUJtSV6GvOppiS9D0bbGptp2X5FAaQVv4iZFA5yogBpfKzUBdQwzDr aGcw== X-Gm-Message-State: AOJu0YzPorUsb3Qe59ZgUh/jUDnO0boyRqwj6E0B/49RRJLDYF3igcrM JYoyElWSyLMKQ6QxGsLKBbj77O5kaaA0zhFajZvTYF8AgTpwxym9V02imulNSxI= X-Gm-Gg: ASbGncua6R90JivrV+TKh4c1w7lLa/6gKqhiP52RmrQaogImozXbD4jXJLVwHUDzvmi 45pmGJhxDQWdConh46fZYDzAz7TFWVqCWQEIdplgqodLGSQKfkh7vxmJdcODmaH8WPbKw1HCark fIMhXDcaiuD2reDNGjkiyHKHyWGgdq2hEP62A6WK7NNTE8T554yNrwEhvTj281h1xmSfO39r0iA drWjpZ1N1Pq9Dg/FLng+ppW37nuXuUKuMI/ik58dbiMpceDhWVkkKGgdyEGHOuO2o03yxuM9qle EEqC5qboWPFKksTrZZFjxJuic7GQ/iAxPA== X-Google-Smtp-Source: AGHT+IEA6V3nMxDldNDoMjMkKoR7L6rleiAGHlzJPbQR9IlKppxff4Q2/SSeEJtfAYqR0cVRG5Jh1Q== X-Received: by 2002:a05:6a00:301a:b0:72a:a7a4:9c6d with SMTP id d2e1a72fcca58-72abdeb6fc1mr5616420b3a.24.1734711344773; Fri, 20 Dec 2024 08:15:44 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad84877bsm3282000b3a.84.2024.12.20.08.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 08:15:44 -0800 (PST) Date: Fri, 20 Dec 2024 08:15:40 -0800 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org, David Christensen , Ian Stokes , Konstantin Ananyev , Wathsala Vithanage , Vladimir Medvedkin , Anatoly Burakov Subject: Re: [PATCH v4 01/24] net/_common_intel: add pkt reassembly fn for intel drivers Message-ID: <20241220081540.1a6a3da5@hermes.local> In-Reply-To: <20241220143925.609044-2-bruce.richardson@intel.com> References: <20241122125418.2857301-1-bruce.richardson@intel.com> <20241220143925.609044-1-bruce.richardson@intel.com> <20241220143925.609044-2-bruce.richardson@intel.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 Fri, 20 Dec 2024 14:38:58 +0000 Bruce Richardson wrote: > + > + if (!split_flags[buf_idx]) { > + /* it's the last packet of the set */ > + start->hash = end->hash; > + start->vlan_tci = end->vlan_tci; > + start->ol_flags = end->ol_flags; > + /* we need to strip crc for the whole packet */ > + start->pkt_len -= crc_len; > + if (end->data_len > crc_len) { > + end->data_len -= crc_len; > + } else { > + /* free up last mbuf */ > + struct rte_mbuf *secondlast = start; > + > + start->nb_segs--; > + while (secondlast->next != end) > + secondlast = secondlast->next; > + secondlast->data_len -= (crc_len - end->data_len); > + secondlast->next = NULL; > + rte_pktmbuf_free_seg(end); > + } The problem with freeing the last buffer is that the CRC will be garbage. What if the CRC is sitting past the last mbuf? +-----------------------+ +-----+ | Data +--->+ CRC | +-----------------------+ +-----+ This part (from original code) will free the second mbuf which contains the CRC. The whole "don't strip CRC and leave it past the mbuf data" model of mbuf's is a danger trap.