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 2F655A0555; Fri, 3 Jun 2022 17:54:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F04440694; Fri, 3 Jun 2022 17:54:05 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 937724021E for ; Fri, 3 Jun 2022 17:54:03 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id b135so7452078pfb.12 for ; Fri, 03 Jun 2022 08:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g3j3zikQTETuPt386Ak9ENOG9GnqbAfD64f8UGoqwEU=; b=hFiPmKgyK6b78QUdcOCIxnuvLoNmAM2UOK2PksqnoouITuSwqQPQoNjLi+oswc3Pue t8vSOxSJThElsUZ9qFxKuhhV8NYlRH+HcagsptkZE1yocDJZNchb/Tw7xZbk4m6jXbfO tTBSxyVUubVtQw8MoJ/e0A2Ky1t0w/xvbH2Wd5PsbGNi2w3kQo0ApOx32bSgkeWowlY1 ArIs0zS13l5fdh2KewOuhdjPt0s9NezanoLxHB33ORvxAOHUG55huPDS8csWWdXoPPMV V4BVSYkO7XOp2eGtX/CHYpDzjqq4HySgnMKyITnqyt+/u1jV2+a7n/W+0A6H9NcUvHb5 S0gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g3j3zikQTETuPt386Ak9ENOG9GnqbAfD64f8UGoqwEU=; b=sBHVwZsW7NcTcTiJWz2p80cLcpS1cSI+X6fNQNjHZhPziBCbuUbmnuOer3iQihDTzE xXlcbYMdVZWkkE5/5SEfMfk7zDDngqoOYMtbMwRmiZ8derTolmqKUSmstbi4QIQQHfhY 8JDQJoZ0V/MpcYwmXsMoBg8boR3gCW/caXEXkDflKrQ1/uua3BoGKirddXxxTSkO7jf1 VP/GID9slI3M++b1ImepjmKxKOJJLyKbu8mhEz0kRj5H/MInKEDzPMLuHhpZ/eGfBD9a 7PmX/UeCJeNA0UJfOzq2ZXh/YB4P+sxQ8gdnRqwwRrJhtGkLk8y+YUryUmcjOr4hGo63 g/rg== X-Gm-Message-State: AOAM532SOnFaSPLgCSMxF2Nn8VBew7Ibkb4nzvIbdcfVKBE7kaG+4P2y BzZOf2XJRo1JGmBOgOEZsCf6aJlC0DkyBw== X-Google-Smtp-Source: ABdhPJy+R8cZe1L/CwfY4lxX3d0Io8YKmFnFVWKW1ao884m7iCrP+2NHLQER5QtcW6ZMVCK5WUSw3w== X-Received: by 2002:a63:84c3:0:b0:3fc:8c46:2447 with SMTP id k186-20020a6384c3000000b003fc8c462447mr9337298pgd.285.1654271642658; Fri, 03 Jun 2022 08:54:02 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id k5-20020a170902e90500b0015e8d4eb2d8sm5627255pld.290.2022.06.03.08.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 08:54:02 -0700 (PDT) Date: Fri, 3 Jun 2022 08:53:59 -0700 From: Stephen Hemminger To: madhuker.mythri@oracle.com Cc: ferruh.yigit@intel.com, dev@dpdk.org Subject: Re: [PATCH] net/tap: Fixed RSS algorithm to support fragmented packets Message-ID: <20220603085359.229c898c@hermes.local> In-Reply-To: <20220325152809.2035-1-madhuker.mythri@oracle.com> References: <20220325152809.2035-1-madhuker.mythri@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Fri, 25 Mar 2022 20:58:09 +0530 madhuker.mythri@oracle.com wrote: > From: Madhuker Mythri > > As per analysis on DPDK Tap PMD, the existing RSS algorithm considering 4-tuple(Src-IP, Dst-IP, Src-port and Dst-port) and identification of fragment packets is not done, thus we are seeing all the fragmented chunks of single packet differs RSS hash value and distributed across multiple queues. > The RSS algorithm assumes that, all the incoming IP packets are based on L4-protocol(UDP/TCP) and trying to fetch the L4 fields(Src-port and Dst-port) for each incoming packet, but for the fragmented packets these L4-header will not be present(except for first packet) and should not consider in RSS hash for L4 header fields in-case of fragmented packets. > Which is a bug in the RSS algorithm implemented in the BPF functionality under TAP PMD. > > So, modified the RSS eBPF C-program and generated the structure of C-array in the 'tap_bpf_insns.h' file, which is in eBPF byte-code instructions format. > > Bugzilla Id: 870 > > Signed-off-by: Madhuker Mythri > --- > drivers/net/tap/tap_bpf_insns.h | 3371 +++++++++++++++-------------- > drivers/net/tap/tap_bpf_program.c | 48 +- > 2 files changed, 1743 insertions(+), 1676 deletions(-) > Going back to the original RSS specs on Windows: https://docs.microsoft.com/en-us/windows-hardware/drivers/network/rss-hashing-types There is note there: If a NIC receives a packet that has both IP and TCP headers, NDIS_HASH_TCP_IPV4 should not always be used. In the case of a fragmented IP packet, NDIS_HASH_IPV4 must be used. This includes the first fragment which contains both IP and TCP headers. The modified BPF program in this patch does not do that exactly. Adding port of 0 is not the same hashing a smaller tuple. IPV6 fragments need similar fix?