<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core/dev.c, branch v3.11</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.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-07-18T20:05:23Z</updated>
<entry>
<title>vlan: mask vlan prio bits</title>
<updated>2013-07-18T20:05:23Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-07-18T14:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4b812dea4a236f729526facf97df1a9d18e191c'/>
<id>urn:sha1:d4b812dea4a236f729526facf97df1a9d18e191c</id>
<content type='text'>
In commit 48cc32d38a52d0b68f91a171a8d00531edc6a46e
("vlan: don't deliver frames for unknown vlans to protocols")
Florian made sure we set pkt_type to PACKET_OTHERHOST
if the vlan id is set and we could find a vlan device for this
particular id.

But we also have a problem if prio bits are set.

Steinar reported an issue on a router receiving IPv6 frames with a
vlan tag of 4000 (id 0, prio 2), and tunneled into a sit device,
because skb-&gt;vlan_tci is set.

Forwarded frame is completely corrupted : We can see (8100:4000)
being inserted in the middle of IPv6 source address :

16:48:00.780413 IP6 2001:16d8:8100:4000:ee1c:0:9d9:bc87 &gt;
9f94:4d95:2001:67c:29f4::: ICMP6, unknown icmp6 type (0), length 64
       0x0000:  0000 0029 8000 c7c3 7103 0001 a0ae e651
       0x0010:  0000 0000 ccce 0b00 0000 0000 1011 1213
       0x0020:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
       0x0030:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233

It seems we are not really ready to properly cope with this right now.

We can probably do better in future kernels :
vlan_get_ingress_priority() should be a netdev property instead of
a per vlan_dev one.

For stable kernels, lets clear vlan_tci to fix the bugs.

Reported-by: Steinar H. Gunderson &lt;sesse@google.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>gso: Update tunnel segmentation to support Tx checksum offload</title>
<updated>2013-07-11T19:18:49Z</updated>
<author>
<name>Alexander Duyck</name>
<email>alexander.h.duyck@intel.com</email>
</author>
<published>2013-07-11T00:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdbaa0bb26d8116d00be24e6b49043777b382f3a'/>
<id>urn:sha1:cdbaa0bb26d8116d00be24e6b49043777b382f3a</id>
<content type='text'>
This change makes it so that the GRE and VXLAN tunnels can make use of Tx
checksum offload support provided by some drivers via the hw_enc_features.
Without this fix enabling GSO means sacrificing Tx checksum offload and
this actually leads to a performance regression as shown below:

            Utilization
            Send
Throughput  local         GSO
10^6bits/s  % S           state
  6276.51   8.39          enabled
  7123.52   8.42          disabled

To resolve this it was necessary to address two items.  First
netif_skb_features needed to be updated so that it would correctly handle
the Trans Ether Bridging protocol without impacting the need to check for
Q-in-Q tagging.  To do this it was necessary to update harmonize_features
so that it used skb_network_protocol instead of just using the outer
protocol.

Second it was necessary to update the GRE and UDP tunnel segmentation
offloads so that they would reset the encapsulation bit and inner header
offsets after the offload was complete.

As a result of this change I have seen the following results on a interface
with Tx checksum enabled for encapsulated frames:

            Utilization
            Send
Throughput  local         GSO
10^6bits/s  % S           state
  7123.52   8.42          disabled
  8321.75   5.43          enabled

v2: Instead of replacing refrence to skb-&gt;protocol with
    skb_network_protocol just replace the protocol reference in
    harmonize_features to allow for double VLAN tag checks.

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>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2013-07-03T21:55:13Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2013-07-03T21:50:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0c1072ae0242fbdffd9a0bba36e7a7033d287f9c'/>
<id>urn:sha1:0c1072ae0242fbdffd9a0bba36e7a7033d287f9c</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/freescale/fec_main.c
	drivers/net/ethernet/renesas/sh_eth.c
	net/ipv4/gre.c

The GRE conflict is between a bug fix (kfree_skb --&gt; kfree_skb_list)
and the splitting of the gre.c code into seperate files.

The FEC conflict was two sets of changes adding ethtool support code
in an "!CONFIG_M5272" CPP protected block.

Finally the sh_eth.c conflict was between one commit add bits set
in the .eesr_err_check mask whilst another commit removed the
.tx_error_check member and assignments.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()</title>
<updated>2013-07-02T22:59:18Z</updated>
<author>
<name>Isaku Yamahata</name>
<email>yamahata@valinux.co.jp</email>
</author>
<published>2013-07-02T11:30:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=06a23fe31ca3992863721f21bdb0307af93da807'/>
<id>urn:sha1:06a23fe31ca3992863721f21bdb0307af93da807</id>
<content type='text'>
The dev_forward_skb() assignment of pkt_type should be done
after the call to eth_type_trans().

ip-encapsulated packets can be handled by localhost. But skb-&gt;pkt_type
can be PACKET_OTHERHOST when packet comes via veth into ip tunnel device.
In that case, the packet is dropped by ip_rcv().
Although this example uses gretap. l2tp-eth also has same issue.
For l2tp-eth case, add dummy device for ip address and ip l2tp command.

netns A |                     root netns                      | netns B
   veth&lt;-&gt;veth=bridge=gretap &lt;-loop back-&gt; gretap=bridge=veth&lt;-&gt;veth

arp packet -&gt;
pkt_type
         BROADCAST------------&gt;ip_rcv()------------------------&gt;

                                                             &lt;- arp reply
                                                                pkt_type
                               ip_rcv()&lt;-----------------OTHERHOST
                               drop

sample operations
  ip link add tapa type gretap remote 172.17.107.4 local 172.17.107.3
  ip link add tapb type gretap remote 172.17.107.3 local 172.17.107.4
  ip link set tapa up
  ip link set tapb up
  ip address add 172.17.107.3 dev tapa
  ip address add 172.17.107.4 dev tapb
  ip route get 172.17.107.3
  &gt; local 172.17.107.3 dev lo  src 172.17.107.3
  &gt;    cache &lt;local&gt;
  ip route get 172.17.107.4
  &gt; local 172.17.107.4 dev lo  src 172.17.107.4
  &gt;    cache &lt;local&gt;
  ip link add vetha type veth peer name vetha-peer
  ip link add vethb type veth peer name vethb-peer
  brctl addbr bra
  brctl addbr brb
  brctl addif bra tapa
  brctl addif bra vetha-peer
  brctl addif brb tapb
  brctl addif brb vethb-peer
  brctl show
  &gt; bridge name     bridge id               STP enabled     interfaces
  &gt; bra             8000.6ea21e758ff1       no              tapa
  &gt;                                                         vetha-peer
  &gt; brb             8000.420020eb92d5       no              tapb
  &gt;                                                         vethb-peer
  ip link set vetha-peer up
  ip link set vethb-peer up
  ip link set bra up
  ip link set brb up
  ip netns add a
  ip netns add b
  ip link set vetha netns a
  ip link set vethb netns b
  ip netns exec a ip address add 10.0.0.3/24 dev vetha
  ip netns exec b ip address add 10.0.0.4/24 dev vethb
  ip netns exec a ip link set vetha up
  ip netns exec b ip link set vethb up
  ip netns exec a arping -I vetha 10.0.0.4
  ARPING 10.0.0.4 from 10.0.0.3 vetha
  ^CSent 2 probes (2 broadcast(s))
  Received 0 response(s)

Cc: Jason Wang &lt;jasowang@redhat.com&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Patrick McHardy &lt;kaber@trash.net&gt;
Cc: Hong Zhiguo &lt;honkiko@gmail.com&gt;
Cc: Rami Rosen &lt;ramirose@gmail.com&gt;
Cc: Tom Parkin &lt;tparkin@katalix.com&gt;
Cc: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Cc: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Cc: Jesse Gross &lt;jesse@nicira.com&gt;
Cc: dev@openvswitch.org
Signed-off-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>dev: introduce skb_scrub_packet()</title>
<updated>2013-06-28T05:29:05Z</updated>
<author>
<name>Nicolas Dichtel</name>
<email>nicolas.dichtel@6wind.com</email>
</author>
<published>2013-06-26T14:11:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=621e84d6f373dcb273ebfd772638b8e7dc3c2c48'/>
<id>urn:sha1:621e84d6f373dcb273ebfd772638b8e7dc3c2c48</id>
<content type='text'>
The goal of this new function is to perform all needed cleanup before sending
an skb into another netns.

Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix kernel deadlock with interface rename and netdev name retrieval.</title>
<updated>2013-06-26T20:42:54Z</updated>
<author>
<name>Nicolas Schichan</name>
<email>nschichan@freebox.fr</email>
</author>
<published>2013-06-26T15:23:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5dbe7c178d3f0a4634f088d9e729f1909b9ddcd1'/>
<id>urn:sha1:5dbe7c178d3f0a4634f088d9e729f1909b9ddcd1</id>
<content type='text'>
When the kernel (compiled with CONFIG_PREEMPT=n) is performing the
rename of a network interface, it can end up waiting for a workqueue
to complete. If userland is able to invoke a SIOCGIFNAME ioctl or a
SO_BINDTODEVICE getsockopt in between, the kernel will deadlock due to
the fact that read_secklock_begin() will spin forever waiting for the
writer process (the one doing the interface rename) to update the
devnet_rename_seq sequence.

This patch fixes the problem by adding a helper (netdev_get_name())
and using it in the code handling the SIOCGIFNAME ioctl and
SO_BINDTODEVICE setsockopt.

The netdev_get_name() helper uses raw_seqcount_begin() to avoid
spinning forever, waiting for devnet_rename_seq-&gt;sequence to become
even. cond_resched() is used in the contended case, before retrying
the access to give the writer process a chance to finish.

The use of raw_seqcount_begin() will incur some unneeded work in the
reader process in the contended case, but this is better than
deadlocking the system.

Signed-off-by: Nicolas Schichan &lt;nschichan@freebox.fr&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: allow large number of tx queues</title>
<updated>2013-06-24T06:56:55Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-06-20T08:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=60877a32bce00041528576e6b8df5abe9251fa73'/>
<id>urn:sha1:60877a32bce00041528576e6b8df5abe9251fa73</id>
<content type='text'>
netif_alloc_netdev_queues() uses kcalloc() to allocate memory
for the "struct netdev_queue *_tx" array.

For large number of tx queues, kcalloc() might fail, so this
patch does a fallback to vzalloc().

As vmalloc() adds overhead on a critical network path, add __GFP_REPEAT
to kzalloc() flags to do this fallback only when really needed.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: add napi_id and hash</title>
<updated>2013-06-11T04:22:35Z</updated>
<author>
<name>Eliezer Tamir</name>
<email>eliezer.tamir@linux.intel.com</email>
</author>
<published>2013-06-10T08:39:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af12fa6e46aa651e7b86a4c4117b562518fef184'/>
<id>urn:sha1:af12fa6e46aa651e7b86a4c4117b562518fef184</id>
<content type='text'>
Adds a napi_id and a hashing mechanism to lookup a napi by id.
This will be used by subsequent patches to implement low latency
Ethernet device polling.
Based on a code sample by Eric Dumazet.

Signed-off-by: Eliezer Tamir &lt;eliezer.tamir@linux.intel.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Tested-by: Willem de Bruijn &lt;willemb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mark netdev_create_hash __net_init</title>
<updated>2013-06-04T23:47:27Z</updated>
<author>
<name>Baruch Siach</name>
<email>baruch@tkos.co.il</email>
</author>
<published>2013-06-02T20:43:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=430f03cde2fb9596d8b562824471e298a8080df9'/>
<id>urn:sha1:430f03cde2fb9596d8b562824471e298a8080df9</id>
<content type='text'>
netdev_create_hash() is only called from netdev_init() which is marked
__net_init.

Signed-off-by: Baruch Siach &lt;baruch@tkos.co.il&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Correct comparisons and calculations using skb-&gt;tail and skb-transport_header</title>
<updated>2013-05-29T06:49:07Z</updated>
<author>
<name>Simon Horman</name>
<email>horms@verge.net.au</email>
</author>
<published>2013-05-28T20:34:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ced14f6804a979d1972415bc23f2f8ddb18595dd'/>
<id>urn:sha1:ced14f6804a979d1972415bc23f2f8ddb18595dd</id>
<content type='text'>
This corrects an regression introduced by "net: Use 16bits for *_headers
fields of struct skbuff" when NET_SKBUFF_DATA_USES_OFFSET is not set. In
that case skb-&gt;tail will be a pointer whereas skb-&gt;transport_header
will be an offset from head. This is corrected by using wrappers that
ensure that comparisons and calculations are always made using pointers.

Signed-off-by: Simon Horman &lt;horms@verge.net.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
