From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 013B0A00C4; Fri, 8 Apr 2022 21:03:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3A2040041; Fri, 8 Apr 2022 21:03:17 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 5E5FC4003F for ; Fri, 8 Apr 2022 21:03:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649444596; x=1680980596; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=54A3dmN51GOqK7Ojh77t0MgrtPW9X4CrktF7HWlaMKY=; b=mAJIciRGd2XqgN6s9TT4y/pto/SWUad7Z6YzYGEM/msYtJ1+8MA31rxy OPNESNMWdQ6JJYPhIKA7ZCxHcUkGtZVIwAiBf+fWoKed+moZt3pIctywz JwxBThwCJpnGXwzQbSwB7PThXloY49BLWef2jsQrd/UInbKyU8vCcF8/J SnP5mG+FM/Vez59KX+HsMvtD/DpApdsFBbux/5WXm0c/IUEe/hPC+YwhA WXi12zOHjd90I9P3Kj7Bwz1vJn/CgNyiL5aEDpUyh/lGxkvGqSrcSBEKd P1utGDYCqIkWNBpGgZ1gdAEbfaVzN2O3nFPqYoK3WIHvfFGk4pA+zdEXp w==; X-IronPort-AV: E=McAfee;i="6400,9594,10311"; a="261658602" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="261658602" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 12:01:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="795863279" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga006.fm.intel.com with ESMTP; 08 Apr 2022 12:01:29 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 8 Apr 2022 12:01:29 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 8 Apr 2022 12:01:08 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 8 Apr 2022 12:01:08 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 8 Apr 2022 12:01:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KKU4TUajdUJ51WJ8lUro9KMY22spO8Yw87skrywNz0nFVz2YUHbKOnkJqk18LdAmN2D8B8Fea1R3genJaMQbuudAq1XGXbpJF/UCmPnS0/HTS93Sz/ZrARDzYG8C9HZPNUDiR23whCbj0H9tsZzb8wmeE5RxhYyRrauNQzkCcQEmIfxYvN6SZgoDuibEhD9GCpOJV4kM6yPMHSzWdRClisCC/dEWES8pDlec0sxUDDFnsfT+CH7Bm1yHfxAXRRRKf9daTZnavbm9/BDKHe/I11p8UUl6Pk17I8YsD8N3yHGrVz8UCHAerTH3aPqJJ8tC+GzYBNcCvYNvu26obl3uoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9i1yu9l8Wyg5Wz0ZljUpUCQbJvN6quNCqKD1sRCOI8E=; b=Orq/7opDUy2RfPKOmgwRxSjD3Sk9SVx2MkWg/Th0VV6ysQxSiC1KtZULFQQkulcdKnUrJsoChF3eto6krecZxkHktBglyS4hKH+qp6gdEYii4LrOedqpJLhcazmOhMlHnYsin+P5dMu97b/jGY74MIR4bLshTKDpzo8WuXQgdX5lHedzMQaHUf71lMuyCsc9lfo4u52I0TqtbjwjnmMimoRJATJgNLZUr1Y/ZiOyzn8cjjp0IXp1bb3JdzeOTyTaRxe/TF8M5bV9jU3rHoigpyqnxEoyAH3TNN6pcyBzntd6F3et6+LrBFsVonaPMBKKJWtK/TKIhLt8gv/HiWLpWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5660.namprd11.prod.outlook.com (2603:10b6:510:d5::6) by SJ0PR11MB5920.namprd11.prod.outlook.com (2603:10b6:a03:42e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 19:01:06 +0000 Received: from PH0PR11MB5660.namprd11.prod.outlook.com ([fe80::b893:7968:e5e2:f27c]) by PH0PR11MB5660.namprd11.prod.outlook.com ([fe80::b893:7968:e5e2:f27c%8]) with mapi id 15.20.5144.027; Fri, 8 Apr 2022 19:01:06 +0000 Message-ID: Date: Fri, 8 Apr 2022 20:01:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v4] examples/l3fwd: merge l3fwd-acl into l3fwd Content-Language: en-US To: "Ananyev, Konstantin" , Thomas Monjalon CC: "dev@dpdk.org" References: <20220406102907.2853883-1-sean.morrissey@intel.com> <20220406120625.3248258-1-sean.morrissey@intel.com> From: "Morrissey, Sean" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0056.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::20) To PH0PR11MB5660.namprd11.prod.outlook.com (2603:10b6:510:d5::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a3d8891-2c1a-4cf8-83b4-08da1992228d X-MS-TrafficTypeDiagnostic: SJ0PR11MB5920:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UjIUpTI2w/eMuFbRSTpbjlPKE7KITyjRF7NoTpLtDcaJk2G1auvURf4KfLcaJ6H++RB3pO8BhOEFYtfrQLjDlPLFUk45VDsEAJQCMmxIt+IURd/hOCAP6hetDBTNQPmIpZOMqWLZZkq893tglDiunH0KPMo9cNisk0C9mctjM85I93VWGIbyUW3pNq1rz7mu3+tdXChh6wvJvdV8i0RAv+GygQ9oIoNuU56jUrBT9REIgWXRSmPh5XRW1F+pdlsXNP0ywyZ5Vp6L5tZKh99ToZnx34XDGPWTAogmac2tLHJAxOpctT/019neiniyJljUyzfR6B3Ae6bdTNvMMjq00xk0XGlsUCwcY2IXXumrB+tBqbMKeAlnKgRzqHhjGTts720DNOdVShfVwra4B0AnxdAB/qUcgyhlscKPs+MxZWueu4OcDHcFc1v1pDn9xatLBgaUo1iUEs+8pNUzMNIPhqdQdECqNLA0/h3sI/xm++0mqDkTmMtDfBAJm1QRneQztUvOjnDUjcbyPc/XUhBGuwAmh/sDK1x0ue47sJLZuEWMxUVsbEzYO2kdAZ/yZdlBhH0MNPy945lH2AO1ANgDVdSME5Xnev9x3SZZcgJArl/bs+TshWb9rozOu8eitwFpx0tmGsXB7YK4eQVM0l7x81/ewssk7iPyAUd6ARSvbN5xZFzsWHqtGZQPqeJRRdyPQyYoUCpOfdsb4bSHsNQzM8zixQCX2xAMoTiez3YtmxfTV8Uvi3CrLADEoZze/0gzWZVd3RauqZiCY0x+MQOkdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5660.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(6512007)(66946007)(86362001)(82960400001)(31696002)(4326008)(5660300002)(66476007)(66556008)(8676002)(53546011)(2906002)(2616005)(6666004)(8936002)(38100700002)(508600001)(316002)(6506007)(6486002)(36756003)(83380400001)(31686004)(110136005)(26005)(186003)(32563001)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGxJT0NNVHZteFYzSjRKdHFSRjZ4UUVwTWRHdExPVkZtMUJmK2tZNUwvR3hP?= =?utf-8?B?Tk0vYVowekM4Y2RvaDR4VlJyTTFBdGYxYXJtN2VlMk50cjdhc3AzeENDUmVh?= =?utf-8?B?ZG1INm9KMEJpandES3VlMVZhemUyTW9YeGhLOUV3emNZMG5EYzJpOStFZUVZ?= =?utf-8?B?THJ6emdmaFgzdmNnbVFORWtxUHlFWC82NVBhYjVxMzVGeFNzcTU3bG1qSXNZ?= =?utf-8?B?aWwxY1VKYUFSUlV0aXZOcHJYTnZHR2h5aVh4WElBODBSdlUrZ1VyVVJGZFho?= =?utf-8?B?TkV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WHhKdzdhK1laWTc4eUxk?= =?utf-8?B?Q1VWM3RETkpGVTlNY2xsYU9RN0FLZkwzNnhPeVVGZEI5QjhrZllHSmZGUHpx?= =?utf-8?B?dzJXUGVrNWJLOU5sNkFtVTBKRlRmRmJOcThsWWVnWHNMcXJORkZxSGE3STF4?= =?utf-8?B?emdxQ25WVGVTREMycDNpeXFDeXZZdVhDd1F1UVFQR1RYZVU4NWRjOGhUMTd0?= =?utf-8?B?TXUzYTNWQzVneHR4MGszNFBmRXBmVjRLSDJNRFg3UkRQT2YvYkdaU2V5REhE?= =?utf-8?Q?HQgzO063LO5MSbtU=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5a3d8891-2c1a-4cf8-83b4-08da1992228d X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5660.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 19:01:06.7433 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /uu00TbiUeaT2pNqgrN5fcl/AS7M3QrwlSO/yrLM5R9ZUjHQDlClofzpm0l48naXey1Evm8An5bPJ41WGig4uI8j/59MWb3MWK3g/ZHKNVg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5920 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Konstantin, Comment on some of your feedback below. I will make the rest of the changes and send a new version. On 08/04/2022 18:26, Ananyev, Konstantin wrote: > Hi Sean, > > Few nits, that I didn't spot previously, pls see below. > >> + >> +/* Setup ACL context. 8< */ > Looks like some typo within comments. I believe these characters are needed in the comments to state the start and end of the automated code snippets for the docs. >> +static struct rte_acl_ctx* >> +app_acl_init(struct rte_acl_rule *route_base, >> + struct rte_acl_rule *acl_base, unsigned int route_num, >> + unsigned int acl_num, int ipv6, int socketid) >> +{ >> + char name[PATH_MAX]; >> + struct rte_acl_param acl_param; >> + struct rte_acl_config acl_build_param; >> + struct rte_acl_ctx *context; >> + int dim = ipv6 ? RTE_DIM(ipv6_defs) : RTE_DIM(ipv4_defs); >> + >> + /* Create ACL contexts */ >> + snprintf(name, sizeof(name), "%s%d", >> + ipv6 ? L3FWD_ACL_IPV6_NAME : L3FWD_ACL_IPV4_NAME, >> + socketid); >> + >> + acl_param.name = name; >> + acl_param.socket_id = socketid; >> + acl_param.rule_size = RTE_ACL_RULE_SZ(dim); >> + acl_param.max_rule_num = MAX_ACL_RULE_NUM; >> + >> + context = rte_acl_create(&acl_param); >> + if (context == NULL) >> + rte_exit(EXIT_FAILURE, "Failed to create ACL context\n"); >> + >> + if (parm_config.alg != RTE_ACL_CLASSIFY_DEFAULT && >> + rte_acl_set_ctx_classify(context, parm_config.alg) != 0) >> + rte_exit(EXIT_FAILURE, >> + "Failed to setup classify method for ACL context\n"); >> + >> + if (rte_acl_add_rules(context, route_base, route_num) < 0) >> + rte_exit(EXIT_FAILURE, "add rules failed\n"); >> + >> + if (rte_acl_add_rules(context, acl_base, acl_num) < 0) >> + rte_exit(EXIT_FAILURE, "add rules failed\n"); >> + >> + /* Perform builds */ >> + memset(&acl_build_param, 0, sizeof(acl_build_param)); >> + >> + acl_build_param.num_categories = DEFAULT_MAX_CATEGORIES; >> + acl_build_param.num_fields = dim; >> + memcpy(&acl_build_param.defs, ipv6 ? ipv6_defs : ipv4_defs, >> + ipv6 ? sizeof(ipv6_defs) : sizeof(ipv4_defs)); >> + >> + if (rte_acl_build(context, &acl_build_param) != 0) >> + rte_exit(EXIT_FAILURE, "Failed to build ACL trie\n"); >> + >> + rte_acl_dump(context); >> + >> + return context; >> +} >> +/* >8 End of ACL context setup. */ > Typo in comments. Same as above.