[1/1] mbuf: add extern "C" to rte_mbuf_dyn.h

Message ID 20201229194144.17824-1-ashish.sadanandan@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series [1/1] mbuf: add extern "C" to rte_mbuf_dyn.h |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Ashish Sadanandan Dec. 29, 2020, 7:41 p.m. UTC
  The header was missing the extern "C" directive which causes name
mangling of functions by C++ compilers, leading to linker errors
complaining of undefined references to these functions.

Signed-off-by: Ashish Sadanandan <ashish.sadanandan@gmail.com>
---
 lib/librte_mbuf/rte_mbuf_dyn.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Stephen Hemminger Dec. 29, 2020, 8:10 p.m. UTC | #1
On Tue, 29 Dec 2020 12:41:44 -0700
Ashish Sadanandan <ashish.sadanandan@gmail.com> wrote:

> The header was missing the extern "C" directive which causes name
> mangling of functions by C++ compilers, leading to linker errors
> complaining of undefined references to these functions.
> 
> Signed-off-by: Ashish Sadanandan <ashish.sadanandan@gmail.com>

Could you add a Fixes tag please?
  
Ashish Sadanandan Dec. 29, 2020, 8:22 p.m. UTC | #2
Hi Stephen,
Should I reference the commit that created rte_mbuf_dyn.h for the Fixes tag?

PS: this is my first time submitting a patch to DPDK, so forgive me if this
is covered in the contributing doc, but I couldn't find anything that
applied to this situation

On Tue, Dec 29, 2020 at 1:10 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Tue, 29 Dec 2020 12:41:44 -0700
> Ashish Sadanandan <ashish.sadanandan@gmail.com> wrote:
>
> > The header was missing the extern "C" directive which causes name
> > mangling of functions by C++ compilers, leading to linker errors
> > complaining of undefined references to these functions.
> >
> > Signed-off-by: Ashish Sadanandan <ashish.sadanandan@gmail.com>
>
> Could you add a Fixes tag please?
>
  
Olivier Matz Jan. 6, 2021, 1:21 p.m. UTC | #3
Hi Ashish,

On Tue, Dec 29, 2020 at 01:22:04PM -0700, Ashish Sadanandan wrote:
> Hi Stephen,
> Should I reference the commit that created rte_mbuf_dyn.h for the Fixes tag?

Yes, it should reference the patch that introduced the issue. In this case,
it should be:

  Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")

Can you please also change the title to start with "fix", for
instance like this:

  mbuf: fix inclusion from c++

You can also add "Cc: stable@dpdk.org" in the commit log.

Some documentation can be found in doc/guides/contributing/patches.rst

Thanks,
Olivier


> PS: this is my first time submitting a patch to DPDK, so forgive me if this
> is covered in the contributing doc, but I couldn't find anything that
> applied to this situation
> 
> On Tue, Dec 29, 2020 at 1:10 PM Stephen Hemminger <
> stephen@networkplumber.org> wrote:
> 
> > On Tue, 29 Dec 2020 12:41:44 -0700
> > Ashish Sadanandan <ashish.sadanandan@gmail.com> wrote:
> >
> > > The header was missing the extern "C" directive which causes name
> > > mangling of functions by C++ compilers, leading to linker errors
> > > complaining of undefined references to these functions.
> > >
> > > Signed-off-by: Ashish Sadanandan <ashish.sadanandan@gmail.com>
> >
> > Could you add a Fixes tag please?
> >
  
Ashish Sadanandan Jan. 7, 2021, 1:42 a.m. UTC | #4
Hi Olivier,

On Wed, Jan 6, 2021 at 6:21 AM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> Hi Ashish,
>
> Yes, it should reference the patch that introduced the issue. In this case,
> it should be:
>
>   Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
>
> Can you please also change the title to start with "fix", for
> instance like this:
>
>   mbuf: fix inclusion from c++
>
> You can also add "Cc: stable@dpdk.org" in the commit log.
>
> Some documentation can be found in doc/guides/contributing/patches.rst

Thanks for the pointers. I've made the changes above. However I don't
know if I'm using the message ID for --in-reply-to correctly, since I
seem to be creating a new thread each time.

Thanks,
Ashish.

>
> Thanks,
> Olivier
>
>
> > PS: this is my first time submitting a patch to DPDK, so forgive me if this
> > is covered in the contributing doc, but I couldn't find anything that
> > applied to this situation
> >
> > On Tue, Dec 29, 2020 at 1:10 PM Stephen Hemminger <
> > stephen@networkplumber.org> wrote:
> >
> > > On Tue, 29 Dec 2020 12:41:44 -0700
> > > Ashish Sadanandan <ashish.sadanandan@gmail.com> wrote:
> > >
> > > > The header was missing the extern "C" directive which causes name
> > > > mangling of functions by C++ compilers, leading to linker errors
> > > > complaining of undefined references to these functions.
> > > >
> > > > Signed-off-by: Ashish Sadanandan <ashish.sadanandan@gmail.com>
> > >
> > > Could you add a Fixes tag please?
> > >
  
David Marchand Jan. 7, 2021, 8:01 a.m. UTC | #5
On Thu, Jan 7, 2021 at 2:42 AM Ashish Sadanandan
<ashish.sadanandan@gmail.com> wrote:
>
> Hi Olivier,
>
> On Wed, Jan 6, 2021 at 6:21 AM Olivier Matz <olivier.matz@6wind.com> wrote:
> >
> > Hi Ashish,
> >
> > Yes, it should reference the patch that introduced the issue. In this case,
> > it should be:
> >
> >   Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
> >
> > Can you please also change the title to start with "fix", for
> > instance like this:
> >
> >   mbuf: fix inclusion from c++
> >
> > You can also add "Cc: stable@dpdk.org" in the commit log.
> >
> > Some documentation can be found in doc/guides/contributing/patches.rst
>
> Thanks for the pointers. I've made the changes above. However I don't
> know if I'm using the message ID for --in-reply-to correctly, since I
> seem to be creating a new thread each time.

You can get the message ID in various places.
I usually take the info from patchwork and update the previous patch
state to Superseded at the same time.

So in your case, the v1 patch was:
http://patchwork.dpdk.org/patch/85878/

Message ID: 20201229194144.17824-1-ashish.sadanandan@gmail.com

So for the v2:
git send-email --to dev@dpdk.org --cc-cmd ./devtools/get-maintainer.sh
--cc XXX --in-reply-to
'20201229194144.17824-1-ashish.sadanandan@gmail.com' v2-*.patch
  
Ashish Sadanandan Jan. 7, 2021, 5:20 p.m. UTC | #6
Hi David,

On Thu, Jan 7, 2021 at 1:02 AM David Marchand <david.marchand@redhat.com>
wrote:

> On Thu, Jan 7, 2021 at 2:42 AM Ashish Sadanandan
> <ashish.sadanandan@gmail.com> wrote:
> >
> > Hi Olivier,
> >
> > On Wed, Jan 6, 2021 at 6:21 AM Olivier Matz <olivier.matz@6wind.com>
> wrote:
> > >
> > > Hi Ashish,
> > >
> > > Yes, it should reference the patch that introduced the issue. In this
> case,
> > > it should be:
> > >
> > >   Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
> > >
> > > Can you please also change the title to start with "fix", for
> > > instance like this:
> > >
> > >   mbuf: fix inclusion from c++
> > >
> > > You can also add "Cc: stable@dpdk.org" in the commit log.
> > >
> > > Some documentation can be found in doc/guides/contributing/patches.rst
> >
> > Thanks for the pointers. I've made the changes above. However I don't
> > know if I'm using the message ID for --in-reply-to correctly, since I
> > seem to be creating a new thread each time.
>
> You can get the message ID in various places.
> I usually take the info from patchwork and update the previous patch
> state to Superseded at the same time.
>
> So in your case, the v1 patch was:
> http://patchwork.dpdk.org/patch/85878/
>
> Message ID: 20201229194144.17824-1-ashish.sadanandan@gmail.com
>
> So for the v2:
> git send-email --to dev@dpdk.org --cc-cmd ./devtools/get-maintainer.sh
> --cc XXX --in-reply-to
> '20201229194144.17824-1-ashish.sadanandan@gmail.com' v2-*.patch
>
>  This is almost the exact command I ran (except for the --cc-cmd arg since
I don't have the Linux source tree cloned). Just tried it once more, but I
think it created a new thread again! I don't get what I'm doing wrong and
am terribly sorry for the spam I've been generating.

- Ashish

>
> --
> David Marchand
>
>
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf_dyn.h b/lib/librte_mbuf/rte_mbuf_dyn.h
index d88e7ba..fc4eee7 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.h
+++ b/lib/librte_mbuf/rte_mbuf_dyn.h
@@ -67,6 +67,11 @@ 
  */
 
 #include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Maximum length of the dynamic field or flag string.
  */
@@ -326,4 +331,8 @@  int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag);
 __rte_experimental
 int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag);
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif /* _RTE_MBUF_DYN_H_ */