Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3491651pxf; Mon, 29 Mar 2021 03:53:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc1/Ai1z8RWj9vl6SBaQZ5k7TIYDCVODBV0zqm7QgFb9X8YE30eXJ+MQWzb1Ko8EaOzOvu X-Received: by 2002:a50:d753:: with SMTP id i19mr27788442edj.43.1617015200305; Mon, 29 Mar 2021 03:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617015200; cv=none; d=google.com; s=arc-20160816; b=PCgkUFgCvGfqnptLVsaBs0cxjcOYVpeSjKDm3ruWaMZIyhe+RPklbCUyq5SrEQ73F+ ju1WwEHXTn+QqjeWjNNjPVKT6YDjZDDcmj0pB21Gl9xTlzpXxSiZ5kmmZJUtmI0nAXo0 BwwA8JAq6Tin+wiJKcdjKNUEAJLfS0CDAv68hNa9njLz5FWPV12VdqEbNMn4TNDmF8gv x1GRcNldYWW83A4gxW4rFbUhoGAno6CeRDuM05zE27evQQLTwSldx407ExXIe+N5kgzw f8IzcwmHAGT+zeX87YVIu48npKQfBzrX+a4xO7fPBsEj9+2gyWsEwL9s00+BUUZd2WbQ iklQ== 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=y1i8TY0z03NaL9sOUn0J532PtvDEs5Fyb9XvvWj5X3E=; b=KiFT7C+Qzz8Yad943xx8FExqTojaZdEgKAEaohxkg+MMKZqFZYsq6VqejCmCbhQ8ty LiecPKvf3+TvTo9avlWgUVH1oKmpSM9AMQFoyX+DqYM/MlIqCWyZpFl3AyYl+FU7xWUM /68Hg+0IjjToBDzLRJD3s5iKue2Qlo9MZJeYbmLPW2eZ4rolxIxNebTdiUuaVH5RgKnu BsQi15imy3vXo7JnZ8zCbPkk4YRPGd6MIimzXVJ8o1F90bb74rok+468siAlPjduj48u zfQKf5oAyrIgTWeFGHbOtra4YNiv4qGT+dsyPxhZdZhhOsYndUstbJqh2S1Lmjk/hUeD z0xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QBxNLy5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si12084640ejt.551.2021.03.29.03.52.58; Mon, 29 Mar 2021 03:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QBxNLy5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235235AbhC2Imb (ORCPT + 99 others); Mon, 29 Mar 2021 04:42:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:41880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234230AbhC2IYL (ORCPT ); Mon, 29 Mar 2021 04:24:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 038C16191F; Mon, 29 Mar 2021 08:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006249; bh=rftRmCZ/mMag9PPX3a0bi48psi9unyOes1jdQE4RAPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QBxNLy5M7zJHVFJ2v2+NkpFW9oaElBHjsuzilpaFEewRgr1LSBFmD5Li7yl84o4US 94baUXlTHlq2Cy6y3vNbIQTx3W/KszxHP1CTHEoSaQLS2L7hQWBBA+nYBW88DtmfLY DtbququTXHW1s0K25TwF9RZVF1evVShiRTnuvtBk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alaa Hleihel , Roi Dayan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 171/221] net/mlx5e: Allow to match on MPLS parameters only for MPLS over UDP Date: Mon, 29 Mar 2021 09:58:22 +0200 Message-Id: <20210329075634.856847361@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alaa Hleihel [ Upstream commit 7d6c86e3ccb5ceea767df5c7a9a17cdfccd3df9a ] Currently, we support hardware offload only for MPLS over UDP. However, rules matching on MPLS parameters are now wrongly offloaded for regular MPLS, without actually taking the parameters into consideration when doing the offload. Fix it by rejecting such unsupported rules. Fixes: 72046a91d134 ("net/mlx5e: Allow to match on mpls parameters") Signed-off-by: Alaa Hleihel Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 4b8a442f09cd..77ee24d52203 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2597,6 +2597,16 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, *match_level = MLX5_MATCH_L4; } + /* Currenlty supported only for MPLS over UDP */ + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS) && + !netif_is_bareudp(filter_dev)) { + NL_SET_ERR_MSG_MOD(extack, + "Matching on MPLS is supported only for MPLS over UDP"); + netdev_err(priv->netdev, + "Matching on MPLS is supported only for MPLS over UDP\n"); + return -EOPNOTSUPP; + } + return 0; } -- 2.30.1