From patchwork Tue Feb 28 16:46:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 62549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3126012wrd; Tue, 28 Feb 2023 08:49:23 -0800 (PST) X-Google-Smtp-Source: AK7set9NWwcfZD283w7z9j/BZuEuALtDF1PP5KhYokOrVI+ZNUk/vCMXNDY1FIWkx6MwF1ik9xCO X-Received: by 2002:a05:6a20:ba83:b0:cd:1367:3b69 with SMTP id fb3-20020a056a20ba8300b000cd13673b69mr3500370pzb.17.1677602962883; Tue, 28 Feb 2023 08:49:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677602962; cv=none; d=google.com; s=arc-20160816; b=DtOX4kNhdTs3Jn7RxBF3LhBb4/TsidFfsaM906Pfw5+VZsXKikubeB+h8Xpvn7fbo7 xtCM0+XhWZ1LH/kut/cSN36b5dQWcZj17LntlE+j8qCq470tY7yrZ2KQ+Tk/WSUANA1V x46+s32K7mp3O5KLHT8xVRi3ND24wUqY6O4Uq5a6dzOjf29op3Tm/3Jk/EqDMfY/fIK2 7s/4Lm3Y0q6/qb9M2x/WEINxHdimQ6xSHA0Jc18GGu1Txji8aG5GyIeafYIp3Va0Trp0 bSYG8ROXL4O188hc7T8EFoju4VqeauYKC7v36Ilt2TsqqPPJaBlX1V8dJUuaCa58V55W P9TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YrxDC/6dT1rc/Y2IwBqwiXkpFskUydPSc/2vojN9XtM=; b=AZP2dFjMrMSLSoVDcUM32shf/AmraWbMzsKuC7RYX3NsHe01f8V52xePFNBQeCL5bw nuT1xPcTAdzP0eE8t+22P3tkr0MH4TZzVlInp5II76GTpn1lIGNzXQFFy68OGbNqriSk deruWXT091aswYYgYzsYAswz2XFNI/LOSKa9O62ad3CcZ15SbJm2unHXFc+5E2WNEebZ TSK/jifV9Oij7cXadA/JXFwQgKo4WaoKOGnSJAYuRsnlmxExiSMjgm1r8U4q+tJtiNMP 3wnmwN/gzSii9UFKNRcMAtsOgAup6ZIQV487mJdUGmSYL63t2ymHB6tts7a8JQ/sWShd CG5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="T1WQN/gx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i33-20020a632221000000b004df3ece2141si9182194pgi.788.2023.02.28.08.49.10; Tue, 28 Feb 2023 08:49:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="T1WQN/gx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbjB1Qsu (ORCPT + 99 others); Tue, 28 Feb 2023 11:48:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjB1Qsl (ORCPT ); Tue, 28 Feb 2023 11:48:41 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8FB083D5; Tue, 28 Feb 2023 08:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677602887; x=1709138887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=exlFMpVF5vBUX97QGUIEERFQuxyaIwqV/MHoSJIWeoc=; b=T1WQN/gxnPOdTnMSKrH/q7H+BzRou7/PrZxu1GjrjxVybTmvkaZRa1/E HqmvKSnwHJmcyYv4MrEcM6zeFh3cSLi7utH78mnaZ54BSA2yKRaKP9N85 AWZ4TjK7D9HxKfrCdWWPrObwtm8X+XrMr0we4cx8W9Pt92hQ3uO38IiB3 N5PBlNzU2fGaDBrPAc4pUx/RBS8YYeBwWF8cKyqiQkEH8B3QYOc/dZV0b c2sOVkJMiCrXmvG3rYe6JIwCZWgTurqCaOsMHndxjcNFYi3woOz8AadB4 DK+ysnwq/UvMIxTUV2D9h6TUaGXB4hYUTvh4tIsOsmnDKRVF9jmWsIjRS w==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="317986834" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="317986834" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 08:48:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="624107467" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="624107467" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orsmga003.jf.intel.com with ESMTP; 28 Feb 2023 08:48:04 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail002.ir.intel.com (Postfix) with ESMTP id CC0F9369F0; Tue, 28 Feb 2023 16:48:02 +0000 (GMT) From: Alexander Lobakin To: Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Michal Kubiak , Larysa Zaremba , Maciej Fijalkowski , Jesse Brandeburg , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 1/2] iavf: fix inverted Rx hash condition leading to disabled hash Date: Tue, 28 Feb 2023 17:46:12 +0100 Message-Id: <20230228164613.1360409-2-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230228164613.1360409-1-aleksander.lobakin@intel.com> References: <20230228164613.1360409-1-aleksander.lobakin@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759094204055792152?= X-GMAIL-MSGID: =?utf-8?q?1759094204055792152?= Condition, which checks whether the netdev has hashing enabled is inverted. Basically, the tagged commit effectively disabled passing flow hash from descriptor to skb, unless user *disables* it via Ethtool. Commit a876c3ba59a6 ("i40e/i40evf: properly report Rx packet hash") fixed this problem, but only for i40e. Invert the condition now in iavf and unblock passing hash to skbs again. Fixes: 857942fd1aa1 ("i40e: Fix Rx hash reported to the stack by our driver") Reviewed-by: Larysa Zaremba Reviewed-by: Michal Kubiak Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c index 18b6a702a1d6..e989feda133c 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c @@ -1096,7 +1096,7 @@ static inline void iavf_rx_hash(struct iavf_ring *ring, cpu_to_le64((u64)IAVF_RX_DESC_FLTSTAT_RSS_HASH << IAVF_RX_DESC_STATUS_FLTSTAT_SHIFT); - if (ring->netdev->features & NETIF_F_RXHASH) + if (!(ring->netdev->features & NETIF_F_RXHASH)) return; if ((rx_desc->wb.qword1.status_error_len & rss_mask) == rss_mask) { From patchwork Tue Feb 28 16:46:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 62563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3127041wrd; Tue, 28 Feb 2023 08:51:17 -0800 (PST) X-Google-Smtp-Source: AK7set/I+Y3fDF9nCjf9o3cVHOjgsHWvJmJLEMTtfa9I+nfeVsiNtp/3gSj+mb67gL5PjFmiyva4 X-Received: by 2002:a62:6586:0:b0:5a8:5e6d:28d7 with SMTP id z128-20020a626586000000b005a85e6d28d7mr3297453pfb.0.1677603077021; Tue, 28 Feb 2023 08:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677603077; cv=none; d=google.com; s=arc-20160816; b=uyASS0MXdJqrBSs5OmY9dNDSqSy9YmHWu8q6QTY4WzwYlys2SZBtknD0cNI58Rx+sB 9btLvO/e8LsYTeg3gl2P6DxjQ3fhcCYr113E/vcRekDJh9y+2E9DHVDsafCBf0885UeG 3/5UFvcO6i3IpG28u2E+C1dJjdKBKgHmEcl/5PiBDF5RC22mGj2W9c4D+fC5vJ+QK4YX bsHUdZVM1ERbhNEQhmD6vi60+qZxTQiEQhgWjT1V8ncS6CfAg3rAQDTEky0ISeXszrnF tsnmWKY9pOtXZtDB4n9XIXLb/cVEFshN7HBhFDT3ZU4Tp5xvkhkkCGR3gjHCApaZ5Dr+ gUNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bKap9BtXP1Ss8yvje+RXIYrmWH/lo5lLFQyYtpwt8GY=; b=lU7stMUA+ynzxnUiv1eCUM9ym2gorYufIY5frvD6zs/5wIy7PoR0w6IfylI8nI7Bnu XNWl/GnwaqwO/s70bGlqgCUrtVlMZWPU5/5qMxVzpQCaBLwAqWqCF4hAv0uDRcAwTfQd Vfic17A9u0AFLz1yo52DH+SKVNXMSsFdyZHDS02SisdXAzT0W4FhFDlCSMprH8QPsRC5 ZKTUehkuFEfBwAEYuy8lOyadpgNvkUpsxPiUyLs9Av5Ey0BWOcqMkM2X53p63RCNLOa6 t8xiVMAzopMBrZlPzHOkChdgSTe8YFQKCLmNSz28EiYmkPaOR0cKK+k3qfhCGZhHA7gL Tr6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fIoaggoQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020a63c110000000b00503015b772asi10352569pgf.743.2023.02.28.08.51.04; Tue, 28 Feb 2023 08:51:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fIoaggoQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229958AbjB1QtV (ORCPT + 99 others); Tue, 28 Feb 2023 11:49:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229923AbjB1QtN (ORCPT ); Tue, 28 Feb 2023 11:49:13 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6139E59CB; Tue, 28 Feb 2023 08:48:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677602917; x=1709138917; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1BRx1cFZ8aFmlbAEYzeOUIKMH3jxuLSG/wPSL5VXqZs=; b=fIoaggoQGe0+PUHVyYjnaZlonDlLjRML65boCYOOJkymSAlVgy03g4Hw Y8P7EksBXIFdQrRINhZrnFYc7HaHM6pFjVDB9KDlyORpirA+WsSqJtZl4 KhbFbGbzQAe4fbmksS0Jt0W15jRkh5uwTZzR+3ucvhiUQEUW3/Dd8wQRY 76k+uNZnKee7nsK0s8aU8FzXAR/rA7sLHMBM3AR3lJRr0/cB0uUYfgbXA mKJfq8ia+ruDuDIz1fQqzBxPa5ANvzfW/Dpg2NGhlQJp777hJS5O2tlNS ssRb0VodM9LY31XptzDnd2gHnaiz9tp7MJwrOHIStYJRTvPIpP/GChZ78 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="317986842" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="317986842" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 08:48:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="624107471" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="624107471" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orsmga003.jf.intel.com with ESMTP; 28 Feb 2023 08:48:04 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 9B821369F2; Tue, 28 Feb 2023 16:48:03 +0000 (GMT) From: Alexander Lobakin To: Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Michal Kubiak , Larysa Zaremba , Maciej Fijalkowski , Jesse Brandeburg , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v2 2/2] iavf: fix non-tunneled IPv6 UDP packet type and hashing Date: Tue, 28 Feb 2023 17:46:13 +0100 Message-Id: <20230228164613.1360409-3-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230228164613.1360409-1-aleksander.lobakin@intel.com> References: <20230228164613.1360409-1-aleksander.lobakin@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759094323999179039?= X-GMAIL-MSGID: =?utf-8?q?1759094323999179039?= Currently, IAVF's decode_rx_desc_ptype() correctly reports payload type of L4 for IPv4 UDP packets and IPv{4,6} TCP, but only L3 for IPv6 UDP. Originally, i40e, ice and iavf were affected. Commit 73df8c9e3e3d ("i40e: Correct UDP packet header for non_tunnel-ipv6") fixed that in i40e, then commit 638a0c8c8861 ("ice: fix incorrect payload indicator on PTYPE") fixed that for ice. IPv6 UDP is L4 obviously. Fix it and make iavf report correct L4 hash type for such packets, so that the stack won't calculate it on CPU when needs it. Fixes: 206812b5fccb ("i40e/i40evf: i40e implementation for skb_set_hash") Reviewed-by: Larysa Zaremba Reviewed-by: Michal Kubiak Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/intel/iavf/iavf_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c index 16c490965b61..dd11dbbd5551 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_common.c +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c @@ -661,7 +661,7 @@ struct iavf_rx_ptype_decoded iavf_ptype_lookup[BIT(8)] = { /* Non Tunneled IPv6 */ IAVF_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3), IAVF_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3), - IAVF_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY3), + IAVF_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY4), IAVF_PTT_UNUSED_ENTRY(91), IAVF_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP, PAY4), IAVF_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4),