Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4049523ybe; Mon, 9 Sep 2019 03:25:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVMDBYrfeE0rpX2IJqoI49Wux5djLvrWd96D0mYM8BJs4QKj4EySOWQbDQKVJZElC96uaC X-Received: by 2002:a17:906:3746:: with SMTP id e6mr19326325ejc.35.1568024738184; Mon, 09 Sep 2019 03:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568024738; cv=none; d=google.com; s=arc-20160816; b=g8A9hsPmtZseAOBh8QewL157CiQgr9jO/4lg1dnaoCLwmSz3xxNi3VEL48Gp5DL/oG N6xNRr9ZurduuV8dgULAJECVwq/quDzN9dJTlS+NCRj227mTpplctNbq+KypW9fcnJXM KILpNUJXzwrNIjCc6ExsK5NiN2uS7vRQ/OjMKy85kP8ty55Q3TGTkU8Ug6FhdZoj2Jnl RN6rwOD6S0dI8lpIOqBK9LoPsAe+QB/5hf0bZskGiu+4Lv/Brie4tqL767AaddGNaDJm 1MCkwuOTDhCuoyu/z/94vyAKqNirJ0jZ1OyN8eQ6ve5GHfxr3SjOSbFz339gM84bdkUh /Blg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qNmQPyDvP2Zg40+6ixovWDtySE5HHByJ2VduWTJ6kww=; b=NI214Rp2uPoQYFDJw44sNZDBzBdFwKEtA8S0oN0VXDV6E48zhF8asmO0C7fD+Uc+zI h2I3E3NPKig9yTnO3nwpwjMyiaopcP//yXgUew1HsyqAjrgEGNEVSdB5adsuYLnKcXV1 PjIQPY7bEESbz5tyZszNRzQ6kksqWw7QVUJ3X+XlP/Hn/Q71uoYJju9l72jdlIX6Lg+i ek1SAAufU3EkJ6lGndoI58RKEXLmInted4Mxww5bp6xcxxeWqEKHc3Egj/yTNWVIFU7U O4L211usKi9miNKU6scy64qvv8fMM7cSWRThqQccVg7AI5Qu6AmP2j17yTpU5zqdXz9v 9gCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gjVW2hRU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si3158025ejo.82.2019.09.09.03.25.14; Mon, 09 Sep 2019 03:25:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gjVW2hRU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731977AbfIHMuI (ORCPT + 99 others); Sun, 8 Sep 2019 08:50:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:40664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731953AbfIHMuG (ORCPT ); Sun, 8 Sep 2019 08:50:06 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA0B821927; Sun, 8 Sep 2019 12:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947006; bh=Hj/mEbfDcU4RvJYf9sQAXSGASOLtPSMuI0BJocJkky8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gjVW2hRUU3xihrU4tdaxIT2vhmtUfzgy2VdErNBMlOdollEGPIY9DX8FvJuYcrfcH XH0v+TVeAjZtR8bovAchUzaV7Sxl2VEBZN27vsrJeDsuNTCMX6o7SVCy8wxrZCUWF9 hke+Fla3Ncro9e8ZdXAeGHSU1DoWrhzvYn5JEEl8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Hurley , Jakub Kicinski , "David S. Miller" Subject: [PATCH 5.2 08/94] nfp: flower: prevent ingress block binds on internal ports Date: Sun, 8 Sep 2019 13:41:04 +0100 Message-Id: <20190908121150.669979451@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121150.420989666@linuxfoundation.org> References: <20190908121150.420989666@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Hurley [ Upstream commit 739d7c5752b255e89ddbb1b0474f3b88ef5cd343 ] Internal port TC offload is implemented through user-space applications (such as OvS) by adding filters at egress via TC clsact qdiscs. Indirect block offload support in the NFP driver accepts both ingress qdisc binds and egress binds if the device is an internal port. However, clsact sends bind notification for both ingress and egress block binds which can lead to the driver registering multiple callbacks and receiving multiple notifications of new filters. Fix this by rejecting ingress block bind callbacks when the port is internal and only adding filter callbacks for egress binds. Fixes: 4d12ba42787b ("nfp: flower: allow offloading of matches on 'internal' ports") Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/flower/offload.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -1280,9 +1280,10 @@ nfp_flower_setup_indr_tc_block(struct ne struct nfp_flower_priv *priv = app->priv; int err; - if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS && - !(f->binder_type == TCF_BLOCK_BINDER_TYPE_CLSACT_EGRESS && - nfp_flower_internal_port_can_offload(app, netdev))) + if ((f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS && + !nfp_flower_internal_port_can_offload(app, netdev)) || + (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_EGRESS && + nfp_flower_internal_port_can_offload(app, netdev))) return -EOPNOTSUPP; switch (f->command) {