From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 892B5A2EFC for ; Wed, 18 Sep 2019 12:26:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6B37A1C221; Wed, 18 Sep 2019 12:26:41 +0200 (CEST) Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) by dpdk.org (Postfix) with ESMTP id 2C3DF1C21C for ; Wed, 18 Sep 2019 12:26:40 +0200 (CEST) Received: by mail-vs1-f42.google.com with SMTP id b1so4084141vsr.10 for ; Wed, 18 Sep 2019 03:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=T0rJmapa6lFcmxOK6Rqpdzi42W8G9QHBUzo+CfwwwiQ=; b=PdjpllE5yldBYqch0GXSO4J7gJZqcGTrgkX0NSZbNpjNqGfjHoqNT/ShpdKbB5IEZh //Lficc3t9Rl6COn/LHtMrkXFWKHT+Wzyd8ye2QYwgfhSVFIlItIXOYSkWqO2GYWB/n7 xMSq3NRJGtyO5V1Jayf2CtrRbfN+srhK+W+nx607h+moBZZm8kX2fPUCjPtx5V03BmA7 iHZdJ2XvyzV2jXio0vQsBW260JJXYkZbBS7IdPorkwpcT9M+gGEv9hvVzqOtkdYX0FiY 0ee+uilgfSOXbZji2mlV2KUPgAwKT8Jgw7mDvtZlXimlxtBdjcvrYtVksDAwTF/2woYP GD2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=T0rJmapa6lFcmxOK6Rqpdzi42W8G9QHBUzo+CfwwwiQ=; b=oLyzQ4jIAiS9DWGgzbVDyi6BIbBtKaCy3Am0SONrvhvtTqzjYM19Xdow2/rUhArvIS lkb3YJ5RuhPKjnMJIerkSWKKECQqw5NM/09ElNErSeNOxnMlq8LKqRVc2N93o1Bu1a1t WYNYORGo7HDQfljVifIkJ0pGVrnVFG8K29zPE1yLyXC2xgjdvPhNpJYKfmpgHy0UTs1+ AZq5ypLPUWHC/cUEr0lbauaBcowZvF1whSZWObAFigBx6rQ+An3QFevvphuG5VOSRX4Y Avnf4clmRF8x/8PU6cGV/7wdil8OBEvsOqVNO/vAfCfaTQJf2hRAZPIUuw7EiKlMfE6a z4Ag== X-Gm-Message-State: APjAAAVmUS5TS7rRDgXHzdhrXq01NgEuingToL0E2UDadlLXycOdsl09 aeEaCroDG8JFmnA8TyHj/TY4Z08/baqZYKn5CbPWTUGN X-Google-Smtp-Source: APXvYqwpoTH7DGjnOmbfDGGw5uiXhbVdWE4pyLKlsyzYyXxbQwWM8nE8N/PBa0tyEC4JnJX6qw0ptSzNpBwhOpKWiOw= X-Received: by 2002:a67:eb85:: with SMTP id e5mr1744462vso.30.1568802399288; Wed, 18 Sep 2019 03:26:39 -0700 (PDT) MIME-Version: 1.0 From: Victor Huertas Date: Wed, 18 Sep 2019 12:26:28 +0200 Message-ID: To: users@dpdk.org Cc: Vikutoru Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] [DPDK v17.11 LTS] Crash (segmentation fault) in ACL table packet look up X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi all, the DPDK lib always crashes when a packet enters an ACL table I created to check IPv6 fragmented packets. If the table is empty nothing happens as the missed packets go to the next table in the pipeline but as soon as I put some entries a crash happens when the first packet enters. It seems to happen in the acl_run.h file (in librte_acl) in line 178 (static inline uint64_t acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n, const struct rte_acl_ctx *ctx)). Subsequently, I put the section of the code where it crashes (in bold and red): /* set completion parameters and starting index for this slot */ parms[n].cmplt = flows->last_cmplt; transition = * flows->trans[parms[n].data[*parms[n].data_index++]* + ctx->trie[flows->trie].root_index]; Running in debug mode, Eclipse tells me that the 'trans' component of 'flows' is NULL and that's what I think that is the cause of the segmentation fault. The thing is that other ACL tables that I use don't causes this segmentation fault at all. I have revised the fields format configuration, etc. and all seems to be OK. The table creation returns 0 and all the table entry insertions returns 0. So the lib doesn't complain at all until the crash happens. I enclose below the sections of my code where the fields format is set as well as the table creation section. Any help is really wellcome to see what is happening here. Thanks a lot for your attention. Now the code samples: ================== ACL fields format (only the one that fails) ======================= struct rte_acl_field_def *field_format_ipv6_1st_fragment* [NUM_FIELDS_IPV6_1ST_FRAGMENT_ACL] = { /* Protocol (1 byte) this value will always be the same (44)*/ [0] = { .type = RTE_ACL_FIELD_TYPE_BITMASK, .size = sizeof(uint8_t), .field_index = 0, .input_index = 0, .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, proto), }, /* ethertype (2 bytes) : this value will always be the same (0x86DD) */ [1] = { .type = RTE_ACL_FIELD_TYPE_BITMASK, .size = sizeof(uint16_t), .field_index = 1, .input_index = 1, // this value must be multiple of 4 bytes .offset = offsetof(struct ether_hdr, ether_type), }, /* tos field (2 bytes) */ [2] = { .type = RTE_ACL_FIELD_TYPE_BITMASK, .size = sizeof(uint16_t), .field_index = 2, .input_index = 1, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, vtc_flow), }, /************* IPv6 source address **************/ /* Source IPv6 address [0-3] */ [3] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 3, .input_index = 2, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, src_addr[0]), }, /* Source IPv6 address [4-7] */ [4] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 4, .input_index = 3, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, src_addr[4]), }, /* Source IPv6 address [8-11] */ [5] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 5, .input_index = 4, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, src_addr[8]), }, /* Source IPv6 address [12-15] */ [6] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 6, .input_index = 5, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, src_addr[12]), }, /************* IPv6 destination address **************/ /* Destination IPv6 address [0-3] */ [7] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 7, .input_index = 6, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, dst_addr[0]), }, /* Destination IPv6 address [4-7] */ [8] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 8, .input_index = 7, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, dst_addr[4]), }, /* Destination IPv6 address [8-11] */ [9] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 9, .input_index = 8, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, dst_addr[8]), }, /* Destination IPv6 address [12-15] */ [10] = { .type = RTE_ACL_FIELD_TYPE_MASK, .size = sizeof(uint32_t), .field_index = 10, .input_index = 9, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + offsetof(struct ipv6_hdr, dst_addr[12]), }, /* next_header+reserved+frag_data (4 byte) in ipv6 frag header */ [11] = { .type = RTE_ACL_FIELD_TYPE_BITMASK, .size = sizeof(uint32_t), .field_index = 11, .input_index = 10, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + sizeof(struct ipv6_hdr) + offsetof(struct ipv6_extension_fragment, next_header), }, /* Source Port */ [12] = { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = 12, .input_index = 11, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + sizeof(struct ipv6_hdr) + sizeof(struct ipv6_extension_fragment) + offsetof(struct tcp_hdr, src_port), }, /* Destination Port */ [13] = { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = 13, .input_index = 11, // this value must be multiple of 4 bytes .offset = sizeof(struct ether_hdr) + sizeof(struct ipv6_hdr) + sizeof(struct ipv6_extension_fragment) + offsetof(struct tcp_hdr, dst_port), }, }; ===================== Table creation ========================== struct rte_table_acl_params acl_flow_line_acl_params[SERVICE_QOS_NUM_FLOW_CLASSIF_TABLES]; /* SERVICE_QOS_IPV4_QOS_POLICY_ACL table params setting */ strcpy(s_fc->table_p[SERVICE_QOS_IPV4_QOS_POLICY_ACL].table_name,"table_acl_ipv4_qos_policy"); s_fc->table_p[SERVICE_QOS_IPV4_QOS_POLICY_ACL].field_format = field_format_ipv4; s_fc->table_p[SERVICE_QOS_IPV4_QOS_POLICY_ACL].n_rule_fields = RTE_DIM(field_format_ipv4); s_fc->table_p[SERVICE_QOS_IPV4_QOS_POLICY_ACL].field_format_size = sizeof(field_format_ipv4); s_fc->table_p[SERVICE_QOS_IPV4_QOS_POLICY_ACL].n_rules = FLOW_CLASSIFY_MAX_RULE_NUM; /* SERVICE_QOS_IPV6_QOS_POLICY_ACL table params setting */ strcpy(s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_ACL].table_name,"table_acl_ipv6_qos_policy"); s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_ACL].field_format = field_format_ipv6; s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_ACL].n_rule_fields = RTE_DIM(field_format_ipv6); s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_ACL].field_format_size = sizeof(field_format_ipv6); s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_ACL].n_rules = FLOW_CLASSIFY_MAX_RULE_NUM; // 8*1024 */* SERVICE_QOS_IPV6_QOS_POLICY_1ST_FRAGMENT_ACL table params setting */strcpy(s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_1ST_FRAGMENT_ACL].table_name,"table_acl_ipv6_qos_policy_1st_fragment");s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_1ST_FRAGMENT_ACL].field_format = field_format_ipv6_1st_fragment;s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_1ST_FRAGMENT_ACL].n_rule_fields = RTE_DIM(field_format_ipv6_1st_fragment);s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_1ST_FRAGMENT_ACL].field_format_size = sizeof(field_format_ipv6_1st_fragment);s_fc->table_p[SERVICE_QOS_IPV6_QOS_POLICY_1ST_FRAGMENT_ACL].n_rules = FLOW_CLASSIFY_MAX_RULE_NUM; // 8*1024* for(unsigned int i=0; itable_p[i].table_name; acl_flow_line_acl_params[i].n_rules = s_fc->table_p[i].n_rules; acl_flow_line_acl_params[i].n_rule_fields = s_fc->table_p[i].n_rule_fields; for(unsigned int j=0; jtable_p[i].n_rule_fields; j++){ memcpy(&acl_flow_line_acl_params[i].field_format[j],&s_fc->table_p[i].field_format[j],sizeof(struct rte_acl_field_def)); } s_fc->table_p[i].pipeline_table_params.ops = &rte_table_acl_ops; s_fc->table_p[i].pipeline_table_params.arg_create = &acl_flow_line_acl_params[i]; s_fc->table_p[i].pipeline_table_params.f_action_hit = get_service_qos_fc_table_ah_hit(); s_fc->table_p[i].pipeline_table_params.f_action_miss = NULL; s_fc->table_p[i].pipeline_table_params.arg_ah = &s_qos->qoss.metadata; s_fc->table_p[i].pipeline_table_params.action_data_size = sizeof(struct service_qos_policy_flow_table_entry) - sizeof(struct rte_pipeline_table_entry); status = rte_pipeline_table_create(p->p, &s_fc->table_p[i].pipeline_table_params, &p->table_id[s_fc->table_p[i].table_index]); if (status) { return NULL; // the rte_free must be done in the pipeline } else{ p->n_tables++; uint32_t pipeline_id; APP_PARAM_GET_ID(p,"PIPELINE",pipeline_id); S_LOG_BE(p, pipeline_id,PIPELINE_LOG_LEVEL_INFO, "Successfully added '%s' table with index {%u}", acl_flow_line_acl_params[i].name,s_fc->table_p[i].table_index); } } } -- Victor