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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 C0748C4332F for ; Sat, 4 Nov 2023 13:44:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 73EF882070; Sat, 4 Nov 2023 13:44:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 73EF882070 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1699105461; bh=HA9nL6VrypDjEF/dSfyFN/BiBhpQZKAOkuLquVX62as=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Tg6/I4QRX+rg7crInIryLEz/qcrCkqa5KdRgtXDH3z14ZOBFXXZTq9xpoCMvCxbKU U+EK6w1yP8kslhrJMxNCjoaw1b9H+02m4y+M6sb5pu7lwAQswHXw9vuthuDIQYXvQz zninhkxNKFetgR1IZ8xj/MDUXwt1cIW8oaD5jyfGMOapiWQUU01wfwSKzCH5pph3Hf eV85VxcOKnOukyMFbT2/sm6DnCt3pItcu9brGc47c7kO5chHnDz85Zd2isEczl8YqS STg3FFm4uipSf2rWHAR2tpDMBidac6cXCVFEmSMb4QTykkLGo9xRZ2SeO2ECvfOj9H bpU5LWHX0F7Tw== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id um3gB381vYG9; Sat, 4 Nov 2023 13:44:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 68E3382073; Sat, 4 Nov 2023 13:44:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 68E3382073 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id CEB901BF30C for ; Sat, 4 Nov 2023 13:44:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B3B8060F34 for ; Sat, 4 Nov 2023 13:44:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B3B8060F34 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3yjvOxqBfZRg for ; Sat, 4 Nov 2023 13:44:18 +0000 (UTC) Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by smtp3.osuosl.org (Postfix) with ESMTPS id AF9A860BDD for ; Sat, 4 Nov 2023 13:44:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org AF9A860BDD Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 452CACE021E; Sat, 4 Nov 2023 13:44:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFC64C433C7; Sat, 4 Nov 2023 13:44:00 +0000 (UTC) Date: Sat, 4 Nov 2023 09:43:54 -0400 From: Simon Horman To: Ivan Vecera Message-ID: <20231104134354.GD891380@kernel.org> References: <20231103204216.1072251-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231103204216.1072251-1-ivecera@redhat.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699105454; bh=Exi3Dp1tHjuY5WnbbDcF0Tl0B0MvUo53adtNSeJJKiM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KhFgqocTgMzh5//2O+R55xZID+VNPjBzSnYZ/XGKMTlO7Doys6mAyTQHVofCaS/is qnJLPB+wfjaaCN5qqpJfUL+CR5PI+UO28EQuV1Fu9bRe7jAGjkZ16abpO4iS4sadHC NrYBN5lnlwogjWRq7yw1FZK7mG11MJIGKypBYA2e7Qu57NW/2YtulryB5kqD3kyhIe BaxJ6+9OIUWKiqlYZwSawB/t4X78Qml4sVQkBdt7w7lbtYMeqeqV3xYy1JG1ntEi1b Qud8eaNS1hN2U5OtjVfS003g/lSh/V0K7vD6By6RpgdTd6hMf49x1DGl79UjrFEgjy ksEgIUwkFKwnQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=KhFgqocT Subject: Re: [Intel-wired-lan] [PATCH net] i40e: Fix adding unsupported cloud filters 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: Wojciech Drewek , Avinash Dayanand , netdev@vger.kernel.org, Jesse Brandeburg , linux-kernel@vger.kernel.org, Eric Dumazet , Tony Nguyen , intel-wired-lan@lists.osuosl.org, Jacob Keller , Jakub Kicinski , Paolo Abeni , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" + Avinash Dayanand On Fri, Nov 03, 2023 at 09:42:16PM +0100, Ivan Vecera wrote: > If a VF tries to add unsupported cloud filter through virchnl > then i40e_add_del_cloud_filter(_big_buf) returns -ENOTSUPP but > this error code is stored in 'ret' instead of 'aq_ret' that > is used as error code sent back to VF. In this scenario where > one of the mentioned functions fails the value of 'aq_ret' > is zero so the VF will incorrectly receive a 'success'. > > Use 'aq_ret' to store return value and remove 'ret' local > variable. Additionally fix the issue when filter allocation > fails, in this case no notification is sent back to the VF. > > Signed-off-by: Ivan Vecera Hi Ivan, as a fix targeted at 'net' this probably warrants a fixes tag. Perhaps the following is appropriate? Fixes: e284fc280473 ("i40e: Add and delete cloud filter") The above not withstanding, this change looks good to me. Reviewed-by: Simon Horman > --- > .../net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c > index 08d7edccfb8ddb..3f99eb19824527 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c > @@ -3844,7 +3844,7 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) > struct i40e_pf *pf = vf->pf; > struct i40e_vsi *vsi = NULL; > int aq_ret = 0; > - int i, ret; > + int i; > > if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { > aq_ret = -EINVAL; > @@ -3868,8 +3868,10 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) > } > > cfilter = kzalloc(sizeof(*cfilter), GFP_KERNEL); > - if (!cfilter) > - return -ENOMEM; > + if (!cfilter) { > + aq_ret = -ENOMEM; > + goto err_out; > + } > > /* parse destination mac address */ > for (i = 0; i < ETH_ALEN; i++) > @@ -3917,13 +3919,13 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) > > /* Adding cloud filter programmed as TC filter */ > if (tcf.dst_port) > - ret = i40e_add_del_cloud_filter_big_buf(vsi, cfilter, true); > + aq_ret = i40e_add_del_cloud_filter_big_buf(vsi, cfilter, true); > else > - ret = i40e_add_del_cloud_filter(vsi, cfilter, true); > - if (ret) { > + aq_ret = i40e_add_del_cloud_filter(vsi, cfilter, true); > + if (aq_ret) { > dev_err(&pf->pdev->dev, > "VF %d: Failed to add cloud filter, err %pe aq_err %s\n", > - vf->vf_id, ERR_PTR(ret), > + vf->vf_id, ERR_PTR(aq_ret), > i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); > goto err_free; > } > -- > 2.41.0 > > _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan