[Skiboot] [PATCH v2 3/9] opal-msg: Enhance opal-get-msg API

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Sat May 11 21:44:30 AEST 2019


On 05/10/2019 02:17 PM, Vasant Hegde wrote:
> On 05/10/2019 12:28 PM, Jeremy Kerr wrote:
>> Hi Vasant,
>>
>>>>> -int _opal_queue_msg(enum opal_msg_type msg_type, void *data,
>>>>> -            void (*consumed)(void *data, int status),
>>>>> -            size_t num_params, const u64 *params)
>>>>> +static int __opal_queue_msg(enum opal_msg_type msg_type, void
>>>>> *data,
>>>>> +                void (*consumed)(void *data, int status),
>>>>> +                size_t params_size, const void *params_data)
>>>>
>>>> Why add the new __opal_queue_msg(), when we have _opal_queue_msg()?
>>>> Can't we just remove the "/sizeof(u64)" from the opal_queue_msg
>>>> macro
>>>> instead, and use _opal_queue_msg() for the low-level function?
>>>
>>> Yeah we can do that.. But _opal_queue_msg() is used in many places
>>> directly.
>>> So we have to change all places to pass actual size.. something like
>>> below :
>>>
>>> diff --git a/core/hmi.c b/core/hmi.c
>>> index e81328600..ab079a95a 100644
>>> --- a/core/hmi.c
>>> +++ b/core/hmi.c
>>> @@ -337,7 +337,7 @@ static int queue_hmi_event(struct OpalHMIEvent
>>> *hmi_evt, int
>>> recover, uint64_t *
>>>
>>>           /* queue up for delivery to host. */
>>>           return _opal_queue_msg(OPAL_MSG_HMI_EVT, NULL, NULL,
>>> -                               num_params, (uint64_t *)hmi_evt);
>>> +                               num_params * sizeof(u64), (uint64_t
>>> *)hmi_evt);
>>>    }
>>>
>>> To avoid these changes I created added function to pass buffer
>>> (opal_queue_msg_buf()).
>>>
>>> If you still want I can change this. Please let me know.
>>
>> I think it'd be simpler to reduce the number of functions here,
>> especially as the difference between them is so subtle.
>>
>> But as you say, it's not super important.
> 
> Correct. May be I will relook into it later.

It turned out that its not too big changes. I have fixed 
opal_queue_msg/_opal_queue_msg
function in v3 and removed opal_queue_msg_buf().

-Vasant





More information about the Skiboot mailing list