LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2016, 02:32 PM   #1
mlugov
LQ Newbie
 
Registered: Jul 2013
Posts: 7

Rep: Reputation: Disabled
What's the exact purpose of synchronize_net function in LINUX?


Can anybody please tell me, what exactly does synchronize_net() function do in LINUX? More specifically, what's the effect of this function if I run regular traffic, or if I run traffic using a packet generator from within the driver itself (so I don't pass all the kernel network stack?

Thank you,
Mark
 
Old 05-01-2016, 10:04 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
It's a barrier operation. After returning, all packet queue operations (which are lockless rcu for performance) will be up to date with respect to operations before the call.

https://lwn.net/Articles/262464/
 
Old 05-01-2016, 11:56 AM   #3
mlugov
LQ Newbie
 
Registered: Jul 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thank you, smallpond.

Can you give more details on what exactly this function does?
More precisely, what happens if I run traffic, and in the driver some process calls this function?

Thank you,
Mark
 
Old 05-01-2016, 09:44 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Well, have you(!) read the entirety of the cited article, and did you read it (several times ...) thoroughly?

Then, did you look at the corresponding Linux source code? (For your particular architecture and distro?)

I like to use the term, "lazy synchronization," to describe this particular networking function. In high-volume, high-performance situations, "close synchronization" is expensive and often unnecessary. To the extent that it is necessary, it is often the case that just a particular process needs to "synchronize with" some subset of the packets that are passing through, so as to synchronize its activities with respect to its clientele.
 
  


Reply

Tags
drivers, kernel, netwoking, programming



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anybody explain exactly, What does synchronize_net function do? mlugov Linux - Networking 1 05-01-2016 05:08 PM
[SOLVED] What is the purpose of lib64? How does it serve it's purpose? BMan8577 Linux - Newbie 2 09-20-2011 01:39 PM
Windows Spawnl (nowait) like function in Linux... How to use Execl function? cheranj Programming 2 09-15-2011 08:01 PM
Compilation issue when Function is parameter in function call on LINUX sa20358 Linux - Software 2 07-24-2008 10:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration