From: Simon Horman <horms@kernel.org>
To: Ahmed Zaki <ahmed.zaki@intel.com>
Cc: Junfeng Guo <junfeng.guo@intel.com>,
netdev@vger.kernel.org,
Marcin Szycik <marcin.szycik@linux.intel.com>,
anthony.l.nguyen@intel.com, jacob.e.keller@intel.com,
intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v2 11/13] ice: enable FDIR filters from raw binary patterns for VFs
Date: Fri, 31 May 2024 19:11:59 +0100 [thread overview]
Message-ID: <20240531181159.GD491852@kernel.org> (raw)
In-Reply-To: <f2cf6650-a164-4d3c-a3d9-cc57c66069a5@intel.com>
On Fri, May 31, 2024 at 09:47:47AM -0600, Ahmed Zaki wrote:
>
>
> On 2024-05-31 7:18 a.m., Simon Horman wrote:
> > On Mon, May 27, 2024 at 12:58:08PM -0600, Ahmed Zaki wrote:
> > > From: Junfeng Guo <junfeng.guo@intel.com>
> > >
> > > Enable VFs to create FDIR filters from raw binary patterns.
> > > The corresponding processes for raw flow are added in the
> > > Parse / Create / Destroy stages.
> > >
> > > Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> > > Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
> > > Co-developed-by: Ahmed Zaki <ahmed.zaki@intel.com>
> > > Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
> >
> > ...
> >
> > > diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c
> >
> > ...
> >
> > > +/**
> > > + * ice_flow_set_parser_prof - Set flow profile based on the parsed profile info
> > > + * @hw: pointer to the HW struct
> > > + * @dest_vsi: dest VSI
> > > + * @fdir_vsi: fdir programming VSI
> > > + * @prof: stores parsed profile info from raw flow
> > > + * @blk: classification blk
> > > + */
> > > +int
> > > +ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi,
> > > + struct ice_parser_profile *prof, enum ice_block blk)
> > > +{
> > > + u64 id = find_first_bit(prof->ptypes, ICE_FLOW_PTYPE_MAX);
> > > + struct ice_flow_prof_params *params __free(kfree);
> > > + u8 fv_words = hw->blk[blk].es.fvw;
> > > + int status;
> > > + int i, idx;
> > > +
> > > + params = kzalloc(sizeof(*params), GFP_KERNEL);
> > > + if (!params)
> > > + return -ENOMEM;
> >
> >
> > params seems to be leaked when this function returns below,
> > in both error and non-error cases.
>
> Shouldn't the __free guard take care of this?
Yes, sorry for missing that.
...
> > > diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > index 5635e9da2212..9138f7783da0 100644
> > > --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > @@ -1,8 +1,8 @@
> > > // SPDX-License-Identifier: GPL-2.0
> > > /* Copyright (C) 2022, Intel Corporation. */
> > > -#include "ice_vf_lib_private.h"
> > > #include "ice.h"
> > > +#include "ice_vf_lib_private.h"
> > > #include "ice_lib.h"
> > > #include "ice_fltr.h"
> > > #include "ice_virtchnl_allowlist.h"
> >
> > To me tweaking the order of includes seems to indicate
> > that something isn't quite right. Is there some sort of
> > dependency loop being juggled here?
>
> This was needed because of the changes in ice_flow.h, struct ice_vsi is now
> used. I will check if there is a better fix.
Thanks.
...
> > > +static int
> > > +ice_vc_fdir_parse_raw(struct ice_vf *vf,
> > > + struct virtchnl_proto_hdrs *proto,
> > > + struct virtchnl_fdir_fltr_conf *conf)
> > > +{
> > > + u8 *pkt_buf, *msk_buf __free(kfree);
> > > + struct ice_parser_result rslt;
> > > + struct ice_pf *pf = vf->pf;
> > > + struct ice_parser *psr;
> > > + int status = -ENOMEM;
> > > + struct ice_hw *hw;
> > > + u16 udp_port = 0;
> > > +
> > > + pkt_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL);
> > > + msk_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL);
> >
> > msk_buf appears to be leaked both in when this function
> > returns for both error and non-error cases.
>
> Same, guarded by __free. I am new to these guards myself, pls let me know if
> I am missing something.
No, sorry. Somehow I missed the __free.
I think we are good here.
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Ahmed Zaki <ahmed.zaki@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
jacob.e.keller@intel.com, anthony.l.nguyen@intel.com,
Junfeng Guo <junfeng.guo@intel.com>,
Marcin Szycik <marcin.szycik@linux.intel.com>
Subject: Re: [PATCH iwl-next v2 11/13] ice: enable FDIR filters from raw binary patterns for VFs
Date: Fri, 31 May 2024 19:11:59 +0100 [thread overview]
Message-ID: <20240531181159.GD491852@kernel.org> (raw)
In-Reply-To: <f2cf6650-a164-4d3c-a3d9-cc57c66069a5@intel.com>
On Fri, May 31, 2024 at 09:47:47AM -0600, Ahmed Zaki wrote:
>
>
> On 2024-05-31 7:18 a.m., Simon Horman wrote:
> > On Mon, May 27, 2024 at 12:58:08PM -0600, Ahmed Zaki wrote:
> > > From: Junfeng Guo <junfeng.guo@intel.com>
> > >
> > > Enable VFs to create FDIR filters from raw binary patterns.
> > > The corresponding processes for raw flow are added in the
> > > Parse / Create / Destroy stages.
> > >
> > > Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> > > Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
> > > Co-developed-by: Ahmed Zaki <ahmed.zaki@intel.com>
> > > Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
> >
> > ...
> >
> > > diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c
> >
> > ...
> >
> > > +/**
> > > + * ice_flow_set_parser_prof - Set flow profile based on the parsed profile info
> > > + * @hw: pointer to the HW struct
> > > + * @dest_vsi: dest VSI
> > > + * @fdir_vsi: fdir programming VSI
> > > + * @prof: stores parsed profile info from raw flow
> > > + * @blk: classification blk
> > > + */
> > > +int
> > > +ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi,
> > > + struct ice_parser_profile *prof, enum ice_block blk)
> > > +{
> > > + u64 id = find_first_bit(prof->ptypes, ICE_FLOW_PTYPE_MAX);
> > > + struct ice_flow_prof_params *params __free(kfree);
> > > + u8 fv_words = hw->blk[blk].es.fvw;
> > > + int status;
> > > + int i, idx;
> > > +
> > > + params = kzalloc(sizeof(*params), GFP_KERNEL);
> > > + if (!params)
> > > + return -ENOMEM;
> >
> >
> > params seems to be leaked when this function returns below,
> > in both error and non-error cases.
>
> Shouldn't the __free guard take care of this?
Yes, sorry for missing that.
...
> > > diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > index 5635e9da2212..9138f7783da0 100644
> > > --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > > @@ -1,8 +1,8 @@
> > > // SPDX-License-Identifier: GPL-2.0
> > > /* Copyright (C) 2022, Intel Corporation. */
> > > -#include "ice_vf_lib_private.h"
> > > #include "ice.h"
> > > +#include "ice_vf_lib_private.h"
> > > #include "ice_lib.h"
> > > #include "ice_fltr.h"
> > > #include "ice_virtchnl_allowlist.h"
> >
> > To me tweaking the order of includes seems to indicate
> > that something isn't quite right. Is there some sort of
> > dependency loop being juggled here?
>
> This was needed because of the changes in ice_flow.h, struct ice_vsi is now
> used. I will check if there is a better fix.
Thanks.
...
> > > +static int
> > > +ice_vc_fdir_parse_raw(struct ice_vf *vf,
> > > + struct virtchnl_proto_hdrs *proto,
> > > + struct virtchnl_fdir_fltr_conf *conf)
> > > +{
> > > + u8 *pkt_buf, *msk_buf __free(kfree);
> > > + struct ice_parser_result rslt;
> > > + struct ice_pf *pf = vf->pf;
> > > + struct ice_parser *psr;
> > > + int status = -ENOMEM;
> > > + struct ice_hw *hw;
> > > + u16 udp_port = 0;
> > > +
> > > + pkt_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL);
> > > + msk_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL);
> >
> > msk_buf appears to be leaked both in when this function
> > returns for both error and non-error cases.
>
> Same, guarded by __free. I am new to these guards myself, pls let me know if
> I am missing something.
No, sorry. Somehow I missed the __free.
I think we are good here.
next prev parent reply other threads:[~2024-05-31 18:12 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 18:57 [Intel-wired-lan] [PATCH iwl-next v2 00/13] ice: iavf: add support for TC U32 filters on VFs Ahmed Zaki
2024-05-27 18:57 ` Ahmed Zaki
2024-05-27 18:57 ` [Intel-wired-lan] [PATCH iwl-next v2 01/13] ice: add parser create and destroy skeleton Ahmed Zaki
2024-05-27 18:57 ` Ahmed Zaki
2024-05-31 13:11 ` [Intel-wired-lan] " Simon Horman
2024-05-31 13:11 ` Simon Horman
2024-07-23 7:53 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 7:53 ` Romanowski, Rafal
2024-05-27 18:57 ` [Intel-wired-lan] [PATCH iwl-next v2 02/13] ice: parse and init various DDP parser sections Ahmed Zaki
2024-05-27 18:57 ` Ahmed Zaki
2024-05-31 13:14 ` [Intel-wired-lan] " Simon Horman
2024-05-31 13:14 ` Simon Horman
2024-07-23 7:54 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 7:54 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 03/13] ice: add debugging functions for the " Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 7:55 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 7:55 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 04/13] ice: add parser internal helper functions Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-05-31 13:15 ` [Intel-wired-lan] " Simon Horman
2024-05-31 13:15 ` Simon Horman
2024-07-23 8:07 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:07 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 05/13] ice: add parser execution main loop Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 7:58 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 7:58 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 06/13] ice: support turning on/off the parser's double vlan mode Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 7:59 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 7:59 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 07/13] ice: add UDP tunnels support to the parser Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 8:01 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:01 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 08/13] ice: add API for parser profile initialization Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 8:02 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:02 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 09/13] virtchnl: support raw packet in protocol header Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 8:03 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:03 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 10/13] ice: add method to disable FDIR SWAP option Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 8:04 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:04 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 11/13] ice: enable FDIR filters from raw binary patterns for VFs Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-05-31 13:18 ` [Intel-wired-lan] " Simon Horman
2024-05-31 13:18 ` Simon Horman
2024-05-31 15:47 ` [Intel-wired-lan] " Ahmed Zaki
2024-05-31 15:47 ` Ahmed Zaki
2024-05-31 18:11 ` Simon Horman [this message]
2024-05-31 18:11 ` Simon Horman
2024-07-23 8:05 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:05 ` Romanowski, Rafal
2024-06-01 0:24 ` Keller, Jacob E
2024-06-01 0:24 ` Keller, Jacob E
2024-06-01 12:06 ` [Intel-wired-lan] " Simon Horman
2024-06-01 12:06 ` Simon Horman
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 12/13] iavf: refactor add/del FDIR filters Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 8:05 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:05 ` Romanowski, Rafal
2024-05-27 18:58 ` [Intel-wired-lan] [PATCH iwl-next v2 13/13] iavf: add support for offloading tc U32 cls filters Ahmed Zaki
2024-05-27 18:58 ` Ahmed Zaki
2024-07-23 8:06 ` [Intel-wired-lan] " Romanowski, Rafal
2024-07-23 8:06 ` Romanowski, Rafal
2024-07-23 8:00 ` [Intel-wired-lan] [PATCH iwl-next v2 00/13] ice: iavf: add support for TC U32 filters on VFs Romanowski, Rafal
2024-07-23 8:00 ` Romanowski, Rafal
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=20240531181159.GD491852@kernel.org \
--to=horms@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=junfeng.guo@intel.com \
--cc=marcin.szycik@linux.intel.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.