Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6101628iog; Thu, 23 Jun 2022 11:20:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5upsqDYlCso33+bUzA8CoKCRqLspQIt0CjeXxbDR03JXZGhwY3fMHzdOjKNW0NiH1UdqA X-Received: by 2002:a05:6402:43c7:b0:435:8a92:e8d0 with SMTP id p7-20020a05640243c700b004358a92e8d0mr12181994edc.174.1656008451450; Thu, 23 Jun 2022 11:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656008451; cv=none; d=google.com; s=arc-20160816; b=ycLxlae/Hw3SJz6QOHkgYXKwCrMRgfZuGa7RoiRtZlH7kC3VakLIZLUqel2GLlIucE QiHv+bj91rWAWBBiTiNdTgAIQXbIATfU2JiQ9y2NgLRJu472hVRpbNodObzIYvLkwIOP 4ZREbdlqKDWaA03HYE4wGA9CqYDey4PizfraJSsynflgPWiPFz3CltugVDXyTDC+zHD0 Xd8sMjQMbDCg7VQ80JnPztK7xYiIVpbnHgrAVYAP51iKUAq0fjdWdOLuTECGAh/FFOjv KiR5qiV980M10dmfIHTV1QWknIpe6tQPcMq+EJK91NIh7quo7MIfLS3UKy+ya9CMVgfg U+Dg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YrqNsO3y5d1he9rLLI8pVEuMV0VtFx3YxRPhyYHZN44=; b=ksnFm2bZ8NBZNH85YJ80dBDjM9wQpZTVSOjVtmpX2x6Ss5dDHqoAwggVQTXcAJNx4k M429vicJbHosfBGfRo5vbEhU2w8MH9sb/ywaf72bjRx1hS90Ks7x55dkVIqYKpbE8bLC ModDHA72nEmzR423lo8D0Pw4PtTZzaZig0tImXQl82UjxUttYJHieFxps/QXK85GvMy2 hztQxJjWME1Zrq8JVUKOiLkYoJO6kU1WZe33qCCn5S8+tf0N55vTqj7RlbNrSTKEMR12 xFC3oQKphJ/zn0xEqf8pAozX8OFl6HHCZEbYCIW1lwntSb+kyQkzjrPDI1TxymhpRaJa O0aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PzXo6FJC; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020aa7c84d000000b00435a62bb07dsi276040edt.341.2022.06.23.11.20.19; Thu, 23 Jun 2022 11:20:51 -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=@linuxfoundation.org header.s=korg header.b=PzXo6FJC; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236906AbiFWSS7 (ORCPT + 99 others); Thu, 23 Jun 2022 14:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236561AbiFWSQH (ORCPT ); Thu, 23 Jun 2022 14:16:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6851A4F457; Thu, 23 Jun 2022 10:22:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F1D5A61DE5; Thu, 23 Jun 2022 17:22:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1EF3C3411B; Thu, 23 Jun 2022 17:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004946; bh=3jdA5NQNZsu0UfLV97BpKlnu8aEvNu+8Lh5WqSw9/bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PzXo6FJC3/TKIZ7i1txjMB4j+L7AvFclq5rUHazYTuiPy5oZHLWUrLVTLRhzsHlrA KPSohJgo55NWzmfiPAcHKzIc7dyFif9EVu5XRdd29422UT1VY5NapKiounLsPZtUTd eNs6y+sS24rshlrqQ/sVA4GwTL6HApE4DVGp/4tk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grzegorz Szczurek , Jedrzej Jagielski , Bharathi Sreenivas , Tony Nguyen , Sasha Levin Subject: [PATCH 4.19 200/234] i40e: Fix adding ADQ filter to TC0 Date: Thu, 23 Jun 2022 18:44:27 +0200 Message-Id: <20220623164348.709705030@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Grzegorz Szczurek [ Upstream commit c3238d36c3a2be0a29a9d848d6c51e1b14be6692 ] Procedure of configure tc flower filters erroneously allows to create filters on TC0 where unfiltered packets are also directed by default. Issue was caused by insufficient checks of hw_tc parameter specifying the hardware traffic class to pass matching packets to. Fix checking hw_tc parameter which blocks creation of filters on TC0. Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower") Signed-off-by: Grzegorz Szczurek Signed-off-by: Jedrzej Jagielski Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 21ea0cdea666..3615c6533cf4 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -7508,6 +7508,11 @@ static int i40e_configure_clsflower(struct i40e_vsi *vsi, return -EOPNOTSUPP; } + if (!tc) { + dev_err(&pf->pdev->dev, "Unable to add filter because of invalid destination"); + return -EINVAL; + } + if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) || test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) return -EBUSY; -- 2.35.1