Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting vrouter.ko to powerPC platform #83

Open
Dineshkumarparameswaran opened this issue Aug 5, 2015 · 9 comments
Open

Porting vrouter.ko to powerPC platform #83

Dineshkumarparameswaran opened this issue Aug 5, 2015 · 9 comments

Comments

@Dineshkumarparameswaran
Copy link

I am porting vrouter-agent to powerpc platform.While compiling the kernel module i am getting following warnings. While inserting the kernel module it throws the same error.

WARNING: "__sync_fetch_and_add_8" undefined
WARNING: "__sync_sub_and_fetch_8" undefined

Can anyone please comment on this

@pedro-r-marques
Copy link
Contributor

Dinesh,
The dev mailing list (http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org) would be a better way to get help... if i recall correctly _sync_fetch_and_add are symbols for atomic instructions on x86. You will have to search for the equivalents in the architecture you are using.

@srajag
Copy link
Contributor

srajag commented Aug 5, 2015

From https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html

"Not all operations are supported by all target processors. If a particular operation cannot be implemented on the target processor, a warning will be generated and a call an external function will be generated. The external function will carry the same name as the builtin, with an additional suffix `_n' where n is the size of the data type."

Looks like ppc is not supported by gcc for these atomic builtins.

@VigneshwaranRM
Copy link

Hi,

Where the definition of these two files, __sync_fetch_and_add and __sync_sub_and_fetch.. It is not present with the contrail-agent source code. If so it will in the kernel source code ??

@srajag
Copy link
Contributor

srajag commented Aug 6, 2015

Those are compiler built-ins i.e. gcc implements them.

@VigneshwaranRM
Copy link

So, we will not have any definition for this functions ??

@srajag
Copy link
Contributor

srajag commented Aug 6, 2015

yes

@VigneshwaranRM
Copy link

What I thought was, to see the definition of the function and change accordingly to support ppc.. If that is not possible, what could be the solution??

I saw in a forum like, by replacing _sync_fetch to _atomic will solve this problem, will this work ??

or any other solution you know ?? If so please help

@srajag
Copy link
Contributor

srajag commented Aug 6, 2015

You can add an ifdef for PPC and add equivalent code.

@VigneshwaranRM
Copy link

ok let me try. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants