Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp549307lqh; Tue, 7 May 2024 07:13:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXaBoFguZ0VH6S6ao5TevonAl2ngCrIzYFb61pc3omy4cUzCSgHeQV5SGqvvdiM+bahTWWXyWlFYKnp37el19wezPuC37BZKLO5GjSskg== X-Google-Smtp-Source: AGHT+IFicXErRR9RMZFgXCN2B11wjjqYD4FasbhYka7YqUvpoNfde4toXA6wA60CFCz9N2iCW4Dk X-Received: by 2002:a05:6870:6393:b0:23c:3b00:ac8e with SMTP id t19-20020a056870639300b0023c3b00ac8emr15657762oap.17.1715091182215; Tue, 07 May 2024 07:13:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715091182; cv=pass; d=google.com; s=arc-20160816; b=iJQNGAtvaRB0JTZX5wxqcRFrR4ZcC/ZmdV4vrX6JbwWPOSMhkkVDYFaxlgvvvYvOGK d70WTORVQDCILAjT59FoLqbqP2A+cr072b4jWT3/z5JzwPJeY8U7/mAx3Mt9PzFvmXNz SqCxYW9QmsbVH6ZfR0E9VuPF+ud+s2K2rmKfVxnnGsUYewkAjsasHgvhD+ioy9k2hXtL ZW2VuDnPnaklBqhVAokHKRHGWR3fGF3wZCArWqPafzCUOlqB6ASnxuu53WdkUNQQ3prq /8DtiEctbR79XgS03kLCf654VrUMtabeMBovvrxyhXa80C2kBbBio8zPHt+MIERhajLV 9COg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ulfnp13Rg5Ky1izIdOx9P6yHmj/ZnZTB/OdGpfvHRTs=; fh=mENY5E4eClWonIkCOtlFWWTx/Dt7WFkfxCrepuo/4GQ=; b=D5m838yRwn9rVUu/kPj6xYfMYDrMEB5JgVpC9RzvqwjELOFvGcFk9Z5frvKlBcByhv hVZ/OrJv8Rs+JZsjpJdWZOjoSzDmZm6YioT4yeOJ6NObWPA9OwwjbECY+V6XrE+UpXXD F1X5HrsOIiiSlsSBpfDe2xtmHtJXGocMJrdkqnyZ532Vgpcgr2Wn7JAElktlxxhxVZ1B ndB1LX4fQIa4829h9zAiscli3Y7ArL6fKyvgTbhv00TBB2az0E88oSmUbohbaDR0267Q IJ5xcoZvdqDkVviWeMChbv0EbwtC9LV6aDXDXocKtL3iHDv0CPZ8CUFmvINgNCEvo9T4 FrgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-171462-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id gi11-20020a0568703b8b00b0023b6d5744a4si4339372oab.127.2024.05.07.07.13.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:13:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171462-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-171462-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 01BE128A210 for ; Tue, 7 May 2024 13:50:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5F1215E815; Tue, 7 May 2024 13:49:55 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB54315749D; Tue, 7 May 2024 13:49:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715089795; cv=none; b=ifchRMQu5CedrApJnRepc+uTnyg1L1d9oMcCRZ/Cu+TbGLv6pTFy9rjH5csapqiaK4qVMZvBh+Ks2hqNOfpZFyY/5Z2Jd3nyEg2IqIY571SjMZQhWAe6kroGrHgiwkL8ueh3FomnbF1N7HOdv2RHP41EmHCOd+GRvEeaTWDtR+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715089795; c=relaxed/simple; bh=sYZVrFOLnaPgey3bb50mHMi7huCis2BVqgXKX2/nz8Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Kww84ymKToZIa4+oCshqhnx1LqprHIYx0iCJq20zMigq2XWN/JaOIPQCIs+7y198e92Vv6Eo3A0wvzOCYA6xl2iiihEX08nz9r5UexeIk+CRkkc4AXxHRhco5qIGf2RfSnglnxka6Cv/iXHyfjgm+Oi2jr3LpWnaI5fjt+ess1k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VYfhm6KYrzNwHs; Tue, 7 May 2024 21:47:04 +0800 (CST) Received: from kwepemm600007.china.huawei.com (unknown [7.193.23.208]) by mail.maildlp.com (Postfix) with ESMTPS id A1BF3180A9C; Tue, 7 May 2024 21:49:50 +0800 (CST) Received: from localhost.localdomain (10.90.30.45) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 7 May 2024 21:49:49 +0800 From: Jijie Shao To: , , , , , , , CC: , , , , , , Subject: [PATCH V3 net 2/7] net: hns3: direct return when receive a unknown mailbox message Date: Tue, 7 May 2024 21:42:19 +0800 Message-ID: <20240507134224.2646246-3-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240507134224.2646246-1-shaojijie@huawei.com> References: <20240507134224.2646246-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600007.china.huawei.com (7.193.23.208) From: Jian Shen Currently, the driver didn't return when receive a unknown mailbox message, and continue checking whether need to generate a response. It's unnecessary and may be incorrect. Fixes: bb5790b71bad ("net: hns3: refactor mailbox response scheme between PF and VF") Signed-off-by: Jian Shen Signed-off-by: Jijie Shao Reviewed-by: Simon Horman --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index d4a0e0be7a72..59c863306657 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -1077,12 +1077,13 @@ static void hclge_mbx_request_handling(struct hclge_mbx_ops_param *param) hdev = param->vport->back; cmd_func = hclge_mbx_ops_list[param->req->msg.code]; - if (cmd_func) - ret = cmd_func(param); - else + if (!cmd_func) { dev_err(&hdev->pdev->dev, "un-supported mailbox message, code = %u\n", param->req->msg.code); + return; + } + ret = cmd_func(param); /* PF driver should not reply IMP */ if (hnae3_get_bit(param->req->mbx_need_resp, HCLGE_MBX_NEED_RESP_B) && -- 2.30.0