Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2806984rwd; Wed, 14 Jun 2023 07:35:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zaNRjujj4CU7h5mu5oUiRLE/7NAuUobWG+S4h/W2kcKJOA+RHWousqBZwjB3DkvkNHv+k X-Received: by 2002:a17:906:ee83:b0:974:62bc:33d5 with SMTP id wt3-20020a170906ee8300b0097462bc33d5mr17213434ejb.20.1686753315745; Wed, 14 Jun 2023 07:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686753315; cv=none; d=google.com; s=arc-20160816; b=ZohpAS368OQMGRtE4xFAD/CjDczRqoKYGPpon9RcVRVLUE+/4z4+RicbCtPacngWAX 2KpajSbfYI1wkX4ElZ3+gTItphMdEkGeAtzdwPYE5iSHW4ycjRAZVHOJnwatT3t6E9y2 XKLxp7aq5WqQmmvPm7UbjaU56mQ4+qNmOZ9wb/kMENd/gRP/E4Edj0YVF1IzFsYLZOUk qnklm0fcoPOXtfk2pfR/AmpHU+NpSosi/fgau2MMxodJ907TRUCEHa8BgYU64mCkUst8 tI/pC6NXBtKKzuUdHLWgu7BbImkUcryIF54QM3RMHZm6N0/LGDOn8TirKcO2cpnF36ht +tzQ== 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:dkim-signature :dkim-signature:from; bh=x6Htu7np35GOzuU2rwqMOLnSJ2z47YfJkRbHy1TCsl0=; b=X8mNMgA8q7Tx1yu6Ds+U0f1VF+BB0V3DWYJrqaT/gZwMst8Db3n1iXyctAeN1xmPer A40S7qmj4XOqzsGnyyuCtxUUdWR+nEkxiTYZTBf6sGDBC+RZ06u8D2niHaofPk3X1ZSP Ch57KA0GqAEFNuzDGuI65E2yMYi9T4Kx/QMueoVHzo4Nqs6joEngLgN5Pqmk8ayfTcz9 B56W7TmR8ueYrBqkjVt27Z10msZNmZhoRqVpKIBj4yMhgMciAycFyqJzK0YWBfvXsEnj yVTCXSpxLMTuZkFmyJnI/67JHX9UMxqG/OwKZFcq2A0hYE7LnjVDOTUlTFu6fIMDU51h G3NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1+8JZxpl; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=slM6BJwh; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v25-20020a17090690d900b009745654e184si8208347ejw.924.2023.06.14.07.34.48; Wed, 14 Jun 2023 07:35:15 -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=@linutronix.de header.s=2020 header.b=1+8JZxpl; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=slM6BJwh; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245381AbjFNOHo (ORCPT + 99 others); Wed, 14 Jun 2023 10:07:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245370AbjFNOHe (ORCPT ); Wed, 14 Jun 2023 10:07:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E5EECD; Wed, 14 Jun 2023 07:07:33 -0700 (PDT) From: Florian Kauer DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686751651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x6Htu7np35GOzuU2rwqMOLnSJ2z47YfJkRbHy1TCsl0=; b=1+8JZxple640L2i78OWj0AT4lW7BSRG5mTek6g1HCJErHIPJWpbpZbA8770+hU+H+m0tNb c9BnZ8Psh4CSh/9fzNZmdOxxeQ2hs3QOXMSxanhaAq7kgy8pyfqTNpd9Pkk8zVadW2EqGg EHQnvyIaPn/G1d5Uws7atr6Ma3KiSfbQ8PQ6+j/C7XxECFdHZtDqNkZ7XoW90Oy36m5gGm NDleKInVyFDzlbfFnAK6BXpJrUyKA/ggBwhnEwJbDOWCVgZ5XKbGumlrZckJHJ+B59NqtC vykd4w1CGkQtniToM4Nce/jXtkl0xIgA8tz4o8zkfydewwK0vEH42Qg5/ID54w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686751651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x6Htu7np35GOzuU2rwqMOLnSJ2z47YfJkRbHy1TCsl0=; b=slM6BJwhD6d50c957awDJHQXUZNZ9MEQweTUaWR3uNdodBTiBsjm6mW1Cvxg+B6E0s8OkD 9nYgz1dY/rUvzFBg== To: 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: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kurt@linutronix.de, florian.kauer@linutronix.de Subject: [PATCH net-next 3/6] igc: Handle already enabled taprio offload for basetime 0 Date: Wed, 14 Jun 2023 16:07:11 +0200 Message-Id: <20230614140714.14443-4-florian.kauer@linutronix.de> In-Reply-To: <20230614140714.14443-1-florian.kauer@linutronix.de> References: <20230614140714.14443-1-florian.kauer@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Since commit e17090eb2494 ("igc: allow BaseTime 0 enrollment for Qbv") it is possible to enable taprio offload with a basetime of 0. However, the check if taprio offload is already enabled (and thus -EALREADY should be returned for igc_save_qbv_schedule) still relied on adapter->base_time > 0. This can be reproduced as follows: # TAPRIO offload (flags == 0x2) and base-time = 0 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 0 \ sched-entry S 01 300000 \ flags 0x2 # The second call should fail with "Error: Device failed to setup taprio offload." # But that only happens if base-time was != 0 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 0 \ sched-entry S 01 300000 \ flags 0x2 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 122158b321d5..35ace8d338a5 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -6123,7 +6123,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter, if (qopt->base_time < 0) return -ERANGE; - if (igc_is_device_id_i225(hw) && adapter->base_time) + if (igc_is_device_id_i225(hw) && adapter->taprio_offload_enable) return -EALREADY; if (!validate_schedule(adapter, qopt)) -- 2.39.2