Patrick McHardy [Wed, 17 Apr 2013 06:47:05 +0000 (06:47 +0000)]
netlink: add flow control for memory mapped I/O
Add flow control for memory mapped RX. Since user-space usually doesn't
invoke recvmsg() when using memory mapped I/O, flow control is performed
in netlink_poll(). Dumps are allowed to continue if at least half of the
ring frames are unused.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:47:04 +0000 (06:47 +0000)]
netlink: implement memory mapped recvmsg()
Add support for mmap'ed recvmsg(). To allow the kernel to construct messages
into the mapped area, a dataless skb is allocated and the data pointer is
set to point into the ring frame. This means frames will be delivered to
userspace in order of allocation instead of order of transmission. This
usually doesn't matter since the order is either not determinable by
userspace or message creation/transmission is serialized. The only case
where this can have a visible difference is nfnetlink_queue. Userspace
can't assume mmap'ed messages have ordered IDs anymore and needs to check
this if using batched verdicts.
For non-mapped sockets, nothing changes.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:47:03 +0000 (06:47 +0000)]
netlink: implement memory mapped sendmsg()
Add support for mmap'ed sendmsg() to netlink. Since the kernel validates
received messages before processing them, the code makes sure userspace
can't modify the message contents after invoking sendmsg(). To do that
only a single mapping of the TX ring is allowed to exist and the socket
must not be shared. If either of these two conditions does not hold, it
falls back to copying.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:47:02 +0000 (06:47 +0000)]
netlink: add mmap'ed netlink helper functions
Add helper functions for looking up mmap'ed frame headers, reading and
writing their status, allocating skbs with mmap'ed data areas and a poll
function.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:47:01 +0000 (06:47 +0000)]
netlink: mmaped netlink: ring setup
Add support for mmap'ed RX and TX ring setup and teardown based on the
af_packet.c code. The following patches will use this to add the real
mmap'ed receive and transmit functionality.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:47:00 +0000 (06:47 +0000)]
netlink: add netlink_skb_set_owner_r()
For mmap'ed I/O a netlink specific skb destructor needs to be invoked
after the final kfree_skb() to clean up state. This doesn't work currently
since the skb's ownership is transfered to the receiving socket using
skb_set_owner_r(), which orphans the skb, thereby invoking the destructor
prematurely.
Since netlink doesn't account skbs to the originating socket, there's no
need to orphan the skb. Add a netlink specific skb_set_owner_r() variant
that does not orphan the skb and use a netlink specific destructor to
call sock_rfree().
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:46:59 +0000 (06:46 +0000)]
netlink: don't orphan skb in netlink_trim()
Netlink doesn't account skbs to the sending socket, so the there's no
need to orphan the skb before trimming it.
Removing the skb_orphan() call is required for mmap'ed netlink, which uses
a netlink specific skb destructor that must not be invoked before the
final freeing of the skb.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:46:58 +0000 (06:46 +0000)]
net: add function to allocate sk_buff head without data area
Add a function to allocate a sk_buff head without any data. This will
be used by memory mapped netlink to attach data from the mmaped area
to the skb.
Additionally change skb_release_all() to check whether the skb has a
data area to allow the skb destructor to clear the data pointer in case
only a head has been allocated.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:46:57 +0000 (06:46 +0000)]
netlink: rename ssk to sk in struct netlink_skb_params
Memory mapped netlink needs to store the receiving userspace socket
when sending from the kernel to userspace. Rename 'ssk' to 'sk' to
avoid confusion.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 19 Apr 2013 18:46:27 +0000 (14:46 -0400)]
Merge branch '8021ad'
Patrick McHardy says:
====================
The following patches add support for 802.1ad (provider tagging) to the
VLAN driver. The patchset consists of the following parts:
- renaming of the NET_F_HW_VLAN feature flags to indicate that they only
operate on CTAGs
- preparation for 802.1ad VLAN filtering offload by adding a proto argument
to the rx_{add,kill}_vid net_device_ops callbacks
- preparation of the VLAN code to support multiple protocols by making the
protocol used for tagging a property of the VLAN device and converting
the device lookup functions accordingly
- second step of preparation of the VLAN code by making the packet tagging
functions take a protocol argument
- introducation of 802.1ad support in the VLAN code, consisting mainly of
checking for ETH_P_8021AD in a couple of places and testing the netdevice
offload feature checks to take the protocol into account
- announcement of STAG offloading capabilities in a couple of drivers for
virtual network devices
The patchset is based on net-next.git and has been tested with single and
double tagging with and without HW acceleration (for CTAGs).
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Fri, 19 Apr 2013 02:04:32 +0000 (02:04 +0000)]
net: vlan: announce STAG offload capability in some drivers
- macvlan: propagate STAG filtering capabilities from underlying device
- ifb: announce STAG tagging support in addition to CTAG tagging support
- veth: announce STAG tagging/stripping support in addition to CTAG support
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Fri, 19 Apr 2013 02:04:31 +0000 (02:04 +0000)]
net: vlan: add 802.1ad support
Add support for 802.1ad VLAN devices. This mainly consists of checking for
ETH_P_8021AD in addition to ETH_P_8021Q in a couple of places and check
offloading capabilities based on the used protocol.
Configuration is done using "ip link":
# ip link add link eth0 eth0.1000 \
type vlan proto 802.1ad id 1000
# ip link add link eth0.1000 eth0.1000.1000 \
type vlan proto 802.1q id 1000
52:54:00:12:34:56 > 92:b1:54:28:e4:8c, ethertype 802.1Q (0x8100), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
20.1.0.2 > 20.1.0.1: ICMP echo request, id 3003, seq 8, length 64
92:b1:54:28:e4:8c > 52:54:00:12:34:56, ethertype 802.1Q-QinQ (0x88a8), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 47944, offset 0, flags [none], proto ICMP (1), length 84)
20.1.0.1 > 20.1.0.2: ICMP echo reply, id 3003, seq 8, length 64
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Fri, 19 Apr 2013 02:04:30 +0000 (02:04 +0000)]
net: vlan: add protocol argument to packet tagging functions
Add a protocol argument to the VLAN packet tagging functions. In case of HW
tagging, we need that protocol available in the ndo_start_xmit functions,
so it is stored in a new field in the skb. The new field fits into a hole
(on 64 bit) and doesn't increase the sks's size.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Fri, 19 Apr 2013 02:04:28 +0000 (02:04 +0000)]
net: vlan: prepare for 802.1ad VLAN filtering offload
Change the rx_{add,kill}_vid callbacks to take a protocol argument in
preparation of 802.1ad support. The protocol argument used so far is
always htons(ETH_P_8021Q).
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Fri, 19 Apr 2013 02:04:27 +0000 (02:04 +0000)]
net: vlan: rename NETIF_F_HW_VLAN_* feature flags to NETIF_F_HW_VLAN_CTAG_*
Rename the hardware VLAN acceleration features to include "CTAG" to indicate
that they only support CTAGs. Follow up patches will introduce 802.1ad
server provider tagging (STAGs) and require the distinction for hardware not
supporting acclerating both.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 19 Apr 2013 18:19:07 +0000 (14:19 -0400)]
Merge branch 'intel'
Jeff Kirsher says:
====================
This series contains updates to ixgbe and igb.
The ixgbe changes contains 2 patches from the community, one which is a
fix from akepner to fix a issue where netif_running() in shutdown was
not done under rtnl_lock. The other community fix from Joe Perches
cleans up #ifdef CONFIG_DEBUG_FS which is no longer necessary. The
last ixgbe patch, from Jacob Keller, adds support for WoL on 82559
SFP+ LOM.
The remaining patches are against igb, 10 of which were previously
submitted in a pull request where changes were requested.
The following igb patches:
igb: Support for 100base-fx SFP
igb: Support to read and export SFF-8472/8079 data
are v2 based on feedback from Dan Carpenter and Ben Hutchings in
the previous pull request.
The largest set of changes are in my patch to cleanup code comments
and whitespace to align the igb driver with the networking style of
code comments. While cleaning up the code comments, fixed several
other whitespace/checkpatch.pl code formatting issues.
Other notable igb patches are EEE capable devices query the PHY to
determine what the link partner is advertising, added support for
i354 devices and added support for spoofchk config.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Matthew Vick [Thu, 21 Feb 2013 03:32:52 +0000 (03:32 +0000)]
igb: Enable EEE LP advertisement
On EEE-capable devices, query the PHY to determine what the link partner is
advertising.
Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jeff Kirsher [Sat, 23 Feb 2013 07:29:56 +0000 (07:29 +0000)]
igb: Fix code comments and whitespace
Aligns the multi-line code comments with the desired style for the
networking tree. Also cleaned up whitespace issues found during the
cleanup of code comments (i.e. remove unnecessary blank lines,
use tabs where possible, properly wrap lines and keep strings on a
single line)
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Alexander Duyck [Tue, 12 Feb 2013 02:31:01 +0000 (02:31 +0000)]
igb: Use rx/tx_itr_setting when setting up initial value of itr
It turns out that the InterruptThrottleRate module parameter was only
having the effect of locking the ITR at the starting ITR value. This was
because the values stored in rx_itr_setting and tx_itr_setting were being
ignored when configuring the initial itr_val of the q_vector.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Alexander Duyck [Thu, 7 Feb 2013 08:55:46 +0000 (08:55 +0000)]
igb: Pull adapter out of main path in igb_xmit_frame_ring
We only need the adapter pointer in the case of ptp. As such we can pull the
adapter out of the main path and place it inside the if statement to avoid
the temptation of accessing the adapter pointer in the fast path.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Alexander Duyck [Fri, 1 Feb 2013 08:56:47 +0000 (08:56 +0000)]
igb: Mask off check of frag_off as we only want fragment offset
We were incorrectly checking the entire frag_off field when we only wanted the
fragment offset. As a result we were not pulling in TCP headers when the DNF
flag was set.
To correct that we will now check for frag off using the IP_OFFSET mask.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This patch fixes code and comments as identified in the driver.
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This patch adds support for 100base-fx SFP and report proper link speed/duplex
via Ethtool.
v2: fix smatch warnings
CC: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Add some empty static inlines instead to make
the code more readable.
Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Wed, 3 Apr 2013 04:41:37 +0000 (04:41 +0000)]
ixgbe: Add support for WoL on 82599 SFP+ LOM
This patch adds software support for WoL for the 82599 SFP+ LOM device,
(ID 0x8976)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
akepner [Wed, 13 Mar 2013 14:54:58 +0000 (14:54 +0000)]
ixgbe: in shutdown, do netif_running() under rtnl_lock
During shutdown it's possible for __dev_close() (which holds
rtnl_lock) to clear the __LINK_STATE_START bit, and for ixgbe
to then read that bit (without holding rtnl_lock), and then
not fail to free irqs, etc. The result is a crash like this:
David S. Miller [Thu, 18 Apr 2013 19:00:59 +0000 (15:00 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:
====================
This series contains updates to ixgbe only.
v2- Dropped the following 2 patches from the series:
ixgbe: Support using build_skb in the case that jumbo frames are disabled
ixgbe: walk pci-e bus to find minimum width
Ben Hutchings found a bug with Alex's patch, so that patch was dropped
permanently. Jacob's "walk PCIe bus" patch is being re-worked for
a more generic solution so that other drivers can benefit.
In the remaining patches...
Alex provides a fix where we were incorrectly checking the entire frag_off
field when we only wanted the fragment offset. Alex also cleans up
the check for PAGE_SIZE, since the default configuration allocates 32K
for all buffers.
Emil provides a change to the calculation of eerd so that it is consistent
between the read and write functions by using | instead of +.
Jacob adds support for displaying PCIe Gen3 link speed, which was
previously missing from the ixgbe driver. He also provides a patch
to clean up ixgbe_get_bus_info_generic to call some conversion
functions, which are used also in another patch provided by Jacob.
Jacob modifies the driver to enable certain devices (which have an
internal switch) to read from the physical slot rather than reading
data from the internal switch.
Don provides a couple of fixes (which are more appropriate for net-next),
one of which resolves an issue where ixgbe was only turning on the laser
when the adapter was up which caused issues for those who wanted to
access the MNG firmware while the port was in a down state. The other
fix is for WoL when currently linked at 1G. Lastly Don bumps the driver
version keep the in-kernel driver up to date with the current functionality.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Host queues (Qdisc + NIC) can hold packets so long that TCP can
eventually retransmit a packet before the first transmit even left
the host.
Its not clear right now if we could avoid this in the first place :
- We could arm RTO timer not at the time we enqueue packets, but
at the time we TX complete them (tcp_wfree())
- Cancel the sending of the new copy of the packet if prior one
is still in queue.
This patch adds instrumentation so that we can at least see how
often this problem happens.
TCPSpuriousRtxHostQueues SNMP counter is incremented every time
we detect the fast clone is not yet freed in tcp_transmit_skb()
Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Tom Herbert <therbert@google.com> Cc: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Don Skidmore [Fri, 1 Mar 2013 07:09:43 +0000 (07:09 +0000)]
ixgbe: bump version number
Bump the version number reflect the corresponding functionality in the
out of tree driver.
Signed-of-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Don Skidmore [Thu, 28 Feb 2013 08:08:44 +0000 (08:08 +0000)]
ixgbe: Fix 1G link WoL
We reset during the shutdown path which will reset AUTOC register. This
would change LMS to 10G. If we were currently linked at 1G we will lose
link, which is a bad thing if we wanted WoL to work. For the fix I needed
to know if WoL is supported so I created a new bool in the ixgbe_hw struct.
If this is set we will not allow the reset to change the current LMS value
in AUTOC.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Don Skidmore [Thu, 21 Feb 2013 03:00:04 +0000 (03:00 +0000)]
ixgbe: fix MNG FW support when adapter not up
We were only turning the laser on when the adapter was up. This
causes issues for those who wanted to access the MNG FW while the
port was in a down state. This patch makes sure the laser is turned
on in probe and remain up even after the port is brought down.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Tue, 9 Apr 2013 07:20:09 +0000 (07:20 +0000)]
ixgbe: enable devices with internal switch to read pci parent
This patch modifies the driver to enable certain devices, which have an internal
switch, to read data from the physical slot rather than reading data from the
internal switch. The internal switch will always report the same PCI width and
speed, which is not useful compared to knowing the width and speed of the slot
the physical card is plugged into.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 15 Feb 2013 09:18:15 +0000 (09:18 +0000)]
ixgbe: create conversion functions from link_status to bus/speed
This patch cleans up ixgbe_get_bus_info_generic to call some conversion
functions, which are used also in a follow on patch that needs to convert
between the link_status PCIe config values into ixgbe's internal enum
representations.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 15 Feb 2013 09:18:10 +0000 (09:18 +0000)]
ixgbe: Enable support for recognizing PCI-e Gen3 link speed
This patch adds support for displaying PCIe Gen3 link speed, which was
previously missing from the driver.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Alexander Duyck [Sat, 9 Feb 2013 01:19:55 +0000 (01:19 +0000)]
ixgbe: Drop check for PAGE_SIZE from ixgbe_xmit_frame_ring
The check for PAGE_SIZE is pointless now that the default configuration is to
allocate 32K for all buffers. Since the Tx descriptor limit is 16K we can
just drop the check and always compare the descriptors to the maximum size
supported.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Emil Tantilov [Tue, 5 Feb 2013 09:43:26 +0000 (09:43 +0000)]
ixgbe: don't do arithmetic operations on bitmasks
Make the calculation of eerd consistent between the read and write functions
by using | instead of + for IXGBE_EEPROM_RW_REG_START
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Alexander Duyck [Fri, 1 Feb 2013 08:56:41 +0000 (08:56 +0000)]
ixgbe: Mask off check of frag_off as we only want fragment offset
We were incorrectly checking the entire frag_off field when we only wanted the
fragment offset. As a result we were not pulling in TCP headers when the DNF
flag was set.
To correct that we will now check for frag off using the IP_OFFSET mask.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
David S. Miller [Wed, 17 Apr 2013 18:18:43 +0000 (14:18 -0400)]
Merge branch 'tipc-ipoib'
Patrick McHardy says:
====================
The following patchset adds support for running TIPC over InfiniBand.
The patchset consists of three parts (+ a minor fix for the ethernet media
type):
- Preparation: removal of an the unused str2addr callback and move of the
bcast_addr from struct tipc_media to struct tipc_bearer. This is necessary
because InfiniBand doesn't have a fixed broadcast address like ethernet,
so it needs to be initialized with the device's broadcast address when
the bearer is enabled
- Introduction of a TIPC InfiniBand media type. A new media type is needed
to deal with the different address sizes
- Support for ETH_P_TIPC in IPoIB
Since the last posting I've addressed all feedback I received and rebased
to the current net-next tree.
I consider these patches ready for merging. Since they mainly affect TIPC
code, I'd propose to have them either go through the TIPC tree or through
Dave directly (not sure how TIPC patches are managed).
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:18:29 +0000 (06:18 +0000)]
IPoIB: add support for TIPC protocol
Support TIPC in the IPoIB driver. Since IPoIB now keeps track of its own
neighbour entries and doesn't require the packet to have a dst_entry
anymore, the only necessary changes are to:
- not drop multicast TIPC packets because of the unknown ethernet type
- handle unicast TIPC packets similar to IPv4/IPv6 unicast packets
in ipoib_start_xmit().
An alternative would be to remove all ethertype limitations since they're
not necessary anymore, all TIPC needs to know about is ARP and RARP since
it wants to always perform "path find", even if a path is already known.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Wed, 17 Apr 2013 06:18:28 +0000 (06:18 +0000)]
tipc: add InfiniBand media type
Add InfiniBand media type based on the ethernet media type.
The only real difference is that in case of InfiniBand, we need the entire
20 bytes of space reserved for media addresses, so the TIPC media type ID is
not explicitly stored in the packet payload.
Patrick McHardy [Wed, 17 Apr 2013 06:18:26 +0000 (06:18 +0000)]
tipc: move bcast_addr from struct tipc_media to struct tipc_bearer
Some network protocols, like InfiniBand, don't have a fixed broadcast
address but one that depends on the configuration. Move the bcast_addr
to struct tipc_bearer and initialize it with the broadcast address of
the network device when the bearer is enabled.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Remove warning introduced by commit 418fc57 ("usbnet: cdc-ether: apply
usbnet_link_change"):
CHECK .../drivers/net/usb/cdc_ether.c
.../drivers/net/usb/cdc_ether.c:409:46: warning: incorrect type in argument 2 (different base types)
.../drivers/net/usb/cdc_ether.c:409:46: expected bool [unsigned] [usertype] <noident>
.../drivers/net/usb/cdc_ether.c:409:46: got restricted __le16 [usertype] wValue
Cc: Ming Lei <ming.lei@canonical.com> Signed-off-by: Bjørn Mork <bjorn@mork.no> Acked-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 11:07:17 +0000 (11:07 +0000)]
net: sctp: sctp_ulpq: remove 'malloced' struct member
The structure sctp_ulpq is embedded into sctp_association and never
separately allocated, also ulpq->malloced is always 0, so that
kfree() is never called. Therefore, remove this code.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 11:07:16 +0000 (11:07 +0000)]
net: sctp: sctp_bind_addr: remove dead code
The sctp_bind_addr structure has a 'malloced' member that is
always set to 0, thus in sctp_bind_addr_free() the kfree()
part can never be called. This part is embedded into
sctp_ep_common anyway and never alloced.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 11:07:15 +0000 (11:07 +0000)]
net: sctp: sctp_transport: remove unused variable
sctp_transport's member 'malloced' is set to 1, never evaluated
and the structure is kfreed anyway. So just remove it.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 11:07:14 +0000 (11:07 +0000)]
net: sctp: outqueue: simplify sctp_outq_uncork function
Just a minor edit to simplify the function. No need for this
error variable here.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 11:07:12 +0000 (11:07 +0000)]
net: sctp: sctp_outq: remove 'malloced' from its struct
sctp_outq is embedded into sctp_association, and thus never
kmalloced in any way. Also, malloced is always 0, thus kfree()
is never called. Therefore, remove that dead piece of code.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 11:07:11 +0000 (11:07 +0000)]
net: sctp: sctp_inq: remove dead code
sctp_inq is never kmalloced, since it's integrated into sctp_ep_common
and only initialized from eps and assocs. Therefore, remove the dead
code from there.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 11:07:10 +0000 (11:07 +0000)]
net: sctp: sctp_ssnmap: remove 'malloced' element from struct
sctp_ssnmap_init() can only be called from sctp_ssnmap_new()
where malloced is always set to 1. Thus, when we call
sctp_ssnmap_free() the test for map->malloced evaluates always
to true.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 17 Apr 2013 17:30:32 +0000 (13:30 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
Jesse Gross says:
====================
A number of improvements for net-next/3.10.
Highlights include:
* Properly exposing linux/openvswitch.h to userspace after the uapi
changes.
* Simplification of locking. It immediately makes things simpler to
reason about and avoids holding RTNL mutex for longer than
necessary. In the near future it will also enable tunnel
registration and more fine-grained locking.
* Miscellaneous cleanups and simplifications.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 7b7a2bbb690 (atl1: Remove unneeded PM_OPS definitions) removed the
definition of atl1_suspend for the !CONFIG_PM_SLEEP case.
So only call atl1_suspend() when CONFIG_PM_SLEEP is defined and fix the
following build error from randconfig:
drivers/net/ethernet/atheros/atlx/atl1.c: In function 'atl1_shutdown':
drivers/net/ethernet/atheros/atlx/atl1.c:2888:2: error: implicit declaration of function 'atl1_suspend' [-Werror=implicit-function-declaration]
Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 16 Apr 2013 20:43:39 +0000 (16:43 -0400)]
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
Marc Kleine-Budde says:
====================
this is a pull-request for net-next/master. It consists of a patch by
Oliver Hartkopp. In this patch he cleans up the sja1000 header file by
using a common prefix for all sja1000 defines.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
pch_gbe: minor: report the actual error on MTU change
If we can't _up() after changing the MTU, report the actual error instead
of -ENOMEM. It can be really misleading cause pch_gbe is usually used in
scenarios where the memory amount is really small, and thus hiding the
real cause.
Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
vxlan: Allow setting destination to unicast address.
This patch allows setting VXLAN destination to unicast address.
It allows that VXLAN can be used as peer-to-peer tunnel without
multicast.
v4: generalize struct vxlan_dev, "gaddr" is replaced with vxlan_rdst.
"GROUP" attribute is replaced with "REMOTE".
they are based by David Stevens's comments.
v3: move a new attribute REMOTE into the last of an enum list
based by Stephen Hemminger's comments.
v2: use a new attribute REMOTE instead of GROUP based by
Cong Wang's comments.
Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp> Acked-by: David L Stevens <dlstevens@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Tue, 16 Apr 2013 01:57:46 +0000 (01:57 +0000)]
packet: minor: add generic tpacket_uhdr to access packet headers
There is no need to add a dozen unions each time at the start
of the function. So, do this once and use it instead. Thus, we
can remove some duplicate code and make it more readable.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Dilip Daya [Tue, 16 Apr 2013 01:39:07 +0000 (01:39 +0000)]
sctp: Add buffer utilization fields to /proc/net/sctp/assocs
sctp: Add buffer utilization fields to /proc/net/sctp/assocs
This patch adds the following fields to /proc/net/sctp/assocs output:
- sk->sk_wmem_alloc as "wmema" (transmit queue bytes committed)
- sk->sk_wmem_queued as "wmemq" (persistent queue size)
- sk->sk_sndbuf as "sndbuf" (size of send buffer in bytes)
- sk->sk_rcvbuf as "rcvbuf" (size of receive buffer in bytes)
When small DATA chunks containing 136 bytes data are sent the TX_QUEUE
(assoc->sndbuf_used) reaches a maximum of 40.9% of sk_sndbuf value when
peer.rwnd = 0. This was diagnosed from sk_wmem_alloc value reaching maximum
value of sk_sndbuf.
TX_QUEUE (assoc->sndbuf_used), sk_wmem_alloc and sk_wmem_queued values are
incremented in sctp_set_owner_w() for outgoing data chunks. Having access to
the above values in /proc/net/sctp/assocs will provide a better understanding
of SCTP buffer management.
With patch applied, example output when peer.rwnd = 0
the work has been scheduled from interrupt, and not been
cancelled when the driver is unloaded, which doesn't remove
the work item from the global workqueue. call the
cancel_work_sync when the driver is removed (rmmod'ed).
Cc: Sriram <srk@ti.com> Cc: Cyril Chemparathy <cyril@ti.com> Cc: Vinay Hegde <vinay.hegde@ti.com> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
at86rf230: change irq handling to prevent lockups with edge type irq
Implemented separate irq handling for edge and level type interrupt
configuration. For edge type interrupts calls to disable_irq_nosync()
and enable_irq() are removed. The at86rf230 resets the irq line only
after the irq status register is read. Disabling the irq can lock the
driver in situations where a irq is set by the radio while the driver
is still reading the frame buffer.
With irq_type configuration set to 0 the original behavior is
preserverd.
Additional the irq filter register is set to filter out all unused
interrupts and the irq status register is read in the probe
function to clear the irq line.
Signed-off-by: Sascha Herrmann <sascha@ps.nvbi.de>
Conflicts:
drivers/net/ieee802154/at86rf230.c Signed-off-by: David S. Miller <davem@davemloft.net>
Add option to at86rf230 platform data to configure the type of the
interrupt used by the driver. The irq polarity of the device will
be configured accordingly.
Signed-off-by: Sascha Herrmann <sascha@ps.nvbi.de> Signed-off-by: David S. Miller <davem@davemloft.net>
SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
Remove the unneeded definitions.
Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
Remove the unneeded definitions.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
Remove the unneeded definitions.
Cc: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
Remove the unneeded definitions.
Cc: Jay Cliburn <jcliburn@gmail.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
Remove the unneeded definitions.
Cc: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
That patch fixed a define conflict between the SH architecture and the sja1000
driver, by addind a prefix to one macro only. This patch consistently renames
the prefix of the SJA1000 controller registers from "REG_" to "SJA1000_".
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Currently OVS uses combination of genl and rtnl lock to protect
datapath state. This was done due to networking stack locking.
But this has complicated locking and there are few lock ordering
issues with new tunneling protocols.
Following patch simplifies locking by introducing new ovs mutex
and now this lock is used to protect entire ovs state.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
David S. Miller [Mon, 15 Apr 2013 20:10:53 +0000 (16:10 -0400)]
Merge branch 'sync_multiple'
Vlad Yasevich says:
====================
Current dev_[uc|mc]_addr_sync() API currently correctly syncs the
addresses to the first device. Any subsequent calls to sync will
not do anything since the synched variable will be set. This
variable is used as an optimization to skip over addresses that have
been synched.
There are some devices (ex: team) that attempt to do the above. There
is other work in progress that needs to above to work corretly.
The short series introduces dev_[uc|mc]_addr_synch_multiple() that
allows multiple calls to sync to multiple different devices. Original
API is left alone and still has the limitation.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
team: Use new sync_multiple api to sync devices adressess.
Team drivers attempts to sync addresses to each of the port
devices; however, the current api doesn't really perform the sync
for any device after the first one. Switch to using the new api
that will actually sync the addresses to all ports.
CC: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
net: add dev_uc_sync_multiple() and dev_mc_sync_multiple() api
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 <jiri@resnulli.us> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Mon, 15 Apr 2013 03:27:18 +0000 (03:27 +0000)]
net: sctp: minor: make sctp_ep_common's member 'dead' a bool
Since dead only holds two states (0,1), make it a bool instead
of a 'char', which is more appropriate for its purpose.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Mon, 15 Apr 2013 03:27:17 +0000 (03:27 +0000)]
net: sctp: remove sctp_ep_common struct member 'malloced'
There is actually no need to keep this member in the structure, because
after init it's always 1 anyway, thus always kfree called. This seems to
be an ancient leftover from the very initial implementation from 2.5
times. Only in case the initialization of an association fails, we leave
base.malloced as 0, but we nevertheless kfree it in the error path in
sctp_association_new().
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Nicolas Ferre [Sun, 14 Apr 2013 22:04:33 +0000 (22:04 +0000)]
net/macb: fix error return code in macb_probe()
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.
Original-idea-by: <yongjun_wei@trendmicro.com.cn> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Mike Rapoport [Sat, 13 Apr 2013 23:21:51 +0000 (23:21 +0000)]
vxlan: don't bypass encapsulation for multi- and broadcasts
The multicast and broadcast packets may have RTCF_LOCAL set in rt_flags
and therefore will be sent out bypassing encapsulation. This breaks
delivery of packets sent to the vxlan multicast group.
Disabling encapsulation bypass for multicasts and broadcasts fixes the
issue.
Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Tested-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Sridhar Samudrala <sri@us.ibm.com> Tested-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Commit 10b96f7306e5 (``tcp_memcontrol: remove a redundant statement
in tcp_destroy_cgroup()'') says ``We read the value but make no use
of it.'', but forgot to remove the variable declaration as well. This
was a follow-up commit of 3f1346193 (``memcg: decrement static keys
at real destroy time'') that removed the read of variable 'val'.
This fixes therefore:
CC net/ipv4/tcp_memcontrol.o
net/ipv4/tcp_memcontrol.c: In function ‘tcp_destroy_cgroup’:
net/ipv4/tcp_memcontrol.c:67:6: warning: unused variable ‘val’ [-Wunused-variable]
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Sun, 14 Apr 2013 08:08:13 +0000 (08:08 +0000)]
net: sock: make sock_tx_timestamp void
Currently, sock_tx_timestamp() always returns 0. The comment that
describes the sock_tx_timestamp() function wrongly says that it
returns an error when an invalid argument is passed (from commit 20d4947353be, ``net: socket infrastructure for SO_TIMESTAMPING'').
Make the function void, so that we can also remove all the unneeded
if conditions that check for such a _non-existant_ error case in the
output path.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Mike Rapoport [Sat, 13 Apr 2013 23:21:39 +0000 (23:21 +0000)]
vxlan: use htonl when snooping for loopback address
Currently "bridge fdb show dev vxlan0" lists loopback address as
"1.0.0.127". Using htonl(INADDR_LOOPBACK) rather than passing it
directly to vxlan_snoop fixes the problem.
Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Acked-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Sat, 13 Apr 2013 19:03:17 +0000 (19:03 +0000)]
fec: Convert printks to netdev_<level>
Use a more current logging message style.
Convert the printks where a struct net_device is available to
netdev_<level>. Convert the other printks to pr_<level> and
add pr_fmt where appropriate.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>