On Mon, May 27, 2024 at 12:57:58PM -0600, Ahmed Zaki wrote:
> From: Junfeng Guo <junfeng....@intel.com>
> 
> Add new parser module which can parse a packet in binary and generate
> information like ptype, protocol/offset pairs and flags which can be later
> used to feed the FXP profile creation directly.
> 
> Add skeleton of the create and destroy APIs:
> ice_parser_create()
> ice_parser_destroy()
> 
> Reviewed-by: Marcin Szycik <marcin.szy...@linux.intel.com>
> Reviewed-by: Wojciech Drewek <wojciech.dre...@intel.com>
> Signed-off-by: Qi Zhang <qi.z.zh...@intel.com>
> Signed-off-by: Junfeng Guo <junfeng....@intel.com>
> Co-developed-by: Ahmed Zaki <ahmed.z...@intel.com>
> Signed-off-by: Ahmed Zaki <ahmed.z...@intel.com>

...

> diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c 
> b/drivers/net/ethernet/intel/ice/ice_parser.c
> new file mode 100644
> index 000000000000..b7865b6a0a9b
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/ice/ice_parser.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (C) 2024 Intel Corporation */
> +
> +#include "ice_common.h"
> +
> +/**
> + * ice_parser_create - create a parser instance
> + * @hw: pointer to the hardware structure
> + *
> + * Return a pointer to the allocated parser instance

Hi Ahmed,

A minor nit from my side.

I think that in order to keep ./scripts/kernel-doc -none -Wall happy
this should be:

 * Return: pointer to the allocated parser instance

And perhaps it would be best to mention the error case too

 * Return: pointer to the allocated parser instance, or an error pointer


> + */
> +struct ice_parser *ice_parser_create(struct ice_hw *hw)
> +{
> +     struct ice_parser *p;
> +
> +     p = kzalloc(sizeof(*p), GFP_KERNEL);
> +     if (!p)
> +             return ERR_PTR(-ENOMEM);
> +
> +     p->hw = hw;
> +     return p;
> +}

...

Reply via email to