From patchwork Wed Apr 3 18:41:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13616597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54858CD1288 for ; Wed, 3 Apr 2024 18:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References:Message-ID :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ej4lDfSvVXqFpJ+pSuvEMLkb3pF9X2UHC4zfgSbf0E8=; b=KsjUb9MxmBxnEc UfKEDIiGBQXDhTLAZKbZzU2rXthPBClzOXfCTO51WJ219zSRYNfzMKsC8sDQeGc1dVyWURNnsh/o/ plzKeH6tDEYXZPAPslg3usW7jYLct0ack5PYcDvFJ7Kr4OwuwZS7YyGUwhe/OYCrU8RkdMvHk9El2 PIUGvQLNJYCiLhSeO/BfFtLfaVa0M7JRAF+ykhk+9fJ9IIBrR1YsL+yeg7HkMPfxPOHXUbODMv9GI wjvVXAcf3tzDS+EyCuYeIBPqG//hA0PaqZq8nVMLTP0F+0MiwpFIiHPiP25LIiG0M6czGv9T1uiLa yj7rsZxEMsu3azLNndgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs5Yz-0000000HQfO-42Zw; Wed, 03 Apr 2024 18:42:21 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs5Yw-0000000HQeH-0Zwc for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2024 18:42:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712169737; x=1743705737; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=otSGrqELwfG2u5gWiiACNPA1KqM19QjHPY37cn0Pw7M=; b=GwbhKsYmiTfFaZNedPdFCVdtUV+daXDYx5W4gn00oquqiY3a9LoIFgR0 Qy0ErhsvgKTkRwbqwZtqKxmAn6WRhxuEaQMuRXlTvIH9eA7RTrp4l2TQZ 2LbolTPDJ7KdNaqTnujL6l1cp3Af0vCk98ARSdAM0qG/K4m+bqIN2xyIv 75veQ4cDRAKx1bB/WdYhTES+p5Kf4PX7LwQAr1C7PqK+sqOzv5s88YUdq qLavQRABGJC3EASjKGSmyd0Xxn9skcQYnu/cRigk2/u3B1TVZETOrOiIH Xw6OFeaTNteuZQnIzRbyNwjNhyQ7TmqzPv4ps0hlmTM6b+AFEsyfZUZyz Q==; X-CSE-ConnectionGUID: S7G30frMRjS4zHdERZ8jng== X-CSE-MsgGUID: zGSWXMK5TQOOroPrNouTCQ== X-IronPort-AV: E=Sophos;i="6.07,177,1708412400"; d="scan'208";a="21259575" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 03 Apr 2024 11:42:13 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 3 Apr 2024 11:42:10 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 3 Apr 2024 11:42:08 -0700 From: Daniel Machon Date: Wed, 3 Apr 2024 20:41:42 +0200 Subject: [PATCH net-next 1/3] net: sparx5: support 72-bit VCAP actions MIME-Version: 1.0 Message-ID: <20240403-mirror-redirect-actions-v1-1-c8e7c8132c89@microchip.com> References: <20240403-mirror-redirect-actions-v1-0-c8e7c8132c89@microchip.com> In-Reply-To: <20240403-mirror-redirect-actions-v1-0-c8e7c8132c89@microchip.com> To: Lars Povlsen , Steen Hegelund , , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni CC: , , , Daniel Machon X-Mailer: b4 0.14-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_114218_487933_2A35107F X-CRM114-Status: GOOD ( 10.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In preparation for supporting tc flower mirred and redirect action, extend the VCAP API to support 72-bit wide VCAP actions. Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/vcap/vcap_api.c | 12 ++++++++++++ drivers/net/ethernet/microchip/vcap/vcap_api_client.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index ef980e4e5bc2..80ae5e1708a6 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -2907,6 +2907,18 @@ int vcap_rule_add_action_u32(struct vcap_rule *rule, } EXPORT_SYMBOL_GPL(vcap_rule_add_action_u32); +/* Add a 72 bit action field with value to the rule */ +int vcap_rule_add_action_u72(struct vcap_rule *rule, + enum vcap_action_field action, + struct vcap_u72_action *fieldval) +{ + struct vcap_client_actionfield_data data; + + memcpy(&data.u72, fieldval, sizeof(data.u72)); + return vcap_rule_add_action(rule, action, VCAP_FIELD_U72, &data); +} +EXPORT_SYMBOL_GPL(vcap_rule_add_action_u72); + static int vcap_read_counter(struct vcap_rule_internal *ri, struct vcap_counter *ctr) { diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_client.h b/drivers/net/ethernet/microchip/vcap/vcap_api_client.h index 88641508f885..56874f2adbba 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_client.h +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_client.h @@ -200,6 +200,8 @@ int vcap_rule_add_action_bit(struct vcap_rule *rule, enum vcap_action_field action, enum vcap_bit val); int vcap_rule_add_action_u32(struct vcap_rule *rule, enum vcap_action_field action, u32 value); +int vcap_rule_add_action_u72(struct vcap_rule *rule, enum vcap_action_field action, + struct vcap_u72_action *fieldval); /* Get number of rules in a vcap instance lookup chain id range */ int vcap_admin_rule_count(struct vcap_admin *admin, int cid);