[dpdk-dev,v3,1/6] ethdev: fix port id storage
Checks
Commit Message
port_id is now 16bits, update function parameter according.
Fixes: 4c270218aa26 ("ethdev: support security APIs")
Cc: stable@dpdk.org
Cc: declan.doherty@intel.com
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
Cc: Boris Pismenny <borisp@mellanox.com>
Cc: Aviad Yehezkel <aviadye@mellanox.com>
Cc: Radu Nicolau <radu.nicolau@intel.com>
Cc: Declan Doherty <declan.doherty@intel.com>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
17/01/2018 22:57, Ferruh Yigit:
> port_id is now 16bits, update function parameter according.
>
> Fixes: 4c270218aa26 ("ethdev: support security APIs")
> Cc: stable@dpdk.org
> Cc: declan.doherty@intel.com
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Obviously,
Acked-by: Thomas Monjalon <thomas@monjalon.net>
17/01/2018 23:09, Thomas Monjalon:
> 17/01/2018 22:57, Ferruh Yigit:
> > port_id is now 16bits, update function parameter according.
> >
> > Fixes: 4c270218aa26 ("ethdev: support security APIs")
> > Cc: stable@dpdk.org
> > Cc: declan.doherty@intel.com
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
> Obviously,
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Not so obvious actually.
It is a good fix, but an API change.
This function was not declared experimental.
It must wait 18.05.
And the function has no doxygen!
And the function was placed randomly in the middle of struct declarations!
One more proof of the poor quality of rte_security stuff.
On 1/17/2018 10:19 PM, Thomas Monjalon wrote:
> 17/01/2018 23:09, Thomas Monjalon:
>> 17/01/2018 22:57, Ferruh Yigit:
>>> port_id is now 16bits, update function parameter according.
>>>
>>> Fixes: 4c270218aa26 ("ethdev: support security APIs")
>>> Cc: stable@dpdk.org
>>> Cc: declan.doherty@intel.com
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>
>> Obviously,
>> Acked-by: Thomas Monjalon <thomas@monjalon.net>
>
> Not so obvious actually.
> It is a good fix, but an API change.
It is more like API fix.
While whole library is using 16bits for port_id, I think we shouldn't deliver
release with this specific API uses 8bits.
I am for getting this because what it does is wrong.
> This function was not declared experimental.
> It must wait 18.05.
>
> And the function has no doxygen!
There was a request to add it [1] but not received the patch yet.
[1]
https://dpdk.org/ml/archives/dev/2017-December/082824.html
> And the function was placed randomly in the middle of struct declarations!
> One more proof of the poor quality of rte_security stuff.
>
18/01/2018 11:15, Ferruh Yigit:
> On 1/17/2018 10:19 PM, Thomas Monjalon wrote:
> > 17/01/2018 23:09, Thomas Monjalon:
> >> 17/01/2018 22:57, Ferruh Yigit:
> >>> port_id is now 16bits, update function parameter according.
> >>>
> >>> Fixes: 4c270218aa26 ("ethdev: support security APIs")
> >>> Cc: stable@dpdk.org
> >>> Cc: declan.doherty@intel.com
> >>>
> >>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >>> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> >>
> >> Obviously,
> >> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> >
> > Not so obvious actually.
> > It is a good fix, but an API change.
>
> It is more like API fix.
> While whole library is using 16bits for port_id, I think we shouldn't deliver
> release with this specific API uses 8bits.
>
> I am for getting this because what it does is wrong.
>
> > This function was not declared experimental.
> > It must wait 18.05.
I really want to keep API stable in 18.02.
We have to keep this mistake for one more release.
@@ -277,7 +277,7 @@ rte_eth_dev_socket_id(uint16_t port_id)
}
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id)
+rte_eth_dev_get_sec_ctx(uint16_t port_id)
{
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL);
return rte_eth_devices[port_id].security_ctx;
@@ -1722,7 +1722,7 @@ struct rte_eth_dev {
} __rte_cache_aligned;
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+rte_eth_dev_get_sec_ctx(uint16_t port_id);
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */