From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0069.outbound.protection.outlook.com [104.47.1.69]) by dpdk.org (Postfix) with ESMTP id 5C1B7231E for ; Thu, 30 Aug 2018 10:01:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CMfRcVtVeRb4Rs+BlZA3EvCeYDwF11AUFdDSxGLTnSg=; b=OoIdcopTn7EAUTnQdse2Vlj+GaKRrJCa4gkwvoIfQ/6tg9Vpc4YiBOwq/vF0h6pL2QL9jhWKfkx4le3sjYECLxVawS6tqFIvWYowdzL0JTunlRlvC/HfMbFZrUcF0xofN2jvKUseXjJgG45BxWml5PG6o1lXpaTths+4IjEgZn8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; Received: from dev-r630-08.mtbc.labs.mlnx (118.201.220.138) by DB6PR0501MB2023.eurprd05.prod.outlook.com (2603:10a6:4:6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Thu, 30 Aug 2018 08:01:34 +0000 From: Xiaoyu Min To: dev@dpdk.org Cc: shahafs@mellanox.com, adrien.mazarguil@6wind.com, xuemingl@mellanox.com, thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com Date: Thu, 30 Aug 2018 16:00:25 +0800 Message-Id: <20180830080025.28199-1-jackmin@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [118.201.220.138] X-ClientProxiedBy: SG2PR02CA0011.apcprd02.prod.outlook.com (2603:1096:3:17::23) To DB6PR0501MB2023.eurprd05.prod.outlook.com (2603:10a6:4:6::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15738119-7793-41c4-9bde-08d60e4ecf96 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2023; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2023; 3:LZwP0L+yW/efdRaLxW9rP90r3bgn2h4UhS9I54+ONmIHBgOE6xKbVg1rwsgHM8LgKwhf9YZ2N7Q3Ek5hxRJsvYR77l3LO7OaLNQpmGM4AZ5G05wlhT1INVP/SlPNESYKvJLajdInuIm5U/JWjAALEOqd23zOTvtaK7bvK4BDKbnYle2GPmfwCtZ+d+R+3F1svTF4TBF1Mlj9k3VoMiH15u60Tl5TUXI04WJ3k3K2U7i3FuSulqGG7TixMEz3f8nN; 25:eILRK4b2Zm5EtRBpLsk+4EKK8E3JaIteyJ/ptj1l7lvVTNZEpzXAvj3412IKEw35mbRfkzGkCQ0NKhZaII/d4b+21hnZaQOCq1IQPQC7EEJdTDIcUpJQEctCPd9VOkG/qU3bl5moXCGwXbflPE1AgHlmWE9PvQkSa3pBfZLyQIkPvhqbSTTPbadHYG81PqewdrGwaT7MLDcP67cU0MChiQCuBufM7GlKMxuyQOW4ZfwcX8jXTMs8PahSJmkIyBlSGjnIHSvV/3fHaa9C5DCigK8v8QjPnqdOEChCw8YytRORF33cQfKa5VJBYienhc6DwqpQ8YuDiJrGalgfATwXeg==; 31:IZ+A+t/qpfqmnGjzXM3ivjpcF1jLWbFdUlnd7RSzi5WOTlnIKGGZRxQO5aijeVA2BAWVjLkbXepvEo/XFFUauct2upxoB9ak9mS29RmN3DFeVejCr1Nwbn/+6/ktlyh+y70zmZ7dGLwm3n8nudIruKbupHH1ljyBkBUC39tLIp7G2GN12stw1VQhsJx9RxfkQQB+1R7IPcThX4pZsdDJyN96UOXQssOw/0gOxbtE5uw= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2023: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2023; 20:5BnNfGrpCcDHUs9mSwqViqcDIl0Wa/URvVbwvZEp8c+UYSQdyiIQyAc5vEXulYz7ODYdY6X+7cymaBa3NxM1T5VtDdD5QknqsE4zxC4ugc1OHWEczKIEARNmW3da825ScpIxQjhNPXPzNQ0PmwvtAcmrbh6IYxRzN6l/dT4g1yEE3lBYRRLr9eRWOk8QEzhWxDqWmjyW88D3VNbfC5HfTB58+w/dNNYBAURu2PG3OhF17axhpTZd4JJtUxMfRy4iqgpppgTz6WVbxZpm7S4GZm2OOtzSOOzb6tu/2y1eIMNuCQi0OVNpDLNeuGnCkIOwSgpUOFI1AzCDhVkLrsbnPy5q4a2l6Ya+m2f0S+ninepro7ZEQI2+Acy2Gkm5+UPRME8/6xfzCUWJJR2ffGkBm3dinVXNwNVN52zlB/AOCVvf9ZKzxZfEEpOpj0L8yWL7PaCLiNwBP6gcOvurFI8NVreBOd+Rt9BoCCsSETzIQYHsBpmVDi3swzyzp6P9GZ8W; 4:2h5CjeetIah4nQHg30ZcFvR6ze2NzG0mtVoDa+ip0zgnsYeLZze+sQCVQ1uELXyFxHMtXls2S0Chf96PrSsSbWwrzXresVBYEZktkzSSMlYSJIgJQf05yvdPixMVwnqMjb9iSuKqQw8g4Vt5FzlO/SkyL3ABUlzF79B/01JyyA5nIdPSaTFX2NKABxd13jFYpSeTCnVHStezWx8g+Xiqjbpk3ufsGW/dP3o1B/0Cdxr0g5n9l4Z1EMawO15O67dZ6hc3hkTdlRSy0RsIWOXvIg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699016); SRVR:DB6PR0501MB2023; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2023; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(376002)(136003)(396003)(199004)(189003)(8936002)(6116002)(8676002)(6486002)(36756003)(3846002)(6666003)(81156014)(6916009)(53936002)(1076002)(6512007)(5660300001)(51416003)(50226002)(47776003)(81166006)(68736007)(52116002)(2906002)(97736004)(50466002)(66066001)(76176011)(486006)(305945005)(4326008)(16586007)(48376002)(316002)(25786009)(2616005)(446003)(476003)(956004)(11346002)(478600001)(86362001)(2361001)(7736002)(186003)(2351001)(106356001)(16526019)(105586002)(26005)(386003)(6506007)(14444005)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2023; H:dev-r630-08.mtbc.labs.mlnx; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2023; 23:T3v5bsP07y+VXLogqJ7sdc8D6R4+9DSRQCHZxnW?= =?us-ascii?Q?6C0LwPQdGaHPV9Df8+9oAURYfmx95oSBudG6AAGWFa/S5mK0o1f5CrVQV9g7?= =?us-ascii?Q?9FothXP0rV9ywQ9NfkcDjRh6kk4tJF4gJ9NwLXdXHSlr3deFw+eGuI1w6wQJ?= =?us-ascii?Q?E06ys2KJHlKKKjI0ontc9+9aXu9fnYYL9tNM7L9Zrg2p6rmBwte/6vJ1cTV0?= =?us-ascii?Q?PajOsLop0DqJ4FjuITc+IahDW3t3qtq+agTMeKzKfXzTQbLpvdjKSApFtEZ/?= =?us-ascii?Q?5nUsqjGCDHpjJ3xilth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Qms76/WeZNgfonKqM3PuLIV1rm79nxynqfddGY1A3CAio+fTyRDbs+x7EO2+46Myj9WLawY2HTNf6AGM5FdcavvhYu24TSyE=; 7:Kom8TWbjybbJNhFR2gUhTEj6h4uZ/lHSq47WY5JvfqwGaiBdNWALWUyiJonOjbNwpqOPb4uEekExXq+ijXyVdEf3bOEGVncPF3dcrPPXx+usRKTkko6zkn4MzqNRvcHLiLh+cHMpGD3V08xNUM4JBE1eA2vQtu2QZDvZiOpByrne0SYV1zFHUJwh8eBxWgtL6hAkdkEHz2lTwf+wrmHQnj9MwdAQVjTMMT2onbdyGmTHt/n9Ew1jSAB85gN5IsOu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2018 08:01:34.6982 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15738119-7793-41c4-9bde-08d60e4ecf96 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2023 Subject: [dpdk-dev] [RFC v2] ethdev: add generic MAC address rewrite actions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2018 08:01:39 -0000 There is a need to offload rewrite outermost MAC address for both destination and source from the matched flow The proposed actions could make above easily achieved Signed-off-by: Xiaoyu Min --- v2: - Updated description about the MAC address is the outermost one lib/librte_ethdev/rte_flow.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index f8ba71cdb..c9cce1049 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -1505,6 +1505,26 @@ enum rte_flow_action_type { * error. */ RTE_FLOW_ACTION_TYPE_NVGRE_DECAP, + + /** + * Set outermost source MAC address from matched flow. + * + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. + * + * See struct rte_flow_action_set_mac. + */ + RTE_FLOW_ACTION_TYPE_SET_MAC_SRC, + + /** + * Set outermost destination MAC address from matched flow. + * + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. + * + * See struct rte_flow_action_set_mac. + */ + RTE_FLOW_ACTION_TYPE_SET_MAC_DST, }; /** @@ -1868,6 +1888,18 @@ struct rte_flow_action_nvgre_encap { struct rte_flow_item *definition; }; +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ACTION_TYPE_SET_MAC + * + * Set outermost MAC address from the matched flow + */ +struct rte_flow_action_set_mac { + uint8_t mac_addr[ETHER_ADDR_LEN]; +}; + /* * Definition of a single action. * -- 2.17.1