Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2931857iog; Mon, 20 Jun 2022 07:45:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s7sdQsX6XBqmJNEKTmMmLRTnPzuWC1JE14PryNzD06dEhlhFAAm6oPnLIJxslPbkcWdLKW X-Received: by 2002:a17:906:37c6:b0:70c:f9f:f0c5 with SMTP id o6-20020a17090637c600b0070c0f9ff0c5mr20759824ejc.743.1655736306712; Mon, 20 Jun 2022 07:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736306; cv=none; d=google.com; s=arc-20160816; b=hh4K09QAbTyBPjahqvkHKNcDgQcLHshwBP8zPiHB1yMbG/LpqQ431RbDXiAmvp34r4 OqIdhkbx3BB1C9h7HrpaXRBTnvlUCge1kNDoPgRQhrGssBQbJnLxPEBdjh5Ec9wDr0Yp fcTGlunWKGbySocAFz+A9e1T3GSN2XJ+tDhIT/xcBUJS62gK7b8sIqIk2IACrsoIlSN2 FWL8xKhoBDEf6lfIjfp20A1oAoFmOI5j5OAkrSqAyCen+RNqLhygHF1X1oVLedwB8oGl AKnd/lQNp57RYPIsRtrWCdBiT6acCRaqeW+kTA1H57R+OfgYa3TZAOdfodTcV2uEgS2R 5vLQ== 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=HKRJ0bUewnhrlbDo85OLPeXSH5hEaLcly2m3SkbfyRA=; b=mAVgSzQxxa0+RI4GRsf1i38h4G7J9ZfMSU8qRVt+lJ6eu+pI27svhJA+T17NsMGgpl MJmGFu9z5L2ydVtsoEMc+I69Tx0cOJ1Wwg6T2uedkJUvNqq9IuH3mOD8gkHpJgPRv3O7 zp54mAlUkhD8BFXrIvbfK1iUipHqBppmXv6RhMVqplACa3Jw52P4hU+/M2USP4e0nshw WlVvvZoUJcQ+bdoHW1ki1isOwYCW15+xpXmgAeaVaG4VIlJfP0j68YLxGZTUsWlVB1uP 1riw0VqnEYIXxODTX+ceMsywkVt1uM5fZXSh70obImyaPGylXMbapNGm5yAegA7H9YGN JPGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qYlSiIwA; 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 b17-20020a056402351100b0043135bbd7b3si15717542edd.606.2022.06.20.07.44.40; Mon, 20 Jun 2022 07:45:06 -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=qYlSiIwA; 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 S1349848AbiFTOFx (ORCPT + 99 others); Mon, 20 Jun 2022 10:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351696AbiFTNzL (ORCPT ); Mon, 20 Jun 2022 09:55:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27CBE33E03; Mon, 20 Jun 2022 06:21:24 -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 639D360EA0; Mon, 20 Jun 2022 13:21:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62688C3411B; Mon, 20 Jun 2022 13:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655731265; bh=TcOQ08Bi+fpcSqJNKhTJNxiA/ySPqO+019amUcXZj3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qYlSiIwADWMVzEsqBZWrva35PIQ+BdXa5R3clafxW72CXzR/FvLvR9ww2q9V9WK0x McGrrN021WPshSmfxw4C/gbAEz/yMfB/37jdfZmd9s32MquBzKXI+PQID4Z3cZFaem PE6mkWzenkW/kbnw3teOjCOTqYVBjvX90IGBrfTA= 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.4 207/240] i40e: Fix adding ADQ filter to TC0 Date: Mon, 20 Jun 2022 14:51:48 +0200 Message-Id: <20220620124744.979136780@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@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 7f4aa2239786..05442bbc218c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -8108,6 +8108,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