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 13D28A00C2; Wed, 19 Jan 2022 20:13:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D39354118F; Wed, 19 Jan 2022 20:13:09 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 9E2A541147 for ; Wed, 19 Jan 2022 20:13:08 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id s61-20020a17090a69c300b001b4d0427ea2so7148279pjj.4 for ; Wed, 19 Jan 2022 11:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atomicrules-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jcWBWCwVSPygDilewyDQPR99yZAOFUToaJhAHK4SJK4=; b=IuDUpvAPmrceebRSu5ue5hI3A5Y0K1CMk3ozR2Zbqt+40iiGIj6J20bD2zQFVNPbCX vFl/8fBcT1pn+bsHFx3BvhJoYEMxjBWYtZRJ0CJXU+1K6bmhnEYltH7uiYqbnZw+92aa hWocykX7W5o8xn2pF4DqDkoGuJ1XqZfcIsOj0wJmbsKipP4ISWWmYJcxsK6WLo9qQVit NANEiHzlYqRWTI47fvJIjLpx1+kudEvmoq1e30CrYEKs3NTGwVgSfax0VPNyt0bvu6Dh ZFtfYyX+25fEKEHEJWoWr2r4bewthFrYvhkh0phA6O4CV+iCpN2+beJze/JoNyxoBzeb GnQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jcWBWCwVSPygDilewyDQPR99yZAOFUToaJhAHK4SJK4=; b=X7Xa0upL4QffnF0gzoRqcsQzQabx6ylIKj8XRB/QZ33xhvRxwDKR+WB6qEK6T7y3BY vtY7xqQEEkDL0BuHGrtXQz5Mi4XrY/Xtl7xjOszeSp6iVTVOuBtGQdUV5vg29Cm/Hcgw Ga+Yh+44Qco6ksV449Q+pBKTYvl9av9Cckv50MhsP+8l0UtVglUbXXugS196iZqi5Zyv vBMLgSsVIcjWhbu+jVTz5cMMVo/b74WxruVE1B4hMqyOqXurLd9cCrlx8a+OuDixwMiG Vns29QSwK8QP/e3OXagl/wnzGNWvs9gUl5ZTfyWadSMMZypJe23lLmfUtLaqlN0SkO4B FawA== X-Gm-Message-State: AOAM531VvwVaXBZ9wOvYGwA69yRk7c9U2hQCPMJPYSTn+mAAMras3J5F lYEMbUbQfDXPWPg8BsO5DgW5ZvUP9Tfy9w== X-Google-Smtp-Source: ABdhPJwzs51kb6bzpdgbr5JgXnHMRx/bCRImYKqhYU5DFor5iXjimTWbQAt8NrwbA6ZOy452Jy7mKQ== X-Received: by 2002:a17:90a:bd09:: with SMTP id y9mr5984544pjr.57.1642619587721; Wed, 19 Jan 2022 11:13:07 -0800 (PST) Received: from john-All-Series.tds (h75-100-85-216.cntcnh.broadband.dynamic.tds.net. [75.100.85.216]) by smtp.gmail.com with ESMTPSA id c17sm399845pfc.171.2022.01.19.11.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 11:13:07 -0800 (PST) From: John Miller To: dev@dpdk.org, ferruh.yigit@intel.com Cc: John Miller Subject: [PATCH 1/4] net/ark: add device capabilities record Date: Wed, 19 Jan 2022 13:12:52 -0600 Message-Id: <20220119191255.273988-1-john.miller@atomicrules.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Add static record of supported device capabilities. Signed-off-by: John Miller --- drivers/net/ark/ark_ethdev.c | 58 +++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index b618cba3f0..0414c78bb5 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -96,6 +96,26 @@ static const struct rte_pci_id pci_id_ark_map[] = { {.vendor_id = 0, /* sentinel */ }, }; +struct ark_caps { + bool rqpacing; +}; +struct ark_dev_caps { + uint32_t device_id; + struct ark_caps caps; +}; +static const struct ark_dev_caps +ark_device_caps[] = { + {0x100d, {.rqpacing = true} }, + {0x100e, {.rqpacing = true} }, + {0x100f, {.rqpacing = true} }, + {0x1010, {.rqpacing = false} }, + {0x1017, {.rqpacing = true} }, + {0x1018, {.rqpacing = true} }, + {0x1019, {.rqpacing = true} }, + {0x101e, {.rqpacing = false} }, + {.device_id = 0,} +}; + static int eth_ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) @@ -256,6 +276,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) int ret; int port_count = 1; int p; + bool rqpacing = false; ark->eth_dev = dev; @@ -270,6 +291,15 @@ eth_ark_dev_init(struct rte_eth_dev *dev) rte_eth_copy_pci_info(dev, pci_dev); dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; + p = 0; + while (ark_device_caps[p].device_id != 0) { + if (pci_dev->id.device_id == ark_device_caps[p].device_id) { + rqpacing = ark_device_caps[p].caps.rqpacing; + break; + } + p++; + } + /* Use dummy function until setup */ dev->rx_pkt_burst = ð_ark_recv_pkts_noop; dev->tx_pkt_burst = ð_ark_xmit_pkts_noop; @@ -288,8 +318,12 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE]; ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE]; - ark->rqpacing = - (struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE); + if (rqpacing) { + ark->rqpacing = + (struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE); + } else { + ark->rqpacing = NULL; + } ark->started = 0; ark->pkt_dir_v = ARK_PKT_DIR_INIT_VAL; @@ -309,13 +343,15 @@ eth_ark_dev_init(struct rte_eth_dev *dev) return -1; } if (ark->sysctrl.t32[3] != 0) { - if (ark_rqp_lasped(ark->rqpacing)) { - ARK_PMD_LOG(ERR, "Arkville Evaluation System - " - "Timer has Expired\n"); - return -1; + if (ark->rqpacing) { + if (ark_rqp_lasped(ark->rqpacing)) { + ARK_PMD_LOG(ERR, "Arkville Evaluation System - " + "Timer has Expired\n"); + return -1; + } + ARK_PMD_LOG(WARNING, "Arkville Evaluation System - " + "Timer is Running\n"); } - ARK_PMD_LOG(WARNING, "Arkville Evaluation System - " - "Timer is Running\n"); } ARK_PMD_LOG(DEBUG, @@ -499,7 +535,8 @@ ark_config_device(struct rte_eth_dev *dev) ark_ddm_stats_reset(ark->ddm.v); ark_ddm_stop(ark->ddm.v, 0); - ark_rqp_stats_reset(ark->rqpacing); + if (ark->rqpacing) + ark_rqp_stats_reset(ark->rqpacing); return 0; } @@ -695,7 +732,8 @@ eth_ark_dev_close(struct rte_eth_dev *dev) /* * TODO This should only be called once for the device during shutdown */ - ark_rqp_dump(ark->rqpacing); + if (ark->rqpacing) + ark_rqp_dump(ark->rqpacing); for (i = 0; i < dev->data->nb_tx_queues; i++) { eth_ark_tx_queue_release(dev->data->tx_queues[i]); -- 2.25.1