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 E11E0A0510; Sun, 8 May 2022 15:38:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8218D4068F; Sun, 8 May 2022 15:38:28 +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 0588040395 for ; Sun, 8 May 2022 15:38:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652017106; 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=BaPgrEw/OT28TdysyuC1YCZIYOQvVLxseisJlEyFxtM=; b=bPHxceRlL+sTl95ia1RwyXN7N7f9OCiYxT0LQSZT+daIWtto5ZTbumlUs0Sjzofax5mO7e Eml3zYMPnbjIOyZzGQwkvGftmK9kTm94+BMQ5td9Y/krTqYWCiw7kTAJ+weggjrFeAWazu eK2nh/PLW2mF4BMyGMR+FLu+UDE9EZ0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-cpwuBB54NAWbcEId67V6rw-1; Sun, 08 May 2022 09:38:25 -0400 X-MC-Unique: cpwuBB54NAWbcEId67V6rw-1 Received: by mail-qv1-f72.google.com with SMTP id j2-20020a0cfd42000000b0045ad9cba5deso6431697qvs.5 for ; Sun, 08 May 2022 06:38:25 -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=BaPgrEw/OT28TdysyuC1YCZIYOQvVLxseisJlEyFxtM=; b=Ge82jwmHivNn5AJdPeecRt9Z643K5lqsFGwhI1CYPOyAVA7H5bZLcUOfGcIoJoZCWM ZiIyW4HUsIc32XaBpUmOs0jS05/HZ6TNMOWihBlMluGJbDCKKyS5tCgNorGNVj2cT7Ag nCC8NWqYs+/SuLutVdXTgaa/p5hAopkeT+TbCCD6D4d+KBWFiR23wo+znUG4IpohMT9k sKMrWMzJRQ+OYuKkpugtxGWzPY1PcJRFHJQ49Lcp3DjO9h1BTt7ZVbIUMyNvWPJ7OFw0 GtxSEykz1FqxUHjdgGmWgOctrofBYo/iZjjLEkW2mtr7dbVIk2XYmQMSuo8/SaLbr545 sZxQ== X-Gm-Message-State: AOAM532BJ/B97s3QYG9wVt+4Bfsyt8VnGjcbN5WcvKSiVdbkTiiZqARQ YrTQRWr0rvLUNHHutes6ObFflGkBjFuPW9r+B6EsPwBwkycyBNfxIbOKzFrg99RzgqyuwnJDsbS GBrQ= X-Received: by 2002:a37:c44:0:b0:69f:9a59:43c1 with SMTP id 65-20020a370c44000000b0069f9a5943c1mr8511334qkm.616.1652017104841; Sun, 08 May 2022 06:38:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVhbblkeYQabVcxYRr/37+G+/h1V/4aZUs6g4mVxKJB3d+ulbtkrNTPDbccWtFxuutYaDvrw== X-Received: by 2002:a37:c44:0:b0:69f:9a59:43c1 with SMTP id 65-20020a370c44000000b0069f9a5943c1mr8511324qkm.616.1652017104605; Sun, 08 May 2022 06:38:24 -0700 (PDT) Received: from localhost.localdomain (024-205-208-113.res.spectrum.com. [24.205.208.113]) by smtp.gmail.com with ESMTPSA id d14-20020ac8544e000000b002f39b99f68fsm6096001qtq.41.2022.05.08.06.38.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 May 2022 06:38:23 -0700 (PDT) Subject: Re: [PATCH v2 3/5] baseband/acc100: configuration of ACC101 from PF To: Nicolas Chautru , dev@dpdk.org, gakhil@marvell.com Cc: thomas@monjalon.net, ray.kinsella@intel.com, bruce.richardson@intel.com, hemant.agrawal@nxp.com, mingshan.zhang@intel.com, david.marchand@redhat.com References: <1651083423-33202-1-git-send-email-nicolas.chautru@intel.com> <1651083423-33202-4-git-send-email-nicolas.chautru@intel.com> From: Tom Rix Message-ID: <8384fb18-ce2d-a6e3-2930-c519f3b2139b@redhat.com> Date: Sun, 8 May 2022 06:38:21 -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: <1651083423-33202-4-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 4/27/22 11:17 AM, Nicolas Chautru wrote: > Adding companion function specific to ACC100 and it > can be called from bbdev-test when running from PF. > > Signed-off-by: Nicolas Chautru > --- > app/test-bbdev/test_bbdev_perf.c | 57 ++++++ > drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ > drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ > drivers/baseband/acc100/version.map | 2 +- > 4 files changed, 377 insertions(+), 1 deletion(-) > > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index 0fa119a..baf5f6d 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -63,6 +63,8 @@ > #define ACC100_QMGR_INVALID_IDX -1 > #define ACC100_QMGR_RR 1 > #define ACC100_QOS_GBR 0 > +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") > +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf") A dup from patch 1 > #endif > > #define OPS_CACHE_SIZE 256U > @@ -765,6 +767,61 @@ typedef int (test_case_function)(struct active_device *ad, > "Failed to configure ACC100 PF for bbdev %s", > info->dev_name); > } > + if ((get_init_device() == true) && > + (!strcmp(info->drv.driver_name, ACC101PF_DRIVER_NAME))) { > + struct rte_acc100_conf conf; Mixing up acc100 and acc101 ? If this actually works, combine the two. > + unsigned int i; > + > + printf("Configure ACC101 FEC Driver %s with default values\n", > + info->drv.driver_name); > + > + /* clear default configuration before initialization */ > + memset(&conf, 0, sizeof(struct rte_acc100_conf)); > + > + /* Always set in PF mode for built-in configuration */ > + conf.pf_mode_en = true; > + for (i = 0; i < RTE_ACC100_NUM_VFS; ++i) { > + conf.arb_dl_4g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_dl_4g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_dl_4g[i].round_robin_weight = ACC100_QMGR_RR; > + conf.arb_ul_4g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_ul_4g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_ul_4g[i].round_robin_weight = ACC100_QMGR_RR; > + conf.arb_dl_5g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_dl_5g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_dl_5g[i].round_robin_weight = ACC100_QMGR_RR; > + conf.arb_ul_5g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_ul_5g[i].gbr_threshold1 = ACC100_QOS_GBR; > + conf.arb_ul_5g[i].round_robin_weight = ACC100_QMGR_RR; > + } > + > + conf.input_pos_llr_1_bit = true; > + conf.output_pos_llr_1_bit = true; > + conf.num_vf_bundles = 1; /**< Number of VF bundles to setup */ > + > + conf.q_ul_4g.num_qgroups = ACC100_QMGR_NUM_QGS; > + conf.q_ul_4g.first_qgroup_index = ACC100_QMGR_INVALID_IDX; > + conf.q_ul_4g.num_aqs_per_groups = ACC100_QMGR_NUM_AQS; > + conf.q_ul_4g.aq_depth_log2 = ACC100_QMGR_AQ_DEPTH; > + conf.q_dl_4g.num_qgroups = ACC100_QMGR_NUM_QGS; > + conf.q_dl_4g.first_qgroup_index = ACC100_QMGR_INVALID_IDX; > + conf.q_dl_4g.num_aqs_per_groups = ACC100_QMGR_NUM_AQS; > + conf.q_dl_4g.aq_depth_log2 = ACC100_QMGR_AQ_DEPTH; > + conf.q_ul_5g.num_qgroups = ACC100_QMGR_NUM_QGS; > + conf.q_ul_5g.first_qgroup_index = ACC100_QMGR_INVALID_IDX; > + conf.q_ul_5g.num_aqs_per_groups = ACC100_QMGR_NUM_AQS; > + conf.q_ul_5g.aq_depth_log2 = ACC100_QMGR_AQ_DEPTH; > + conf.q_dl_5g.num_qgroups = ACC100_QMGR_NUM_QGS; > + conf.q_dl_5g.first_qgroup_index = ACC100_QMGR_INVALID_IDX; > + conf.q_dl_5g.num_aqs_per_groups = ACC100_QMGR_NUM_AQS; > + conf.q_dl_5g.aq_depth_log2 = ACC100_QMGR_AQ_DEPTH; > + > + /* setup PF with configuration information */ > + ret = rte_acc101_configure(info->dev_name, &conf); > + TEST_ASSERT_SUCCESS(ret, > + "Failed to configure ACC101 PF for bbdev %s", > + info->dev_name); > + } > #endif > /* Let's refresh this now this is configured */ > rte_bbdev_info_get(dev_id, info); > diff --git a/drivers/baseband/acc100/rte_acc100_cfg.h b/drivers/baseband/acc100/rte_acc100_cfg.h > index d233e42..2e3c43f 100644 > --- a/drivers/baseband/acc100/rte_acc100_cfg.h > +++ b/drivers/baseband/acc100/rte_acc100_cfg.h This file marks its API as experimental though the acc100 has been used in production for some time. It is important that the API be stable. Is this an oversight ? Or what is needed to stabilize the API ? > @@ -106,6 +106,23 @@ struct rte_acc100_conf { > int > rte_acc100_configure(const char *dev_name, struct rte_acc100_conf *conf); > > +/** > + * Configure a ACC101 device > + * > + * @param dev_name > + * The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. > + * It can also be retrieved for a bbdev device from the dev_name field in the > + * rte_bbdev_info structure returned by rte_bbdev_info_get(). > + * @param conf > + * Configuration to apply to ACC101 HW. > + * > + * @return > + * Zero on success, negative value on failure. > + */ > +__rte_experimental > +int > +rte_acc101_configure(const char *dev_name, struct rte_acc100_conf *conf); I am finding seeing acc100* structs in acc101 function parameters confusing. Maybe a general renaming of acc100 -> acc10x for the common parts. Will we have this problem on acc120 or acc200 ? Maybe shorten everything now to acc > + > #ifdef __cplusplus > } > #endif > diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c > index daf2ce0..b03cedc 100644 > --- a/drivers/baseband/acc100/rte_acc100_pmd.c > +++ b/drivers/baseband/acc100/rte_acc100_pmd.c > @@ -4921,3 +4921,305 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev) > rte_bbdev_log_debug("PF Tip configuration complete for %s", dev_name); > return 0; > } > + > + > +/* Initial configuration of a ACC101 device prior to running configure() */ > +int > +rte_acc101_configure(const char *dev_name, struct rte_acc100_conf *conf) > +{ This is very similar to the acc100 configure function. It would be good if these could be combined. Tom