Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2942599iog; Mon, 20 Jun 2022 07:59:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tyNZUhn9WDkJYCzvHxSdQlNcezdoz7yq7p41A74y9oCC1MPPQaY5fQIOEIboTtic3wVn76 X-Received: by 2002:a17:902:f792:b0:168:e97b:3c05 with SMTP id q18-20020a170902f79200b00168e97b3c05mr24046984pln.94.1655737169657; Mon, 20 Jun 2022 07:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655737169; cv=none; d=google.com; s=arc-20160816; b=gy7mMRa+G0o68/kKcssTNSY8BgbWP9OmDiGsUJhgdZebtjvVd67YnenCUj2IjK2LuN tBnQRssQwzX6tQwQU1k1PmuJ7o70xRkkEQyBfRNRP8IWHDYYXxrZGF7/cuxj6DCIBgDo GfpaEUViTJFT/QGVC8EcCTaHzPviK77TbdM7moou/PlDcTI5YtH/Bd5mw9fYGZjSODpm VROSNQ7sHcHoThq4/QA+GCFdS62onuAW42Wpc+bv3pDyTYEgk/V0Bh8CZjOjEYT2Z/xH JG33hTCzpCwzNxpu07YkvNwp0EQyX4wYDqTzID+u+FXEThc82T8AF4Vcb8VtMPFY55Hn T+ig== 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=U0PieewkFwfAa4BhgRIcXkrdtWtxfBSdIF9ZxwM2bbo=; b=dV5RPz5G0h4KpweJS2sEZeC2x4lTFRh4vSEbqfwoBfuLi7l/Gb9oExIAQL5mUgTxnf 17symdAFFUa9+83lpTnn1MaSvEBnNpZcjJvAH601+UHHb6lJZhGlUAsID9lnH57/LGlU Xhc52OjrIpR4Jjwm+cIUVtq75xjpNXv6yHjlH4gZfx4OSuGi+nHKlL8SkWEDaPkOet7Q keKeQsaZS42Z6MUSpbuslRz12LxGx8DFg3WKW2ly3VjRTYd/MXQtQqi8e5MuffV/NKqs GqpaTB5fOZ+36hcBw4xJMNx4gRakuv3o8aibmcjCam2uR/eVwmtv1xjongaSUd2oUuXD neog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YJwbQ6JW; 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 y11-20020a62640b000000b0051e77ab003esi9056389pfb.68.2022.06.20.07.59.18; Mon, 20 Jun 2022 07:59:29 -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=YJwbQ6JW; 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 S230345AbiFTNAy (ORCPT + 99 others); Mon, 20 Jun 2022 09:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243701AbiFTM6b (ORCPT ); Mon, 20 Jun 2022 08:58:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BDEF1B7AA; Mon, 20 Jun 2022 05:55:51 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9D73BB811A9; Mon, 20 Jun 2022 12:55:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0904C3411B; Mon, 20 Jun 2022 12:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655729738; bh=1UGWyHsgoE8E5WlvbcwhMzAmuODbM36nWvBTLQ2IXR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YJwbQ6JWyBRggKEkkkQgdFJanhfFYmxF3BihHg0CCYbZm649VL4WxsLu0i0ksR68W F+UiMQIgXLKn7PJMQAz2ah+160RA0OhrPFnnOkmS3fI61bQIhFhHG6JBdS3pLtQ9Ft FeyISBfX9RUcS61fjVh4nsZ33sDTEjkOk1iL3kaU= 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 5.18 058/141] i40e: Fix adding ADQ filter to TC0 Date: Mon, 20 Jun 2022 14:49:56 +0200 Message-Id: <20220620124731.252175025@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124729.509745706@linuxfoundation.org> References: <20220620124729.509745706@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 98871f014994..46bb1169a004 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -8537,6 +8537,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