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 94A0A7803D1 for ; Mon, 23 Oct 2023 13:05:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=LdPRKNe1d3t/Rr/DAbRgBn4HTx0+4G78dneodK0BOHY=; 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=1698066326; v=1; b=F6Iy87o/dcnp79rQuo5LGfaQzRTQ65Qi0fFm1f2Eo9f85lBSQveyRds/YC15rqubdCCq16Jq /zN9/Og1jg/t6L0cJD9M06tto0IocXkqQIrVLZM7O7JPwgUbzneu/nuuZghknd60S8zUiOd0gOg a9xLDgjjLfn6yE7pvXQush2I= X-Received: by 127.0.0.2 with SMTP id WIiVYY7687511xhophl5S562; Mon, 23 Oct 2023 06:05:26 -0700 X-Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web11.120287.1698066323806373312 for ; Mon, 23 Oct 2023 06:05:24 -0700 X-Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2c51388ccebso48332221fa.3 for ; Mon, 23 Oct 2023 06:05:23 -0700 (PDT) X-Gm-Message-State: qP5Lac2f4mKqlw0qbbsvn2twx7686176AA= X-Google-Smtp-Source: AGHT+IEZH1E+Oq/uw83/t1vS49ccI8EpB9pLwC74ZurpW2eK2LSBLXZ7ZHbbnIh27PWoEhhstyuOKQ== X-Received: by 2002:a2e:b042:0:b0:2c0:1c32:b4df with SMTP id d2-20020a2eb042000000b002c01c32b4dfmr5769756ljl.15.1698066321706; Mon, 23 Oct 2023 06:05:21 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id r11-20020a2e994b000000b002b9e0d19644sm1550081ljj.106.2023.10.23.06.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:05:21 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: abner.chang@amd.com, AbdulLateef.Attar@amd.com, nicklew@nvidia.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH edk2-platforms v3 08/16] ManageabilityPkg: Don't check MCTP header fields if transfer has failed Date: Mon, 23 Oct 2023 16:05:03 +0300 Message-Id: <20231023130511.4521-9-aladyshev22@gmail.com> In-Reply-To: <20231023130511.4521-1-aladyshev22@gmail.com> References: <20231023130511.4521-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="F6Iy87o/"; 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 (#109916): https://edk2.groups.io/g/devel/message/109916 Mute This Topic: https://groups.io/mt/102134656/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-