Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: Junfeng Guo <junfeng.guo@intel.com>, intel-wired-lan@lists.osuosl.org
Cc: ivecera@redhat.com, netdev@vger.kernel.org,
	jesse.brandeburg@intel.com, edumazet@google.com,
	anthony.l.nguyen@intel.com, horms@kernel.org,
	qi.z.zhang@intel.com, kuba@kernel.org, pabeni@redhat.com,
	davem@davemloft.net
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v9 02/15] ice: init imem table for parser
Date: Wed, 6 Sep 2023 12:50:07 +0200	[thread overview]
Message-ID: <7a1e8afa-5b01-4081-9961-18c6e4b00be4@redhat.com> (raw)
In-Reply-To: <20230904021455.3944605-3-junfeng.guo@intel.com>

Dne 04. 09. 23 v 4:14 Junfeng Guo napsal(a):
> diff --git a/drivers/net/ethernet/intel/ice/ice_imem.c b/drivers/net/ethernet/intel/ice/ice_imem.c
> new file mode 100644
> index 000000000000..005e04947626
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/ice/ice_imem.c
> @@ -0,0 +1,324 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (C) 2023 Intel Corporation */
> +
> +#include "ice_common.h"
> +#include "ice_parser_util.h"
> +
> +static void _ice_imem_bst_bm_dump(struct ice_hw *hw, struct ice_bst_main *bm)

You have a lot of functions whose names start with an underscore. It's 
unusual. If it's to indicate that they're only to be used from the 
current source file, it's already implied by them being defined as static.

[...]
> diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c b/drivers/net/ethernet/intel/ice/ice_parser.c
> index 747dfad66db2..dd089c859616 100644
> --- a/drivers/net/ethernet/intel/ice/ice_parser.c
> +++ b/drivers/net/ethernet/intel/ice/ice_parser.c
[...]
> +/**
> + * 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
> + * @parse_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 = U16_MAX;
> +	void *table;
> +	void *data;
> +
> +	if (!seg)
> +		return NULL;
> +
> +	table = devm_kzalloc(ice_hw_to_dev(hw), item_size * length,
> +			     GFP_KERNEL);

Use devm_kcalloc.


Michal

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-09-06 10:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04  2:14 [Intel-wired-lan] [PATCH iwl-next v9 00/15] Introduce the Parser Library Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 01/15] ice: add parser create and destroy skeleton Junfeng Guo
2023-09-06 10:49   ` Michal Schmidt
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 02/15] ice: init imem table for parser Junfeng Guo
2023-09-06 10:50   ` Michal Schmidt [this message]
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 03/15] ice: init metainit " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 04/15] ice: init parse graph cam tables " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 05/15] ice: init boost tcam and label " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 06/15] ice: init ptype marker tcam table " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 07/15] ice: init marker and protocol group tables " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 08/15] ice: init flag redirect table " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 09/15] ice: init XLT key builder " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 10/15] ice: add parser runtime skeleton Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 11/15] ice: add internal help functions Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 12/15] ice: add parser execution main loop Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 13/15] ice: support double vlan mode configure for parser Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 14/15] ice: add tunnel port support " Junfeng Guo
2023-09-04  2:14 ` [Intel-wired-lan] [PATCH iwl-next v9 15/15] ice: add API for parser profile initialization Junfeng Guo
2023-09-05 22:37 ` [Intel-wired-lan] [PATCH iwl-next v9 00/15] Introduce the Parser Library Jakub Kicinski
2023-09-05 23:05   ` Tom Herbert
2023-09-07 19:10     ` Samudrala, Sridhar
2023-09-09 17:34       ` Tom Herbert
2023-09-12 20:37         ` Samudrala, Sridhar
2023-09-07 19:08   ` Samudrala, Sridhar
2023-09-07 19:38     ` Jakub Kicinski

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=7a1e8afa-5b01-4081-9961-18c6e4b00be4@redhat.com \
    --to=mschmidt@redhat.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=ivecera@redhat.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qi.z.zhang@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