[Skiboot] [PATCH V6 08/21] core/pldm: Encode GetPLDMVersion response

Christophe Lombard clombard at linux.vnet.ibm.com
Thu Apr 13 18:16:04 AEST 2023



Le 13/04/2023 à 08:38, Joel Stanley a écrit :
> On Tue, 13 Sept 2022 at 10:30, Christophe Lombard
> <clombard at linux.vnet.ibm.com> wrote:
>> The GetPLDMVersion command can be used to retrieve the PLDM base
>> specification versions that the PLDM terminus supports, as well as the
>> PLDM Type specification versions supported for each PLDM Type.
>>
>> The reported version for Type 0 (PLDMbase) shall be encoded as 0xF1F1F000.
>>
>> Reviewed-by: Abhishek Singh Tomar <abhishek at linux.ibm.com>
> What happened to the format of the mail address here?
>

Certainly a bad copy/paste from my side when I created this new set of 
patches.

>
>> Signed-off-by: Christophe Lombard <clombard at linux.vnet.ibm.com>
>> ---
>>   core/pldm/pldm-responder.c | 84 ++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 84 insertions(+)
>>
>> diff --git a/core/pldm/pldm-responder.c b/core/pldm/pldm-responder.c
>> index 88545685..230b9c05 100644
>> --- a/core/pldm/pldm-responder.c
>> +++ b/core/pldm/pldm-responder.c
>> @@ -208,6 +208,7 @@ static struct pldm_cmd pldm_base_get_types = {
>>   /*
>>    * Extended error codes defined for the Base command set.
>>    */
>> +#define INVALID_TRANSFER_OPERATION_FLAG        0x80
>>   #define INVALID_PLDM_TYPE_IN_REQUEST_DATA      0x83
>>   #define INVALID_PLDM_VERSION_IN_REQUEST_DATA   0x84
>>
>> @@ -294,6 +295,88 @@ static struct pldm_cmd pldm_base_get_commands = {
>>          .handler = base_get_commands_handler,
>>   };
>>
>> +/*
>> + * GetPLDMVersion (0x03)
>> + * The GetPLDMVersion command can be used to retrieve the PLDM base
>> + * specification versions that the PLDM terminus supports, as well as
>> + * the PLDM Type specification versions supported for each PLDM Type.
>> + */
>> +static int base_get_version_handler(const struct pldm_rx_data *req)
>> +{
>> +       uint32_t tmp[2];
>> +       char response_msg[PKT_SIZE(struct pldm_get_version_resp) + sizeof(tmp)];
> This PKT_SIZE macro is unfortunately named. It's not obvious that it's
> exported by the pldm library.
>
> I went hunting as I was wondering how big the allocation would be.
> Would it be safer to use malloc?
>
> Finally, can you explain what's going on with the buffer named "tmp"
> tacked onto the end?



More information about the Skiboot mailing list