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 00F31A0548; Sun, 9 May 2021 16:20:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D496A40140; Sun, 9 May 2021 16:20:56 +0200 (CEST) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mails.dpdk.org (Postfix) with ESMTP id 3B7C34003E for ; Sun, 9 May 2021 16:20:56 +0200 (CEST) Received: by mail-io1-f42.google.com with SMTP id i7so4909367ioa.12 for ; Sun, 09 May 2021 07:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=eJXv8XF+Qa7k3ynlv6iCZhO2foR3yQj8+Qj+/7E8wUQ=; b=1lETvSwD+26jf6K6RURjH84gbwzMV2lIUThXYAZAXzc9EhLhAdlOYQ/SAULf3DIveN b/MPM2OJFG/PHbYRzE7yozPxzeNDSuUltJzwMWg1dG/k/2uhqZoD7oDEqwHJPu0QxzaM Eu3qKGdAmL24D5dICc1H7fsQCFUIRAOs4JBRtOqSragL9M6tLw/jIWCBskJwv+XtWQCB kOI8tuZ9FAWP/PJLfz3tMwFfvgjQMJBmOV8YAnsBHEzgjKiY04HY2oVN5QzdiScAeOqH Zdkp3lGIpbGghF8CD8CNcl+UO6aIaMA+qiZ/ntih7SpmWnNOgO0yhOvBV+VJNuQsMEUQ oO/w== 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:content-transfer-encoding; bh=eJXv8XF+Qa7k3ynlv6iCZhO2foR3yQj8+Qj+/7E8wUQ=; b=gbhvjaGPBu3IR5M3CPmxfvjbDg1JnSGUQm7dZahKmL/MFPzwCRX5SZOl3HCvHh9urU TfpDP6Vu8UecaQG6aspQOMWYxG7lESJx99rGkHtltb7ZbwXIKPK/bBeIvCTLBn1AASBC qMz4w6hcZkjbm3RHQQqLa4OsosVfaMJUtkI89PT8J5oQcadHu+zKy7FENsaomoGBQL6p Pg03eUEyRJ/+oO3bKX1K1MadgkwA8tC4NPtelYzteuYMU3An7mGBVRKltEyohvKD+CSv jOt8+8cWntYbBimBY3a2F403isLj1yOMv3gOqFUK/Xc1WQy1LRSz1GwozDcVETX8J+VY XbEQ== X-Gm-Message-State: AOAM531gwUTftIU5ycbIv+I3NbgqfNlEsuWOL70gPrD6OaGK+pZGS+kk 8S2WN8sJ8saCr+PNQsQW/23WmhjOJC/SvZ08fGPKOQ== X-Google-Smtp-Source: ABdhPJyBcDUienzIJ1pZzlQISyWHvWPihNHJS1SrnJvcm/7YFNab1/r1YxVfXFzGlhfrQGUjNjnu26HctONhhCuhWts= X-Received: by 2002:a05:6602:14d3:: with SMTP id b19mr7240383iow.154.1620570055645; Sun, 09 May 2021 07:20:55 -0700 (PDT) MIME-Version: 1.0 References: <20210505073348.6394-1-mk@semihalf.com> <20210506142526.28245-1-mk@semihalf.com> <20210506142526.28245-15-mk@semihalf.com> In-Reply-To: From: =?UTF-8?Q?Micha=C5=82_Krawczyk?= Date: Sun, 9 May 2021 16:20:43 +0200 Message-ID: To: Ferruh Yigit Cc: dev , "Dagan, Noam" , "Tzalik, Guy" , "Chauskin, Igor" , upstream@semihalf.com, stable@dpdk.org, Amit Bernstein Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 14/22] net/ena: indicate Rx RSS hash presence 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 Sender: "dev" pt., 7 maj 2021 o 18:47 Ferruh Yigit napisa=C5=82(= a): > > On 5/6/2021 3:25 PM, Michal Krawczyk wrote: > > To make it possible to the app to determine if the hash was calculated > > for the packet or not, the PKT_RX_RSS_HASH should be set in the mbuf's > > ol_flags. > > > > As the PMD wasn't setting that, the application couldn't check if there > > is a hash in a proper way. > > > > The hash is valid only if it's UDP or TCP and the IP packet wasn't > > fragmented. > > > > Fixes: e5df9f33db00 ("net/ena: fix passing RSS hash to mbuf") > > Cc: stable@dpdk.org > > > > Signed-off-by: Michal Krawczyk > > Reviewed-by: Igor Chauskin > > Reviewed-by: Amit Bernstein > > --- > > drivers/net/ena/ena_ethdev.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.= c > > index 6092288239..5d107775f4 100644 > > --- a/drivers/net/ena/ena_ethdev.c > > +++ b/drivers/net/ena/ena_ethdev.c > > @@ -51,6 +51,8 @@ > > > > #define ENA_MIN_RING_DESC 128 > > > > +#define ENA_PTYPE_HAS_HASH (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP) > > + > > enum ethtool_stringset { > > ETH_SS_TEST =3D 0, > > ETH_SS_STATS, > > @@ -314,6 +316,11 @@ static inline void ena_rx_mbuf_prepare(struct rte_= mbuf *mbuf, > > else > > ol_flags |=3D PKT_RX_L4_CKSUM_GOOD; > > > > + if (likely((packet_type & ENA_PTYPE_HAS_HASH) && !ena_rx_ctx->fra= g)) { > > + ol_flags |=3D PKT_RX_RSS_HASH; > > + mbuf->hash.rss =3D ena_rx_ctx->hash; > > + } > > The driver should announce the 'DEV_RX_OFFLOAD_RSS_HASH' offload capabili= ty > first, and should set 'PKT_RX_RSS_HASH' only if application requests the > 'DEV_RX_OFFLOAD_RSS_HASH'. > > > Normally this is an optimization to not always update the 'mbuf->hash.rss= ' but > wait for explicit request from application for it. > > But there is no practical performance gain for some PMDs and they enable = it even > user does not ask for it [1] (of course if RSS is enabled), if this is sa= me for > 'ena' you can do the same. > Thanks for the reference - ENA should do the same, I will change that in v4= . > [1] > https://git.dpdk.org/dpdk/tree/drivers/net/ixgbe/ixgbe_ethdev.c?h=3Dv21.0= 5-rc2#n2384 > > > + > > mbuf->ol_flags =3D ol_flags; > > mbuf->packet_type =3D packet_type; > > } > > @@ -2245,8 +2252,6 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue,= struct rte_mbuf **rx_pkts, > > ++rx_ring->rx_stats.bad_csum; > > } > > > > - mbuf->hash.rss =3D ena_rx_ctx.hash; > > - > > rx_pkts[completed] =3D mbuf; > > rx_ring->rx_stats.bytes +=3D mbuf->pkt_len; > > } > > >