doc: deprecate using MAX values as array size

Message ID 20200130142003.2645765-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series doc: deprecate using MAX values as array size |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Ferruh Yigit Jan. 30, 2020, 2:20 p.m. UTC
  Adding the deprecation notice as reminder for next ABI breakage release
(20.11).
This one time breakage is required to be able to extend enum/define
without breaking ABI.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Comments

Ferruh Yigit Feb. 21, 2020, 10:25 a.m. UTC | #1
On 1/30/2020 2:20 PM, Ferruh Yigit wrote:
> Adding the deprecation notice as reminder for next ABI breakage release
> (20.11).
> This one time breakage is required to be able to extend enum/define
> without breaking ABI.
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index dfcca87ab..99d81564a 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -38,6 +38,20 @@ Deprecation Notices
>    remove it from the externally visible ABI and allow it to be updated in the
>    future.
>  
> +* lib: will fix extending some enum/define breaking the ABI. There are multiple
> +  samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
> +  used by iterators, and arrays holding these values are sized with this
> +  ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*``
> +  value which increases the size of the array and depending on how/where the
> +  array is used this may break the ABI.
> +  ``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a new flow
> +  type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]`` array
> +  usage in following public struct hierarchy:
> +  ``rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)``.
> +  Need to identify this kind of usages and fix in 20.11, otherwise this blocks
> +  us extending existing enum/define.
> +  One solution can be using a fixed size array instead of ``.*MAX.*`` value.
> +
>  * dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been replaced
>    by a pa-va search library. This structure was earlier being used for holding
>    memory segments used by dpaa2 driver for faster pa->va translation. This
> 

Reminder of this deprecation notice.
  
Akhil Goyal Feb. 24, 2020, 6:18 a.m. UTC | #2
> 
> On 1/30/2020 2:20 PM, Ferruh Yigit wrote:
> > Adding the deprecation notice as reminder for next ABI breakage release
> > (20.11).
> > This one time breakage is required to be able to extend enum/define
> > without breaking ABI.
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> >  doc/guides/rel_notes/deprecation.rst | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> > index dfcca87ab..99d81564a 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -38,6 +38,20 @@ Deprecation Notices
> >    remove it from the externally visible ABI and allow it to be updated in the
> >    future.
> >
> > +* lib: will fix extending some enum/define breaking the ABI. There are
> multiple
> > +  samples in DPDK that enum/define terminated with a ``.*MAX.*`` value
> which is
> > +  used by iterators, and arrays holding these values are sized with this
> > +  ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*``
> > +  value which increases the size of the array and depending on how/where the
> > +  array is used this may break the ABI.
> > +  ``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a
> new flow
> > +  type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]``
> array
> > +  usage in following public struct hierarchy:
> > +  ``rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)``.
> > +  Need to identify this kind of usages and fix in 20.11, otherwise this blocks
> > +  us extending existing enum/define.
> > +  One solution can be using a fixed size array instead of ``.*MAX.*`` value.
> > +
> >  * dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been
> replaced
> >    by a pa-va search library. This structure was earlier being used for holding
> >    memory segments used by dpaa2 driver for faster pa->va translation. This
> >
> 
We admit that the issue is there and we can discuss the possible solutions for this issue.

For the deprecation notice.
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  
Andrew Rybchenko Feb. 24, 2020, 8:51 a.m. UTC | #3
On 2/21/20 1:25 PM, Ferruh Yigit wrote:
> On 1/30/2020 2:20 PM, Ferruh Yigit wrote:
>> Adding the deprecation notice as reminder for next ABI breakage release
>> (20.11).
>> This one time breakage is required to be able to extend enum/define
>> without breaking ABI.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>>  doc/guides/rel_notes/deprecation.rst | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
>> index dfcca87ab..99d81564a 100644
>> --- a/doc/guides/rel_notes/deprecation.rst
>> +++ b/doc/guides/rel_notes/deprecation.rst
>> @@ -38,6 +38,20 @@ Deprecation Notices
>>    remove it from the externally visible ABI and allow it to be updated in the
>>    future.
>>  
>> +* lib: will fix extending some enum/define breaking the ABI. There are multiple
>> +  samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
>> +  used by iterators, and arrays holding these values are sized with this
>> +  ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*``
>> +  value which increases the size of the array and depending on how/where the
>> +  array is used this may break the ABI.
>> +  ``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a new flow
>> +  type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]`` array
>> +  usage in following public struct hierarchy:
>> +  ``rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)``.
>> +  Need to identify this kind of usages and fix in 20.11, otherwise this blocks
>> +  us extending existing enum/define.
>> +  One solution can be using a fixed size array instead of ``.*MAX.*`` value.
>> +
>>  * dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been replaced
>>    by a pa-va search library. This structure was earlier being used for holding
>>    memory segments used by dpaa2 driver for faster pa->va translation. This
>>
> Reminder of this deprecation notice.

Acked-by: Andrew Rybchenko <arybchenko@oktetlabs.ru>
  
Thomas Monjalon Feb. 25, 2020, 11:03 a.m. UTC | #4
> > > Adding the deprecation notice as reminder for next ABI breakage release
> > > (20.11).
> > > This one time breakage is required to be able to extend enum/define
> > > without breaking ABI.
> > >
> > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > ---
> > > +* lib: will fix extending some enum/define breaking the ABI. There are
> > multiple
> > > +  samples in DPDK that enum/define terminated with a ``.*MAX.*`` value
> > which is
> > > +  used by iterators, and arrays holding these values are sized with this
> > > +  ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*``
> > > +  value which increases the size of the array and depending on how/where the
> > > +  array is used this may break the ABI.
> > > +  ``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a
> > new flow
> > > +  type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]``
> > array
> > > +  usage in following public struct hierarchy:
> > > +  ``rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)``.
> > > +  Need to identify this kind of usages and fix in 20.11, otherwise this blocks
> > > +  us extending existing enum/define.
> > > +  One solution can be using a fixed size array instead of ``.*MAX.*`` value.
> > 
> We admit that the issue is there and we can discuss the possible solutions for this issue.
> 
> For the deprecation notice.
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

I think we'll need a new coding style guideline to avoid shuch issue in future.
Anyway, about fixing the issue in 20.11,
Acked-by: Thomas Monjalon <thomas@monjalon.net>
  
David Marchand Feb. 25, 2020, 1:52 p.m. UTC | #5
On Thu, Jan 30, 2020 at 3:20 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> Adding the deprecation notice as reminder for next ABI breakage release
> (20.11).
> This one time breakage is required to be able to extend enum/define
> without breaking ABI.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index dfcca87ab..99d81564a 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -38,6 +38,20 @@ Deprecation Notices
>    remove it from the externally visible ABI and allow it to be updated in the
>    future.
>
> +* lib: will fix extending some enum/define breaking the ABI. There are multiple
> +  samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
> +  used by iterators, and arrays holding these values are sized with this
> +  ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*``
> +  value which increases the size of the array and depending on how/where the
> +  array is used this may break the ABI.
> +  ``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a new flow
> +  type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]`` array
> +  usage in following public struct hierarchy:
> +  ``rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)``.
> +  Need to identify this kind of usages and fix in 20.11, otherwise this blocks
> +  us extending existing enum/define.
> +  One solution can be using a fixed size array instead of ``.*MAX.*`` value.
> +
>  * dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been replaced
>    by a pa-va search library. This structure was earlier being used for holding
>    memory segments used by dpaa2 driver for faster pa->va translation. This
> --
> 2.24.1
>

Acked-by: David Marchand <david.marchand@redhat.com>


--
David Marchand
  
David Marchand Feb. 25, 2020, 2:53 p.m. UTC | #6
On Thu, Jan 30, 2020 at 3:20 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> Adding the deprecation notice as reminder for next ABI breakage release
> (20.11).
> This one time breakage is required to be able to extend enum/define
> without breaking ABI.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>


Applied, thanks.
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index dfcca87ab..99d81564a 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,6 +38,20 @@  Deprecation Notices
   remove it from the externally visible ABI and allow it to be updated in the
   future.
 
+* lib: will fix extending some enum/define breaking the ABI. There are multiple
+  samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
+  used by iterators, and arrays holding these values are sized with this
+  ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*``
+  value which increases the size of the array and depending on how/where the
+  array is used this may break the ABI.
+  ``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a new flow
+  type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]`` array
+  usage in following public struct hierarchy:
+  ``rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)``.
+  Need to identify this kind of usages and fix in 20.11, otherwise this blocks
+  us extending existing enum/define.
+  One solution can be using a fixed size array instead of ``.*MAX.*`` value.
+
 * dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been replaced
   by a pa-va search library. This structure was earlier being used for holding
   memory segments used by dpaa2 driver for faster pa->va translation. This