Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2899825lqz; Wed, 3 Apr 2024 11:44:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWd0zs/oeo8OfuyQesGTF4WY9sm/TlZZsAqwfTs774irQdB3DtSCyoYfCU2Lraj6y7Es3Ud0j1RqdkbMVbiRUvw5Pmu6ZpfEWT8pkXAHQ== X-Google-Smtp-Source: AGHT+IGgHdkhJhDH2uUc3Jsbv/7w1Zhfelxuixf9AWecdiMR8IsGNnqT1u0JpcPGcRWItVJ/UWmD X-Received: by 2002:a17:906:4685:b0:a51:7a32:eb26 with SMTP id a5-20020a170906468500b00a517a32eb26mr112728ejr.28.1712169850238; Wed, 03 Apr 2024 11:44:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712169850; cv=pass; d=google.com; s=arc-20160816; b=XNbd6Vol/s+fnuYonrLPDYn+XOuDz4J60pyZ9X3HzUEov7EpdoI4J4MXv5ilsU0Lw6 ALGlG2ujBMGqvcePqPQTT5zykM+Ho5R+HvNju9Xz+Ah50RKBdt2C66GN2JP/Ef/6vU0l FYz6XLBEPf5unexImqj12VRe/qVG7ExKnDw855S1qhRLRIfFxiR3z5DFsTymbgH2r+76 Yp0vvaT40JFS6do6aozpH/UzCb7JrgmfvEYdHnB5KZ+roXQvxPXrj/JTVC6KK8l3P7rF pQ5i2zmplD+YLbLc9HK+MJuOHoCXhHQz0Ogi5hETVnk+iDMS1znNuROcJkYANUxgkIem Cb2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=LSckRLUoxsB6vKKygdMSoJUTycM3CeslD+i8svrZnqQ=; fh=CcpIfF41kPsBYbNJC7aGKDxU9p2Ogr1gYig74/Y7Xd4=; b=D3OcBy0dq6mDrLT0zp5FZ5zk3xEvMj2ZDUre/TSx/cxwty2v0NoOmC0kjubQXOWOru +N0Rlv3hsR4SgETtg6KvG+sL6TThungc/GAugXt8lEjSlFmD/R3IQDnskj7o1Bn2oy7f dAdQB3TZ+ijvuip8vaTyqSgpX2gXZ0ADNoTFcY9UuWEAZ6FK9JLmX02+/N0Wzf78uvib ix82LKHWbdK12NACI7PDFfaxiZHH8yr0oMav8/7fxQTTTDo4Qs2R3NhxyUbi9He5QcbX zP05ODcD/7Sx923S+vQBwIxAdTkaKHxV5nmPs/Yj6z7fWlsr7IiplW4t0t8j8TvqTEIy 5tyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=YLnKeusc; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-130452-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130452-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mf15-20020a170906cb8f00b00a46e5d13ea1si7161391ejb.114.2024.04.03.11.44.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 11:44:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130452-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=YLnKeusc; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-130452-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130452-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 05AF91F2634E for ; Wed, 3 Apr 2024 18:42:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC6B9153BFE; Wed, 3 Apr 2024 18:42:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="YLnKeusc" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B022015359C; Wed, 3 Apr 2024 18:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712169737; cv=none; b=DUzcbyx1yOtDFaRnmTQ2scqgNFQysg2SCHlMgU0zHgOY/JhCXDWiwF/x7d7Hgr0DCJjDPv8CJGbsTZ1QHEphHv/IkaPAO7anwiBYePW2L58mrQL5zom6IYVyC+4ehsmpu+z6bVZOYaFQQJIsYOMGr/3N+adht0evpEP2lbqzatM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712169737; c=relaxed/simple; bh=otSGrqELwfG2u5gWiiACNPA1KqM19QjHPY37cn0Pw7M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=oC1mKRUdmqB7KI39VyE1dUokK9ao8L2MU9JvWrNIrsifVrXRCF0VlwolZ8lkgA+eHKdt84svxawETM8WZJqCPrBQNyEizWF2A1w8vZt63zL6HvUw2HPjTvO5dZQmX1I9Gr3wioWBNS+OTOhCxhUlOZa8tQkK216vG47Y2fi5DQk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=YLnKeusc; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712169734; x=1743705734; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=otSGrqELwfG2u5gWiiACNPA1KqM19QjHPY37cn0Pw7M=; b=YLnKeusc6bhryot9ig0m0Uf2mTNB8GleLy6x7VtZJwXcCvTJV9gUYq8m CtVgH/E6h9h8uX3Nfx92IOV8CgAX16/qM7P0heedakn2JhmbCw/Nk8sPg CSK/HXb8fJz02ZHr9gJ2dBTRZO/tid+20HOW+HnrhB5F10y8C09F2LWtS vRqAHXaDeLE9wZGblp1mLJ9jzEqPrQgBtUBaOqKCPWKoAFxVP+5e4ygI9 BR+V3r8dWEQ8qCzJK4usfdU1y+jdk/U6CzB4vd06T0NfmuQ9XFxZ7iOsX vCfit90nEr3l5B3palHz88VjI4nGp7apT3tsE1hC2hMdDpmwwS2tISsuK A==; 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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); -- 2.34.1