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 7F2B2A0540; Wed, 6 Jul 2022 21:01:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23E1E4069D; Wed, 6 Jul 2022 21:01:37 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9CB2F40691 for ; Wed, 6 Jul 2022 21:01:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657134095; 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=feQwP//Yftw1G24BaSl9dhVgiArRDh/GGI5Afo3vw+U=; b=BvcHcYCpoenNxv6ofge4HkfYpkP+l/5HU/wCzkAq0JCAx/ztI24KA+RajTDQ/VJtc+oWI3 bpIxsOTNcFZRUOPTafJ1rLnRD8VgYjCbDlyZNmQSY1W5QRpz1oTLY+Hx1/n+LCfiXoXEoi bYvkr7Tn6Ezxr2S4FGjcoCtlQ3pMD/4= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-lFGNrxl1O_-mn7YBXkDvNQ-1; Wed, 06 Jul 2022 15:01:34 -0400 X-MC-Unique: lFGNrxl1O_-mn7YBXkDvNQ-1 Received: by mail-qk1-f200.google.com with SMTP id bj39-20020a05620a192700b006b5467f4f4eso1018696qkb.19 for ; Wed, 06 Jul 2022 12:01:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=feQwP//Yftw1G24BaSl9dhVgiArRDh/GGI5Afo3vw+U=; b=UNHDQG44VZca2kbgYV93z3qVBc6X/wHZ06JvS8RcbqWMkX/bE1TifOkmsmp6zbvFGv o4luWUcfLplusxnwHY+/Gq3tsjAZ/xt14X0GSkJqD3RdSzATDfW+m/MwhnUBPIDRwKbN sDc5pmbgZY6Bqe2Yc0+dWG3/PANq4Ux2PJwrg5e40+0Yuh92ty6r4Uj22zMY4radpx1v PpfQYd7GjxQ1JUWpYnj/KM/feft0ZcxyIldqsP+b1p8n1VyY7QZWiQ1nj/DzhUPBWIYZ XzSZRmeS2tUfUhklmXzXDBkAaN1rM3pwkaSQ3jSIRKoqyL6Hu1o9E4qxxjMNj11NYtZm zEJw== X-Gm-Message-State: AJIora/EnqkjYiZ5byLVeFTwlEyG+BPczSXOiXguuOyHYz9vTz0cz2cR UTzfhZN1NW/1HgpiSfnnQa9vRiJ4U9pUydGsB2cw7KGLxpMyFM746/41+/8JDzl+bHFR0669hP1 TxmQ= X-Received: by 2002:ac8:5c0a:0:b0:31d:417b:fded with SMTP id i10-20020ac85c0a000000b0031d417bfdedmr18304246qti.67.1657134093508; Wed, 06 Jul 2022 12:01:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uU95Mbu+UUfLGx8ozLQeZ/4/k6trXGpjDNxxVMb/KCT2KufSaiDuw7Ear7FrAvD4NyGOnvxQ== X-Received: by 2002:ac8:5c0a:0:b0:31d:417b:fded with SMTP id i10-20020ac85c0a000000b0031d417bfdedmr18304217qti.67.1657134093226; Wed, 06 Jul 2022 12:01:33 -0700 (PDT) Received: from localhost.localdomain (024-205-208-113.res.spectrum.com. [24.205.208.113]) by smtp.gmail.com with ESMTPSA id bn32-20020a05620a2ae000b006b26790293bsm13565936qkb.100.2022.07.06.12.01.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Jul 2022 12:01:32 -0700 (PDT) Subject: Re: [PATCH v4 7/7] bbdev: add a lock option for enqueue/dequeue operation To: Nicolas Chautru , dev@dpdk.org, thomas@monjalon.net, gakhil@marvell.com, hemant.agrawal@nxp.com Cc: maxime.coquelin@redhat.com, mdr@ashroe.eu, bruce.richardson@intel.com, david.marchand@redhat.com, stephen@networkplumber.org References: <1655491040-183649-6-git-send-email-nicolas.chautru@intel.com> <1657067022-54373-1-git-send-email-nicolas.chautru@intel.com> <1657067022-54373-8-git-send-email-nicolas.chautru@intel.com> From: Tom Rix Message-ID: <25b4ece1-8f67-f119-7a0e-5b133f4e571c@redhat.com> Date: Wed, 6 Jul 2022 12:01:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1657067022-54373-8-git-send-email-nicolas.chautru@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=trix@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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 7/5/22 5:23 PM, Nicolas Chautru wrote: > Locking is not explicitly required but can be valuable > in case the application cannot guarantee to be thread-safe, > or specifically is at risk of using the same queue from multiple threads. > This is an option for PMD to use this. > > Signed-off-by: Nicolas Chautru > --- > lib/bbdev/rte_bbdev.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h > index b7ecf94..8e7ca86 100644 > --- a/lib/bbdev/rte_bbdev.h > +++ b/lib/bbdev/rte_bbdev.h > @@ -407,6 +407,8 @@ struct rte_bbdev_queue_data { > struct rte_bbdev_stats queue_stats; /**< Queue statistics */ > enum rte_bbdev_enqueue_status enqueue_status; /**< Enqueue status when op is rejected */ > bool started; /**< Queue state */ > + rte_rwlock_t lock_enq; /**< lock protection for the Enqueue */ > + rte_rwlock_t lock_deq; /**< lock protection for the Dequeue */ No. This is a good idea but needs a use before introducing another element, particularly a complicated one like locking Tom > }; > > /** @internal Enqueue encode operations for processing on queue of a device. */