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 A171EA0546; Fri, 30 Apr 2021 14:59:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A659641137; Fri, 30 Apr 2021 14:58:02 +0200 (CEST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id C406041273 for ; Fri, 30 Apr 2021 14:57:55 +0200 (CEST) Received: by mail-wr1-f49.google.com with SMTP id n2so17315758wrm.0 for ; Fri, 30 Apr 2021 05:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CCn/jybjwpSYdpjlPdx2Ac4wk64prMVI0wGVgKgb4uo=; b=kDAayFKIk4vQR2DA7kV16tgbX2PPGZI+SyfGFMdTik3o0oj0sTFMC9yWNd6GH825YV YY/ftHZSg38Xhk6R1U1AYmOG6yNxPG0ZDo3/VQKreyfUfOn7EooeJ/Z6rt1D6bsQIdep 4guLRpMarXw96LvtLj0cWEvr6iPRXnhYDXWBaig1s48/Gu7+/TXzTI8+eyKqlFP2ZKUp XSQiuyzwIUMgHmStbdjgzwSUUNvoOo3E8qvov84bSBeSFe2dutCfjaXpKoHQ47LD2kG5 DqgaCrVFnuLmjJ+SYI0rq5pR1m64zOcrKk3C+aOd+ZzPthdR8gAo6eeYCIJZ0yiFRZ5W +N2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CCn/jybjwpSYdpjlPdx2Ac4wk64prMVI0wGVgKgb4uo=; b=B7HQuN/ud2KcGavhJKDsOfadvR/7XhKieaSjyFuMTk0YuLIokjvC4P6MlR/rKiY2ZW MxZy26Ol85lM6hDsRPh6DXUlg8a1zSefBiUig+JcdORlKwiO4FLFC4MwsMvYor1o6zvj ZeNinrvbVqMvnbqfUeIkkBa/optY+Z9QthpGF3uJM0ZbUD8s+8N6nY2Ptk8FSvcOsq5w vuTiE5aslI1KjbB5yC8nxOWgipLHNbOwLqFJCPQqMpdTs4YhIyZOZrSTvZWB40iZohZ/ yyOT2FMySDn00vO7wqgyxmMqKv+5tx9cNTegW2PbcKpJAM6diR6I1W9cJacCYUTwV7SP nVbQ== X-Gm-Message-State: AOAM532b8VZbbaZ7Aec9G3y0OTnwmujjS/3zDkv6EvXHsnqi8V1B0h+x s0fSwLKjv43WLtyYcEVRjaOnNmXsSO0LT/EW X-Google-Smtp-Source: ABdhPJwhQQaDkIDfsCjt7PcTg+nAz4fvSae7jX++jZ5T3QE6kOPArmbcomp5HTskgzNanNr7AjGDvw== X-Received: by 2002:a5d:4805:: with SMTP id l5mr6961948wrq.40.1619787475155; Fri, 30 Apr 2021 05:57:55 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl. [89.79.189.199]) by smtp.gmail.com with ESMTPSA id l13sm13476245wmj.3.2021.04.30.05.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 05:57:54 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazom.com, gtzalik@amazon.com, igorch@amazon.com, mw@semihalf.com, Michal Krawczyk , stable@dpdk.org, Amit Bernstein Date: Fri, 30 Apr 2021 14:57:17 +0200 Message-Id: <20210430125725.28796-15-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430125725.28796-1-mk@semihalf.com> References: <20210430125725.28796-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 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" 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 = 0, ETH_SS_STATS, @@ -314,6 +316,11 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf, else ol_flags |= PKT_RX_L4_CKSUM_GOOD; + if (likely((packet_type & ENA_PTYPE_HAS_HASH) && !ena_rx_ctx->frag)) { + ol_flags |= PKT_RX_RSS_HASH; + mbuf->hash.rss = ena_rx_ctx->hash; + } + mbuf->ol_flags = ol_flags; mbuf->packet_type = 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 = ena_rx_ctx.hash; - rx_pkts[completed] = mbuf; rx_ring->rx_stats.bytes += mbuf->pkt_len; } -- 2.25.1