From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 7E905A04B6;
	Sun, 11 Oct 2020 12:14:21 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 464281D53D;
	Sun, 11 Oct 2020 12:14:19 +0200 (CEST)
Received: from mail-il1-f193.google.com (mail-il1-f193.google.com
 [209.85.166.193]) by dpdk.org (Postfix) with ESMTP id 5511F1D53A
 for <dev@dpdk.org>; Sun, 11 Oct 2020 12:14:17 +0200 (CEST)
Received: by mail-il1-f193.google.com with SMTP id b2so13254545ilr.1
 for <dev@dpdk.org>; Sun, 11 Oct 2020 03:14:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=x3t3gc0Y4JE6FQB/GA1KzOMlACtdes8UHzYiI2XlbIA=;
 b=exYLASRp3yOWJ9+nprC0C+YfY0rXYMruWtWAkHpmvZgjIaGzTy44hMSyIUuB4Y1FZX
 jiAVAyw3a5MDr4z9DUAA/1dIOy2loQvLeO14ebpxi8vKPOhGUKDD3iUP/BMm5DHz96B5
 T/P3mZLSIwj/yEDCI2azvvtlcOc3IIq+8x10Dg6PClJ3hqiDm2wyRcWpbcxZaPw7tL0e
 BmZ1E2qeDTr1XSNMVAwUnOFOvyPXaaQXrxj3tskNG1lToN8AT5zo0xN71rmFMUpmS5lV
 IrQwQPtsQ/cx1S+YrWSL55+rcUlzgsxrQ5JtOdQmt2wbMKmK2Cg1SKvvghGRh0qs3q4e
 /Ubg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=x3t3gc0Y4JE6FQB/GA1KzOMlACtdes8UHzYiI2XlbIA=;
 b=nZh4FTO0r6ge/EIpLilUsO2Dk3LH1BCYMfSxJvHvhpkkWpZBWQu07olgMq2WfLOa8j
 QKWuSKP6zf4AjGysglPPSoYYdKcwm6DX3HWnHSxEZtVaEo3vEqKp8A4yiwulSZwzO04U
 sTUBQzFRDWZ8uLClNjA2eS+hQ8+yYdgS4RLCt8V/TDDV3jy/0tyzL/qrUZwo87C0TL/J
 +UFttJ+AhnGpATogUpARV+g8d9uCzrW3SSHfivTs2CvEJAT4GPtkjKLMf8TTmxObn4yr
 f7l7R77Vv6g+3QZ2ZpcrtFmCZyV/i59284DCRYFJm5SPSKPYCHF/4ZgkypIh4oECBYXA
 zPqQ==
X-Gm-Message-State: AOAM533iuaWc/QfMc65IYcLLO6/aU7lMeaAL+/2CJ8HLYCbDx63MW6nx
 IQCihpPIm1LzEX+f99eZBeA9lnsM3gAxikmzB8Y=
X-Google-Smtp-Source: ABdhPJw4q8o3G4P1+JyOaLLrSKQ0hR2XMkf59tT6TaQe41OOT7JP/2wDkdq0MvpDfYB8C8aIpg4RQALzU51QvyR5zyg=
X-Received: by 2002:a92:1e02:: with SMTP id e2mr14031388ile.294.1602411255649; 
 Sun, 11 Oct 2020 03:14:15 -0700 (PDT)
MIME-Version: 1.0
References: <20200831075333.10135-1-nipun.gupta@nxp.com>
 <20201009131331.5897-1-nipun.gupta@nxp.com>
In-Reply-To: <20201009131331.5897-1-nipun.gupta@nxp.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Sun, 11 Oct 2020 15:43:59 +0530
Message-ID: <CALBAE1O=nv46esk+1_B8XUh+dAS0Z6f6=oVRNtHeGomMeNmZUw@mail.gmail.com>
To: Nipun Gupta <nipun.gupta@nxp.com>
Cc: dpdk-dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>, 
 Ferruh Yigit <ferruh.yigit@intel.com>,
 Andrew Rybchenko <arybchenko@solarflare.com>, 
 Hemant Agrawal <hemant.agrawal@nxp.com>, Sachin Saxena <sachin.saxena@nxp.com>,
 Rohit Raj <rohit.raj@nxp.com>, Stephen Hemminger <stephen@networkplumber.org>,
 asafp@nvidia.com
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Fri, Oct 9, 2020 at 6:43 PM <nipun.gupta@nxp.com> wrote:
>
> From: Nipun Gupta <nipun.gupta@nxp.com>
>
> 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 <nipun.gupta@nxp.com>
> Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
> Reviewed-by: Asaf Penso <asafp@nvidia.com>
> ---
>
> 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(+)


The patch looks good to me.

1) Missed to update port_offload_cap_display() for new oflload in
/app/test-pmd/config.c
2) Please update doc/guides/nics/features.rst for this new offload

See [1] as a reference.
[1]
commit 28f6a3b88d23a348eeffd2bac79b2e0819d3b4e9
Author: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date:   Tue Oct 2 16:21:41 2018 +0530

    ethdev: support SCTP Rx checksum offload

    Added SCTP Rx checksum offload support

    Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
    Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>



>
> 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 */
> --
> 2.17.1
>