Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3302524ybi; Fri, 5 Jul 2019 05:14:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfE5mNo5QzXjpyKL2UT+dwJFYDnIZ9v+pqT+jt1zMjI38aiRMrmiRE1SMj8U5X3j0fkjIJ X-Received: by 2002:a63:460c:: with SMTP id t12mr5212083pga.69.1562328899234; Fri, 05 Jul 2019 05:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562328899; cv=none; d=google.com; s=arc-20160816; b=LTwFKL3gynvtSk8i0agriGO09N1xbXgG8aTpKh4yHmcRGXerXjaum/tTJ9JE+HEaqi ZKZhUX6gmZfjH2XlnRwH19cqhuEUZk4gFCepo3MoTHvmX1JRxnboIpFVF/gHZilgifrC iBO77bbg1u/zfQuCatUXm/zrElT0ZO6iHG2cZ3Zw3cAdSdmfiyESK/+d2GRCuzZsRLr4 UnDJGP0fWPB/ja6jR+RcFbQ36hxWpmT6jg5kxPhnjufT0QyTWweUWBi0svjRBLYosyht C5jYQonN7czxJEUqUivtE6Z7pEhQubWVOMlLzqq+yVU627xBARguRY4JXapBoc2VFYcp 4PNw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sEk8eh/WZX52vhZjt9j66vA5gBnPvpML1f8yj58nR0M=; b=Lh6vGbf5kBJfkOQLdHQU5tN8znhZmYNTxwBk9Kny2xkFBgK95kOjtW0GjBrxI1JhOo G8Na2qTVB6ZWiu6F8z6SNfiuq5VIpj7rRuzcCmpP+/oSFPuDOGo1W0pxXo7BLwHb59ng wUZDinx5vtv/kVASfG6o24u+EFQiB0xeC6NNZjdN8V5QVUcRGHTXOEhmQXqnXjJDwxep y6UfKN2/R8FLRmlq99VqrypzJ2QxNJnIjELCDPUHgN8l2+VviaqpDVFNGgI8lcc4T+Eh UhTiEmKXzcWZLryy/+w610XmvQtlXMJW5aR/FiO6HPIoe6kLuuCDGlcTHUHBaIEUQjRd j9kA== ARC-Authentication-Results: i=1; mx.google.com; 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 d21si8961016pgd.544.2019.07.05.05.14.43; Fri, 05 Jul 2019 05:14:59 -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; 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 S1728881AbfGEMJT (ORCPT + 99 others); Fri, 5 Jul 2019 08:09:19 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:49957 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728062AbfGEMJR (ORCPT ); Fri, 5 Jul 2019 08:09:17 -0400 Received: from mc-bl-xps13.lan (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 4A055200011; Fri, 5 Jul 2019 12:09:15 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com Subject: [PATCH net-next 1/2] net: mvpp2: cls: Report an error for unsupported flow types Date: Fri, 5 Jul 2019 14:09:12 +0200 Message-Id: <20190705120913.25013-2-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705120913.25013-1-maxime.chevallier@bootlin.com> References: <20190705120913.25013-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a missing check to detect flow types that we don't support, so that user can be informed of this. Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c index b195fb5d61f4..6c088c903c15 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c @@ -1373,6 +1373,10 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port, efs->rule.flow = ethtool_rule->rule; efs->rule.flow_type = mvpp2_cls_ethtool_flow_to_type(info->fs.flow_type); + if (efs->rule.flow_type < 0) { + ret = efs->rule.flow_type; + goto clean_rule; + } ret = mvpp2_cls_rfs_parse_rule(&efs->rule); if (ret) -- 2.20.1