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 2405BA0524; Wed, 5 May 2021 09:36:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BC3A4116D; Wed, 5 May 2021 09:34:21 +0200 (CEST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id A5CA941117 for ; Wed, 5 May 2021 09:34:17 +0200 (CEST) Received: by mail-wr1-f43.google.com with SMTP id s8so657212wrw.10 for ; Wed, 05 May 2021 00:34:17 -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=AOWFKy1Ct47JpsP4QpkdVjvj333ObsHyx1z3sJ6DiYFx+BMQhZbtwAygYLp0VILKjq /foXfm0EqrYLUWD2RhQ9YagW2h7lGcl1Km99rO+TycTc8ZNl5Bpa/TENtbUs55Z+yWb8 u47sdt47wfkdYF7OYKHwyXi1eWUOVobprxbKnAvnDxtjmh6ixNXijBWUKXa5MZZlKkN+ /7Fs/XPpr8WIvN1+Pk56lz7oWjxznLc5ydG42RA3motoIL9MW+zesxP9L/CaOQQGsTIF Hy3JGCE2QC+PcBj3LghLKy5jRKQwXUp4WuebGNZoROhBNelXCfAHhXqo7lFpBE6KaUwd TNyA== 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=TfJWmWxf424Qs4q0aa3WqUvf5jCs2QEvdSmb3+6ch7oWREUZZol5bQRJLRediWycEZ 4A3xSw4+wEAZlxKJYVi/Xi8amEnXt4D1YkaqBp9r5wmo669ry/QQAL5wKZYTBYa+Ze// IJywNJNpN/p+ek6dcjsHXGHNh+SMj2vMV2Q/W6cbfYesMfPcDP0Km1oyrRpjimnLMZrH Clt3Guoa1RV9oZpQDlYZtq+vQ7MRmvaCU7VzBuVZUpd8Gw1QaICzAQnYV9NvWgZ4ECIQ R/nvHsTKFrFHOSk+fcgvsKWicf2TrLMYLgO7Adj38A8StvIrHaV6/Jy1svFIyWJLdE2u TI9Q== X-Gm-Message-State: AOAM531+d94NkoZuJam1tO0Q2CEAVRfVC7n8TkBLoz1e5Ya87Y7a61zx te8KVz0UwoXQh/V4l2ztGVjXbuAeWabGrTtG X-Google-Smtp-Source: ABdhPJwr0y+KQQe/bEJMk4v/Wk+TCPc3VWsnBHY5MMB/PvDHOuBWDtX2vuSVAEjdzlzmJlchJZ8Ihg== X-Received: by 2002:a5d:6e04:: with SMTP id h4mr29988345wrz.256.1620200057121; Wed, 05 May 2021 00:34:17 -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 t17sm4679856wmq.12.2021.05.05.00.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 00:34:16 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org, Amit Bernstein Date: Wed, 5 May 2021 09:33:40 +0200 Message-Id: <20210505073348.6394-15-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505073348.6394-1-mk@semihalf.com> References: <20210430125725.28796-1-mk@semihalf.com> <20210505073348.6394-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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