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 340CCA034C; Mon, 2 May 2022 23:22:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15BFE410FB; Mon, 2 May 2022 23:22:45 +0200 (CEST) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) by mails.dpdk.org (Postfix) with ESMTP id D562440C35 for ; Mon, 2 May 2022 23:22:43 +0200 (CEST) Received: by mail-qv1-f48.google.com with SMTP id e17so11040183qvj.11 for ; Mon, 02 May 2022 14:22:43 -0700 (PDT) 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; bh=e0WuTwtSTw3iA5YHZqv1DTf8G6zep89dezxmCo5FYOI=; b=2E2he8xtEis6hRUc4n/iTKfy5yZZ7wcTrk4gBuZd5dyczpOOrm6+ycbYE/g9Y5WYH1 Y5AFj7N4b7R+rac9rMpODheDIFE2plwmyt2r7geYKJ1/nu18ZktEAi0Q2d1NNDEzgNMV /26/wo9TWxLDJzeVPDOQeGUcOSQcNuQ7Unpxx2NMftiDVnJUfeDKdchjRunOvYwbsBXm ffyq4rUjqNlSoWayahO6P99bpVgeE+Ilt/4AVDCML39U53eNcmSvmKCMQRJYhG0SDVwO YvMG1tXqQSge8/lxNdjuEOnIHduLqY+3KU7h8chxy3fQaRYBRos5PCec/h7TKsyYfVae Fdog== 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; bh=e0WuTwtSTw3iA5YHZqv1DTf8G6zep89dezxmCo5FYOI=; b=qUDjOLB0q8r2z5fFvSQpD1zBPX2+RQ9CgZI4Fz+nLdNs8L1qx/aEoleAiDatP9YjHc qJQ4juZ/OdXG5Up1/wQ+OC6xNjHdXiiUZITsXNH1f3u3MF6zQf1eio0aviBV3GJkoic8 JSfBq8WO/xtPu3MNnk0m9fRqTaMDcdXsVFODcgSWBydNS15/XDE3wp17a1t4vhVSdu2e r+UsHDOYLj0z5B/ClqN678AslcMkNBT0bHavyck1h2hwMeF6k5x0DEdKpuBYrgATqVTz YoKow89yS2l5m8PcuETYoNcuGjn3/VYTZDtbTFTSM96greoP75aF+oivTFM7gBITWENe MMqg== X-Gm-Message-State: AOAM532XtSLejxq5VTb+9i7e5hMok4ECNabG9QswZ2VMdePPGNneFRxn URiwPdzwU2H2PBLaLb6XnDCWOh+gJh2EzgsT X-Google-Smtp-Source: ABdhPJxvNWQuHmt5UWIo+HV6DFU4EjDY0J9E+s23xxyHjZVHAY2+ZcDfrSvxUTk219naGafGPz9UXQ== X-Received: by 2002:a05:6214:c4d:b0:449:7011:56d0 with SMTP id r13-20020a0562140c4d00b00449701156d0mr10969063qvj.70.1651526562319; Mon, 02 May 2022 14:22:42 -0700 (PDT) Received: from z170.czeck.local (pool-173-48-102-189.bstnma.fios.verizon.net. [173.48.102.189]) by smtp.gmail.com with ESMTPSA id s26-20020ac8529a000000b002f39b99f6b4sm4712736qtn.78.2022.05.02.14.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 14:22:41 -0700 (PDT) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Ed Czeck , Shepard Siegel , John Miller Subject: [PATCH 1/4] net/ark: update mpu code to match current hardware version Date: Mon, 2 May 2022 17:22:29 -0400 Message-Id: <20220502212232.1283-1-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.17.1 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 new version code remove device-level global operations remove ark_mpu_reset_stats function Signed-off-by: Ed Czeck --- drivers/net/ark/ark_ethdev.c | 2 -- drivers/net/ark/ark_ethdev_rx.c | 4 ---- drivers/net/ark/ark_mpu.c | 15 ++++----------- drivers/net/ark/ark_mpu.h | 3 ++- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 76b88c62d0..c0578b85ce 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev) num_q = ark_api_num_queues(mpu); ark->rx_queues = num_q; for (i = 0; i < num_q; i++) { - ark_mpu_reset(mpu); mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET); } @@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev) num_q = ark_api_num_queues(mpu); ark->tx_queues = num_q; for (i = 0; i < num_q; i++) { - ark_mpu_reset(mpu); mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET); } diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c index 0fbb2603db..85e34d0bb8 100644 --- a/drivers/net/ark/ark_ethdev_rx.c +++ b/drivers/net/ark/ark_ethdev_rx.c @@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev, ark_udm_write_addr(queue->udm, phys_addr_prod_index); - /* advance the valid pointer, but don't start until the queue starts */ - ark_mpu_reset_stats(queue->mpu); - /* The seed is the producer index for the HW */ ark_mpu_set_producer(queue->mpu, queue->seed_index); dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED; @@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue) if (queue == 0) return; - ark_mpu_reset_stats(queue->mpu); ark_udm_queue_stats_reset(queue->udm); } diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c index b8e94b6ed3..4038c08747 100644 --- a/drivers/net/ark/ark_mpu.c +++ b/drivers/net/ark/ark_mpu.c @@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size) { uint32_t version; - version = mpu->id.vernum & 0x0000fF00; - if ((mpu->id.idnum != 0x2055504d) || - (mpu->hw.obj_size != obj_size) || - (version != 0x00003100)) { + version = mpu->id.vernum; + if (mpu->id.idnum != ARK_MPU_MODID || + version != ARK_MPU_MODVER || + mpu->hw.obj_size != obj_size) { ARK_PMD_LOG(ERR, " MPU module not found as expected %08x" " \"%c%c%c%c %c%c%c%c\"\n", @@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu) mpu->cfg.command = MPU_CMD_FORCE_RESET; usleep(10); } - ark_mpu_reset_stats(mpu); return mpu->cfg.command != MPU_CMD_IDLE; } -void -ark_mpu_reset_stats(struct ark_mpu_t *mpu) -{ - mpu->stats.pci_request = 1; /* reset stats */ -} - int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size, int is_tx) diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h index 92c3e67c86..944bf37f59 100644 --- a/drivers/net/ark/ark_mpu.h +++ b/drivers/net/ark/ark_mpu.h @@ -15,6 +15,8 @@ * there is minimal documentation. */ +#define ARK_MPU_MODID 0x2055504d +#define ARK_MPU_MODVER 0x37313232 /* * MPU hardware structures * These are overlay structures to a memory mapped FPGA device. These @@ -113,7 +115,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx); void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid); -void ark_mpu_reset_stats(struct ark_mpu_t *mpu); /* this action is in a performance critical path */ static inline void -- 2.17.1