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 BB677A0544; Tue, 11 Oct 2022 02:54:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D05042C26; Tue, 11 Oct 2022 02:52:21 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2052.outbound.protection.outlook.com [40.107.94.52]) by mails.dpdk.org (Postfix) with ESMTP id 21C3742C11 for ; Tue, 11 Oct 2022 02:52:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DOpSNq+PKUPP+krgB/VXDGrsFPyq/Vxb5i7Z53FJcRi4QwF7CIRcc2+T92SKWWStUfxOkp6LWBBlFtSlkaqO6qWru+ww5txBBVfgHZ33eTBAHDN6fvwsgEJX/W9/xH2c+cPmnX8v+yCbf62O2of15e/xKcjfF7ohLFlnaBz9Tkec3cvNtaL0VMMS6Xn6RGt5Z9KIZneRf+ITsdg3Fk7w2G5wj6X9IrGr+q9eDAdyvsO+LLVoiFlJtPyNrb5YD5787TfBh/UdnpL4P0+Ifh6n/cSeouvROQsxQGSn4QfyO/2UhPT+uzY/T8GUcyBuoRE9U636OS/FDvCliBiVdt5VkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j3z9QjRhpg0flPMRxaBDL46bn9IFc1QDgjutGUQq41M=; b=WDddtJSfPC/bO2U2VYReZLsfsLVBA2w9/yFLo3EzWAmapWNYNJJA0OcbuptmLvTUrCKh0+UOJR80czXxiOSSKi0tAPADSj0fxKD7eWAsbJ0OW6Qcpcz9Rr8JK6bWxTn5gj81gnS65QwGCDS85QnMbwhzA3EyMCaheNh9X4ogyQwz6rE3e0+xeM5kwVWgY01rTHnd9av3IbVmciiIJXL4fB8jElBOq/MNAPNKKDh7n0aXe6PtrBFdnVYB2SPuw0t5kZoGnTpZTLA0en/B5MVMMyaFOkM8PGa/r0cHJx//q7wPffjoVF1cKP5EGAowsthyYdF755ETmvbnX4acwdjj3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j3z9QjRhpg0flPMRxaBDL46bn9IFc1QDgjutGUQq41M=; b=CTd5D1UpEbcpHw3ioeeVuIjUwt2beaYrmFkHkGrWg06/dZ5eI0lCAjOlopbFSq6D1XDW49QGSnYAB6GhX833ZGYSuw9AZmo7tra6T3rr9hNqmGuHxeNKDPmN/stRP0V/4F2o2TRKJKkucYnvgcvCfSUQMgrgEwTunnmy/6tA6Es= Received: from BN9PR03CA0045.namprd03.prod.outlook.com (2603:10b6:408:fb::20) by DS0PR12MB7630.namprd12.prod.outlook.com (2603:10b6:8:11d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.36; Tue, 11 Oct 2022 00:52:15 +0000 Received: from BN8NAM11FT089.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fb:cafe::66) by BN9PR03CA0045.outlook.office365.com (2603:10b6:408:fb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Tue, 11 Oct 2022 00:52:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT089.mail.protection.outlook.com (10.13.176.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Tue, 11 Oct 2022 00:52:15 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 10 Oct 2022 19:52:13 -0500 From: Andrew Boyer To: CC: Andrew Boyer , Allen Hubbe Subject: [PATCH v1 26/35] net/ionic: add Rx descriptor status functions Date: Mon, 10 Oct 2022 17:50:23 -0700 Message-ID: <20221011005032.47584-27-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007174336.54354-1-andrew.boyer@amd.com> References: <20221007174336.54354-1-andrew.boyer@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT089:EE_|DS0PR12MB7630:EE_ X-MS-Office365-Filtering-Correlation-Id: ef85791c-a39c-431a-3618-08daab22d71e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w/4HJUExp5JRfftKZbXdhUDFvbKbNinCNYMsPErRaYppy9U2hI7I0glGZL0gNcllT2+RtEv13JndVTB7EDgS7opQCzAEN0lGkC8dU06T5j9dsj6fNMFno0SdgGBTjRVQnisozARmNfNR8R6qbyeRO8MMikWB1DhLXF/PZ0BHhuuPXnqAjFetFCiRtz0Ya/JN67jKMY1bbc3Ka1sDB0NwQVNRD0sTBRMb/UNhbAPYzFaKRUVR402KHpk5uFZ9+EeO6gCRXyzWETsMO1TDHC6wwb3+1PtbxtO25Oe+AtpHrtNnD48q18T65p+zVz/98IaxMNXfzfeDp1ount3MnzCsyzeNuq+robkY+UCcsTwhgjhvl7t4eVyl9bASETTWqLw6tPcKi1S3q3jJaS0Zu8PYMEo/ZBLf+rDzQlvE398Q8Cd0QcXFYt8LpmP1hCNvBYECNtZzgdQZ/Jnixl4M6ilzLItU4Z8T5RI+gIEcsu+Y441uKEYkVdB2no7WIGBSw0l7pmOxGbvJDz2/oTNgW9xMIYqlQQQiki0jraMhzfxn6591xJ2Hajq137kpyY+f44rT5x/fs84HLCFv1XJdCzGJyB8zCXU+32U+vdIE8UadBNuDXPR5SC9uo3lJ8p1rkjyM7TaoWgoxlL7prtPge6q6bavWrvIiVJ8M9kLgIYIhv2r75UZChNPTNFl56Zywi3+fZtDYRRBU9SSdM5PlBb3/pBzfKb6ansaDPQIiw1TZelZiUlJ/h1K8gb2i2yXoXkM69rYNV3AWNTWbCCnFDJ+yil9wxAB1a5bB+iLwd9dFpK0= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199015)(40470700004)(36840700001)(46966006)(316002)(40480700001)(70586007)(40460700003)(82310400005)(6666004)(8676002)(356005)(81166007)(4326008)(70206006)(54906003)(6916009)(1076003)(336012)(186003)(426003)(82740400003)(83380400001)(16526019)(86362001)(36860700001)(26005)(2616005)(5660300002)(36756003)(47076005)(478600001)(44832011)(2906002)(8936002)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2022 00:52:15.2353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef85791c-a39c-431a-3618-08daab22d71e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT089.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7630 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 These may be useful for clients. Signed-off-by: Andrew Boyer Signed-off-by: Allen Hubbe --- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 ++ drivers/net/ionic/ionic_rxtx.c | 39 ++++++++++++++++++++++++++ drivers/net/ionic/ionic_rxtx.h | 2 ++ 5 files changed, 45 insertions(+) diff --git a/doc/guides/nics/features/ionic.ini b/doc/guides/nics/features/ionic.ini index 77947bfd22..e01ba87135 100644 --- a/doc/guides/nics/features/ionic.ini +++ b/doc/guides/nics/features/ionic.ini @@ -27,6 +27,7 @@ CRC offload = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y +Rx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 2b62310e06..d8a97f8ef2 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -167,6 +167,7 @@ New Features * Enhanced data path to provide substantial performance improvements. * Added support for mbuf fast free. * Added support for advertising packet types. + * Added support for descriptor status functions. * **Added support for MACsec in rte_security.** diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 39bbe60d79..7ac7006d88 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -984,6 +984,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->tx_pkt_burst = &ionic_xmit_pkts; eth_dev->tx_pkt_prepare = &ionic_prep_pkts; + eth_dev->rx_descriptor_status = ionic_dev_rx_descriptor_status; + /* Multi-process not supported, primary does initialization anyway */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 24fd8fcf04..64cbbd9815 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -1235,3 +1235,42 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, return rx_svc.nb_rx; } + +int +ionic_dev_rx_descriptor_status(void *rx_queue, uint16_t offset) +{ + struct ionic_rx_qcq *rxq = rx_queue; + struct ionic_qcq *qcq = &rxq->qcq; + struct ionic_rxq_comp *cq_desc; + uint16_t mask, head, tail, pos; + bool done_color; + + mask = qcq->q.size_mask; + + /* offset must be within the size of the ring */ + if (offset > mask) + return -EINVAL; + + head = qcq->q.head_idx; + tail = qcq->q.tail_idx; + + /* offset is beyond what is posted */ + if (offset >= ((head - tail) & mask)) + return RTE_ETH_RX_DESC_UNAVAIL; + + /* interested in this absolute position in the rxq */ + pos = (tail + offset) & mask; + + /* rx cq position == rx q position */ + cq_desc = qcq->cq.base; + cq_desc = &cq_desc[pos]; + + /* expected done color at this position */ + done_color = qcq->cq.done_color != (pos < tail); + + /* has the hw indicated the done color at this position? */ + if (color_match(cq_desc->pkt_type_color, done_color)) + return RTE_ETH_RX_DESC_DONE; + + return RTE_ETH_RX_DESC_AVAIL; +} diff --git a/drivers/net/ionic/ionic_rxtx.h b/drivers/net/ionic/ionic_rxtx.h index de51f21012..465001a063 100644 --- a/drivers/net/ionic/ionic_rxtx.h +++ b/drivers/net/ionic/ionic_rxtx.h @@ -40,6 +40,8 @@ void ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, void ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo); +int ionic_dev_rx_descriptor_status(void *rx_queue, uint16_t offset); + const uint32_t *ionic_dev_supported_ptypes_get(struct rte_eth_dev *dev); #endif /* _IONIC_RXTX_H_ */ -- 2.17.1