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 X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEE47C2D0E4 for ; Mon, 23 Nov 2020 23:27:58 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AAE54206B6 for ; Mon, 23 Nov 2020 23:27:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="E2vfQY7T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAE54206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4Cg3Gy2xtWzDqKM for ; Tue, 24 Nov 2020 10:27:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=os.amperecomputing.com (client-ip=40.107.237.117; helo=nam12-bn8-obe.outbound.protection.outlook.com; envelope-from=tungnguyen@os.amperecomputing.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.a=rsa-sha256 header.s=selector2 header.b=E2vfQY7T; dkim-atps=neutral Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2117.outbound.protection.outlook.com [40.107.237.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CfcvX12dKzDq7j for ; Mon, 23 Nov 2020 17:39:34 +1100 (AEDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TCOKApF9qD5KH4SVL/6jzcx+gMYH8CARar8dKdtmDgx8GFu4G2Iws0Wh0FbkHiOyLpV1sm6TSMmy86d23bx7bcp6SjVrT8IiV6zWaTkTqSwMZQ555+KhuaoSRMBQvI85f6qCyyp92cEZKMgfHGZG/LsCPsPjKkmLpqAZagYdXFuf11MIn2J9uQ60W8vbhLo+RjFVti+0B5hx0p4IM2MHCTOPwfarFzxVUJmdhAvODpdHl3+lDgDh6KJ5tCtNa8mwiTiwqRbJlX1dFjtiRRlrYe/eo0zZ1tlFVGQeNv7mZrO7zd0w8BKOIzEe39kaMeb1CLDyi0ZNKpAbjKtFwvxdAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZgGbL+g84NZIsDRlFlwskwxhnZZ0rGlTfSfCctJIIN4=; b=V0ODGY7IWm5wXVsJKBZNuOekd9q817VOAhkRAnzFR+Y8auRQfFmJ2RrPX82xnv5NaWYVe/AG0zP2pLxaZOP1WE+TYkYjkNxKAcO4zWw5BNJyYboHL49kbGOZQBCOXP9C4sTKrZetml5DoASjagXVgiaJz3PPobIN6GfaxAUKlUTC8T59RxcK4m7bwdLEoCB+0iDD1hvLfHTy/Of7OPeJYEzOzSKpD/Iep0y1NgZ5T+Ju7GaLvFwInzUvJrRKfANh5WOIa9+SirMD4s4Nxqf2jvqG70jAlIy0lnlZ8pKuTlyf6Y8EqoptRts9oKm9i6bGVr8sEvqrbn/F0bv6/sM+XA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZgGbL+g84NZIsDRlFlwskwxhnZZ0rGlTfSfCctJIIN4=; b=E2vfQY7TF2Hc7Is6l2hMdw+i1hEWJkrdrmJJ1lrIbL75Ma7lYj/GElsxleE2NYOI2vuGY47Xpjkvzfw8en+Wt1B3mrEmzgdUwMNjlS11jahlA7pKI2YXS2lcxr2uvVDs40DzXrVSZ70dTg5IYkh4d30eMk/uUvQPBRLhWPzS+KE= Received: from BL0PR01MB5156.prod.exchangelabs.com (2603:10b6:208:67::13) by BL0PR01MB4977.prod.exchangelabs.com (2603:10b6:208:63::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20; Mon, 23 Nov 2020 06:39:27 +0000 Received: from BL0PR01MB5156.prod.exchangelabs.com ([fe80::c8df:fcda:a248:704]) by BL0PR01MB5156.prod.exchangelabs.com ([fe80::c8df:fcda:a248:704%6]) with mapi id 15.20.3589.028; Mon, 23 Nov 2020 06:39:27 +0000 From: Tung Nguyen OS To: "openbmc@lists.ozlabs.org" Subject: ipmi command implementation mismatch with the design document Thread-Topic: ipmi command implementation mismatch with the design document Thread-Index: AQHWwV/O++lSF4Cq4kKpl5AQcrbAwA== Date: Mon, 23 Nov 2020 06:39:27 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.ozlabs.org; dkim=none (message not signed) header.d=none;lists.ozlabs.org; dmarc=none action=none header.from=os.amperecomputing.com; x-originating-ip: [118.69.219.201] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 864755dc-0ef4-4de5-41e2-08d88f7a862b x-ms-traffictypediagnostic: BL0PR01MB4977: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tVNUKYmhd80EuUqmFuhKMUpSyRqZVNxww5WdsnZm6IUVRPBSR5GIg5Bu/xFOzapw9O5xcM2ls5Zcp5l8T9Q1eHgrdpuun1UxexYbdROV/rbdjbqaypcro9EKS/ZxOX3eOLrWlbQwQzTs6bf0Q9oBnCWlnQHBdNypG6QMvayPkUX5Ll0ITnbccjOkVTX/CSFSJL1iEm7t8WDP4wAH8iVjAzDUIklecA3XiCiyxLDtmA45QXA8MFPdah1In4B3A6BWUOL24kDaDvUdK1NwcISxaoszF+4oMyhwTsRdMwSszhfvAyhStKKqFSs9mM6cjF/LGz0grx5kHW2YcFTcpQXUgoXUSR50OW9TlcelNe8/nggg+kbxg71IpThwo4ABFj83CI+xWL+/c8ACgZMQyWInvg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR01MB5156.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(4636009)(39840400004)(396003)(366004)(376002)(346002)(136003)(8676002)(8936002)(66946007)(9686003)(4743002)(86362001)(76116006)(6916009)(2906002)(91956017)(26005)(966005)(5660300002)(316002)(7696005)(55016002)(33656002)(71200400001)(478600001)(83380400001)(66476007)(186003)(66446008)(6506007)(64756008)(52536014)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: wJF5vx5h5zw4yY95QQWfF+AaFXGBSNXJ8eb4Eg/TSD5JNy2lv2xX/NQm0eiQ32E5OMyJIiFit60Mcn0uRVdEI3a1j7rwgzUFGKjJO5moGKHC8KK9/57hP5RsksHRtxjkc26olL7PPIj0Bqz7v6PF/ypcR6kQZV9Nvstgw2m5DptwotdJkNmNKMgcWEfrBs1mJUqcRnsBnrneoTORc9rPnZHxO7qJrlKwRbGqJm0BlScwdP3G75A8QykoeqdSpPC7wnLDpMUZn4zlh1BIEeZp32/5GS2HDma8k1nSd/abDR8Y4aOLqFGMNoYUpjP6nHmXh8QkfxKWhLGV4OLz+wtDPWctRgzhhxjHAVOsiBNroXHEopLeCr/T+T89C7XLfogS/alfy38cXhbM8jCMk+FRVRsy2fhLizrdN5Bi+KRSVlMeDj9TRMmy/9cIEe3tY48VJAwx8mXfJFS1EDorm6uJSeTrJwSnIfgxbEI1EIc5s8rXI3AlS4KWLDYzvH2Bp6YhxI2Z4G59rn6SVAYOaNbOVJrqXZQS0VkLp9TdQpn4i/hcXeY3zzrWoddTtVZME8di4TZP+J+zl9GMcd/b8z03/5kiK9jvST6gG7eXRENocKbidGkotGtFvxhUtqFQzggaQfXRbI0WoqiGGANql6Y4prCew2sYVNx6+eSGwhbgQVwALjH9lWssMz0t6nUBhnWcNueb3vb/waHGp+Yc/GqNQOYuQAWVQ2FL3a0y0+W31X460CcTypNgOiSAiOJWo+wp5MqiRJ6O3obiSH/NT/0RthjTWXWx0KHnXVir5o2jGqbvPtXTjvhajV12jkMlD19P/2YLlk206rUbe4cnMOGh5Eo9OL4ZrfBNAexlqwJCABnIiSGNYBdFIg5+wUkG4SuR0aiKkG3SdQdLk7hF7n29Sg== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_BL0PR01MB515650923510989237151B70FFFC0BL0PR01MB5156prod_" MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR01MB5156.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 864755dc-0ef4-4de5-41e2-08d88f7a862b X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2020 06:39:27.1239 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bPPHkA0cHkZ6CajkPJnSZ49sJvLWKABFqi8GMZhrvv1sEN9D8d9rlj0C4heiM70Zud5VireTL9sLeydplk0WzsREr5lMcXYO/FsBDPHOd3csvvGCgQGPv6OiX3KKZZ3R X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR01MB4977 X-Mailman-Approved-At: Tue, 24 Nov 2020 10:26:40 +1100 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" --_000_BL0PR01MB515650923510989237151B70FFFC0BL0PR01MB5156prod_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi everyone, I=92m Tung Nguyen, developer for AmpereComputing - Altra system. While work= ing with the IPMI commands I have a concern when comparing the design docum= ent and the implementation like the following: The state-management-and-external-interfaces.md The full mapping of Redfish and IPMI to xyz.openbmc_project.State.* is as f= ollows: Redfish IPMI xyz.openbmc_project.State.Trans= ition ForceOff power down Chassis.Off ForceOn power up Host.On ForceRestart hard reset Host.ForceWarmReboot GracefulRestart Host.GracefulWarmReboot GracefulShutdown soft off Host.Off On power up Host.On PowerCycle (host on) power cycle Host.Reboot PowerCycle (host off) Chassis.PowerCycle the IPMI =96 chassishandler.cpp: ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) { int rc =3D 0; switch (chassisControl) { case CMD_POWER_ON: rc =3D initiate_state_transition(State::Host::Transition::On); break; case CMD_POWER_OFF: // This path would be hit in 2 conditions. // 1: When user asks for power off using ipmi chassis command 0= x04 // 2: Host asking for power off post shutting down. // If it's a host requested power off, then need to nudge Softo= ff // application that it needs to stop the watchdog timer if runn= ing. // If it is a user requested power off, then this is not really // needed. But then we need to differentiate between user and h= ost // calling this same command // For now, we are going ahead with trying to nudge the soft of= f and // interpret the failure to do so as a non softoff case rc =3D stop_soft_off_timer(); // Only request the Off transition if the soft power off // application is not running if (rc < 0) { // First create a file to indicate to the soft off applicat= ion // that it should not run. Not doing this will result in St= ate // manager doing a default soft power off when asked for po= wer // off. indicate_no_softoff_needed(); // Now request the shutdown rc =3D initiate_state_transition(State::Host::Transition::O= ff); } else { log("Soft off is running, so let shutdown targ= et " "stop the host"); } break; The redfish =96 systems.hpp: else if (resetType =3D=3D "ForceOff") { command =3D "xyz.openbmc_project.State.Chassis.Transition.Off"; hostCommand =3D false; } Although the indicate_no_softoff_needed() can prevent the host from soft of= f, but it seems like a mismatch b/w the design document and the IPMI implem= entation. So, my question: is it reasonable for IPMI command ? Reference: https://github.com/openbmc/docs/blob/master/designs/state-management-and-ex= ternal-interfaces.md Best regards, Tung --_000_BL0PR01MB515650923510989237151B70FFFC0BL0PR01MB5156prod_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Hi everyone,<= /p>

I=92m Tung Nguyen, developer fo= r AmpereComputing - Altra system. While working with the IPMI commands I ha= ve a concern when comparing the design document and the implementation like= the following:

The state-management-and-extern= al-interfaces.md

The full mapping of Redfish and IPMI to xyz.op= enbmc_project.State.* is as follows:

Redfish      &nb= sp;          IPMI  &= nbsp;            &nb= sp;xyz.openbmc_project.State.Transition

 

ForceOff   =              power down          = Chassis.Off

ForceOn      &nb= sp;          power up &nb= sp;          Host.On

ForceRestart     &nbs= p;      hard reset     &n= bsp;    Host.ForceWarmReboot

GracefulRestart     &= nbsp;            &nb= sp;          Host.Gracefu= lWarmReboot

GracefulShutdown     =    soft off         =    Host.Off

On       &n= bsp;            = ;  power up          = ;  Host.On

PowerCycle (host on)    power c= ycle         Host.Reboot=

PowerCycle (host off)    &= nbsp;           &nbs= p;      Chassis.PowerCycle

 

the IPMI =96 chassishandler.cpp= :

ipmi::R= spType<> ipmiChassisControl(uint8_t chassisControl)=

{

    int rc =3D 0;

    switch= (chassisControl)

    {

        case CMD_POWER_ON:

            rc =3D initiate_state_transi= tion(State::Host::Transition::On);

            break<= /span>;

        case CMD_POWER_OFF<= span class=3D"s3">:

            // This path would be hit in= 2 conditions.

            // 1: When user asks for pow= er off using ipmi chassis command 0x04

            // 2: Host asking for power = off post shutting down.

 

            // If it's a host requested = power off, then need to nudge Softoff

            // application that it needs= to stop the watchdog timer if running.

            // If it is a user requested= power off, then this is not really

            // needed. But then we need = to differentiate between user and host

            // calling this same command=

 

            // For now, we are going ahe= ad with trying to nudge the soft off and

            // interpret the failure to = do so as a non softoff case

            rc =3D stop_soft_off_timer()= ;

 

            // Only request the Off tran= sition if the soft power off

            // application is not runnin= g

            if (rc < 0)

            {

              &n= bsp; // First create a file to in= dicate to the soft off application

              &n= bsp; // that it should not run. N= ot doing this will result in State

              &n= bsp; // manager doing a default s= oft power off when asked for power

                // off.

                indicate_no_softoff_needed()= ;

 

              &n= bsp; // Now request the shutdown<= o:p>

                rc =3D initiate_state_transi= tion(State::Host::Transition::Off);

            }

            else

            {

              &n= bsp; log<level::INFO>(<= span style=3D"font-size:10.0pt">"Soft off is running, so let shutdown target "

                 &= nbsp;               "sto= p the host");

            }

            break<= /span>;

 

The redfish =96 systems.hpp:

        else if (resetType =3D=3D "ForceOff")

        {

            command =3D "xyz.openbmc_project.State.Chassis.Transition.Off";

            hostCommand =3D false;

        }

 

 

Although the indicate_no_softof= f_needed() can prevent the host from soft off, but it = seems like a mismatch b/w the design document and the IPMI implementation.<= o:p>

So, my question: is it reasonable for = IPMI command ?

 

Reference:

https://github.com/openbmc/docs= /blob/master/designs/state-management-and-external-interfaces.md=

 

Best regards,=

Tung

--_000_BL0PR01MB515650923510989237151B70FFFC0BL0PR01MB5156prod_--