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 7E32B42996; Thu, 20 Apr 2023 12:49:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57D0B40A4B; Thu, 20 Apr 2023 12:49:43 +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 F198440A4B for ; Thu, 20 Apr 2023 12:49:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681987781; 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=+jJ1CBdx5WPk6gLiXbrN7CV0HV4IUudyYXyhdMg9Tdk=; b=Ho5OiXdjUXJSdJG19pd9w3SJI6b9o0Zz/+XsIrtCOY6KN9sHqzofABLIZua5dFlC7DAv52 74/AqlEr28tcOpLj5eyLfdWonHHNQG+nlGiIauUVRApF5E+Tz79UwFlfUtP9ZeI+t3Z+Lh BKtcizL5y2hSeieexM+rpt1VSRVC1g0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-208-SNekAvtWNSixzoUHj-2iUw-1; Thu, 20 Apr 2023 06:49:40 -0400 X-MC-Unique: SNekAvtWNSixzoUHj-2iUw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-2f69e5def13so210495f8f.0 for ; Thu, 20 Apr 2023 03:49:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681987779; x=1684579779; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+jJ1CBdx5WPk6gLiXbrN7CV0HV4IUudyYXyhdMg9Tdk=; b=LQfIt2gCF1juBnE9pio6hUeYaQVvau+D/fitTupga3hPNZq+GW3IG3CYvh/bQ7pbkP sWXStDC3xUE6L9Q7E/3WHsjarsG0a8wXpbE8YVlAH0LBviIVCNk7tsun0DsdVjlwASNU C+raI/C3UNDQixaWXll+MDCxVo2cLNmGDIcWTX5tVmI9CAHdgvc/qSJQzgiZMS1/y8my gn9TEV7ojUjNy2muQfUPIESi9olfn5QsfVn1UKUyCeicxiteStYfz7kl7cLxqjhxwd9D Q6Um6LV4SZxMV40SLa67AraB620QfDL/KDyM8DrNAFz65AXVJm89lhWKZ1xMuVFYP1d1 vjKQ== X-Gm-Message-State: AAQBX9dg7Jd4SOrB8xCmAMwpFNSjuv3j5Nz25tqNc2qTZkk7Jxqh1N1Y rqBdquKYcHAi9F4jMVeB99IenrN5J7sd1LeUZOPmSFbAPnTFFmP7Z5VXrjdhNb2/aSQFebgrgoW XGOV1typmBMKQwg== X-Received: by 2002:adf:e507:0:b0:2f5:7ce1:781d with SMTP id j7-20020adfe507000000b002f57ce1781dmr1139225wrm.50.1681987779141; Thu, 20 Apr 2023 03:49:39 -0700 (PDT) X-Google-Smtp-Source: AKy350agV8rVXiR/8bK0S8p4Z7ZTP9/QYGsUqetxPFKWduHPtDz6rT09Rpvn+w1Gko0S1hc9bGragg== X-Received: by 2002:adf:e507:0:b0:2f5:7ce1:781d with SMTP id j7-20020adfe507000000b002f57ce1781dmr1139212wrm.50.1681987778759; Thu, 20 Apr 2023 03:49:38 -0700 (PDT) Received: from [192.168.0.36] ([78.19.110.151]) by smtp.gmail.com with ESMTPSA id r3-20020a05600c35c300b003f1836c98b7sm2718800wmq.48.2023.04.20.03.49.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Apr 2023 03:49:38 -0700 (PDT) Message-ID: Date: Thu, 20 Apr 2023 11:49:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 To: Saoirse O'Donovan , Kai Ji , Pablo de Lara Cc: dev@dpdk.org, piotrx.bronowski@intel.com, stable@dpdk.org, "Xueming(Steven) Li" References: <20230418142249.38447-1-saoirse.odonovan@intel.com> <20230420103141.8770-1-saoirse.odonovan@intel.com> From: Kevin Traynor Subject: Re: [PATCH v2] crypto/ipsec_mb: enqueue counter fix In-Reply-To: <20230420103141.8770-1-saoirse.odonovan@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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 20/04/2023 11:31, Saoirse O'Donovan wrote: > This patch removes enqueue op counter update from the process_op_bit > function where the process is now done in dequeue stage. The original > stats increment was incorrect as they shouldn't have been updated at all > in this function. > > Fixes: 4f1cfda59ad3 ("crypto/ipsec_mb: move snow3g PMD") > Cc: piotrx.bronowski@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Saoirse O'Donovan > > --- > v2: Added cc stable for 21.11 and 22.11 backport. > > A similar fix has been sent to 20.11 LTS stable, in the interest of > time. In that fix, the enqueued stat is still in use, therefore only the > fix to the count increment was necessary. > Thanks for the explanation. As it has the correct tags, we will pick this up for 21.11 and 22.11 LTS releases in the normal workflow, which is after it has been released as part of a DPDK main branch release. thanks, Kevin. > Here is the mail archive link: > https://mails.dpdk.org/archives/stable/2023-April/043550.html > --- > drivers/crypto/ipsec_mb/pmd_snow3g.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c > index 8ed069f428..e64df1a462 100644 > --- a/drivers/crypto/ipsec_mb/pmd_snow3g.c > +++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c > @@ -372,9 +372,10 @@ process_ops(struct rte_crypto_op **ops, struct snow3g_session *session, > /** Process a crypto op with length/offset in bits. */ > static int > process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session, > - struct ipsec_mb_qp *qp, uint16_t *accumulated_enqueued_ops) > + struct ipsec_mb_qp *qp) > { > - uint32_t enqueued_op, processed_op; > + unsigned int processed_op; > + int ret; > > switch (session->op) { > case IPSEC_MB_OP_ENCRYPT_ONLY: > @@ -421,9 +422,10 @@ process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session, > > if (unlikely(processed_op != 1)) > return 0; > - enqueued_op = rte_ring_enqueue(qp->ingress_queue, op); > - qp->stats.enqueued_count += enqueued_op; > - *accumulated_enqueued_ops += enqueued_op; > + > + ret = rte_ring_enqueue(qp->ingress_queue, op); > + if (ret != 0) > + return ret; > > return 1; > } > @@ -439,7 +441,6 @@ snow3g_pmd_dequeue_burst(void *queue_pair, > struct snow3g_session *prev_sess = NULL, *curr_sess = NULL; > uint32_t i; > uint8_t burst_size = 0; > - uint16_t enqueued_ops = 0; > uint8_t processed_ops; > uint32_t nb_dequeued; > > @@ -479,8 +480,7 @@ snow3g_pmd_dequeue_burst(void *queue_pair, > prev_sess = NULL; > } > > - processed_ops = process_op_bit(curr_c_op, curr_sess, > - qp, &enqueued_ops); > + processed_ops = process_op_bit(curr_c_op, curr_sess, qp); > if (processed_ops != 1) > break; >