From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Yang, Qiming" <qiming.yang@intel.com>
Cc: "Guo, Junfeng" <junfeng.guo@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 02/20] net/ice/base: init imem table for parser
Date: Tue, 21 Sep 2021 12:51:38 +0000 [thread overview]
Message-ID: <62531e2de0324d61a941dfb4da6331ac@intel.com> (raw)
In-Reply-To: <20210917144322.3141886-3-qi.z.zhang@intel.com>
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Friday, September 17, 2021 10:43 PM
> To: Yang, Qiming <qiming.yang@intel.com>
> Cc: Guo, Junfeng <junfeng.guo@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: [PATCH v2 02/20] net/ice/base: init imem table for parser
>
> Parse DDP section ICE_SID_RXPARSER_IMEM into an array of struct
> ice_imem_item.
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
.....
> +/**
> + * ice_parser_sect_item_get - parse a item from a section
> + * @sect_type: section type
> + * @section: section object
> + * @index: index of the item to get
> + * @offset: dummy as prototype of ice_pkg_enum_entry's last parameter
> +*/ void *ice_parser_sect_item_get(u32 sect_type, void *section,
> + u32 index, u32 *offset)
> +{
> + struct ice_pkg_sect_hdr *hdr;
> + int data_off = ICE_SEC_DATA_OFFSET;
> + int size;
> +
> + if (!section)
> + return NULL;
> +
> + switch (sect_type) {
> + case ICE_SID_RXPARSER_IMEM:
> + size = ICE_SID_RXPARSER_IMEM_ENTRY_SIZE;
> + break;
> + default:
> + return NULL;
> + }
> +
> + hdr = (struct ice_pkg_sect_hdr *)section;
> + if (index >= LE16_TO_CPU(hdr->count))
> + return NULL;
> +
> + return (void *)((u64)section + data_off + index * size); }
Compile warning for 32bit, replace u64 with uintptr_t
> +
> +/**
> + * ice_parser_create_table - create a item table from a section
> + * @hw: pointer to the hardware structure
> + * @sect_type: section type
> + * @item_size: item size in byte
> + * @length: number of items in the table to create
> + * @item_get: the function will be parsed to ice_pkg_enum_entry
> + * @parser_item: the function to parse the item */ void
> +*ice_parser_create_table(struct ice_hw *hw, u32 sect_type,
> + u32 item_size, u32 length,
> + void *(*item_get)(u32 sect_type, void *section,
> + u32 index, u32 *offset),
> + void (*parse_item)(struct ice_hw *hw, u16 idx,
> + void *item, void *data,
> + int size))
> +{
> + struct ice_seg *seg = hw->seg;
> + struct ice_pkg_enum state;
> + u16 idx = 0;
> + void *table;
> + void *data;
> +
> + if (!seg)
> + return NULL;
> +
> + table = ice_malloc(hw, item_size * length);
> + if (!table) {
> + ice_debug(hw, ICE_DBG_PARSER, "failed to allocate memory for
> table type %d.\n",
> + sect_type);
> + return NULL;
> + }
> +
> + ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM);
> + do {
> + data = ice_pkg_enum_entry(seg, &state, sect_type, NULL,
> + item_get);
> + seg = NULL;
> + if (data) {
> + struct ice_pkg_sect_hdr *hdr =
> + (struct ice_pkg_sect_hdr *)state.sect;
> +
> + idx = hdr->offset + state.entry_idx;
> + parse_item(hw, idx,
> + (void *)((u64)table + idx * item_size),
Same issue as above.
Will fix during apply.
next prev parent reply other threads:[~2021-09-21 12:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 14:43 [dpdk-dev] [PATCH v2 00/20] ice/base: add parser module Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 01/20] net/ice/base: add parser create and destroy skeleton Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 02/20] net/ice/base: init imem table for parser Qi Zhang
2021-09-21 12:51 ` Zhang, Qi Z [this message]
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 03/20] net/ice/base: init metainit " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 04/20] net/ice/base: init parse graph cam " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 05/20] net/ice/base: init boost TCAM " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 06/20] net/ice/base: init ptype marker " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 07/20] net/ice/base: init marker group " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 08/20] net/ice/base: init protocol " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 09/20] net/ice/base: init flag redirect " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 10/20] net/ice/base: init XLT key builder " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 11/20] net/ice/base: add parser runtime skeleton Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 12/20] net/ice/base: add helper function for boost TCAM match Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 13/20] net/ice/base: add helper functions for parse graph key matching Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 14/20] net/ice/base: add helper function for ptype markers match Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 15/20] net/ice/base: add helper function to redirect flags Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 16/20] net/ice/base: add helper function to aggregate flags Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 17/20] net/ice/base: add parser execution main loop Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 18/20] net/ice/base: support double VLAN mode configure for parser Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 19/20] net/ice/base: add tunnel port support " Qi Zhang
2021-09-17 14:43 ` [dpdk-dev] [PATCH v2 20/20] net/ice/base: add API for parser profile initialization Qi Zhang
2021-09-18 1:59 ` [dpdk-dev] [PATCH v2 00/20] ice/base: add parser module Guo, Junfeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62531e2de0324d61a941dfb4da6331ac@intel.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=junfeng.guo@intel.com \
--cc=qiming.yang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).