Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3382252rdb; Sun, 10 Dec 2023 03:37:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMM+fw2C7Cxdy4bbLojNdxl9yFXTQLFL6Cdz8eZrxTcPwC3YuBPkOEfxeN49p8pL7Z4OCY X-Received: by 2002:a05:6e02:198a:b0:35d:70f7:2f8f with SMTP id g10-20020a056e02198a00b0035d70f72f8fmr5772611ilf.13.1702208274316; Sun, 10 Dec 2023 03:37:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702208274; cv=none; d=google.com; s=arc-20160816; b=DCGB/8YQPhiALWqHtW2OCmMgwR7qn8V2F8tVNFpnWffS+1lbZ5BZAt9iMbro5xesuP 0M0nrpyFgOyqpnNFKxydoGgIoPUxbGFtwwK205KyB1+GUnF66OhayECbRxY/O1+IQ9pv IZkndexsK0s886C8VF9ule6VNC3C/uD89En7RqcfKOf24e4wMn2EXImMN9lM6PLfZS8E EbON7RS2z8LCS9FBGafG6Asj288h0AdZ/F1WUM6PICCO5bmpXTGcVbj/ayYxshXk9GOn gHjVllGUxSo08kWaBuospq5ljP+WTKfg59T4FxZ0PhjREO2JcXOoU58b+BYEIVbGTe+b EnRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UdiQmPwuDrk788d86publmYwFYB/xbbTS1S5ykt4anU=; fh=1a6KPL+cNBeTJsdunu1O6qIssNNIdIY+N8uBMF2kiDA=; b=Sr/cbsHJCNCdxh9s7F8YAy0Kaiu5HF51bwI5SdF6DtzlIuyXWQd7jhEn3ajo5gYBYB pAdYxRgOxt8P5fIierUr8NEBI3uK8D2SuWqy2HObtrcOlOXxe7+5svCBnwpox7s8lKPz IBeDRMEt8REUwpPgMg/KYXim9frH1QOUirfQKmey98TUBfGj3hcdbRbVneE/tMrRtiI/ Ix7bPm/bpo55nj4Tfi0c6mVRwlB4XwRC83PLZ1F9/HWR9fGG1x92tjHC7mBr5PpNyflh /w49vwzWTd0CrJve1jK1r9nvyIPrP9VOsyO0T/MGK2thpqyWGyVTcIgPcxyZ4LysGJgQ stKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KzqVkRhx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id r77-20020a632b50000000b005c66b0c9dd7si4439705pgr.786.2023.12.10.03.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 03:37:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KzqVkRhx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3FCEF805C3FF; Sun, 10 Dec 2023 03:37:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231948AbjLJLhd (ORCPT + 99 others); Sun, 10 Dec 2023 06:37:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjLJLhc (ORCPT ); Sun, 10 Dec 2023 06:37:32 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C22F8FE for ; Sun, 10 Dec 2023 03:37:38 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EF7DC433C8; Sun, 10 Dec 2023 11:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702208258; bh=fQuCk+8Fl3NLJUs5k6QdH8GKGyoRU1ec77I08QQKBsg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KzqVkRhxhGAAfxO3ObXGj++ChnacncyHIBrvDGjGA5UgtU2NNfDsGOngKdIpkH5mA +Oey4RgzeQEmi6WCMgDlBef2l3gJvgCtyKfn1A4Ddh+lg7saa644NaRXGHyh0gW7YR k0RzZ1vxx7mLF/SEAv70k+zPM8TSQaCMEUPbEG8AFRptPwa2u18NKo1S8AfTI3wTRA OZr4Zx02TMzOvxHohXB7cqB25HzWMCP41UsctOHdDA5ElqhkMOCqN/IEWrXpYw/VY6 KpBiWjv5P9aPqhLARX+pVbnGz1dPHwFWP+WykkGJYl0uerPl0ihj26prHUUXohFYyW mUTmGz4xFlKyA== Date: Sun, 10 Dec 2023 11:37:32 +0000 From: Simon Horman To: Shinas Rasheed Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hgani@marvell.com, vimleshk@marvell.com, egallen@redhat.com, mschmidt@redhat.com, pabeni@redhat.com, kuba@kernel.org, davem@davemloft.net, wizhao@redhat.com, kheib@redhat.com, konguyen@redhat.com, Veerasenareddy Burru , Sathesh Edara , Eric Dumazet Subject: Re: [PATCH net-next v2 1/4] octeon_ep: add PF-VF mailbox communication Message-ID: <20231210113732.GF5817@kernel.org> References: <20231209081450.2613561-1-srasheed@marvell.com> <20231209081450.2613561-2-srasheed@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231209081450.2613561-2-srasheed@marvell.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 10 Dec 2023 03:37:51 -0800 (PST) On Sat, Dec 09, 2023 at 12:14:47AM -0800, Shinas Rasheed wrote: > Implement mailbox communication between PF and VFs. > PF-VF mailbox is used for all control commands from VF to PF and > asynchronous notification messages from PF to VF. > > Signed-off-by: Shinas Rasheed ... > diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c ... > @@ -1315,6 +1335,7 @@ static void octep_device_cleanup(struct octep_device *oct) > oct->mbox[i] = NULL; > } > > + octep_delete_pfvf_mbox(oct); > octep_ctrl_net_uninit(oct); > cancel_delayed_work_sync(&oct->hb_task); > > @@ -1411,6 +1432,13 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > goto err_octep_config; > } > > + err = octep_setup_pfvf_mbox(octep_dev); > + if (err) { > + dev_err(&pdev->dev, " pfvf mailbox setup failed\n"); > + octep_ctrl_net_uninit(octep_dev); > + return err; Hi Shinas, This seems inconsistent with other error handling in this function, I suspect it is leaking resources. And even if it does not, it's likely to lead to such problems as this function is updated in future. Please consider consistently handling error unwinding using goto labels in this function. I think that means either making sure that octep_delete_pfvf_mbox() can handle the case whereby octep_setup_pfvf_mbox() fails. Or including) the steps taken by octep_device_cleanup() in the unwind ladder provided by goto labels (which could be a separate patch, and I suspect to be the best approach). But I could well be wrong. > + } > + > octep_ctrl_net_get_info(octep_dev, OCTEP_CTRL_NET_INVALID_VFID, > &octep_dev->conf->fw_info); > dev_info(&octep_dev->pdev->dev, "Heartbeat interval %u msecs Heartbeat miss count %u\n", ...