From patchwork Sun Jul 29 11:46:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nir Dotan X-Patchwork-Id: 10548175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78897112E for ; Sun, 29 Jul 2018 11:47:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DC8A2A4DD for ; Sun, 29 Jul 2018 11:47:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 520A42A4FB; Sun, 29 Jul 2018 11:47:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D3142A4DD for ; Sun, 29 Jul 2018 11:47:25 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41dgt25JpNzF0yB for ; Sun, 29 Jul 2018 21:47:22 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=193.47.165.129; helo=mellanox.co.il; envelope-from=nird@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by lists.ozlabs.org (Postfix) with ESMTP id 41dgsx715nzF10W for ; Sun, 29 Jul 2018 21:47:13 +1000 (AEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from nird@mellanox.com) with ESMTPS (AES256-SHA encrypted); 29 Jul 2018 14:50:26 +0300 Received: from r-vnc13.mtr.labs.mlnx (r-vnc13.mtr.labs.mlnx [10.208.0.13]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w6TBl6qP024317; Sun, 29 Jul 2018 14:47:06 +0300 Received: from r-vnc13.mtr.labs.mlnx (r-vnc13.mtr.labs.mlnx [127.0.0.1]) by r-vnc13.mtr.labs.mlnx (8.14.4/8.14.4) with ESMTP id w6TBl61A016010; Sun, 29 Jul 2018 14:47:06 +0300 Received: (from nird@localhost) by r-vnc13.mtr.labs.mlnx (8.14.4/8.14.4/Submit) id w6TBl6UE016005; Sun, 29 Jul 2018 14:47:06 +0300 From: Nir Dotan To: linux-internal@mellanox.com Subject: [PATCH net mlxsw 0/2] mlxsw: Fix ACL actions error condition handling Date: Sun, 29 Jul 2018 14:46:57 +0300 Message-Id: <20180729114659.15917-1-nird@mellanox.com> X-Mailer: git-send-email 2.8.4 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP Two issues were lately noticed within mlxsw ACL actions error condition handling. The first patch deals with conflicting actions such as: - tc filter add dev swp49 parent ffff: protocol ip pref 10 flower skip_sw dst_ip 192.168.101.1 action goto chain 100 action mirred egress redirect dev swp4i The second action will never execute, however SW model allows this configuration, while the mlxsw driver cannot allow for it as it implements actions in sets of up to three actions per set with a single termination marking. Conflicting actions create a contradiction over this single marking and thus cannot be configured. The fix replaces a misplaced warning with an error code to be returned. The second patch fixes a condition of duplicate destruction of resources. Some actions require allocation of specific resource prior to setting the action itself. On error condition this resource was destroyed twice, leading to a crash when using mirror action, and to a redundant destruction in other cases, since for error condition rule destruction also takes care of resource destruction. In order to fix this state a symmetry in behavior is added and resource destruction also takes care of removing the resource from rule's resource list. Nir Dotan (2): mlxsw: core_acl_flex_actions: Return error for conflicting actions mlxsw: core_acl_flex_actions: Remove redundant resource destruction .../mellanox/mlxsw/core_acl_flex_actions.c | 51 ++++++++++++---------- 1 file changed, 29 insertions(+), 22 deletions(-)