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 9608B160 for ; Mon, 8 Oct 2018 08:58:21 +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=6l7pOVLfQplfwr91nKQQC3GQBn4REwPhdF14KlbUJvk=; b=yLV43/nZkbYRJSacuy5Umw7qsnSiLONi4WPSOg+ie42+OUVVErPLADGWrUpAwhOWRiyXErc6uGEfY3W/guGAGeRMVFueS/bTIhAQcLDX5q9MuVhpr1T7mI7TjbtxWp4KUY71hYRUSrzvn3Lukabhn2743oYOQthkrAMDnOEBW0k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; Received: from MTBC-JACKMIN.mtl.com (139.226.41.141) by AM5PR0501MB2017.eurprd05.prod.outlook.com (2603:10a6:203:1a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Mon, 8 Oct 2018 06:58:15 +0000 Date: Mon, 8 Oct 2018 14:57:55 +0800 From: Xiaoyu Min To: Yongseok Koh Cc: "ferruh.yigit@intel.com" , Shahaf Shuler , "dev@dpdk.org" Message-ID: <20181008065755.lmcqzm7q32gjgaxh@MTBC-JACKMIN.mtl.com> References: <20180925134718.18945-1-jackmin@mellanox.com> <20180925134718.18945-4-jackmin@mellanox.com> <20181003200652.GC26206@mtidpdk.mti.labs.mlnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181003200652.GC26206@mtidpdk.mti.labs.mlnx> User-Agent: NeoMutt/20180716 X-Originating-IP: [139.226.41.141] X-ClientProxiedBy: HK0PR01CA0072.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::36) To AM5PR0501MB2017.eurprd05.prod.outlook.com (2603:10a6:203:1a::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e3377ae-ded7-4300-a7c5-08d62ceb6e33 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2017; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2017; 3:4BHAP20n4AYzNLR1p2sPPKgSKj4i0adWBdWmodn/su3Ww1JTlvAeemfuc3gnKrAd3xu1bmBJqRpsf6Wu2qSh/RWQdmVjoGPctn0B8cuqv/5CexlqlWQWgkLbS7dHkTlAuVVniYWHC4+WEV3xqZtMn/Rsk1+zQD33EJkNiQAH+esWiHA6w3nPJV/rls1QJlvoSfu1H3c6drdKuOIqZOf8QZx94BvB/6TdFMzQcir3Bct0CfyxIWuQ6qNe2PoiWlOc; 25:Pm0C3vdafLQ2vTCVtnRy72/AkPs7XmTaau66dZMZGsdEXCJysqdVfxZMDrnR/O/q06y8UuwZumdiJt673ckxqKM70h9cf86yziZA24WGGffi3c+CxRuP8bQXx9fGP9mu90KWRMve1zsKxq0Ku1QcnaI4HKB/ydtpmweyGtopkDWPuLsMor1notsPcqAkJTS0ZXZwKkdvSfL33gt7gOvpj4NKneWvpwsACQqQNa8SPl1Y4MYfO+oi3inbecRAseDr4xKWoSOm6vWpF+54mjV0K/GMVxEcnFXY928gpYnVAxOwwE/fzfREIfEQV64cu5EhR37u26IhOANNpMG+65JAng==; 31:jz5LOGcOn/aQBheOEzWCxvK4p2HFtPRA+IC7q/pHuPeTudyfCCd4cK+cDrVJw+qjoUZsTPYMd592u+Po7JpHKzhcBoBsH/27pM/rmRCsKIWFtvp5SU/YNHzPTgDO56xZZUqnin3NOEdaclNqDeVu1RmK+YHlmdXYUj1mykG/MLZgrzAD7p3Yweo9rsTsUkO5O8kY9d7ZxVSV19gX8lbkB92byJR8AGnQr7XliU5qLGw= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2017: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2017; 20:wz0HUtWhY3nQhVjkhnewzxIR+QcFgsm2dJm3PwqKbupt5sw16JikAeLARnvkToaKWa3vrrXiqCIi7M4tnh4Ru2j48ujkFTuV8a9yqv30G7M4/YJ4nX4TFcjDcdGEMLobmb3oPWPCili8gbg1JmC8hzgahEkdQfJ9Hi9DLVrjQDIz88Ya+Lm87neBmgbzzfBb6+Vt5/q9Vs+peC5n69TrEUD5keXPKvFfIRqGJW+R53jPb4Mk1vbyXdd/98/78KmPe/qdyIDsw3A7I/yrnj65htd6rOnpftLcEBeb1t3/t+WDnnNvrzC+imb/fVtNW+3/5v7t0jGTIri333NJFkkRxaqYfMIHMvrqJEvRvsKHa/bzVXY87f1a3P6cRDWrUYVOnZ+XcyBqsBD95pmQzvxTt508z/klcFZcSmLViu7YpDRBKnGsRdu6+C8MOkw2G2L/jVVj8jypTVJvxQl7vvlxGxv1MeQ0Lhg4O86WHGpav/yW0T0FNHnG6GB4R5G+ZbSP; 4:qmJX9I77b7nivAdgpOkBxVGHEbIKG4ESx+dwj8xuWqx8nl18d/zlartZDiG4SvVDYlQArOy8dJM4bpe24wrxfNPcE0zZuyJstRE956WssTIXuCvQSq8BJsWsd696NW3Gi0rEYtr23cPdHHq8PbzI1pZ2rC1E5yHkZcwfncWyuuGinsez6nN7QESamvjxHcVe7YupT8fKAArGzlLu3nRCKVNdo9mYSYvL28Yle0Kx4/u68eezSLmfxtSIXowS/MzNsT7YmZhvE/Yo4CW6ihpgZA== 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)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991055); SRVR:AM5PR0501MB2017; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2017; X-Forefront-PRVS: 081904387B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(136003)(39860400002)(366004)(199004)(189003)(68736007)(53936002)(47776003)(53416004)(229853002)(478600001)(1076002)(6116002)(3846002)(6862004)(66066001)(25786009)(4326008)(23726003)(305945005)(9686003)(50466002)(7736002)(55016002)(6246003)(316002)(58126008)(8676002)(476003)(86362001)(81166006)(81156014)(6636002)(106356001)(6666003)(16586007)(8936002)(26005)(97736004)(575784001)(7696005)(16526019)(52116002)(105586002)(386003)(14444005)(53546011)(956004)(76176011)(11346002)(5660300001)(486006)(6506007)(186003)(446003)(54906003)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2017; H:MTBC-JACKMIN.mtl.com; 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; AM5PR0501MB2017; 23:3ID9eWieq7NDpXoGsGuAnCKTFwRLU4wv9qi0qnQ?= =?us-ascii?Q?jVQd0489Qe5uJ2wocrjfJt6LzMFdohsezDz5jb+NGDaGVssc49+0to052AGg?= =?us-ascii?Q?0Jxsi9uJcXkrWrocgZNx7pC2ZoPkPVqaC4ffFgUVU1GxOhp8X1Ci81EiW3ux?= =?us-ascii?Q?rIvgeha0dC4QALm9NzerHc9zPXqnsefVzGk91p1YbhhLHkQaqgd6KDWdMJay?= =?us-ascii?Q?ja87zJb7bHU3cjTNmZmCTnai+5mCLRJgwFU+QPiV8TdiGQe1J7btocAv5GsW?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Vj4wQHlxo6qlUYfqSzWmKktBQjQ==; 5:83NyjGV2PAGFSxL8vUJtKnx7mbY59gykRE/YE9aGpK+5EJfS6J9T1yQmBK3D3eXSI8QOiPgPSxtXEEKwAGSEWbtCBOeipMVw4iZVex0P+qX9QAaxn69lrc9Ofv9o/eOy4NmuhR3O+ZFjAw5Ca2W6FFWdQ9iObdrvSUhpv/V9CGw=; 7:nnUm/ec22HZ67t+JBKVw8Bja5pD58mex0w3pbuHPb6l3rHFeNPXNZ51Yt9iaU/QObRCalFVFE/0WrzB5EJJHmUGDwHGfsMAGiWbTEfBM8Ex7IYsze9DFfL8fJta9Ba7R0A+HF9z4QPx0bf3rJ5zz9BxzDBtmOB4QpfPiP/WYsQjMl/FTtxc3/7ryOTW8lgEkCijxdckc050NkEBL40p+RK5q/ERRJSvyy+k/GcBy209dHCLJiB2Rj0/oTtPL217M SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2018 06:58:15.9818 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e3377ae-ded7-4300-a7c5-08d62ceb6e33 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2017 Subject: Re: [dpdk-dev] [PATCH 3/3] net/mlx5: eswitch-modify TTL 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: Mon, 08 Oct 2018 06:58:21 -0000 On 18-10-04 04:07:02, Yongseok Koh wrote: > On Tue, Sep 25, 2018 at 09:47:18PM +0800, Xiaoyu Min wrote: > > Offload following modify TTL actions to E-Swtich via > > TC-Flower driver > > > > - RTE_FLOW_ACTION_TYPE_SET_TTL > > - RTE_FLOW_ACTION_TYPE_DEC_TTL > > > > The corresponding IP protocol rte_flow_item_ipv[4|6] > > must be present in rte_flow pattern otherwith PMD > > return error > > > > Signed-off-by: Xiaoyu Min > > --- > > As it is quite similar to the other patch of IP addr and UDP/TCP port, I have > the same comments on this patch too. > > Two more things. > > 1) commit title. > 'eswitch' isn't allowed. Like you mentioned in the commit message, it is > officially E-Switch. And I'm curious why '-' is needed for the title. > Yes you are right I should use officially one. '-' is wrongly used, I will remove it. > 2) MLX5_ACTION_* > As there are a few more pending patches which add new actions - encap/decap and > multi-table, we may have to have final rebasing in order at the last moment. > Definitely we need. > > Thanks, > Yongseok > > > drivers/net/mlx5/mlx5_flow.h | 2 + > > drivers/net/mlx5/mlx5_flow_tcf.c | 74 +++++++++++++++++++++++++++++++- > > 2 files changed, 74 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h > > index be182a643..5237e31dd 100644 > > --- a/drivers/net/mlx5/mlx5_flow.h > > +++ b/drivers/net/mlx5/mlx5_flow.h > > @@ -93,6 +93,8 @@ > > #define MLX5_ACTION_SET_IPV6_DST (1u << 14) > > #define MLX5_ACTION_SET_TP_SRC (1u << 15) > > #define MLX5_ACTION_SET_TP_DST (1u << 16) > > +#define MLX5_ACTION_SET_TTL (1u << 17) > > +#define MLX5_ACTION_DEC_TTL (1u << 18) > > > > /* possible L3 layers protocols filtering. */ > > #define MLX5_IP_PROTOCOL_TCP 6 > > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c > > index 85c92f369..af88c4a0d 100644 > > --- a/drivers/net/mlx5/mlx5_flow_tcf.c > > +++ b/drivers/net/mlx5/mlx5_flow_tcf.c > > @@ -217,6 +217,10 @@ struct tc_pedit_sel { > > #define TP_PORT_LEN 2 /* Transport Port (UDP/TCP) Length */ > > #endif > > > > +#ifndef TTL_LEN > > +#define TTL_LEN 1 > > +#endif > > + > > /** Empty masks for known item types. */ > > static const union { > > struct rte_flow_item_port_id port_id; > > @@ -297,7 +301,9 @@ struct flow_tcf_ptoi { > > (act) == RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC || \ > > (act) == RTE_FLOW_ACTION_TYPE_SET_IPV6_DST || \ > > (act) == RTE_FLOW_ACTION_TYPE_SET_TP_SRC || \ > > - (act) == RTE_FLOW_ACTION_TYPE_SET_TP_DST) ? \ > > + (act) == RTE_FLOW_ACTION_TYPE_SET_TP_DST || \ > > + (act) == RTE_FLOW_ACTION_TYPE_SET_TTL || \ > > + (act) == RTE_FLOW_ACTION_TYPE_DEC_TTL) ? \ > > 1 : 0; }) > > #define MAX_PEDIT_KEYS (128) > > #define SZ_PEDIT_KEY_VAL (4) > > @@ -321,6 +327,34 @@ flow_tcf_calc_pedit_keys(const uint64_t size) > > return keys; > > } > > > > +static void > > +flow_tcf_pedit_key_set_dec_ttl(const struct rte_flow_action *actions, > > + struct pedit_parser *p_parser, > > + uint64_t item_flags) > > +{ > > + int idx = p_parser->sel.nkeys; > > + > > + p_parser->keys[idx].mask = 0xFFFFFF00; > > + if (item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV4) { > > + p_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_IP4; > > + p_parser->keys[idx].off = 8; /* IPv4 TTL Offset */ > > + } > > + if (item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV6) { > > + p_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_IP6; > > + p_parser->keys[idx].off = 7; /* IPv6 HopLimit Offset */ > > + } > > + if (actions->type == RTE_FLOW_ACTION_TYPE_DEC_TTL) { > > + p_parser->keys_ex[idx].cmd = TCA_PEDIT_KEY_EX_CMD_ADD; > > + p_parser->keys[idx].val = 0xFF; > > + } else { > > + p_parser->keys_ex[idx].cmd = TCA_PEDIT_KEY_EX_CMD_SET; > > + p_parser->keys[idx].val = > > + ((const struct rte_flow_action_set_ttl *) > > + actions->conf)->ttl_value; > > + } > > + p_parser->sel.nkeys = (++idx); > > +} > > + > > static void > > flow_tcf_pedit_key_set_tp_port(const struct rte_flow_action *actions, > > struct pedit_parser *p_parser, > > @@ -408,6 +442,11 @@ flow_tcf_create_pedit_mnl_msg(struct nlmsghdr *nl, > > flow_tcf_pedit_key_set_tp_port(*actions, > > &p_parser, item_flags); > > break; > > + case RTE_FLOW_ACTION_TYPE_SET_TTL: > > + case RTE_FLOW_ACTION_TYPE_DEC_TTL: > > + flow_tcf_pedit_key_set_dec_ttl(*actions, > > + &p_parser, item_flags); > > + break; > > default: > > goto pedit_mnl_msg_done; > > } > > @@ -488,6 +527,14 @@ flow_tcf_get_pedit_actions_size(const struct rte_flow_action **actions, > > keys += flow_tcf_calc_pedit_keys(TP_PORT_LEN); > > flags |= MLX5_ACTION_SET_TP_DST; > > break; > > + case RTE_FLOW_ACTION_TYPE_SET_TTL: > > + keys += flow_tcf_calc_pedit_keys(TTL_LEN); > > + flags |= MLX5_ACTION_SET_TTL; > > + break; > > + case RTE_FLOW_ACTION_TYPE_DEC_TTL: > > + keys += flow_tcf_calc_pedit_keys(TTL_LEN); > > + flags |= MLX5_ACTION_DEC_TTL; > > + break; > > default: > > goto get_pedit_action_size_done; > > } > > @@ -988,13 +1035,20 @@ flow_tcf_validate(struct rte_eth_dev *dev, > > case RTE_FLOW_ACTION_TYPE_SET_TP_DST: > > action_flags |= MLX5_ACTION_SET_TP_DST; > > break; > > + case RTE_FLOW_ACTION_TYPE_SET_TTL: > > + action_flags |= MLX5_ACTION_SET_TTL; > > + break; > > + case RTE_FLOW_ACTION_TYPE_DEC_TTL: > > + action_flags |= MLX5_ACTION_DEC_TTL; > > + break; > > default: > > return rte_flow_error_set(error, ENOTSUP, > > RTE_FLOW_ERROR_TYPE_ACTION, > > actions, > > "action not supported"); > > } > > - if (IS_MODIFY_ACTION(actions->type)) { > > + if (IS_MODIFY_ACTION(actions->type) && > > + actions->type != RTE_FLOW_ACTION_TYPE_DEC_TTL) { > > if (!actions->conf) > > return rte_flow_error_set(error, ENOTSUP, > > RTE_FLOW_ERROR_TYPE_ACTION_CONF, > > @@ -1029,6 +1083,16 @@ flow_tcf_validate(struct rte_eth_dev *dev, > > "no TCP/UDP item found in" > > " pattern"); > > } > > + if (action_flags & > > + (MLX5_ACTION_SET_TTL | MLX5_ACTION_DEC_TTL)) { > > + if (!(item_flags & > > + (MLX5_FLOW_LAYER_OUTER_L3_IPV4 | > > + MLX5_FLOW_LAYER_OUTER_L3_IPV6))) > > + return rte_flow_error_set(error, ENOTSUP, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > + actions, > > + "no IP found in pattern"); > > + } > > return 0; > > } > > > > @@ -1178,6 +1242,8 @@ flow_tcf_get_actions_and_size(const struct rte_flow_action actions[], > > case RTE_FLOW_ACTION_TYPE_SET_IPV6_DST: > > case RTE_FLOW_ACTION_TYPE_SET_TP_SRC: > > case RTE_FLOW_ACTION_TYPE_SET_TP_DST: > > + case RTE_FLOW_ACTION_TYPE_SET_TTL: > > + case RTE_FLOW_ACTION_TYPE_DEC_TTL: > > size += flow_tcf_get_pedit_actions_size(&actions, > > &flags); > > break; > > @@ -1451,6 +1517,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, > > RTE_BE16(0x0fff))); > > break; > > case RTE_FLOW_ITEM_TYPE_IPV4: > > + item_flags |= MLX5_FLOW_LAYER_OUTER_L3_IPV4; > > mask.ipv4 = flow_tcf_item_mask > > (items, &rte_flow_item_ipv4_mask, > > &flow_tcf_mask_supported.ipv4, > > @@ -1490,6 +1557,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, > > } > > break; > > case RTE_FLOW_ITEM_TYPE_IPV6: > > + item_flags |= MLX5_FLOW_LAYER_OUTER_L3_IPV6; > > mask.ipv6 = flow_tcf_item_mask > > (items, &rte_flow_item_ipv6_mask, > > &flow_tcf_mask_supported.ipv6, > > @@ -1718,6 +1786,8 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, > > case RTE_FLOW_ACTION_TYPE_SET_IPV6_DST: > > case RTE_FLOW_ACTION_TYPE_SET_TP_SRC: > > case RTE_FLOW_ACTION_TYPE_SET_TP_DST: > > + case RTE_FLOW_ACTION_TYPE_SET_TTL: > > + case RTE_FLOW_ACTION_TYPE_DEC_TTL: > > na_act_index = > > mnl_attr_nest_start(nlh, na_act_index_cur++); > > flow_tcf_create_pedit_mnl_msg(nlh, > > -- > > 2.17.1 > >