From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F73AA04B5; Wed, 9 Sep 2020 22:31:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 047EB1C0BD; Wed, 9 Sep 2020 22:31:41 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 268D01DB8 for ; Wed, 9 Sep 2020 22:31:39 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from andreyv@nvidia.com) with SMTP; 9 Sep 2020 23:31:38 +0300 Received: from nvidia.com (r-arch-host11.mtr.labs.mlnx [10.213.43.60]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 089KUKbQ023874; Wed, 9 Sep 2020 23:31:38 +0300 From: Andrey Vesnovaty To: dev@dpdk.org Cc: thomas@nvidia.net, orika@nvidia.com, viacheslavo@nvidia.com, andrey.vesnovaty@gmail.com, ozsh@nvidia.com, elibr@nvidia.com, alexr@nvidia.com, roniba@nvidia.com, Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Date: Wed, 9 Sep 2020 23:30:09 +0300 Message-Id: <20200909203008.25563-3-andreyv@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909203008.25563-1-andreyv@nvidia.com> References: <20200909203008.25563-1-andreyv@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC 2/3] ethdev: support SFT APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ethdev updated to support SFT lookup offload to ethernet device. Signed-off-by: Andrey Vesnovaty --- lib/librte_ethdev/rte_ethdev.c | 7 +++++++ lib/librte_ethdev/rte_ethdev.h | 16 ++++++++++++++++ lib/librte_ethdev/rte_ethdev_core.h | 1 + 3 files changed, 24 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 7858ad5f11..fcdcfcce6d 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -752,6 +752,13 @@ rte_eth_dev_get_sec_ctx(uint16_t port_id) return rte_eth_devices[port_id].security_ctx; } +void * +rte_eth_dev_get_sft_ctx(uint16_t port_id) +{ + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); + return rte_eth_devices[port_id].sft_ctx; +} + uint16_t rte_eth_dev_count_avail(void) { diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 70295d7ab7..83a71a8532 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1228,6 +1228,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 #define DEV_RX_OFFLOAD_RSS_HASH 0x00080000 +#define DEV_RX_OFFLOAD_SFT 0x00100000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ @@ -4388,6 +4389,21 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool); void * rte_eth_dev_get_sec_ctx(uint16_t port_id); +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * Get the SFT context for the Ethernet device. + * + * @param port_id + * Port identifier of the Ethernet device + * @return + * - NULL on error. + * - pointer to SFT context on success. + */ +void * +rte_eth_dev_get_sft_ctx(uint16_t port_id); + /** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 32407dd418..4ff458bfe0 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -806,6 +806,7 @@ struct rte_eth_dev { struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT]; enum rte_eth_dev_state state; /**< Flag indicating the port state */ void *security_ctx; /**< Context for security ops */ + void *sft_ctx; /**< Context for SFT ops */ uint64_t reserved_64s[4]; /**< Reserved for future fields */ void *reserved_ptrs[4]; /**< Reserved for future fields */ -- 2.26.2