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 B308243CAD for ; Thu, 14 Mar 2024 01:10:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A971F40297; Thu, 14 Mar 2024 01:10:23 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id 5EA2242E4B for ; Thu, 14 Mar 2024 01:10:21 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-413ef8f77e1so2399215e9.3 for ; Wed, 13 Mar 2024 17:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710375021; x=1710979821; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I2bgYaVFGPKNWXjpqBHMnD/Yr1cKox9AivpnCKK2L40=; b=RlB0F1//Ru0FR2l16KxxDLgIAujxM8CnFNeFES5bkAePzNddBwZVqURgw0XjbhrXhD sE3g2PmsHKzwDcddN4w0NBydSa0PMV4NxzGmu2G21mH7c/KynKTdSl62inj99e9DubZv 7rLUd7tCG+co4qEZ2gpMT/Dr924Fu7ALP1jp+mp0p4HAt1zciqFpqmG7GIEzxskKwWkq zA3y6kKZmHMKEQ2qQIeVmfL/hTIwW9J0OL5sSw2t+wxy/llFKczslAp2RyFG408pdcTZ lmsmhSUIY1RspA2aJdjm4/ZFheG6IVHmzN66EcC3djYcGWcjuq8t+/uTXCdAcF2tvT7n ZO7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710375021; x=1710979821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I2bgYaVFGPKNWXjpqBHMnD/Yr1cKox9AivpnCKK2L40=; b=t1VKMg7VCBPgvSOzPmTPDnc3HWNQZh6vA8QGUTq9j4xdLRpIBidfjsvYkVonm7ApUP CscCl26f0lbCX0RqtO2bCc6GmsL0eT2DH/7G/YUcTTw+QroA5R2pyTZ7JCzv4Zoc4rgn MTR8k/RG1XmATjCI5BNCzA989fUgUcivdEjIENZ8tNdISzFxujWYptasnMsX/hqYOB/R PZGVtxDnAJMaXtyjjiozFCoadTryWLcFoy+oM6ytufXxHw4WtK6qSS9uYIbEOliLARVK Gng7RfottCvL5AnEnKa5X3JfkCyH0yuoAWiVW4pxHoPLc3V1QV6zUKorv/tANDMVHDWu hqrA== X-Forwarded-Encrypted: i=1; AJvYcCV8KRy2lNO7+4vjtapLIArqzdMiEvqRiUUwaVIDtHZ2G4/EWKTT6LUNJ0G3d5+J8hccIDTyaiIkE85jXgfwO54= X-Gm-Message-State: AOJu0YzG7v2+RTw5Fg5BbUugrAIeTye1ipgs7H37rlMYrf1GmJgUw/ey 707egXDo5rJ+Kyb9Ht+D9C35mwxeaAlymXmmizypa1ik2gMRRd0vmvMVTw2l X-Google-Smtp-Source: AGHT+IEOnUwP+83zW2rMdd67N4YfSoTLJSaQotzyvWFtfzLBj3xkIhDbvDDD9o8XE40i0out3/2+4w== X-Received: by 2002:a05:600c:444d:b0:413:f033:e1ee with SMTP id v13-20020a05600c444d00b00413f033e1eemr218955wmn.9.1710375021047; Wed, 13 Mar 2024 17:10:21 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id r17-20020a05600c459100b00413429bfab0sm3783269wmo.16.2024.03.13.17.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 17:10:20 -0700 (PDT) From: luca.boccassi@gmail.com To: Ganapati Kundapura Cc: Abhinandan Gujjar , dpdk stable Subject: patch 'eventdev/crypto: fix enqueueing' has been queued to stable release 22.11.5 Date: Thu, 14 Mar 2024 00:09:05 +0000 Message-Id: <20240314000957.2810803-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240314000957.2810803-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-102-luca.boccassi@gmail.com> <20240314000957.2810803-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/16/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/85bd236b258a30cd41dcf01634af52ef48e5fda7 Thanks. Luca Boccassi --- >From 85bd236b258a30cd41dcf01634af52ef48e5fda7 Mon Sep 17 00:00:00 2001 From: Ganapati Kundapura Date: Wed, 28 Feb 2024 04:39:19 -0600 Subject: [PATCH] eventdev/crypto: fix enqueueing [ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ] When tail pointer of circular buffer rolls over as the circular buffer becomes full, crypto adapter is enqueueing ops beyond the size of the circular buffer leading to segfault due to invalid ops access. Fixed by enqueueing ops from head pointer to (size-head) number of ops when circular buffer becomes full and the remaining ops will be flushed in next iteration. Fixes: 6c3c888656fc ("eventdev/crypto: fix circular buffer full case") Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- lib/eventdev/rte_event_crypto_adapter.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index c31b2b4021..a25316a43a 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -237,20 +237,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp, struct rte_crypto_op **ops = bufp->op_buffer; if (*tailp > *headp) + /* Flush ops from head pointer to (tail - head) OPs */ n = *tailp - *headp; else if (*tailp < *headp) + /* Circ buffer - Rollover. + * Flush OPs from head to max size of buffer. + * Rest of the OPs will be flushed in next iteration. + */ n = bufp->size - *headp; else { /* head == tail case */ /* when head == tail, * circ buff is either full(tail pointer roll over) or empty */ if (bufp->count != 0) { - /* circ buffer is full */ - n = bufp->count; + /* Circ buffer - FULL. + * Flush OPs from head to max size of buffer. + * Rest of the OPS will be flushed in next iteration. + */ + n = bufp->size - *headp; } else { - /* circ buffer is empty */ + /* Circ buffer - Empty */ *nb_ops_flushed = 0; - return 0; /* buffer empty */ + return 0; } } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-14 00:09:21.218040234 +0000 +++ 0009-eventdev-crypto-fix-enqueueing.patch 2024-03-14 00:09:20.573614427 +0000 @@ -1 +1 @@ -From f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 Mon Sep 17 00:00:00 2001 +From 85bd236b258a30cd41dcf01634af52ef48e5fda7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index d46595d190..9903f96695 100644 +index c31b2b4021..a25316a43a 100644 @@ -27 +28 @@ -@@ -245,20 +245,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp, +@@ -237,20 +237,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,