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 ED1D4A0540; Wed, 6 Jul 2022 20:57:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF0684069D; Wed, 6 Jul 2022 20:57:10 +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 D815240691 for ; Wed, 6 Jul 2022 20:57:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657133828; 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=GcZS9TQfzz0wjhjxoHXAq1VGw44AAfRbQ6/Ic1yCJEI=; b=io/f/A+GEBbsUEOf/k+Nosl5ALaQDRdow/8PEovN8QgzjqadSAF4rGpvujNOC4093eDwkr 0UuDnZSwKfNynptjsGG159Mals/AgYPZwpgyQqM6XadtXKwO9fpsQW/EEBciMFTxqoWXWN l+g9e94J+4NpqCK6G3CVCpvViNu9U6k= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-ZvcMSQl_PW2xXkc2fJxMKw-1; Wed, 06 Jul 2022 14:57:05 -0400 X-MC-Unique: ZvcMSQl_PW2xXkc2fJxMKw-1 Received: by mail-qt1-f199.google.com with SMTP id q21-20020ac84115000000b0031bf60d9b35so13071282qtl.4 for ; Wed, 06 Jul 2022 11:57:05 -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=GcZS9TQfzz0wjhjxoHXAq1VGw44AAfRbQ6/Ic1yCJEI=; b=YmkwH4oaM9rVxD2Pzzxcal9Bt83Pf0wtG+C8uOF+MRXJHCOKj4dmKBcbIhdXiMV2oz hFcZXNKCcpmrhGHgZWqspG4eGFqCCgwETUeIfUU5UXSCoCsgJXVcSgzAhYXsEh7buCGG q5BqT8pW9VSbRp/nE5+FjzuXGheNeUyuxkhrN+bjbKI/5hLHn4VViXBh6VeCQpNYBcUz kzuSG7mLAexwCMqG/OFHJYEWbjtiWBtDt6w0XS3B0aGy7PBVyXZCfdPJLkkW25wA1u+o R5XxFXikrRTkeGKzHluxZ87nSBVwrOotZZYTNfzAzztff5WUVH4u+HEI5QKX8XmJLCXW N1kg== X-Gm-Message-State: AJIora/21tLNM2+tmvXpjoJYgHOdw6PgOLGhUvToq9T67mawlFwaKJ1c CP/QgFJCM5GbKRM1Mx0h663ne0UKLHEyW5Z+LyILYJCuqhWTrm+mRYY8pAnc8aqewXkuighTNxV w/4A= X-Received: by 2002:ad4:5dc3:0:b0:473:1ab4:d1e4 with SMTP id m3-20020ad45dc3000000b004731ab4d1e4mr3659278qvh.131.1657133824867; Wed, 06 Jul 2022 11:57:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tF0JJKFiIzqgFKIQNsubcSbKPHdBFPqDMDjqu2Z4483Zbqn0U+55yLrg+tACqrAcA3navrwQ== X-Received: by 2002:ad4:5dc3:0:b0:473:1ab4:d1e4 with SMTP id m3-20020ad45dc3000000b004731ab4d1e4mr3659267qvh.131.1657133824651; Wed, 06 Jul 2022 11:57:04 -0700 (PDT) Received: from localhost.localdomain (024-205-208-113.res.spectrum.com. [24.205.208.113]) by smtp.gmail.com with ESMTPSA id bq9-20020a05620a468900b006af6f0893c6sm19579622qkb.91.2022.07.06.11.57.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Jul 2022 11:57:04 -0700 (PDT) Subject: Re: [PATCH v4 6/7] bbdev: add queue related warning and status information 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-7-git-send-email-nicolas.chautru@intel.com> From: Tom Rix Message-ID: <9c89a688-9746-89fd-0408-28097a0a27a2@redhat.com> Date: Wed, 6 Jul 2022 11:57:01 -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-7-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: > This allows to expose more information with regards to any > queue related failure and warning which cannot be supported > in existing API. > > Signed-off-by: Nicolas Chautru > --- > app/test-bbdev/test_bbdev_perf.c | 2 ++ > lib/bbdev/rte_bbdev.c | 21 +++++++++++++++++++++ > lib/bbdev/rte_bbdev.h | 34 ++++++++++++++++++++++++++++++++++ > lib/bbdev/version.map | 1 + > 4 files changed, 58 insertions(+) > > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index 1abda2d..653b21f 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -4360,6 +4360,8 @@ typedef int (test_case_function)(struct active_device *ad, > stats->dequeued_count = q_stats->dequeued_count; > stats->enqueue_err_count = q_stats->enqueue_err_count; > stats->dequeue_err_count = q_stats->dequeue_err_count; > + stats->enqueue_warning_count = q_stats->enqueue_warning_count; > + stats->dequeue_warning_count = q_stats->dequeue_warning_count; > stats->acc_offload_cycles = q_stats->acc_offload_cycles; > > return 0; > diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c > index 28b105d..ddad464 100644 > --- a/lib/bbdev/rte_bbdev.c > +++ b/lib/bbdev/rte_bbdev.c > @@ -27,6 +27,8 @@ > #define BBDEV_OP_TYPE_COUNT 6 > /* Number of supported device status */ > #define BBDEV_DEV_STATUS_COUNT 9 > +/* Number of supported enqueue status */ > +#define BBDEV_ENQ_STATUS_COUNT 4 > > /* BBDev library logging ID */ > RTE_LOG_REGISTER_DEFAULT(bbdev_logtype, NOTICE); > @@ -723,6 +725,8 @@ struct rte_bbdev * > stats->dequeued_count += q_stats->dequeued_count; > stats->enqueue_err_count += q_stats->enqueue_err_count; > stats->dequeue_err_count += q_stats->dequeue_err_count; > + stats->enqueue_warn_count += q_stats->enqueue_warn_count; > + stats->dequeue_warn_count += q_stats->dequeue_warn_count; > } > rte_bbdev_log_debug("Got stats on %u", dev->data->dev_id); > } > @@ -1165,3 +1169,20 @@ struct rte_mempool * > rte_bbdev_log(ERR, "Invalid device status"); > return NULL; > } > + > +const char * > +rte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status) > +{ > + static const char * const enq_sta_string[] = { > + "RTE_BBDEV_ENQ_STATUS_NONE", > + "RTE_BBDEV_ENQ_STATUS_QUEUE_FULL", > + "RTE_BBDEV_ENQ_STATUS_RING_FULL", > + "RTE_BBDEV_ENQ_STATUS_INVALID_OP", > + }; > + > + if (status < BBDEV_ENQ_STATUS_COUNT) Single use of #define, could just be an array size check and remove the #define > + return enq_sta_string[status]; > + > + rte_bbdev_log(ERR, "Invalid enqueue status"); > + return NULL; > +} > diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h > index ed528b8..b7ecf94 100644 > --- a/lib/bbdev/rte_bbdev.h > +++ b/lib/bbdev/rte_bbdev.h > @@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { > rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id); > > /** > + * Flags indicate the reason why a previous enqueue may not have > + * consumed all requested operations > + * In case of multiple reasons the latter superdes a previous one > + */ > +enum rte_bbdev_enqueue_status { > + RTE_BBDEV_ENQ_STATUS_NONE, /**< Nothing to report */ > + RTE_BBDEV_ENQ_STATUS_QUEUE_FULL, /**< Not enough room in queue */ > + RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough room in ring */ > + RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation was rejected as invalid */ > + RTE_BBDEV_ENQ_STATUS_PADDED_MAX = 6, /**< Maximum enq status number including padding */ Pad to 8 like the other patch ? > +}; > + > +/** > * Flags indicate the status of the device > */ > enum rte_bbdev_device_status { > @@ -246,6 +259,12 @@ struct rte_bbdev_stats { > uint64_t enqueue_err_count; > /** Total error count on operations dequeued */ > uint64_t dequeue_err_count; > + /** Total warning count on operations enqueued */ > + uint64_t enqueue_warn_count; > + /** Total warning count on operations dequeued */ > + uint64_t dequeue_warn_count; > + /** Total enqueue status count based on rte_bbdev_enqueue_status enum */ > + uint64_t enqueue_status_count[RTE_BBDEV_ENQ_STATUS_PADDED_MAX]; This element is not used in this patch, is it needed ? > /** CPU cycles consumed by the (HW/SW) accelerator device to offload > * the enqueue request to its internal queues. > * - For a HW device this is the cycles consumed in MMIO write > @@ -386,6 +405,7 @@ struct rte_bbdev_queue_data { > void *queue_private; /**< Driver-specific per-queue data */ > struct rte_bbdev_queue_conf conf; /**< Current configuration */ > struct rte_bbdev_stats queue_stats; /**< Queue statistics */ > + enum rte_bbdev_enqueue_status enqueue_status; /**< Enqueue status when op is rejected */ This element is not used in this patch, is it needed ? Tom > bool started; /**< Queue state */ > }; > > @@ -938,6 +958,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id, > const char* > rte_bbdev_device_status_str(enum rte_bbdev_device_status status); > > +/** > + * Converts queue status from enum to string > + * > + * @param status > + * Queue status as enum > + * > + * @returns > + * Queue status as string or NULL if op_type is invalid > + * > + */ > +__rte_experimental > +const char* > +rte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/bbdev/version.map b/lib/bbdev/version.map > index efae50b..1c06738 100644 > --- a/lib/bbdev/version.map > +++ b/lib/bbdev/version.map > @@ -44,6 +44,7 @@ EXPERIMENTAL { > global: > > rte_bbdev_device_status_str; > + rte_bbdev_enqueue_status_str; > rte_bbdev_enqueue_fft_ops; > rte_bbdev_dequeue_fft_ops; > rte_bbdev_fft_op_alloc_bulk;