From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 92217740034 for ; Mon, 16 Oct 2023 13:18:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=TwwKEzjtZ7T7i/PQhEqEOz8UtTRVw4HvgNU93Myi2VE=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1697462309; v=1; b=qM/xG3vUWpa0Jc1GrbEJ5/7SOBwsihDcQ6ERzqpziEWQ18gR3Yc37vUUk4H0T31DfvxwBgg4 wk+0k7872mH9t++uRPZwVUvyxr4t3Qhqqlo052nJ5dGi8Zrs3yrVDh2XLFRsINSPERJ+t9Qxgfk EbRFMNsiZjS41z8d154AiqA8= X-Received: by 127.0.0.2 with SMTP id 8IocYY7687511xlXYKV48LZC; Mon, 16 Oct 2023 06:18:29 -0700 X-Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mx.groups.io with SMTP id smtpd.web11.123864.1697462307195172484 for ; Mon, 16 Oct 2023 06:18:27 -0700 X-Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2b9d07a8d84so53699481fa.3 for ; Mon, 16 Oct 2023 06:18:26 -0700 (PDT) X-Gm-Message-State: EGabceoSlqUNH8YZyp44S0wzx7686176AA= X-Google-Smtp-Source: AGHT+IFyHVQyqa/H9WFBICUy2WwmRkNXe2xcpQ/4qVgQ8HriZt0wnH1VquJLPHMXyJyWVtD1MGKokQ== X-Received: by 2002:a05:651c:a12:b0:2c5:169f:ff03 with SMTP id k18-20020a05651c0a1200b002c5169fff03mr5630663ljq.5.1697462305090; Mon, 16 Oct 2023 06:18:25 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id 9-20020a2e1449000000b002ba586d27a2sm1362545lju.26.2023.10.16.06.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:18:24 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: abner.chang@amd.com, isaac.w.oram@intel.com, AbdulLateef.Attar@amd.com, nicklew@nvidia.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH edk2-platforms 08/10] ManageabilityPkg: Don't check MCTP header fields if transfer has failed Date: Mon, 16 Oct 2023 16:18:14 +0300 Message-Id: <20231016131816.6634-9-aladyshev22@gmail.com> In-Reply-To: <20231016131816.6634-1-aladyshev22@gmail.com> References: <20231016131816.6634-1-aladyshev22@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,aladyshev22@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="qM/xG3vU"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io If MCTP KCS communication has failed we need to abort MCTP transfer function before checking any MCTP header data. Signed-off-by: Konstantin Aladyshev --- .../MctpProtocol/Common/MctpProtocolCommon.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpPr= otocolCommon.c b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/Mc= tpProtocolCommon.c index 3128aadd15..4aae4fcba9 100644 --- a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolC= ommon.c +++ b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolC= ommon.c @@ -461,6 +461,13 @@ CommonMctpSubmitMessage ( &TransferToken=0D );=0D =0D + *AdditionalTransferError =3D TransferToken.TransportAdditionalStatus;=0D + Status =3D TransferToken.TransferStatus;=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a: Failed to send MCTP command over %s: %r\n", = __func__, mTransportName, Status));=0D + return Status;=0D + }=0D +=0D MctpTransportResponseHeader =3D (MCTP_TRANSPORT_HEADER *)ResponseBuffer;= =0D if (MctpTransportResponseHeader->Bits.HeaderVersion !=3D MCTP_KCS_HEADER= _VERSION) {=0D DEBUG ((=0D @@ -543,18 +550,9 @@ CommonMctpSubmitMessage ( return EFI_DEVICE_ERROR;=0D }=0D =0D - //=0D - // Return transfer status.=0D - //=0D - *AdditionalTransferError =3D TransferToken.TransportAdditionalStatus;=0D *ResponseDataSize =3D TransferToken.ReceivePackage.ReceiveSizeInB= yte - sizeof (MCTP_TRANSPORT_HEADER) - sizeof (MCTP_MESSAGE_HEADER);=0D CopyMem (ResponseData, ResponseBuffer + sizeof (MCTP_TRANSPORT_HEADER) += sizeof (MCTP_MESSAGE_HEADER), *ResponseDataSize);=0D FreePool (ResponseBuffer);=0D - Status =3D TransferToken.TransferStatus;=0D - if (EFI_ERROR (Status)) {=0D - DEBUG ((DEBUG_ERROR, "%a: Failed to send MCTP command over %s: %r\n", = __func__, mTransportName, Status));=0D - return Status;=0D - }=0D =0D return Status;=0D }=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109641): https://edk2.groups.io/g/devel/message/109641 Mute This Topic: https://groups.io/mt/101994946/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-