<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core/dev_addr_lists.c, branch v3.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-06-02T17:40:54Z</updated>
<entry>
<title>net: Add support for device specific address syncing</title>
<updated>2014-06-02T17:40:54Z</updated>
<author>
<name>Alexander Duyck</name>
<email>alexander.h.duyck@intel.com</email>
</author>
<published>2014-05-29T01:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=670e5b8eaf85704742bc3cb1df51fdd3ce08fc15'/>
<id>urn:sha1:670e5b8eaf85704742bc3cb1df51fdd3ce08fc15</id>
<content type='text'>
This change provides a function to be used in order to break the
ndo_set_rx_mode call into a set of address add and remove calls.  The code
is based on the implementation of dev_uc_sync/dev_mc_sync.  Since they
essentially do the same thing but with only one dev I simply named my
functions __dev_uc_sync/__dev_mc_sync.

I also implemented an unsync version of the functions as well to allow for
cleanup on close.

Signed-off-by: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Correctly sync addresses from multiple sources to single device</title>
<updated>2014-01-23T21:06:34Z</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2014-01-22T17:54:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ef7b8a23a2022915a7e1ac1a7b847ded7d977b1'/>
<id>urn:sha1:6ef7b8a23a2022915a7e1ac1a7b847ded7d977b1</id>
<content type='text'>
When we have multiple devices attempting to sync the same address
to a single destination, each device should be permitted to sync
it once.  To accomplish this, pass the 'sync_cnt' of the source
address when adding the addresss to the lower device.  'sync_cnt'
tracks how many time a given address has been succefully synced.
This way, we know that if the 'sync_cnt' passed in is 0, we should
sync this address.

Also, turn 'synced' member back into the counter as was originally
done in
   commit 4543fbefe6e06a9e40d9f2b28d688393a299f079.
   net: count hw_addr syncs so that unsync works properly.
It tracks how many time a given address has been added via a
'sync' operation.  For every successfull 'sync' the counter is
incremented, and for ever 'unsync', the counter is decremented.
This makes sure that the address will be properly removed from
the the lower device when all the upper devices have removed it.

Reported-by: Andrey Dmitrov &lt;andrey.dmitrov@oktetlabs.ru&gt;
CC: Andrey Dmitrov &lt;andrey.dmitrov@oktetlabs.ru&gt;
CC: Alexandra N. Kossovsky &lt;Alexandra.Kossovsky@oktetlabs.ru&gt;
CC: Konstantin Ushakov &lt;Konstantin.Ushakov@oktetlabs.ru&gt;
Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: remove dead code for add/del multiple</title>
<updated>2013-12-17T20:14:04Z</updated>
<author>
<name>stephen hemminger</name>
<email>shemming@brocade.com</email>
</author>
<published>2013-12-13T20:35:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=477bb93320cec7ae74d5ccfad4f2bfa0b28fbe90'/>
<id>urn:sha1:477bb93320cec7ae74d5ccfad4f2bfa0b28fbe90</id>
<content type='text'>
These function to manipulate multiple addresses are not used anywhere
in current net-next tree. Some out of tree code maybe using these but
too bad; they should submit their code upstream..

Also, make __hw_addr_flush local since only used by dev_addr_lists.c

Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net, mc: fix the incorrect comments in two mc-related functions</title>
<updated>2013-10-29T04:19:05Z</updated>
<author>
<name>Zhi Yong Wu</name>
<email>wuzhy@linux.vnet.ibm.com</email>
</author>
<published>2013-10-28T08:15:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdfb97bc010d9e9d994eb68f2cbac3a8ada26104'/>
<id>urn:sha1:cdfb97bc010d9e9d994eb68f2cbac3a8ada26104</id>
<content type='text'>
Signed-off-by: Zhi Yong Wu &lt;wuzhy@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/core: dev_mc_sync_multiple calls wrong helper</title>
<updated>2013-05-31T23:56:56Z</updated>
<author>
<name>Jay Vosburgh</name>
<email>fubar@us.ibm.com</email>
</author>
<published>2013-05-31T11:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b190a50875b95e58ebe2b00ed3bf7f1d44961471'/>
<id>urn:sha1:b190a50875b95e58ebe2b00ed3bf7f1d44961471</id>
<content type='text'>
The dev_mc_sync_multiple function is currently calling
__hw_addr_sync, and not __hw_addr_sync_multiple.  This will result in
addresses only being synced to the first device from the set.

	Corrected by calling the _multiple variant.

Signed-off-by: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
Reviewed-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Tested-by: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/core: __hw_addr_sync_one / _multiple broken</title>
<updated>2013-05-31T23:56:56Z</updated>
<author>
<name>Jay Vosburgh</name>
<email>fubar@us.ibm.com</email>
</author>
<published>2013-05-31T11:57:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=29ca2f8fcc721517b83d0a560c47cee2dde827a6'/>
<id>urn:sha1:29ca2f8fcc721517b83d0a560c47cee2dde827a6</id>
<content type='text'>
Currently, __hw_addr_sync_one is called in a loop by
__hw_addr_sync_multiple to sync each of a "from" device's hw addresses
to a "to" device.  __hw_addr_sync_one calls __hw_addr_add_ex to attempt
to add each address.  __hw_addr_add_ex is called with global=false, and
sync=true.

	__hw_addr_add_ex checks to see if the new address matches an
address already on the list.  If so, it tests global and sync.  In this
case, sync=true, and it then checks if the address is already synced,
and if so, returns 0.

	This 0 return causes __hw_addr_sync_one to increment the sync_cnt
and refcount for the "from" list's address entry, even though the address
is already synced and has a reference and sync_cnt.  This will cause
the sync_cnt and refcount to increment without bound every time an
addresses is added to the "from" device and synced to the "to" device.

	The fix here has two parts:

	First, when __hw_addr_add_ex finds the address already exists
and is synced, return -EEXIST instead of 0.

	Second, __hw_addr_sync_one checks the error return for -EEXIST,
and if so, it (a) does not add a refcount/sync_cnt, and (b) returns 0
itself so that __hw_addr_sync_multiple will not return an error.

Signed-off-by: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
Reviewed-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Tested-by: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/core: __hw_addr_unsync_one "from" address not marked synced</title>
<updated>2013-05-31T23:56:56Z</updated>
<author>
<name>Jay Vosburgh</name>
<email>fubar@us.ibm.com</email>
</author>
<published>2013-05-31T11:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=60ba834c2fb65f2fafee47e03c258fac579d0591'/>
<id>urn:sha1:60ba834c2fb65f2fafee47e03c258fac579d0591</id>
<content type='text'>
When an address is added to a subordinate interface (the "to"
list), the address entry in the "from" list is not marked "synced" as
the entry added to the "to" list is.

	When performing the unsync operation (e.g., dev_mc_unsync),
__hw_addr_unsync_one calls __hw_addr_del_entry with the "synced"
parameter set to true for the case when the address reference is being
released from the "from" list.  This causes a test inside to fail,
with the result being that the reference count on the "from" address
is not properly decremeted and the address on the "from" list will
never be freed.

	Correct this by having __hw_addr_unsync_one call the
__hw_addr_del_entry function with the "sync" flag set to false for the
"remove from the from list" case.

Signed-off-by: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
Reviewed-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Tested-by: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/core: __hw_addr_create_ex does not initialize sync_cnt</title>
<updated>2013-05-31T23:56:56Z</updated>
<author>
<name>Jay Vosburgh</name>
<email>fubar@us.ibm.com</email>
</author>
<published>2013-05-31T11:57:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9747ba6636be8a7e8ba83a1fb231d061ca318e4f'/>
<id>urn:sha1:9747ba6636be8a7e8ba83a1fb231d061ca318e4f</id>
<content type='text'>
The sync_cnt field is not being initialized, which can result
in arbitrary values in the field.  Fixed by initializing it to zero.

Signed-off-by: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
Reviewed-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Tested-by: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: add dev_uc_sync_multiple() and dev_mc_sync_multiple() api</title>
<updated>2013-04-15T20:10:47Z</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-04-15T09:54:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4cd729b04285b7330edaf5a7080aa795d6d15ff3'/>
<id>urn:sha1:4cd729b04285b7330edaf5a7080aa795d6d15ff3</id>
<content type='text'>
The current implementation of dev_uc_sync/unsync() assumes that there is
a strict 1-to-1 relationship between the source and destination of the sync.
In other words, once an address has been synced to a destination device, it
will not be synced to any other device through the sync API.
However, there are some virtual devices that aggreate a number of lower
devices and need to sync addresses to all of them.  The current
API falls short there.

This patch introduces a new dev_uc_sync_multiple() api that can be called
in the above circumstances and allows sync to work for every invocation.

CC: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: count hw_addr syncs so that unsync works properly.</title>
<updated>2013-04-05T04:18:46Z</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2013-04-02T21:10:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4543fbefe6e06a9e40d9f2b28d688393a299f079'/>
<id>urn:sha1:4543fbefe6e06a9e40d9f2b28d688393a299f079</id>
<content type='text'>
A few drivers use dev_uc_sync/unsync to synchronize the
address lists from master down to slave/lower devices.  In
some cases (bond/team) a single address list is synched down
to multiple devices.  At the time of unsync, we have a leak
in these lower devices, because "synced" is treated as a
boolean and the address will not be unsynced for anything after
the first device/call.

Treat "synced" as a count (same as refcount) and allow all
unsync calls to work.

Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
