From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70042.outbound.protection.outlook.com [40.107.7.42]) by dpdk.org (Postfix) with ESMTP id 01CCFF72 for ; Tue, 7 Aug 2018 16:20:11 +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=o6mR1eUKqOHLScXvYVkC/Sv0/IRw/4zRcY9NGJaS4H4=; b=Z6FWL9AyuscVLFzeRj6N16ZO9y2T1zTm6wMbUB6syz4GWbGHnSDgWzLIMa93xrMhPCaHFcAoKV5G2SzCdi6ssmm3FCBn7MYhekZAjAJoHXAHPkIOFqbPBu2HJdW2cXjyjNsVtSZxjjr9v86rD22dJu/U5l0AUIYmCsWiqJhccCI= Received: from DB6PR0501MB2023.eurprd05.prod.outlook.com (10.168.9.17) by DB6PR0501MB2583.eurprd05.prod.outlook.com (10.168.74.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 14:20:10 +0000 Received: from DB6PR0501MB2023.eurprd05.prod.outlook.com ([fe80::dc91:8499:ae2f:4b7c]) by DB6PR0501MB2023.eurprd05.prod.outlook.com ([fe80::dc91:8499:ae2f:4b7c%6]) with mapi id 15.20.1017.019; Tue, 7 Aug 2018 14:20:10 +0000 From: Jack Min To: "dev@dpdk.org" CC: Shahaf Shuler , "Xueming(Steven) Li" , Thomas Monjalon , Adrien Mazarguil Thread-Topic: [RFC] ethdev: add generic MAC address rewrite actions Thread-Index: AdQuKrNwuOvENMrySAio+8wX/nYS9A== Date: Tue, 7 Aug 2018 14:20:10 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; x-originating-ip: [58.34.205.212] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0501MB2583; 6:goeeO4AM8gcB+Go2DQ3/+Xphi/8O55lOy0JJ6wzfcXD76T+QMG0/1rDuXs7bFRuJYxmTzkE/mT8A3KFI7Vo7Cfqnf6OjpR6tI8zaBCQhNl0Ik7gNHAeH7xkkm3ors5dRmSyh5Q232Qk70FF+zfKg+wmMhVKXXwo7UuIxDlCsP47qdwqfz/b7Ww8npjZcAHv960NwOfeIyN0avbPw/K3UpslhnF8C10OA25R0G3vHdt3G5dCuSjSYq3YZqLXocHxtxh08GC9CkJDD8/aZGc73Ib/02vUmNRBL/Jf7ktR0sltYWC9bqa9M1NlLmv0YDz0rHqQfb5qRIP2/ATTCznM2THyFyKGwr3Hx1rBVOAd7wwlbHde42vRClgxeZCciZFFL4/NH2Vn1r60cH9eRnjKjERqBDf+6fV3TXK39M6/W9J9p+RI609JVnnyS6wJLvnv9kT0oN5kGxkVZOd8aTRFdAg==; 5:j92x3rXExvwJ5UGxOUv/IeF/801GT30DDjEJFb2dh9GMiR5UlJeWVN+6DlZCHNRoLSSqddXqFFH6kISJJYUIP2yGiwtYC43sz2TdOe6mXrpY435VR4M+vBbj8TS8lDweI44V2RM9YkkJ0LnaTzWmrqF6eJJqBS7hkjUkAlildKo=; 7:tm4VYU25cycaaidsHwRmYBqypgt+YBkaGyADDhqYQa6Ob+73aGlQ318TzaQyZiMqnruvVVScqtHZzRkK0EKTSMnDjQznXZp+0GfXfgk2kObCATth4QscDWWfyWyZN49t3e1dAJ3bwxlxPog3hXkr4eAOqO1RrcsHergWmr46fVZsW5LLVI1vPn7/Kolj4JdRWV+PbTclX0+epNUu8q1aylwVrrWEaL32DyBjjhVDY3lncIHk9LYNDAbGCYD/k9I5 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: fbe7faf6-2086-42b1-bac0-08d5fc70e227 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2583; x-ms-traffictypediagnostic: DB6PR0501MB2583: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(21748063052155); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB6PR0501MB2583; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2583; x-forefront-prvs: 0757EEBDCA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(136003)(346002)(366004)(189003)(199004)(26005)(6506007)(2351001)(5250100002)(7736002)(106356001)(105586002)(102836004)(5630700001)(2501003)(8936002)(99286004)(2900100001)(97736004)(236005)(54906003)(186003)(14454004)(55016002)(3846002)(74316002)(81166006)(9686003)(54896002)(6306002)(790700001)(6116002)(5660300001)(476003)(8676002)(478600001)(7696005)(86362001)(25786009)(6916009)(4326008)(256004)(14444005)(33656002)(81156014)(5640700003)(2906002)(53936002)(6436002)(68736007)(66066001)(316002)(486006)(1730700003)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2583; H:DB6PR0501MB2023.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: VPo6GJSnlbJoFBfqRkiRkgYs7Df21HhroxM9lG5JX1WCqlXdhQ99Gp5vlILlOxwBvyQU40wjXq29WtjqZSaL32zno8fcVmf4O/XnCHxWxdpN95l7ZDeH0wf4aNvZy8+B0A7CXJdIiOCIDwpXPoZ7omMbjRapDAB44WFKfh12XfTe1hrO+6doOhVbtYfCbqv5snOOJ/27b1fzypFFBZ3NFkAgFv24SD+MtOLwG1y/6EstUnD70w5g4W6Wg0K1ODaIg3/XxeHjpxOqH9X0sd4N3Z3WLtcbNgeetAnOUJpc34hqE57cjvJoSNYBvZQoTRxksJRWIEG//K4hOIaShPbBkG2oB463hNC7Nl/T53zFxsI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbe7faf6-2086-42b1-bac0-08d5fc70e227 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2018 14:20:10.1352 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2583 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [RFC] 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: Tue, 07 Aug 2018 14:20:12 -0000 There is a need to offload rewrite MAC address for both destination and sou= rce from the matched flow The proposed actions could make above easily achieved Signed-off-by: Xiaoyu Min > --- 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..4a51ab2a3 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 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 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 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