[2/3] doc: announce bonding data change

Message ID 20230714081526.1277786-3-chaoyong.he@corigine.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series announce bonding macro and function change |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Chaoyong He July 14, 2023, 8:15 a.m. UTC
  In order to support inclusive naming, the data structure of bonding 8023
info need to be renamed. Do this through deprecation process now for
23.07.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 doc/guides/rel_notes/deprecation.rst      | 3 +++
 drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.h | 4 ++--
 drivers/net/bonding/rte_eth_bond_pmd.c    | 4 ++--
 4 files changed, 8 insertions(+), 5 deletions(-)
  

Comments

Ferruh Yigit July 17, 2023, 3:03 p.m. UTC | #1
On 7/14/2023 9:15 AM, Chaoyong He wrote:
> In order to support inclusive naming, the data structure of bonding 8023
> info need to be renamed. Do this through deprecation process now for
> 23.07.
> 
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> ---
>  doc/guides/rel_notes/deprecation.rst      | 3 +++
>  drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
>  drivers/net/bonding/rte_eth_bond_8023ad.h | 4 ++--
>  drivers/net/bonding/rte_eth_bond_pmd.c    | 4 ++--
>  4 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index c9477dd0da..5b16b66267 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -165,3 +165,6 @@ Deprecation Notices
>  * bonding: The macro ``RTE_ETH_DEV_BONDED_SLAVE`` will be deprecated in
>    DPDK 23.07, and removed in DPDK 23.11. The relevant code can be updated using
>    ``RTE_ETH_DEV_BONDING_MEMBER``.
> +  The data structure ``struct rte_eth_bond_8023ad_slave_info`` will be
> +  deprecated in DPDK 23.07, and removed in DPDK 23.11. The relevant code can be
> +  updated using ``struct rte_eth_bond_8023ad_member_info``.

<...>

> --- a/drivers/net/bonding/rte_eth_bond_8023ad.h
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
> @@ -141,7 +141,7 @@ struct rte_eth_bond_8023ad_conf {
>  	enum rte_bond_8023ad_agg_selection agg_selection;
>  };
>  
> -struct rte_eth_bond_8023ad_slave_info {
> +struct rte_eth_bond_8023ad_member_info {
>  	enum rte_bond_8023ad_selection selected;
>  	uint8_t actor_state;
>  	struct port_params actor;

There is no good way to deprecate struct names.

For macros it is possible to keep both old and new ones, old ones will
give warning but still continue to work, so that is just a heads up for
the user.
But above is rename and will break the application, forcing user to
update their code.
And if we will force user to update their code, this should be done on
ABI break release, v23.11.

That is why I suggest just keep the deprecation notice update, saying
that struct will be renamed in v23.11, without mentioning from
deprecating struct in this release etc..
  
Chaoyong He July 18, 2023, 1:13 a.m. UTC | #2
> On 7/14/2023 9:15 AM, Chaoyong He wrote:
> > In order to support inclusive naming, the data structure of bonding
> > 8023 info need to be renamed. Do this through deprecation process now
> > for 23.07.
> >
> > Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> > ---
> >  doc/guides/rel_notes/deprecation.rst      | 3 +++
> >  drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
> > drivers/net/bonding/rte_eth_bond_8023ad.h | 4 ++--
> >  drivers/net/bonding/rte_eth_bond_pmd.c    | 4 ++--
> >  4 files changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst
> > b/doc/guides/rel_notes/deprecation.rst
> > index c9477dd0da..5b16b66267 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -165,3 +165,6 @@ Deprecation Notices
> >  * bonding: The macro ``RTE_ETH_DEV_BONDED_SLAVE`` will be deprecated
> in
> >    DPDK 23.07, and removed in DPDK 23.11. The relevant code can be
> updated using
> >    ``RTE_ETH_DEV_BONDING_MEMBER``.
> > +  The data structure ``struct rte_eth_bond_8023ad_slave_info`` will
> > + be  deprecated in DPDK 23.07, and removed in DPDK 23.11. The
> > + relevant code can be  updated using ``struct
> rte_eth_bond_8023ad_member_info``.
> 
> <...>
> 
> > --- a/drivers/net/bonding/rte_eth_bond_8023ad.h
> > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
> > @@ -141,7 +141,7 @@ struct rte_eth_bond_8023ad_conf {
> >  	enum rte_bond_8023ad_agg_selection agg_selection;  };
> >
> > -struct rte_eth_bond_8023ad_slave_info {
> > +struct rte_eth_bond_8023ad_member_info {
> >  	enum rte_bond_8023ad_selection selected;
> >  	uint8_t actor_state;
> >  	struct port_params actor;
> 
> There is no good way to deprecate struct names.
> 
> For macros it is possible to keep both old and new ones, old ones will give
> warning but still continue to work, so that is just a heads up for the user.
> But above is rename and will break the application, forcing user to update their
> code.
> And if we will force user to update their code, this should be done on ABI
> break release, v23.11.
> 
> That is why I suggest just keep the deprecation notice update, saying that
> struct will be renamed in v23.11, without mentioning from deprecating struct
> in this release etc..

Got it. Thanks for point it out, I will revise in the v2 patch.
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index c9477dd0da..5b16b66267 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -165,3 +165,6 @@  Deprecation Notices
 * bonding: The macro ``RTE_ETH_DEV_BONDED_SLAVE`` will be deprecated in
   DPDK 23.07, and removed in DPDK 23.11. The relevant code can be updated using
   ``RTE_ETH_DEV_BONDING_MEMBER``.
+  The data structure ``struct rte_eth_bond_8023ad_slave_info`` will be
+  deprecated in DPDK 23.07, and removed in DPDK 23.11. The relevant code can be
+  updated using ``struct rte_eth_bond_8023ad_member_info``.
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 4a266bb2ca..49f22ffab1 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1518,7 +1518,7 @@  rte_eth_bond_8023ad_setup(uint16_t port_id,
 
 int
 rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
-		struct rte_eth_bond_8023ad_slave_info *info)
+		struct rte_eth_bond_8023ad_member_info *info)
 {
 	struct rte_eth_dev *bond_dev;
 	struct bond_dev_private *internals;
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h
index 7ad8d6d00b..ab6d0182a9 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.h
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
@@ -141,7 +141,7 @@  struct rte_eth_bond_8023ad_conf {
 	enum rte_bond_8023ad_agg_selection agg_selection;
 };
 
-struct rte_eth_bond_8023ad_slave_info {
+struct rte_eth_bond_8023ad_member_info {
 	enum rte_bond_8023ad_selection selected;
 	uint8_t actor_state;
 	struct port_params actor;
@@ -195,7 +195,7 @@  rte_eth_bond_8023ad_setup(uint16_t port_id,
  */
 int
 rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
-		struct rte_eth_bond_8023ad_slave_info *conf);
+		struct rte_eth_bond_8023ad_member_info *conf);
 
 #ifdef __cplusplus
 }
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 73205f78f4..0a595d427c 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3471,7 +3471,7 @@  dump_lacp_port_param(const struct port_params *params, FILE *f)
 }
 
 static void
-dump_lacp_slave(const struct rte_eth_bond_8023ad_slave_info *info, FILE *f)
+dump_lacp_slave(const struct rte_eth_bond_8023ad_member_info *info, FILE *f)
 {
 	char a_state[256] = { 0 };
 	char p_state[256] = { 0 };
@@ -3520,7 +3520,7 @@  dump_lacp_slave(const struct rte_eth_bond_8023ad_slave_info *info, FILE *f)
 static void
 dump_lacp(uint16_t port_id, FILE *f)
 {
-	struct rte_eth_bond_8023ad_slave_info slave_info;
+	struct rte_eth_bond_8023ad_member_info slave_info;
 	struct rte_eth_bond_8023ad_conf port_conf;
 	uint16_t slaves[RTE_MAX_ETHPORTS];
 	int num_active_slaves;