From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11D8FC25B75 for ; Fri, 31 May 2024 18:12:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8E7EA4246A; Fri, 31 May 2024 18:12:08 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ETi3vVdrioSh; Fri, 31 May 2024 18:12:07 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8D44042461 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1717179127; bh=YTeCQH8c4iSgAEch1LLSZ7JoenQRRD0qfgLROm4HE4Q=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=uD5Ixuv7cB9O9ygSO6E7kuRc1QzTWnQO8dEuzcdA2R6LnPPHiJW1rjmy8luwDmblw OD2W1L2iioq+BtR2LWmHYhFh2xflRMypwqAN84QAwcFzVvwPBUSi3x4FlRyTRTUsKx 0a8LNxOXpEiH5EqzZOIMf+hcytpHJsdRswUxI1qDAwONanXNhC2ImfX24Y+Wiq6QMb KK4PhO2IathJAdFGXRKNjGp9rn/FUmXWYj5sLUPbZpKKMa+A+HKc1J+7FW+ieaqCzZ Vl6ncbV4nXIc30+ScAbZTlCmDCU48Z7lQAkA+X9aZy2/gFj7AEdT1o2jNleZSg9uJq 8/hq9ETABEl9Q== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 8D44042461; Fri, 31 May 2024 18:12:07 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E8BB21BF36D for ; Fri, 31 May 2024 18:12:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DE134845C5 for ; Fri, 31 May 2024 18:12:05 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id CdYoGbVPE_Sk for ; Fri, 31 May 2024 18:12:05 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 1068C845BF DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1068C845BF Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1068C845BF for ; Fri, 31 May 2024 18:12:04 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7FFC262A98; Fri, 31 May 2024 18:12:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81B49C116B1; Fri, 31 May 2024 18:12:01 +0000 (UTC) Date: Fri, 31 May 2024 19:11:59 +0100 From: Simon Horman To: Ahmed Zaki Message-ID: <20240531181159.GD491852@kernel.org> References: <20240527185810.3077299-1-ahmed.zaki@intel.com> <20240527185810.3077299-12-ahmed.zaki@intel.com> <20240531131802.GG123401@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717179123; bh=2W5a4FkyIWrmZpTDIuM0HNCBwfLq0NtYDbJGbW/qSwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WkNB/UYde4Vf4gq7BXTPhxovzYDYIarLppMOLcp9q/QSxifA7WHFr0sIiqliUgEa/ X6OVdRZsBeCD4r7VLcUao9G8cCd9GO9ifbn1uzWws4yeeduNabTJuC471LZh/3tPri pilBEin7I3FpXt6EuwrBmB8hezFfuWgCN9cIj6P8u5LbksJG+mqnRg8fz2Ojmm2eLR OqPZ9OHMCqtE9e4BF41mPjLsxf/wIbrEHf2iq9UFvfKlCOdaFoAMrnjY6icuQNBSGW y/QDgLXvFl0fAoDd0G5gUbnL4rKJiwHjyJYwwICtZgRSsUOQ8nuCM5NksjAVwt9n29 yX3Dzuahiuytw== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=WkNB/UYd Subject: Re: [Intel-wired-lan] [PATCH iwl-next v2 11/13] ice: enable FDIR filters from raw binary patterns for VFs X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Junfeng Guo , netdev@vger.kernel.org, Marcin Szycik , anthony.l.nguyen@intel.com, jacob.e.keller@intel.com, intel-wired-lan@lists.osuosl.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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 > > > > > > 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 > > > Signed-off-by: Junfeng Guo > > > Co-developed-by: Ahmed Zaki > > > Signed-off-by: Ahmed Zaki > > > > ... > > > > > 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.