Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/5277/?format=api
https://patches.dpdk.org/api/patches/5277/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1433760090-17110-6-git-send-email-konstantin.ananyev@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1433760090-17110-6-git-send-email-konstantin.ananyev@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1433760090-17110-6-git-send-email-konstantin.ananyev@intel.com", "date": "2015-06-08T10:41:27", "name": "[dpdk-dev,PATCHv2,5/8] acl: code dedup - introduce a new macro", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "9c50d938e4a4654535d07176b3ad800d9346a4e3", "submitter": { "id": 33, "url": "https://patches.dpdk.org/api/people/33/?format=api", "name": "Ananyev, Konstantin", "email": "konstantin.ananyev@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1433760090-17110-6-git-send-email-konstantin.ananyev@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/5277/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/5277/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 5A5BF5963;\n\tMon, 8 Jun 2015 12:41:44 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 34832DE0\n\tfor <dev@dpdk.org>; Mon, 8 Jun 2015 12:41:41 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga103.jf.intel.com with ESMTP; 08 Jun 2015 03:41:39 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 08 Jun 2015 03:41:37 -0700", "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tt58AfbWe029639; Mon, 8 Jun 2015 11:41:37 +0100", "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id t58AfbPu017580;\n\tMon, 8 Jun 2015 11:41:37 +0100", "(from kananye1@localhost)\n\tby sivswdev02.ir.intel.com with id t58AfbwA017575;\n\tMon, 8 Jun 2015 11:41:37 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,573,1427785200\"; d=\"scan'208\";a=\"583972353\"", "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>", "To": "dev@dpdk.org", "Date": "Mon, 8 Jun 2015 11:41:27 +0100", "Message-Id": "<1433760090-17110-6-git-send-email-konstantin.ananyev@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1433760090-17110-1-git-send-email-konstantin.ananyev@intel.com>", "References": "<1433373024-5558-2-git-send-email-konstantin.ananyev@intel.com>\n\t<1433760090-17110-1-git-send-email-konstantin.ananyev@intel.com>", "Subject": "[dpdk-dev] [PATCHv2 5/8] acl: code dedup - introduce a new macro", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Introduce new RTE_ACL_MASKLEN_TO_BITMASK macro, that will be used\nin several places inside librte_acl and it's UT.\nSimplify and cleanup build_trie() code a bit.\n\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n lib/librte_acl/acl_bld.c | 16 +++-------------\n lib/librte_acl/rte_acl.h | 3 +++\n 2 files changed, 6 insertions(+), 13 deletions(-)", "diff": "diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c\nindex d89c66a..4d8a62f 100644\n--- a/lib/librte_acl/acl_bld.c\n+++ b/lib/librte_acl/acl_bld.c\n@@ -1262,19 +1262,9 @@ build_trie(struct acl_build_context *context, struct rte_acl_build_rule *head,\n \t\t\t\t * all higher bits.\n \t\t\t\t */\n \t\t\t\tuint64_t mask;\n-\n-\t\t\t\tif (fld->mask_range.u32 == 0) {\n-\t\t\t\t\tmask = 0;\n-\n-\t\t\t\t/*\n-\t\t\t\t * arithmetic right shift for the length of\n-\t\t\t\t * the mask less the msb.\n-\t\t\t\t */\n-\t\t\t\t} else {\n-\t\t\t\t\tmask = -1 <<\n-\t\t\t\t\t\t(rule->config->defs[n].size *\n-\t\t\t\t\t\tCHAR_BIT - fld->mask_range.u32);\n-\t\t\t\t}\n+\t\t\t\tmask = RTE_ACL_MASKLEN_TO_BITMASK(\n+\t\t\t\t\tfld->mask_range.u32,\n+\t\t\t\t\trule->config->defs[n].size);\n \n \t\t\t\t/* gen a mini-trie for this field */\n \t\t\t\tmerge = acl_gen_mask_trie(context,\ndiff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h\nindex 8d9bbe5..bd8f892 100644\n--- a/lib/librte_acl/rte_acl.h\n+++ b/lib/librte_acl/rte_acl.h\n@@ -122,6 +122,9 @@ enum {\n \n #define\tRTE_ACL_INVALID_USERDATA\t0\n \n+#define\tRTE_ACL_MASKLEN_TO_BITMASK(v, s)\t\\\n+((v) == 0 ? (v) : (typeof(v))((uint64_t)-1 << ((s) * CHAR_BIT - (v))))\n+\n /**\n * Miscellaneous data for ACL rule.\n */\n", "prefixes": [ "dpdk-dev", "PATCHv2", "5/8" ] }{ "id": 5277, "url": "