Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25854210rwd; Mon, 3 Jul 2023 01:50:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xXytX73hHmO8gdQV+xsiyZgTVgpSvdMfiDxw0+VZztP6rN84+JXTCb8MFo+glFwE9h2TJ X-Received: by 2002:a05:620a:450b:b0:767:2bb9:d187 with SMTP id t11-20020a05620a450b00b007672bb9d187mr13722714qkp.1.1688374238242; Mon, 03 Jul 2023 01:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688374238; cv=none; d=google.com; s=arc-20160816; b=wKCZ7/nSPwmxH7Wjm9IclGUcWa8u6hFx0l/PM5cXwfednIaEtCdRclIO66oUpsURSe GNpBNTopxTcmWqXYPxe3BX26gCu/dNFxsWo0UEixh66dHiJjmb9mBUb8BTm2kZvpQyd1 Vg+R4iYgkw7mb1pwF8klSFUrzokBYv9gxMKoLt4RTwvwBgBAgVTYFvP7a9xHGgQJTQ0y c5qUwZtBVwwLXyfn2NnA1XemEppKNM87eQrwFxVXIFnojpzKrI9Xmgdbkn+/CqbhfnPS ZlK4KUcxlkGNzjV1rSPvlKZcrTGh/Ez3WiO1caIqQdQmyUUtExOtFW7eI3GFI5Qmeo8q A7SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=knIsX2Gj9vQz5dNQBDwwFBn/hzoY87mEnXKqvq2qfqw=; fh=YVpWIptA1QtmdWVQV8LkxDVZNZDhDvpOrepJDsoAZqU=; b=fVXNCzDPd4+eC9kFNXOwSG4j9ZTbQ87NK8W0DFYJC1ANivLnXclV25BpBqgYFRhLYo 8H5GfZGsRIj9OlHetLzfvcB4V2BqRMYG+5bTzm6ZpZm1urOpL7VeTeWKmNlzjn9k7hW0 5SlvsjD0i+1kNdVkI7JLwTKIGDFoTgHLn0Ov9/mgKnWKo7MTwHiHNhxyAQUNzT1ayiIt Q1Y3WegCu9zFtUNXyEWMFMZ9u4/I6NbIPKvPs/8T3Sllwgu4WV+dmsuFjCSC50NUQHvZ fffeMcqhxVBcinA7BJKrKVv12O3N3/b2frNtQxPRZQ4M+yV9mLluRpKSgcTXwuAOVCFW 2iXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="EDgGbf/4"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x27-20020a634a1b000000b0051b423d966csi18212333pga.280.2023.07.03.01.50.24; Mon, 03 Jul 2023 01:50:38 -0700 (PDT) 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="EDgGbf/4"; 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 S229925AbjGCIfA (ORCPT + 99 others); Mon, 3 Jul 2023 04:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbjGCIex (ORCPT ); Mon, 3 Jul 2023 04:34:53 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D984DD; Mon, 3 Jul 2023 01:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688373292; x=1719909292; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7kbif9bfnNgRHrXrFMABWk7zXjF8D6a49xUb4z1x3J8=; b=EDgGbf/46vhrppbnxJa+FD1hxPJQF3Ixnj0JzyGit15dtH/CTo3GqRk5 +YBVilG9wMdsBSeSpVdtxnUbsuelgAbPlTLZ1cCWNkipzy3duPpTAxbxj HmWtgsXhIdv+fcplb6wSvngIvHKBHeWrF2yGaSrbgbIhZVCejhCY6PLwW qb25/z95k0M8Tbbgr54AOrhlYnUrTo0gjAsow1aSZRhE3plJUsLvqlZHP 99lnWHYEqonKtaNuw3btRNNYkiG1Yah4ARinIFuVJ9jxwiJ3IO0eYn3uz nOjjuPmsjPsnZr6QAMhU0C2LnE3/ZLE8ngm8BBl0TAE/IX2zBfyjN71PM A==; X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="426508743" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="426508743" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 01:34:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="788447778" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="788447778" Received: from naamamex-mobl.ger.corp.intel.com (HELO [10.13.12.63]) ([10.13.12.63]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 01:34:47 -0700 Message-ID: Date: Mon, 3 Jul 2023 11:34:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [Intel-wired-lan] [PATCH net v2 2/6] igc: Do not enable taprio offload for invalid arguments Content-Language: en-US To: Florian Kauer , Jesse Brandeburg , Tony Nguyen , Vinicius Costa Gomes , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Tan Tee Min , Muhammad Husaini Zulkifli , Aravindhan Gunasekaran , Malli C Cc: netdev@vger.kernel.org, kurt@linutronix.de, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org References: <20230619100858.116286-1-florian.kauer@linutronix.de> <20230619100858.116286-3-florian.kauer@linutronix.de> From: "naamax.meir" In-Reply-To: <20230619100858.116286-3-florian.kauer@linutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On 6/19/2023 13:08, Florian Kauer wrote: > Only set adapter->taprio_offload_enable after validating the arguments. > Otherwise, it stays set even if the offload was not enabled. > Since the subsequent code does not get executed in case of invalid > arguments, it will not be read at first. > However, by activating and then deactivating another offload > (e.g. ETF/TX launchtime offload), taprio_offload_enable is read > and erroneously keeps the offload feature of the NIC enabled. > > This can be reproduced as follows: > > # TAPRIO offload (flags == 0x2) and negative base-time leading to expected -ERANGE > sudo tc qdisc replace dev enp1s0 parent root handle 100 stab overhead 24 taprio \ > num_tc 1 \ > map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ > queues 1@0 \ > base-time -1000 \ > sched-entry S 01 300000 \ > flags 0x2 > > # IGC_TQAVCTRL is 0x0 as expected (iomem=relaxed for reading register) > sudo pcimem /sys/bus/pci/devices/0000:01:00.0/resource0 0x3570 w*1 > > # Activate ETF offload > sudo tc qdisc replace dev enp1s0 parent root handle 6666 mqprio \ > num_tc 3 \ > map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ > queues 1@0 1@1 2@2 \ > hw 0 > sudo tc qdisc add dev enp1s0 parent 6666:1 etf \ > clockid CLOCK_TAI \ > delta 500000 \ > offload > > # IGC_TQAVCTRL is 0x9 as expected > sudo pcimem /sys/bus/pci/devices/0000:01:00.0/resource0 0x3570 w*1 > > # Deactivate ETF offload again > sudo tc qdisc delete dev enp1s0 parent 6666:1 > > # IGC_TQAVCTRL should now be 0x0 again, but is observed as 0x9 > sudo pcimem /sys/bus/pci/devices/0000:01:00.0/resource0 0x3570 w*1 > > Fixes: e17090eb2494 ("igc: allow BaseTime 0 enrollment for Qbv") > Signed-off-by: Florian Kauer > Reviewed-by: Kurt Kanzenbach > --- > drivers/net/ethernet/intel/igc/igc_main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Tested-by: Naama Meir