From patchwork Mon Apr 13 19:40:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkat Duvvuru X-Patchwork-Id: 68346 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 300FEA0577; Mon, 13 Apr 2020 21:46:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D6941C1AA; Mon, 13 Apr 2020 21:42:46 +0200 (CEST) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id 516AF1C1AF for ; Mon, 13 Apr 2020 21:42:42 +0200 (CEST) Received: by mail-pj1-f67.google.com with SMTP id ng8so4290106pjb.2 for ; Mon, 13 Apr 2020 12:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aGOUuvvI4KyVWeTQvMtkMat+0tLQgTwl42n2hGXUB0I=; b=UF/6kqv6MFufHsn4By2Za8M7p4914fhaVFYwKaVhe8Reu4B3Q7ZDeYA3HIlkH1i72f KvjqLtbpQK0fv0hN+mQJFRVhdLrPtNVHeFyCUUdWD8XsAXZXbzWoG/jDotA0nuWoWdtf aQ19yCdZi0H4/unZtWwpXtmTwIr9RW97PazfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aGOUuvvI4KyVWeTQvMtkMat+0tLQgTwl42n2hGXUB0I=; b=NqJ6T34ZDzfKCQ/z5ON1gDQ4ZAh5TVneBApG3ScY7fRh7N38LZy7eMaa69HQzvTxVv 8Z1c+AfkjbO29S0dK0xYUFO81H6U1o0c8OHuoCM7TxypDR/oABEBiLqsqiDGTyk+hry7 6elBL2Nr8cSVPsYpaYuAIETd1I+gDZkTQK86yzvAdOSPPYTnWWU1/Ps7oWwJfKOPb3WW NBC9wUo+VkOiw95TqIt6kAk3NqbfJQq5yxd0miGTa6T2D/PqVj0SGP7XDwG/eQAGJXcT 6HLCHIuLdq3Yt8N1gYEkk07yqcsBIlO9w0jSamB2+M8dNXz6+z1bBUJV+A83SvMTpsqF AX+g== X-Gm-Message-State: AGi0PuaUTJYEaMWKE+rFh8HXDtEKw5zGX9fg0NTj0SK9UrpNMJYFQBnt cKO2Xopgp/43HEB76w38QH5iOd4SiD7ebkUS5ZgfgptmQtU00/5+Fk1CJVwBAL5Aigb4qgWO3iD P1G+a9CTXTsQOayQ4JFBSCq+dcQcM5Eqmt12FojfKeCOv1T4vRECS5epcnzhfQ5yBS/3o X-Google-Smtp-Source: APiQypJD5muYZadrdaGjeLROGwqMB5719kfoK1kePjuARl4TzdZHVRb7veLbc0eFKj/qK4HZuGtr/w== X-Received: by 2002:a17:902:ec01:: with SMTP id l1mr18739673pld.151.1586806960826; Mon, 13 Apr 2020 12:42:40 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 9sm1381663pfn.204.2020.04.13.12.42.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2020 12:42:40 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Date: Tue, 14 Apr 2020 01:10:00 +0530 Message-Id: <1586806811-21736-24-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586806811-21736-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1584459511-5353-1-git-send-email-venkatkumar.duvvuru@broadcom.com> <1586806811-21736-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH v2 23/34] net/bnxt: match rte flow items with flow template patterns 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kishore Padmanabha This patch does the following 1. Takes hdr_bitmap generated from the rte_flow_items 2. Iterates through the static hdr_bitmap list 3. Returns success if a match is found, otherwise an error Signed-off-by: Kishore Padmanabha Signed-off-by: Venkat Duvvuru Reviewed-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/Makefile | 1 + drivers/net/bnxt/tf_ulp/bnxt_tf_common.h | 12 ++ drivers/net/bnxt/tf_ulp/ulp_matcher.c | 152 ++++++++++++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_matcher.h | 26 +++++ drivers/net/bnxt/tf_ulp/ulp_template_db.c | 115 +++++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_template_db.h | 40 +++++++ drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 21 ++++ 7 files changed, 367 insertions(+) create mode 100644 drivers/net/bnxt/tf_ulp/ulp_matcher.c create mode 100644 drivers/net/bnxt/tf_ulp/ulp_matcher.h diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile index f464d9e..455fd5c 100644 --- a/drivers/net/bnxt/Makefile +++ b/drivers/net/bnxt/Makefile @@ -63,6 +63,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_flow_db.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_template_db.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_utils.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_mapper.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_matcher.c # # Export include files diff --git a/drivers/net/bnxt/tf_ulp/bnxt_tf_common.h b/drivers/net/bnxt/tf_ulp/bnxt_tf_common.h index 3516df4..e4ebfc5 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_tf_common.h +++ b/drivers/net/bnxt/tf_ulp/bnxt_tf_common.h @@ -25,6 +25,18 @@ #define BNXT_ULP_TX_NUM_FLOWS 32 #define BNXT_ULP_TX_TBL_IF_ID 0 +enum bnxt_tf_rc { + BNXT_TF_RC_PARSE_ERR = -2, + BNXT_TF_RC_ERROR = -1, + BNXT_TF_RC_SUCCESS = 0 +}; + +/* ulp direction Type */ +enum ulp_direction_type { + ULP_DIR_INGRESS, + ULP_DIR_EGRESS, +}; + struct bnxt_ulp_mark_tbl * bnxt_ulp_cntxt_ptr2_mark_db_get(struct bnxt_ulp_context *ulp_ctx); diff --git a/drivers/net/bnxt/tf_ulp/ulp_matcher.c b/drivers/net/bnxt/tf_ulp/ulp_matcher.c new file mode 100644 index 0000000..f367e4c --- /dev/null +++ b/drivers/net/bnxt/tf_ulp/ulp_matcher.c @@ -0,0 +1,152 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2014-2020 Broadcom + * All rights reserved. + */ + +#include "ulp_matcher.h" +#include "ulp_utils.h" + +/* Utility function to check if bitmap is zero */ +static inline +int ulp_field_mask_is_zero(uint8_t *bitmap, uint32_t size) +{ + while (size-- > 0) { + if (*bitmap != 0) + return 0; + bitmap++; + } + return 1; +} + +/* Utility function to check if bitmap is all ones */ +static inline int +ulp_field_mask_is_ones(uint8_t *bitmap, uint32_t size) +{ + while (size-- > 0) { + if (*bitmap != 0xFF) + return 0; + bitmap++; + } + return 1; +} + +/* Utility function to check if bitmap is non zero */ +static inline int +ulp_field_mask_notzero(uint8_t *bitmap, uint32_t size) +{ + while (size-- > 0) { + if (*bitmap != 0) + return 1; + bitmap++; + } + return 0; +} + +/* Utility function to mask the computed and internal proto headers. */ +static void +ulp_matcher_hdr_fields_normalize(struct ulp_rte_hdr_bitmap *hdr1, + struct ulp_rte_hdr_bitmap *hdr2) +{ + /* copy the contents first */ + rte_memcpy(hdr2, hdr1, sizeof(struct ulp_rte_hdr_bitmap)); + + /* reset the computed fields */ + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_SVIF); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_OO_VLAN); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_OI_VLAN); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_IO_VLAN); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_II_VLAN); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_O_L3); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_O_L4); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_I_L3); + ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_I_L4); +} + +/* + * Function to handle the matching of RTE Flows and validating + * the pattern masks against the flow templates. + */ +int32_t +ulp_matcher_pattern_match(enum ulp_direction_type dir, + struct ulp_rte_hdr_bitmap *hdr_bitmap, + struct ulp_rte_hdr_field *hdr_field, + struct ulp_rte_act_bitmap *act_bitmap, + uint32_t *class_id) +{ + struct bnxt_ulp_header_match_info *sel_hdr_match; + uint32_t hdr_num, idx, jdx; + uint32_t match = 0; + struct ulp_rte_hdr_bitmap hdr_bitmap_masked; + uint32_t start_idx; + struct ulp_rte_hdr_field *m_field; + struct bnxt_ulp_matcher_field_info *sf; + + /* Select the ingress or egress template to match against */ + if (dir == ULP_DIR_INGRESS) { + sel_hdr_match = ulp_ingress_hdr_match_list; + hdr_num = BNXT_ULP_INGRESS_HDR_MATCH_SZ; + } else { + sel_hdr_match = ulp_egress_hdr_match_list; + hdr_num = BNXT_ULP_EGRESS_HDR_MATCH_SZ; + } + + /* Remove the hdr bit maps that are internal or computed */ + ulp_matcher_hdr_fields_normalize(hdr_bitmap, &hdr_bitmap_masked); + + /* Loop through the list of class templates to find the match */ + for (idx = 0; idx < hdr_num; idx++, sel_hdr_match++) { + if (ULP_BITSET_CMP(&sel_hdr_match->hdr_bitmap, + &hdr_bitmap_masked)) { + /* no match found */ + BNXT_TF_DBG(DEBUG, "Pattern Match failed template=%d\n", + idx); + continue; + } + match = ULP_BITMAP_ISSET(act_bitmap->bits, + BNXT_ULP_ACTION_BIT_VNIC); + if (match != sel_hdr_match->act_vnic) { + /* no match found */ + BNXT_TF_DBG(DEBUG, "Vnic Match failed template=%d\n", + idx); + continue; + } else { + match = 1; + } + + /* Found a matching hdr bitmap, match the fields next */ + start_idx = sel_hdr_match->start_idx; + for (jdx = 0; jdx < sel_hdr_match->num_entries; jdx++) { + m_field = &hdr_field[jdx + BNXT_ULP_HDR_FIELD_LAST - 1]; + sf = &ulp_field_match[start_idx + jdx]; + switch (sf->mask_opcode) { + case BNXT_ULP_FMF_MASK_ANY: + match &= ulp_field_mask_is_zero(m_field->mask, + m_field->size); + break; + case BNXT_ULP_FMF_MASK_EXACT: + match &= ulp_field_mask_is_ones(m_field->mask, + m_field->size); + break; + case BNXT_ULP_FMF_MASK_WILDCARD: + match &= ulp_field_mask_notzero(m_field->mask, + m_field->size); + break; + case BNXT_ULP_FMF_MASK_IGNORE: + default: + break; + } + if (!match) + break; + } + if (match) { + BNXT_TF_DBG(DEBUG, + "Found matching pattern template %d\n", + sel_hdr_match->class_tmpl_id); + *class_id = sel_hdr_match->class_tmpl_id; + return BNXT_TF_RC_SUCCESS; + } + } + BNXT_TF_DBG(DEBUG, "Did not find any matching template\n"); + *class_id = 0; + return BNXT_TF_RC_ERROR; +} diff --git a/drivers/net/bnxt/tf_ulp/ulp_matcher.h b/drivers/net/bnxt/tf_ulp/ulp_matcher.h new file mode 100644 index 0000000..57a161d --- /dev/null +++ b/drivers/net/bnxt/tf_ulp/ulp_matcher.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2014-2020 Broadcom + * All rights reserved. + */ + +#ifndef ULP_MATCHER_H_ +#define ULP_MATCHER_H_ + +#include +#include "bnxt.h" +#include "ulp_template_db.h" +#include "ulp_template_struct.h" +#include "bnxt_tf_common.h" + +/* + * Function to handle the matching of RTE Flows and validating + * the pattern masks against the flow templates. + */ +int32_t +ulp_matcher_pattern_match(enum ulp_direction_type dir, + struct ulp_rte_hdr_bitmap *hdr_bitmap, + struct ulp_rte_hdr_field *hdr_field, + struct ulp_rte_act_bitmap *act_bitmap, + uint32_t *class_id); + +#endif /* ULP_MATCHER_H_ */ diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c index 5ec7adc..68a2dc0 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c @@ -796,6 +796,121 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = { } }; +struct bnxt_ulp_header_match_info ulp_ingress_hdr_match_list[] = { + { + .hdr_bitmap = { .bits = + BNXT_ULP_HDR_BIT_O_ETH | + BNXT_ULP_HDR_BIT_O_IPV4 | + BNXT_ULP_HDR_BIT_O_UDP }, + .start_idx = 0, + .num_entries = 24, + .class_tmpl_id = 0, + .act_vnic = 0 + } +}; + +struct bnxt_ulp_header_match_info ulp_egress_hdr_match_list[] = { +}; + +struct bnxt_ulp_matcher_field_info ulp_field_match[] = { + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_EXACT, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_EXACT, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_ANY, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_ANY, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_EXACT, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_EXACT, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_EXACT, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_EXACT, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + }, + { + .mask_opcode = BNXT_ULP_FMF_MASK_IGNORE, + .spec_opcode = BNXT_ULP_FMF_SPEC_IGNORE + } +}; + struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = { { .field_bit_size = 10, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h index 957b21a..319500a 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h @@ -13,6 +13,8 @@ #define BNXT_ULP_MAX_NUM_DEVICES 4 #define BNXT_ULP_LOG2_MAX_NUM_DEV 2 +#define BNXT_ULP_INGRESS_HDR_MATCH_SZ 2 +#define BNXT_ULP_EGRESS_HDR_MATCH_SZ 1 enum bnxt_ulp_action_bit { BNXT_ULP_ACTION_BIT_MARK = 0x0000000000000001, @@ -45,6 +47,31 @@ enum bnxt_ulp_action_bit { BNXT_ULP_ACTION_BIT_LAST = 0x0000000008000000 }; +enum bnxt_ulp_hdr_bit { + BNXT_ULP_HDR_BIT_SVIF = 0x0000000000000001, + BNXT_ULP_HDR_BIT_O_ETH = 0x0000000000000002, + BNXT_ULP_HDR_BIT_OO_VLAN = 0x0000000000000004, + BNXT_ULP_HDR_BIT_OI_VLAN = 0x0000000000000008, + BNXT_ULP_HDR_BIT_O_L3 = 0x0000000000000010, + BNXT_ULP_HDR_BIT_O_IPV4 = 0x0000000000000020, + BNXT_ULP_HDR_BIT_O_IPV6 = 0x0000000000000040, + BNXT_ULP_HDR_BIT_O_L4 = 0x0000000000000080, + BNXT_ULP_HDR_BIT_O_TCP = 0x0000000000000100, + BNXT_ULP_HDR_BIT_O_UDP = 0x0000000000000200, + BNXT_ULP_HDR_BIT_T_VXLAN = 0x0000000000000400, + BNXT_ULP_HDR_BIT_T_GRE = 0x0000000000000800, + BNXT_ULP_HDR_BIT_I_ETH = 0x0000000000001000, + BNXT_ULP_HDR_BIT_IO_VLAN = 0x0000000000002000, + BNXT_ULP_HDR_BIT_II_VLAN = 0x0000000000004000, + BNXT_ULP_HDR_BIT_I_L3 = 0x0000000000008000, + BNXT_ULP_HDR_BIT_I_IPV4 = 0x0000000000010000, + BNXT_ULP_HDR_BIT_I_IPV6 = 0x0000000000020000, + BNXT_ULP_HDR_BIT_I_L4 = 0x0000000000040000, + BNXT_ULP_HDR_BIT_I_TCP = 0x0000000000080000, + BNXT_ULP_HDR_BIT_I_UDP = 0x0000000000100000, + BNXT_ULP_HDR_BIT_LAST = 0x0000000000200000 +}; + enum bnxt_ulp_byte_order { BNXT_ULP_BYTE_ORDER_BE, BNXT_ULP_BYTE_ORDER_LE, @@ -67,12 +94,25 @@ enum bnxt_ulp_fmf_mask { BNXT_ULP_FMF_MASK_LAST }; +enum bnxt_ulp_fmf_spec { + BNXT_ULP_FMF_SPEC_IGNORE = 0, + BNXT_ULP_FMF_SPEC_LAST = 1 +}; + enum bnxt_ulp_mark_enable { BNXT_ULP_MARK_ENABLE_NO = 0, BNXT_ULP_MARK_ENABLE_YES = 1, BNXT_ULP_MARK_ENABLE_LAST = 2 }; +enum bnxt_ulp_hdr_field { + BNXT_ULP_HDR_FIELD_MPLS_TAG_NUM = 0, + BNXT_ULP_HDR_FIELD_O_VTAG_NUM = 1, + BNXT_ULP_HDR_FIELD_I_VTAG_NUM = 2, + BNXT_ULP_HDR_FIELD_SVIF_INDEX = 3, + BNXT_ULP_HDR_FIELD_LAST = 4 +}; + enum bnxt_ulp_mask_opc { BNXT_ULP_MASK_OPC_SET_TO_CONSTANT = 0, BNXT_ULP_MASK_OPC_SET_TO_HDR_FIELD = 1, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index b7094c5..dd06fb1 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -29,6 +29,11 @@ struct ulp_rte_hdr_field { uint32_t size; }; +struct bnxt_ulp_matcher_field_info { + enum bnxt_ulp_fmf_mask mask_opcode; + enum bnxt_ulp_fmf_spec spec_opcode; +}; + struct ulp_rte_act_bitmap { uint64_t bits; }; @@ -41,6 +46,22 @@ struct ulp_rte_act_prop { uint8_t act_details[BNXT_ULP_ACT_PROP_IDX_LAST]; }; +/* Flow Matcher structures */ +struct bnxt_ulp_header_match_info { + struct ulp_rte_hdr_bitmap hdr_bitmap; + uint32_t start_idx; + uint32_t num_entries; + uint32_t class_tmpl_id; + uint32_t act_vnic; +}; + +/* Flow Matcher templates Structure Array defined in template source*/ +extern struct bnxt_ulp_header_match_info ulp_ingress_hdr_match_list[]; +extern struct bnxt_ulp_header_match_info ulp_egress_hdr_match_list[]; + +/* Flow field match Information Structure Array defined in template source*/ +extern struct bnxt_ulp_matcher_field_info ulp_field_match[]; + /* Device specific parameters */ struct bnxt_ulp_device_params { uint8_t description[16];