From patchwork Fri Oct 9 13:13:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 317536 Delivered-To: patch@linaro.org Received: by 2002:a92:d603:0:0:0:0:0 with SMTP id w3csp2305101ilm; Fri, 9 Oct 2020 06:13:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxyuxfwueZW28nTsEdzactEuBzXXr4/TuUP+qDE1bOIwuziVpbHs58yLBereDXxd2+IT68 X-Received: by 2002:a50:bb0d:: with SMTP id y13mr15144497ede.317.1602249232643; Fri, 09 Oct 2020 06:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602249232; cv=none; d=google.com; s=arc-20160816; b=ikqonYxa+rLAGJ+RbLZ9TL4RclgYEiyMba3tGdRHq5nfWynus2IDwBdBx/EZyUBf33 dCNGNAcpGpENrCGqia8yauCcW7Y3wJUnGdNOmVya3TtlALJ4zwQERjJSifC+J1A10AAk nQUhhX34t0I+BuA+IyvyhOFDLvjvpB2T6dTPBPW/aJqiR+9p/4qR8SlVPysMk1cCTQHK iUDbtnJRdr8fbIztGBQeDYpw59Sc7IyXN1Pu+VCoXTyGXEx8FN+BeKy6svAXnEKlFtma g06/zXMd32n82r15pv3NtRAP4sMNMxorqv9AEOdxndMJWUH3pQQHcxnLxqucWpSyk6ep C37Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=2JWqgtsVqglvsU+PhNdc5A08djcL2ujdnbGX1E3xCzc=; b=S/uPbQUwaNx5SjlrtVO1+VSBJUMnv+nqq6hDibrKGUzSFRms79CqOy7iMT5bVTINRu 8kKls9vdMzfJhCAogd8Yfn1pXIm2WnnOCDrmvYTnsur4tOBnJKPpNqLpGP8k4UQLFAGI eBoAsORD4U+a+QZoQTy8Lbi8rR1IDL7Bvljl4YxbBKPe5YevMdekQ/t+Z7oMYtmDxC+f V8HwikszUUDv8/q58fAzkTYYt7o1lrbFp2TJHLzq3oYQUthmKXPgurrsYhmrcbCVDMQq A+3WDuA61Z5+Uobh+pR8Xu7AsT9Jw9TAyEQxCmrHXAFoqzCLYM7WKtjJPpmY0NMihXtN cyAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id oc24si6327408ejb.530.2020.10.09.06.13.52; Fri, 09 Oct 2020 06:13:52 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 080171D5A2; Fri, 9 Oct 2020 15:13:47 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id C32811C1D0 for ; Fri, 9 Oct 2020 15:13:44 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 958AA20039E; Fri, 9 Oct 2020 15:13:44 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id F312620039C; Fri, 9 Oct 2020 15:13:39 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 95D55402B0; Fri, 9 Oct 2020 15:13:34 +0200 (CEST) From: nipun.gupta@nxp.com To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, rohit.raj@nxp.com, jerinjacobk@gmail.com, stephen@networkplumber.org, asafp@nvidia.com, Nipun Gupta Date: Fri, 9 Oct 2020 18:43:29 +0530 Message-Id: <20201009131331.5897-1-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200831075333.10135-1-nipun.gupta@nxp.com> References: <20200831075333.10135-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/3 v3] ethdev: add rx offload to drop error packets 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" From: Nipun Gupta This change adds a RX offload capability and configuration to enable hardware to drop the packets in case of any error in the packets such as L3 checksum error or L4 checksum. Signed-off-by: Nipun Gupta Signed-off-by: Rohit Raj Reviewed-by: Asaf Penso --- v3: - Add additional rx_err_drop_offload_capa, which is specific capability flag for RX packets error drop offload. Currently only 'all' error packet drops are enabled, but can be extended to provide capability to drop any specific errors like L1 FCS, L3 Checksum etc. - Added separate config structure to enable the drop configuration. - Updated doc with the new updated option in testbbdev (patch 3/3) v2: - Add support in DPAA1 driver (patch 2/3) - Add support and config parameter in testpmd (patch 3/3) lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) -- 2.17.1 diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 48d1333b1..be25e947e 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -128,6 +128,7 @@ static const struct { RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM), RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), RTE_RX_OFFLOAD_BIT2STR(RSS_HASH), + RTE_RX_OFFLOAD_BIT2STR(ERR_PKT_DROP), }; #undef RTE_RX_OFFLOAD_BIT2STR diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index d2bf74f12..cb968d38a 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1194,6 +1194,16 @@ struct rte_intr_conf { uint32_t rmv:1; }; +/** + * A structure used to enable/disable error packet drop on RX. + */ +struct rte_rx_err_pkt_drop_conf { + /** enable/disable all RX error packet drop. + * 0 (default) - disable, 1 enable + */ + uint32_t all:1; +}; + /** * A structure used to configure an Ethernet port. * Depending upon the RX multi-queue mode, extra advanced @@ -1236,6 +1246,8 @@ struct rte_eth_conf { uint32_t dcb_capability_en; struct rte_fdir_conf fdir_conf; /**< FDIR configuration. DEPRECATED */ struct rte_intr_conf intr_conf; /**< Interrupt mode configuration. */ + struct rte_rx_err_pkt_drop_conf err_pkt_drop_conf; + /**< RX error packet drop configuration. */ }; /** @@ -1260,6 +1272,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_ERR_PKT_DROP 0x00100000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ @@ -1274,6 +1287,13 @@ struct rte_eth_conf { * mentioned in rte_rx_offload_names in rte_ethdev.c file. */ +/** + * RX Error Drop offload config/capabilities of a device. These + * are valid only when RX capability DEV_RX_OFFLOAD_ERR_PKT_DROP + * is supported by the device. + */ +#define DEV_RX_ERR_PKT_DROP_OFFLOAD_ALL 0x00000001 + /** * TX offload capabilities of a device. */ @@ -1411,6 +1431,8 @@ struct rte_eth_dev_info { /**< Device per-queue RX offload capabilities. */ uint64_t tx_queue_offload_capa; /**< Device per-queue TX offload capabilities. */ + uint64_t rx_err_drop_offload_capa; + /**< RX error packet drop offload capabilities. */ uint16_t reta_size; /**< Device redirection table size, the total number of entries. */ uint8_t hash_key_size; /**< Hash key size in bytes */