diff mbox

[dpdk-dev] Added missing extern 'C' decls in mode4 header files

Message ID 1422362703-18868-1-git-send-email-pawelx.wodkowski@intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Wodkowski, PawelX Jan. 27, 2015, 12:45 p.m. UTC
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
---
 lib/librte_pmd_bond/rte_eth_bond_8023ad.h         |    8 ++++++++
 lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h |    8 ++++++++
 2 files changed, 16 insertions(+)

Comments

Thomas Monjalon Jan. 30, 2015, 10:20 a.m. UTC | #1
Hi Pawel,

> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
> ---
>  lib/librte_pmd_bond/rte_eth_bond_8023ad.h         |    8 ++++++++
>  lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h |    8 ++++++++

Why adding extern C in a private header file?
Wodkowski, PawelX Jan. 30, 2015, 10:56 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, January 30, 2015 11:21 AM
> To: Wodkowski, PawelX
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] Added missing extern 'C' decls in mode4 header
> files
> 
> Hi Pawel,
> 
> > Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
> > ---
> >  lib/librte_pmd_bond/rte_eth_bond_8023ad.h         |    8 ++++++++
> >  lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h |    8 ++++++++
> 
> Why adding extern C in a private header file?
> 
> --
> Thomas

To be consistent with rte_eth_bond_private.h where it is included.
Doherty, Declan Jan. 30, 2015, 11:42 a.m. UTC | #3
On 30/01/15 10:56, Wodkowski, PawelX wrote:
>> -----Original Message-----
>> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
>> Sent: Friday, January 30, 2015 11:21 AM
>> To: Wodkowski, PawelX
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] Added missing extern 'C' decls in mode4 header
>> files
>>
>> Hi Pawel,
>>
>>> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
>>> ---
>>>   lib/librte_pmd_bond/rte_eth_bond_8023ad.h         |    8 ++++++++
>>>   lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h |    8 ++++++++
>>
>> Why adding extern C in a private header file?
>>
>> --
>> Thomas
>
> To be consistent with rte_eth_bond_private.h where it is included.
>
>

We only need the decls on the public headers exported by the 
librte_pmd_bond makefile, so there is no need to modify 
rte_eth_bond_private.h as it should never be linked to directly by 
external code.
Wodkowski, PawelX Jan. 30, 2015, 12:11 p.m. UTC | #4
> -----Original Message-----
> From: Doherty, Declan
> Sent: Friday, January 30, 2015 12:42 PM
> To: Wodkowski, PawelX; Thomas Monjalon
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] Added missing extern 'C' decls in mode4 header
> files
> 
> On 30/01/15 10:56, Wodkowski, PawelX wrote:
> >> -----Original Message-----
> >> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> >> Sent: Friday, January 30, 2015 11:21 AM
> >> To: Wodkowski, PawelX
> >> Cc: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH] Added missing extern 'C' decls in mode4
> header
> >> files
> >>
> >> Hi Pawel,
> >>
> >>> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
> >>> ---
> >>>   lib/librte_pmd_bond/rte_eth_bond_8023ad.h         |    8 ++++++++
> >>>   lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h |    8 ++++++++
> >>
> >> Why adding extern C in a private header file?
> >>
> >> --
> >> Thomas
> >
> > To be consistent with rte_eth_bond_private.h where it is included.
> >
> >
> 
> We only need the decls on the public headers exported by the
> librte_pmd_bond makefile, so there is no need to modify
> rte_eth_bond_private.h as it should never be linked to directly by
> external code.

I modified rte_eth_bond_8023ad_private.h not rte_eth_bond_private.h.
In rte_eth_bond_private.h those declarations are present already.
If so those declarations should be removed from rte_eth_bond_private.h.

I can do this in v2 if you accept this.
Doherty, Declan Jan. 30, 2015, 12:15 p.m. UTC | #5
On 30/01/15 12:11, Wodkowski, PawelX wrote:
> > -----Original Message-----
> > From: Doherty, Declan
> > Sent: Friday, January 30, 2015 12:42 PM
> > To: Wodkowski, PawelX; Thomas Monjalon
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH] Added missing extern 'C' decls in mode4 header
> > files
> >
> > On 30/01/15 10:56, Wodkowski, PawelX wrote:
> >>> -----Original Message-----
> >>> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> >>> Sent: Friday, January 30, 2015 11:21 AM
> >>> To: Wodkowski, PawelX
> >>> Cc: dev@dpdk.org
> >>> Subject: Re: [dpdk-dev] [PATCH] Added missing extern 'C' decls in mode4
> > header
> >>> files
> >>>
> >>> Hi Pawel,
> >>>
> >>>> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
> >>>> ---
> >>>>    lib/librte_pmd_bond/rte_eth_bond_8023ad.h         |    8 ++++++++
> >>>>    lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h |    8 ++++++++
> >>>
> >>> Why adding extern C in a private header file?
> >>>
> >>> --
> >>> Thomas
> >>
> >> To be consistent with rte_eth_bond_private.h where it is included.
> >>
> >>
> >
> > We only need the decls on the public headers exported by the
> > librte_pmd_bond makefile, so there is no need to modify
> > rte_eth_bond_private.h as it should never be linked to directly by
> > external code.
>
> I modified rte_eth_bond_8023ad_private.h not rte_eth_bond_private.h.
> In rte_eth_bond_private.h those declarations are present already.
> If so those declarations should be removed from rte_eth_bond_private.h.
>
> I can do this in v2 if you accept this.
>
Sure, that sounds good to me.
diff mbox

Patch

diff --git a/lib/librte_pmd_bond/rte_eth_bond_8023ad.h b/lib/librte_pmd_bond/rte_eth_bond_8023ad.h
index 9adc6aa..ebd0e93 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_8023ad.h
+++ b/lib/librte_pmd_bond/rte_eth_bond_8023ad.h
@@ -36,6 +36,10 @@ 
 
 #include <rte_ether.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Actor/partner states
  */
@@ -211,4 +215,8 @@  int
 rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id,
 		struct rte_eth_bond_8023ad_slave_info *conf);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RTE_ETH_BOND_8023AD_H_ */
diff --git a/lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h b/lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h
index 8adee70..7930345 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h
+++ b/lib/librte_pmd_bond/rte_eth_bond_8023ad_private.h
@@ -42,6 +42,10 @@ 
 
 #include "rte_eth_bond_8023ad.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define BOND_MODE_8023AX_UPDATE_TIMEOUT_MS  100
 /** Maximum number of packets to one slave queued in TX ring. */
 #define BOND_MODE_8023AX_SLAVE_RX_PKTS        3
@@ -305,4 +309,8 @@  bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint8_t slave_pos);
 void
 bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RTE_ETH_BOND_8023AD_H_ */