<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/net/ipvlan/ipvlan.h, branch v4.11.5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.11.5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.11.5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-02-12T01:59:41+00:00</updated>
<entry>
<title>ipvtap: IP-VLAN based tap driver</title>
<updated>2017-02-12T01:59:41+00:00</updated>
<author>
<name>Sainath Grandhi</name>
<email>sainath.grandhi@intel.com</email>
</author>
<published>2017-02-11T00:03:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=235a9d89da976e2975b3de9afc0bed7b72557983'/>
<id>urn:sha1:235a9d89da976e2975b3de9afc0bed7b72557983</id>
<content type='text'>
This patch adds a tap character device driver that is based on the
IP-VLAN network interface, called ipvtap. An ipvtap device can be created
in the same way as an ipvlan device, using 'type ipvtap', and then accessed
using the tap user space interface.

Signed-off-by: Sainath Grandhi &lt;sainath.grandhi@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: improvise dev_id generation logic in IPvlan</title>
<updated>2017-01-11T01:47:12+00:00</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2017-01-09T23:05:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=da36e13cf653541e385a8d2ec2637fff6ea3461a'/>
<id>urn:sha1:da36e13cf653541e385a8d2ec2637fff6ea3461a</id>
<content type='text'>
The patch 009146d117b ("ipvlan: assign unique dev-id for each slave
device.") used ida_simple_get() to generate dev_ids assigned to the
slave devices. However (Eric has pointed out that) there is a shortcoming
with that approach as it always uses the first available ID. This
becomes a problem when a slave gets deleted and a new slave gets added.
The ID gets reassigned causing the new slave to get the same link-local
address. This side-effect is undesirable.

This patch adds a per-port variable that keeps track of the IDs
assigned and used as the stat-base for the IDR api. This base will be
wrapped around when it reaches the MAX (0xFFFE) value possibly on a
busy system where slaves are added and deleted routinely.

Fixes: 009146d117b ("ipvlan: assign unique dev-id for each slave device.")
Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
CC: Eric Dumazet &lt;edumazet@google.com&gt;
CC: David Miller &lt;davem@davemloft.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: assign unique dev-id for each slave device.</title>
<updated>2017-01-04T18:30:42+00:00</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2017-01-03T20:47:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=009146d117b9b816193fce0f1ed75f015a398721'/>
<id>urn:sha1:009146d117b9b816193fce0f1ed75f015a398721</id>
<content type='text'>
IPvlan setup uses one mac-address (of master). The IPv6 link-local
addresses are derived using the mac-address on the link. Lack of
dev-ids makes these link-local addresses same for all slaves including
that of master device. dev-ids are necessary to add differentiation
when L2 address is shared.

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: fix multicast processing</title>
<updated>2016-12-23T22:53:47+00:00</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-12-22T01:30:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e252536068efd1578c6e23e7323527c5e6e980bd'/>
<id>urn:sha1:e252536068efd1578c6e23e7323527c5e6e980bd</id>
<content type='text'>
In an IPvlan setup when master is set in loopback mode e.g.

  ethtool -K eth0 set loopback on

  where eth0 is master device for IPvlan setup.

The failure is caused by the faulty logic that determines if the
packet is from TX-path vs. RX-path by just looking at the mac-
addresses on the packet while processing multicast packets.

In the loopback-mode where this crash was happening, the packets
that are sent out are reflected by the NIC and are processed on
the RX path, but mac-address check tricks into thinking this
packet is from TX path and falsely uses dev_forward_skb() to pass
packets to the slave (virtual) devices.

This patch records the path while queueing packets and eliminates
logic of looking at mac-addresses for the same decision.

------------[ cut here ]------------
kernel BUG at include/linux/skbuff.h:1737!
Call Trace:
 [&lt;ffffffff921fbbc2&gt;] dev_forward_skb+0x92/0xd0
 [&lt;ffffffffc031ac65&gt;] ipvlan_process_multicast+0x395/0x4c0 [ipvlan]
 [&lt;ffffffffc031a9a7&gt;] ? ipvlan_process_multicast+0xd7/0x4c0 [ipvlan]
 [&lt;ffffffff91cdfea7&gt;] ? process_one_work+0x147/0x660
 [&lt;ffffffff91cdff09&gt;] process_one_work+0x1a9/0x660
 [&lt;ffffffff91cdfea7&gt;] ? process_one_work+0x147/0x660
 [&lt;ffffffff91ce086d&gt;] worker_thread+0x11d/0x360
 [&lt;ffffffff91ce0750&gt;] ? rescuer_thread+0x350/0x350
 [&lt;ffffffff91ce960b&gt;] kthread+0xdb/0xe0
 [&lt;ffffffff91c05c70&gt;] ? _raw_spin_unlock_irq+0x30/0x50
 [&lt;ffffffff91ce9530&gt;] ? flush_kthread_worker+0xc0/0xc0
 [&lt;ffffffff92348b7a&gt;] ret_from_fork+0x9a/0xd0
 [&lt;ffffffff91ce9530&gt;] ? flush_kthread_worker+0xc0/0xc0

Fixes: ba35f8588f47 ("ipvlan: Defer multicast / broadcast processing to a work-queue")
Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
CC: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>driver: ipvlan: Free ipvl_port directly with kfree instead of kfree_rcu</title>
<updated>2016-12-07T18:21:21+00:00</updated>
<author>
<name>Gao Feng</name>
<email>fgao@ikuai8.com</email>
</author>
<published>2016-12-07T00:44:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48140a210b450db229cc9dd927480f65537dc7eb'/>
<id>urn:sha1:48140a210b450db229cc9dd927480f65537dc7eb</id>
<content type='text'>
There are two functions which would free the ipvl_port now. The first
is ipvlan_port_create. It frees the ipvl_port in the error handler,
so it could kfree it directly. The second is ipvlan_port_destroy. It
invokes netdev_rx_handler_unregister which enforces one grace period
by synchronize_net firstly, so it also could kfree the ipvl_port
directly and safely.

So it is unnecessary to use kfree_rcu to free ipvl_port.

Signed-off-by: Gao Feng &lt;fgao@ikuai8.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>driver: ipvlan: Remove useless member mtu_adj of struct ipvl_dev</title>
<updated>2016-11-30T20:01:32+00:00</updated>
<author>
<name>Gao Feng</name>
<email>fgao@ikuai8.com</email>
</author>
<published>2016-11-30T00:48:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8f679ed88f8860206edddff725e2749b4cdbb0e8'/>
<id>urn:sha1:8f679ed88f8860206edddff725e2749b4cdbb0e8</id>
<content type='text'>
The mtu_adj is initialized to zero when alloc mem, there is no any
assignment to mtu_adj. It is only used in ipvlan_adjust_mtu as one
right value.
So it is useless member of struct ipvl_dev, then remove it.

Signed-off-by: Gao Feng &lt;fgao@ikuai8.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: Introduce l3s mode</title>
<updated>2016-09-19T05:25:22+00:00</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-09-16T19:59:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4fbae7d83c98c30efcf0a2a2ac55fbb75ef5a1a5'/>
<id>urn:sha1:4fbae7d83c98c30efcf0a2a2ac55fbb75ef5a1a5</id>
<content type='text'>
In a typical IPvlan L3 setup where master is in default-ns and
each slave is into different (slave) ns. In this setup egress
packet processing for traffic originating from slave-ns will
hit all NF_HOOKs in slave-ns as well as default-ns. However same
is not true for ingress processing. All these NF_HOOKs are
hit only in the slave-ns skipping them in the default-ns.
IPvlan in L3 mode is restrictive and if admins want to deploy
iptables rules in default-ns, this asymmetric data path makes it
impossible to do so.

This patch makes use of the l3_rcv() (added as part of l3mdev
enhancements) to perform input route lookup on RX packets without
changing the skb-&gt;dev and then uses nf_hook at NF_INET_LOCAL_IN
to change the skb-&gt;dev just before handing over skb to L4.

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
CC: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Reviewed-by: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: misc changes</title>
<updated>2016-02-22T03:43:24+00:00</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-02-21T03:31:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ab5b7013db3cc637a8f19e00d71310e40db75bf6'/>
<id>urn:sha1:ab5b7013db3cc637a8f19e00d71310e40db75bf6</id>
<content type='text'>
1. scope correction for few functions that are used in single file.
2. Adjust variables that are used in fast-path to fit into single cacheline
3. Update rcv_frame() to skip shared check for frames coming over wire

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: mode is u16</title>
<updated>2016-02-22T03:43:24+00:00</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-02-21T03:31:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e93fbc5a15ff25d4f9fd92a13c33cd37d99a2340'/>
<id>urn:sha1:e93fbc5a15ff25d4f9fd92a13c33cd37d99a2340</id>
<content type='text'>
The mode argument was erronusly defined as u32 but it has always
been u16. Also use ipvlan_set_mode() helper to set the mode instead
of assigning directly. This should avoid future erronus assignments /
updates.

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: use rcu_deference_bh() in ipvlan_queue_xmit()</title>
<updated>2015-07-16T04:33:40+00:00</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2015-07-14T13:35:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0fba37a3af03a7e74bf9e75473729adb98da49c3'/>
<id>urn:sha1:0fba37a3af03a7e74bf9e75473729adb98da49c3</id>
<content type='text'>
In tx path rcu_read_lock_bh() is held, so we need rcu_deference_bh().
This fixes the following warning:

 ===============================
 [ INFO: suspicious RCU usage. ]
 4.1.0-rc1+ #1007 Not tainted
 -------------------------------
 drivers/net/ipvlan/ipvlan.h:106 suspicious rcu_dereference_check() usage!

 other info that might help us debug this:

 rcu_scheduler_active = 1, debug_locks = 0
 1 lock held by dhclient/1076:
  #0:  (rcu_read_lock_bh){......}, at: [&lt;ffffffff817e8d84&gt;] rcu_lock_acquire+0x0/0x26

 stack backtrace:
 CPU: 2 PID: 1076 Comm: dhclient Not tainted 4.1.0-rc1+ #1007
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  0000000000000001 ffff8800d381bac8 ffffffff81a4154f 000000003c1a3c19
  ffff8800d4d0a690 ffff8800d381baf8 ffffffff810b849f ffff880117d41148
  ffff880117d40000 ffff880117d40068 0000000000000156 ffff8800d381bb18
 Call Trace:
  [&lt;ffffffff81a4154f&gt;] dump_stack+0x4c/0x65
  [&lt;ffffffff810b849f&gt;] lockdep_rcu_suspicious+0x107/0x110
  [&lt;ffffffff8165a522&gt;] ipvlan_port_get_rcu+0x47/0x4e
  [&lt;ffffffff8165ad14&gt;] ipvlan_queue_xmit+0x35/0x450
  [&lt;ffffffff817ea45d&gt;] ? rcu_read_unlock+0x3e/0x5f
  [&lt;ffffffff810a20bf&gt;] ? local_clock+0x19/0x22
  [&lt;ffffffff810b4781&gt;] ? __lock_is_held+0x39/0x52
  [&lt;ffffffff8165b64c&gt;] ipvlan_start_xmit+0x1b/0x44
  [&lt;ffffffff817edf7f&gt;] dev_hard_start_xmit+0x2ae/0x467
  [&lt;ffffffff817ee642&gt;] __dev_queue_xmit+0x50a/0x60c
  [&lt;ffffffff817ee7a7&gt;] dev_queue_xmit_sk+0x13/0x15
  [&lt;ffffffff81997596&gt;] dev_queue_xmit+0x10/0x12
  [&lt;ffffffff8199b41c&gt;] packet_sendmsg+0xb6b/0xbdf
  [&lt;ffffffff810b5ea7&gt;] ? mark_lock+0x2e/0x226
  [&lt;ffffffff810a1fcc&gt;] ? sched_clock_cpu+0x9e/0xb7
  [&lt;ffffffff817d56f9&gt;] sock_sendmsg_nosec+0x12/0x1d
  [&lt;ffffffff817d7257&gt;] sock_sendmsg+0x29/0x2e
  [&lt;ffffffff817d72cc&gt;] sock_write_iter+0x70/0x91
  [&lt;ffffffff81199563&gt;] __vfs_write+0x7e/0xa7
  [&lt;ffffffff811996bc&gt;] vfs_write+0x92/0xe8
  [&lt;ffffffff811997d7&gt;] SyS_write+0x47/0x7e
  [&lt;ffffffff81a4d517&gt;] system_call_fastpath+0x12/0x6f

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Cc: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Acked-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
