service: fix parameter type
Checks
Commit Message
The type of value parameter to rte_service_attr_get
should be uint64_t *, since the attributes
are of type uint64_t.
Fixes: 4d55194d76a4 ("service: add attribute get function")
Reviewed-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---
lib/librte_eal/common/include/rte_service.h | 2 +-
lib/librte_eal/common/rte_service.c | 2 +-
test/test/test_service_cores.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
For 19.02, I assume this will require the ABI change announcement. I will
post it once this patch is acked.
Comments
> -----Original Message-----
> From: Rao, Nikhil
> Sent: Saturday, January 19, 2019 2:01 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Rao, Nikhil <nikhil.rao@intel.com>
> Subject: [PATCH] service: fix parameter type
>
> The type of value parameter to rte_service_attr_get
> should be uint64_t *, since the attributes
> are of type uint64_t.
>
> Fixes: 4d55194d76a4 ("service: add attribute get function")
>
> Reviewed-by: Gage Eads <gage.eads@intel.com>
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
> lib/librte_eal/common/include/rte_service.h | 2 +-
> lib/librte_eal/common/rte_service.c | 2 +-
> test/test/test_service_cores.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> For 19.02, I assume this will require the ABI change announcement. I will
> post it once this patch is acked.
Correct - this breaks API and ABI, so certainly will need an announce.
Thanks for the fixup, -Harry
On 1/21/2019 11:43 AM, Van Haaren, Harry wrote:
>> -----Original Message-----
>> From: Rao, Nikhil
>> Sent: Saturday, January 19, 2019 2:01 PM
>> To: Van Haaren, Harry <harry.van.haaren@intel.com>
>> Cc: dev@dpdk.org; Rao, Nikhil <nikhil.rao@intel.com>
>> Subject: [PATCH] service: fix parameter type
>>
>> The type of value parameter to rte_service_attr_get
>> should be uint64_t *, since the attributes
>> are of type uint64_t.
>>
>> Fixes: 4d55194d76a4 ("service: add attribute get function")
>>
>> Reviewed-by: Gage Eads <gage.eads@intel.com>
>> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
>
>> ---
>> lib/librte_eal/common/include/rte_service.h | 2 +-
>> lib/librte_eal/common/rte_service.c | 2 +-
>> test/test/test_service_cores.c | 2 +-
>> 3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> For 19.02, I assume this will require the ABI change announcement. I will
>> post it once this patch is acked.
>
> Correct - this breaks API and ABI, so certainly will need an announce.
Hi Nikhil P,
Can you please send a new version of this patch, that includes removing the
deprecation notice too? (Keeping the ack)
Thanks,
ferruh
>
> Thanks for the fixup, -Harry
>
@@ -372,7 +372,7 @@ int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
* -EINVAL Invalid id, attr_id or attr_value was NULL.
*/
int32_t rte_service_attr_get(uint32_t id, uint32_t attr_id,
- uint32_t *attr_value);
+ uint64_t *attr_value);
/**
* Reset all attribute values of a service.
@@ -734,7 +734,7 @@ int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
}
int32_t
-rte_service_attr_get(uint32_t id, uint32_t attr_id, uint32_t *attr_value)
+rte_service_attr_get(uint32_t id, uint32_t attr_id, uint64_t *attr_value)
{
struct rte_service_spec_impl *s;
SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL);
@@ -259,7 +259,7 @@ static int32_t dummy_mt_safe_cb(void *args)
rte_service_set_stats_enable(id, 1);
uint32_t attr_id = UINT32_MAX;
- uint32_t attr_value = 0xdead;
+ uint64_t attr_value = 0xdead;
/* check error return values */
TEST_ASSERT_EQUAL(-EINVAL, rte_service_attr_get(id, attr_id,
&attr_value),