100 Commits
Author SHA1 Message Date
stephen hemminger 23bdbc80e1 dcb: fix sparse warnings
Add header with function definitions to quiet warnings and avoid future errors.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-03-09 16:09:18 -05:00
stephen hemminger 2ea4659943 team: make local function static
Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-03-09 16:09:18 -05:00
stephen hemminger baec126cf6 phy: vitesse make vsc824x_add_skew static
Function is only used in this file, should be static and not
an exported symbol.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-03-09 16:09:17 -05:00
stephen hemminger 199453339d Supject: phy: make local function static
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-03-09 16:09:17 -05:00
stephen hemminger 7068a67581 bna: fix declaration mismatch
The function is declared to take u32 but definition uses enum.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Rasesh Mody <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-03-09 16:09:17 -05:00
Stephen Hemminger fec9dd15d5 qlcnic: make pci_error_handlers const
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Jitendra Kalsaria <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-01-30 20:34:50 -05:00
stephen hemminger 5a406b0cdf netfilter: nf_ct_snmp: add include file
Prototype for nf_nat_snmp_hook is in nf_conntrack_snmp.h therefore
it should be included to get type checking. Found by sparse.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
2013-01-18 00:28:18 +01:00
stephen hemminger 3b09adcb20 ip-sysctl: fix spelling errors
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-01-04 15:12:34 -08:00
stephen hemminger 6602d00789 vxlan: allow live mac address change
The VXLAN pseudo-device doesn't care if the mac address changes
when device is up.

Signed-off-by: Stephen Hemminger <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2013-01-03 01:58:13 -08:00
stephen hemminger 576eb62598 bridge: respect RFC2863 operational state
The bridge link detection should follow the operational state
of the lower device, rather than the carrier bit. This allows devices
like tunnels that are controlled by userspace control plane to work
with bridge STP link management.

Signed-off-by: Stephen Hemminger <[email protected]>
Reviewed-by: Flavio Leitner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-12-30 02:31:43 -08:00
stephen hemminger 61c5e88aec skbuff: make __kmalloc_reserve static
Sparse detected case where this local function should be static.
It may even allow some compiler optimizations.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-12-28 20:32:36 -08:00
stephen hemminger bb717d7649 tcp: make proc_tcp_fastopen_key static
Detected by sparse.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-12-28 20:32:36 -08:00
stephen hemminger bd2a13e2eb sctp: make sctp_addr_wq_timeout_handler static
Fix sparse warning about local function that should be static.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-12-28 20:32:36 -08:00
stephen hemminger eca2a43bb0 bridge: fix icmpv6 endian bug and other sparse warnings
Fix the warnings reported by sparse on recent bridge multicast
changes. Mostly just rcu annotation issues but in this case
sparse found a real bug! The ICMPv6 mld2 query mrc
values is in network byte order.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-12-13 12:58:11 -05:00
stephen hemminger 895464fa4b uapi: add missing netconf.h to export list
Add netconf.h for use by iproute2.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Nicolas Dichtel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-12-12 12:40:23 -05:00
stephen hemminger a676847b39 tun: allow setting ethernet addresss while running
This is a pure software device, and ok with live address change.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-12-11 12:49:53 -05:00
stephen hemminger 96800ee73c vmxnet3: fix indentation
Minor indentation out of alignment.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-11-14 21:48:16 -05:00
stephen hemminger 1007dd1aa5 bridge: add root port blocking
This is Linux bridge implementation of root port guard.
If BPDU is received from a leaf (edge) port, it should not
be elected as root port.

Why would you want to do this?
If using STP on a bridge and the downstream bridges are not fully
trusted; this prevents a hostile guest for rerouting traffic.

Why not just use netfilter?
Netfilter does not track of follow spanning tree decisions.
It would be difficult and error prone to try and mirror STP
resolution in netfilter module.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-11-14 20:20:44 -05:00
stephen hemminger a2e01a65cd bridge: implement BPDU blocking
This is Linux bridge implementation of STP protection
(Cisco BPDU guard/Juniper BPDU block). BPDU block disables
the bridge port if a STP BPDU packet is received.

Why would you want to do this?
If running Spanning Tree on bridge, hostile devices on the network
may send BPDU and cause network failure. Enabling bpdu block
will detect and stop this.

How to recover the port?
The port will be restarted if link is brought down, or
removed and reattached.  For example:
 # ip li set dev eth0 down; ip li set dev eth0 up

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-11-14 20:20:44 -05:00
stephen hemminger cd7537326e bridge: add template for bridge port flags
Provide macro to build sysfs data structures and functions
for accessing flag bits.  If flag bits change do netlink
notification.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-11-14 20:20:44 -05:00
stephen hemminger 25c71c75ac bridge: bridge port parameters over netlink
Expose bridge port parameter over netlink. By switching to a nested
message, this can be used for other bridge parameters.

This changes IFLA_PROTINFO attribute from one byte to a full nested
set of attributes. This is safe for application interface because the
old message used IFLA_PROTINFO and new one uses
 IFLA_PROTINFO | NLA_F_NESTED.

The code adapts to old format requests, and therefore stays
compatible with user mode RSTP daemon. Since the type field
for nested and unnested attributes are different, and the old
code in libnetlink doesn't do the mask, it is also safe to use
with old versions of bridge monitor command.

Note: although mode is only a boolean, treating it as a
full byte since in the future someone will probably want to add more
values (like macvlan has).

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-11-14 20:20:44 -05:00
stephen hemminger b77bc2069d ppp: make ppp_get_stats64 static
This was picked up by sparse.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-11-01 12:38:31 -04:00
stephen hemminger e0683e707c tcp: make tcp_clear_md5_list static
Trivial. Only used in one file.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-31 13:56:40 -04:00
stephen hemminger 3c172868cb vxlan: don't expire permanent entries
VXLAN confused flag versus bitmap on state.
Based on part of a earlier patch by David Stevens.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-31 13:42:12 -04:00
stephen hemminger 8437e7610c vti: fix sparse bit endian warnings
Use be32_to_cpu instead of htonl to keep sparse happy.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-12 13:56:52 -04:00
stephen hemminger 68aaed54e7 ipv4: fix route mark sparse warning
Sparse complains about RTA_MARK which is should be host order according
to include file and usage in iproute.

net/ipv4/route.c:2223:46: warning: incorrect type in argument 3 (different base types)
net/ipv4/route.c:2223:46:    expected restricted __be32 [usertype] value
net/ipv4/route.c:2223:46:    got unsigned int [unsigned] [usertype] flowic_mark

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:54:59 -04:00
stephen hemminger 34e02aa1fb vxlan: fix oops when give unknown ifindex
If vxlan is created and the ifindex is passed; there are two cases which
are incorrectly handled by the existing code. The ifindex could be zero
(i.e. no device) or there could be no device with that ifindex.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:22 -04:00
stephen hemminger d97c00a321 vxlan: fix receive checksum handling
Vxlan was trying to use postpull_rcsum to allow receive checksum
offload to work on drivers using CHECKSUM_COMPLETE method. But this
doesn't work correctly. Just force full receive checksum on received
packet.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:22 -04:00
stephen hemminger 2840bf2286 vxlan: add additional headroom
Tell upper layer protocols to allocate skb with additional headroom.
This avoids allocation and copy in local packet sends.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:22 -04:00
stephen hemminger 05f47d69c4 vxlan: allow configuring port range
VXLAN bases source UDP port based on flow to help the
receiver to be able to load balance based on outer header flow.

This patch restricts the port range to the normal UDP local
ports, and allows overriding via configuration.

It also uses jhash of Ethernet header when looking at flows
with out know L3 header.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:21 -04:00
stephen hemminger 1cad87156b vxlan: associate with tunnel socket on transmit
When tunnelling a skb, associate it with the tunnel socket.
This allows parameters set on tunnel socket (like multicast loop
flag), to be picked up by ip_output.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:21 -04:00
stephen hemminger ca78f18129 vxlan: use ip_route_output
Select source address for VXLAN packet based on route destination
and don't lie to route code. VXLAN is not GRE.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:21 -04:00
stephen hemminger 321fb99139 vxlan: fix byte order in hash function
Shift was wrong direction causing packets to hash based on
other parts of the ethernet header, not the address.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:21 -04:00
stephen hemminger ef59febe3b vxlan: minor output refactoring
Move code to find destination to a small function.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-10 22:41:21 -04:00
Stephen Hemminger 7c41c42c5d vxlan: fix more sparse warnings
Fix a couple harmless sparse warnings reported by Fengguang Wu.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-08 17:57:57 -04:00
stephen hemminger bfe1b9b16e vxlan: put UDP socket in correct namespace
Move vxlan UDP socket to correct network namespace

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-02 14:38:04 -04:00
stephen hemminger d342894c5d vxlan: virtual extensible lan
This is an implementation of Virtual eXtensible Local Area Network
as described in draft RFC:
  http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-02

The driver integrates a Virtual Tunnel Endpoint (VTEP) functionality
that learns MAC to IP address mapping.

This implementation has not been tested only against the Linux
userspace implementation using TAP, not against other vendor's
equipment.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-01 18:39:45 -04:00
stephen hemminger 193ba92452 igmp: export symbol ip_mc_leave_group
Needed for VXLAN.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-01 18:39:44 -04:00
stephen hemminger edc7d57327 netlink: add attributes to fdb interface
Later changes need to be able to refer to neighbour attributes
when doing fdb_add.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-01 18:39:44 -04:00
stephen hemminger 9fbef059d6 gre: fix sparse warning
Use be16 consistently when looking at flags.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-10-01 17:35:31 -04:00
stephen hemminger eccc1bb8d4 tunnel: drop packet if ECN present with not-ECT
Linux tunnels were written before RFC6040 and therefore never
implemented the corner case of ECN getting set in the outer header
and the inner header not being ready for it.

Section 4.2.  Default Tunnel Egress Behaviour.
 o If the inner ECN field is Not-ECT, the decapsulator MUST NOT
      propagate any other ECN codepoint onwards.  This is because the
      inner Not-ECT marking is set by transports that rely on dropped
      packets as an indication of congestion and would not understand or
      respond to any other ECN codepoint [RFC4774].  Specifically:

      *  If the inner ECN field is Not-ECT and the outer ECN field is
         CE, the decapsulator MUST drop the packet.

      *  If the inner ECN field is Not-ECT and the outer ECN field is
         Not-ECT, ECT(0), or ECT(1), the decapsulator MUST forward the
         outgoing packet with the ECN field cleared to Not-ECT.

This patch moves the ECN decap logic out of the individual tunnels
into a common place.

It also adds logging to allow detecting broken systems that
set ECN bits incorrectly when tunneling (or an intermediate
router might be changing the header).

Overloads rx_frame_error to keep track of ECN related error.

Thanks to Chris Wright who caught this while reviewing the new VXLAN
tunnel.

This code was tested by injecting faulty logic in other end GRE
to send incorrectly encapsulated packets.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-09-27 18:12:37 -04:00
stephen hemminger b0558ef24a xfrm: remove extranous rcu_read_lock
The handlers for xfrm_tunnel are always invoked with rcu read lock
already.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-09-27 18:12:37 -04:00
stephen hemminger 0c5794a66c gre: remove unnecessary rcu_read_lock/unlock
The gre function pointers for receive and error handling are
always called (from gre.c) with rcu_read_lock already held.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-09-27 18:12:37 -04:00
stephen hemminger d208328765 gre: fix handling of key 0
GRE driver incorrectly uses zero as a flag value. Zero is a perfectly
valid value for key, and the tunnel should match packets with no key only
with tunnels created without key, and vice versa.

This is a slightly visible  change since previously it might be possible to
construct a working tunnel that sent key 0 and received only because
of the key wildcard of zero.  I.e the sender sent key of zero, but tunnel
was defined without key.

Note: using gre key 0 requires iproute2 utilities v3.2 or later.
The original utility code was broken as well.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-09-27 18:12:37 -04:00
stephen hemminger 6b6e27255f netdev: make address const in device address management
The internal functions for add/deleting addresses don't change
their argument.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-09-19 16:35:22 -04:00
Stephen Hemminger 9869a937d3 staging: ipack: make function tables const.
Make some variables const:
  1. bus oerations table
  2. driver name
  3. tpci control register table

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-10 11:18:01 -07:00
Stephen Hemminger 2065945540 staging: tpci200: fix section mismatch warning
PCI probe routines have to be named _probe to avoid section mismatch warning.
Found when doing 'make allmodconfig'

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-07 22:02:20 -07:00
Stephen Hemminger 1d3520357d make drivers with pci error handlers const
Covers the rest of the uses of pci error handler.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
2012-09-07 16:35:00 -06:00
Stephen Hemminger a55b2d21e8 scsi: make pci error handlers const
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
2012-09-07 16:35:00 -06:00
Stephen Hemminger 3646f0e5c9 netdev: make pci_error_handlers const
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
2012-09-07 16:35:00 -06:00
Stephen Hemminger 494530284f PCI: Make pci_error_handlers const
Since pci_error_handlers is just a function table make it const.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Acked-by: Linas Vepstas <[email protected]>
2012-09-07 16:24:59 -06:00
Stephen Hemminger c03307eab6 bridge: fix rcu dereference outside of rcu_read_lock
Alternative solution for problem found by Linux Driver Verification
project (linuxtesting.org).

As it noted in the comment before the br_handle_frame_finish
function, this function should be called under rcu_read_lock.

The problem callgraph:
br_dev_xmit -> br_nf_pre_routing_finish_bridge_slow ->
 -> br_handle_frame_finish -> br_port_get_rcu -> rcu_dereference

And in this case there is no read-lock section.

Reported-by: Denis Efremov <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-08-15 15:09:41 -07:00
stephen hemminger 5a0d513b62 bridge: make port attributes const
Simple table that can be marked const.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-07-30 14:53:22 -07:00
stephen hemminger 8427b2acfd bridge: update documentation references
Update the references to bridge utilities and web pages
to current locations

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-07-19 10:48:07 -07:00
stephen hemminger 83bd1b793e ipx: move peII functions
The Ethernet II wrapper is only used by IPX protocol, may have once
been used by Appletalk but not currently. Therefore it makes sense to
move it to the IPX dust bin and drop the exports.

Build tested only.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-07-19 10:48:00 -07:00
stephen hemminger 149ddd83a9 bridge: Assign rtnl_link_ops to bridge devices created via ioctl (v2)
This ensures that bridges created with brctl(8) or ioctl(2) directly
also carry IFLA_LINKINFO when dumped over netlink. This also allows
to create a bridge with ioctl(2) and delete it with RTM_DELLINK.

Signed-off-by: Thomas Graf <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-06-26 21:12:32 -07:00
Stephen Hemminger f73332fc39 ixgbe: simplify padding and length checks
The check for length <= 0 is bogus because length is unsigned, and network
stack never sends zero length packets (unless it is totally broken).

The check for really small packets can be optimized (using unlikely)
and calling skb_pad directly.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Phil Schmitt <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-06-21 15:04:21 -07:00
stephen hemminger 5ff0feac88 sky2: fix checksum bit management on some chips
The newer flavors of Yukon II use a different method for receive
checksum offload. This is indicated in the driver by the SKY2_HW_NEW_LE
flag. On these newer chips, the BMU_ENA_RX_CHKSUM should not be set.

The driver would get incorrectly toggle the bit, enabling the old
checksum logic on these chips and cause a BUG_ON() assertion. If
receive checksum was toggled via ethtool.

Reported-by: Kirill Smelkov <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-06-07 13:06:42 -07:00
stephen hemminger 37c106d0a4 if: restore token ring ARP type to header
Recent removal of Token Ring breaks the build of iproute2.

Even though Token Ring support is gone from the kernel, it is worth
keeping the the definition of the TR ARP type to avoid breaking
userspace programs that use this file.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-05-22 17:13:11 -04:00
Stephen Hemminger 349f29d841 econet: remove ancient bug ridden protocol
More spring cleaning!

The ancient Econet protocol should go. Most of the bug fixes in recent
years have been fixing security vulnerabilities. The hardware hasn't
been made since the 90s, it is only interesting as an archeological curiosity.

For the truly curious, or insomniac, go read up on it.
  http://en.wikipedia.org/wiki/Econet

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-05-18 01:35:08 -04:00
stephen hemminger 048b899ce3 etherdevice: fix comments
Fix some minor problems in comments of etherdevice.h
 * Warning is out dated, file hasn't moved or disappeared in many years and
    is unlikely to do so soon.
 * Capitalize Ethernet consistently since it is a proper name
 * Fix descriptive comment of padding
 * Spelling and grammar fix for alignment comment

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-05-17 15:36:35 -04:00
stephen hemminger e072b3fad5 sky2: fix receive length error in mixed non-VLAN/VLAN traffic
Bug: The VLAN bit of the MAC RX Status Word is unreliable in several older
supported chips. Sometimes the VLAN bit is not set for valid VLAN packets
and also sometimes the VLAN bit is set for non-VLAN packets that came after
a VLAN packet. This results in a receive length error when VLAN hardware
tagging is enabled.

Fix: Variation on original fix proposed by Mirko.
The VLAN information is decoded in the status loop, and can be
applied to the received SKB there. This eliminates the need for the
separate tag field in the interface data structure. The tag has to
be copied and cleared if packet is copied. This version checked out
with vlan and normal traffic.

Note: vlan_tx_tag_present should be renamed vlan_tag_present, but that
is outside scope of this.

Reported-by: Mirko Lindner <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-05-01 13:39:13 -04:00
stephen hemminger 3f42941b5d sky2: propogate rx hash when packet is copied
When a small packet is received, the driver copies it to a new skb to allow
reusing the full size Rx buffer. The copy was propogating the checksum offload
but not the receive hash information. The bug is impact was mostly harmless
and therefore not observed until reviewing this area of code.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-05-01 13:39:13 -04:00
stephen hemminger 87b6d218f3 tunnel: implement 64 bits statistics
Convert the per-cpu statistics kept for GRE, IPIP, and SIT tunnels
to use 64 bit statistics.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-04-14 14:47:05 -04:00
stephen hemminger 9b17876f3e rtnetlink: fix comments
Fix spelling and references in rtnetlink.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-04-13 13:32:39 -04:00
stephen hemminger efacb309b5 rtnetlink & bonding: change args got get_tx_queues
Change get_tx_queues, drop unsused arg/return value real_tx_queues,
and use return by value (with error) rather than call by reference.

Probably bonding should just change to LLTX and the whole get_tx_queues
API could disappear!

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-04-13 13:31:00 -04:00
stephen hemminger 44c14c1d4c MAINTAINERS: update for Marvell Ethernet drivers
Marvell has agreed to do maintenance on the sky2 driver.
   * Add the developer to the maintainers file
   * Remove the old reference to the long gone (sk98lin) driver
   * Rearrange to fit current topic organization

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-04-05 19:09:04 -04:00
stephen hemminger 857504d06d sky2: copy received packets on inefficient unaligned architecture
Modified from original patch from Chris.

The sky2 driver has to have 8 byte alignment of receive buffer
on some chip versions. On architectures which don't support efficient
unaligned access this doesn't work very well. The solution is to
just copy all received packets which is what the driver already
does for small packets.

This allows the driver to be used on the Tilera TILEmpower-Gx, since
the tile architecture doesn't currently handle kernel unaligned accesses,
just userspace.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Chris Metcalf <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-04-04 18:14:04 -04:00
stephen hemminger b3f4d5990b intel: make wired ethernet driver message level consistent (rev2)
Dan Carpenter noticed that ixgbevf initial default was different than
the rest. But the problem is broader than that, only one Intel driver (ixgb)
was doing it almost right.

The convention for default debug level should be consistent among
Intel drivers and follow established convention.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Aaron Brown <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
2012-03-27 23:29:22 -07:00
stephen hemminger 5676cc7bfe sky2: override for PCI legacy power management
Some BIOS's don't setup power management correctly (what else is
new) and don't allow use of PCI Express power control. Add a special
exception module parameter to allow working around this issue.
Based on slightly different patch by Knut Petersen.

Reported-by: Arkadiusz Miskiewicz <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-03-21 16:54:36 -04:00
stephen hemminger 3f2010b2ad packetengines: fix config default
As part of the big network driver reorg, each vendor directory defaults to
yes, so that older config's can migrate correctly. Looks like this one
got missed.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-03-02 19:05:47 -05:00
stephen hemminger bff528578f gre: fix spelling in comments
The original spelling and bad word choice makes these comments hard to read.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-02-24 17:41:11 -05:00
stephen hemminger aadf1f0fc8 Revert "skge: check for PCI dma mapping errors"
As reported by several people...

The code in rx_clean was panic'ing so revert
commit d0249e4443.
Will redo DMA mapping checks as new patches for a later release.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-02-07 12:51:10 -05:00
Stephen Hemminger 1bba2e81f5 ixgbe: make ethtool strings table const
Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Phil Schmitt <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-03 03:05:43 -08:00
Stephen Hemminger 3eb1fa7e00 brcm80211: make ethtool_ops const
All usage of ethtool_ops should be const; also add comma at end
of initializer list.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Arend van Spriel <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
2012-01-24 14:06:05 -05:00
stephen hemminger da057fb7d2 skge: add byte queue limit support
This also changes the cleanup logic slightly to aggregate
completed notifications for multiple packets.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-23 14:25:00 -05:00
stephen hemminger d0249e4443 skge: check for PCI dma mapping errors
Driver should check for mapping errors.
Machines with limited DMA maps may return an error when a PCI map is
requested (not an issue on standard x86).

Also use upper/lower 32 bits macros for clarity.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-22 15:08:44 -05:00
stephen hemminger 19f9ad7893 skge: don't assert carrier until link is up
Skge device would assert carrier (link up) as soon as network device open
was called, rather than waiting until PHY has detected link.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-22 15:08:44 -05:00
Stephen Hemminger 3d8fe98f8d ixgbevf: make operations tables const
The arrays of function pointers should be const to make life harder
for rootkits.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Sibai Li <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-19 12:35:07 -05:00
Stephen Hemminger b5417bf8e8 ixgbevf: fix sparse warnings
Fixes sparse warnings:
drivers/net/ethernet/intel/ixgbevf/vf.c:418:21: warning: symbol 'ixgbevf_82599_vf_info' was not declared. Should it be static?
drivers/net/ethernet/intel/ixgbevf/vf.c:423:21: warning: symbol 'ixgbevf_X540_vf_info' was not declared. Should it be static?
drivers/net/ethernet/intel/ixgbevf/mbx.c:331:29: warning: symbol 'ixgbevf_mbx_ops' was not declared. Should it be static?

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Sibai Li <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-19 12:35:06 -05:00
Stephen Hemminger b47aca135d ixgbevf: make ethtool ops and strings const
Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Sibai Li <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-19 12:35:06 -05:00
Stephen Hemminger b2f0f6bb87 igbvf: remove unneeded cast
The cast and comment are unnecessary in the current upstream kernel.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Garrett, RobertX E <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-19 12:35:06 -05:00
Stephen Hemminger c50b52a0c7 igb: make local functions static
Sparse caught two functions that were only being used in one file.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Aaron Brown <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-19 12:35:05 -05:00
stephen hemminger 7c7c7f01cc vhost-net: add module alias (v2.1)
By adding some module aliases, programs (or users) won't have to explicitly
call modprobe. Vhost-net will always be available if built into the kernel.
It does require assigning a permanent minor number for depmod to work.

Also:
  - use C99 style initialization.
  - add missing entry in documentation for loop-control

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-By: Kay Sievers <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-13 10:12:23 -08:00
stephen hemminger e5686ad82c netdev: make net_device_ops const
More drivers where net_device_ops should be const.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-09 14:05:23 -08:00
stephen hemminger 1aff0cbe9d bcm63xx: make ethtool_ops const
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-09 14:05:23 -08:00
stephen hemminger bc689c9788 usbnet: make ethtool_ops const
The ethtool_ops table of function pointers should be const.
Fix all the usb network drivers.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-09 14:05:23 -08:00
Stephen Hemminger 4269a93054 ath6kl: make net_device_ops const
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2012-01-09 16:33:23 +02:00
stephen hemminger e1e0918fca bna: fix sparse warnings/errors
This fixes a several sparse warnings.
  * the __iomem tag was being used incorrectly (needs to be a prefix)
  * several variables should have been static since local to one file
  * the firmware was not being forwared declared
    and was const one place and not the other

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-05 13:23:00 -05:00
stephen hemminger 975419cf01 bna: make ethtool_ops and strings const
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-05 13:23:00 -05:00
stephen hemminger bd601cc464 xgmac: cleanups
Make local function static, make ethtool_ops const.
Compile tested only.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-05 13:23:00 -05:00
stephen hemminger 9b07be4b2a net: make ethtool_ops const
Auditing all usage of ethtool_ops found several drivers that
are not declaring the struct const when it should be.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-05 13:23:00 -05:00
stephen hemminger c8b88efc30 vmxnet3" make ethtool ops const
All tables of function pointers should be const to make hacks
more difficult. Compile tested only.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Shreyas N Bhatewara <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-05 13:23:00 -05:00
stephen hemminger 813abbbaa3 xen-netback: make ops structs const
All tables of function pointers should be const to make hacks
more difficult. Compile tested only.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Ian Campbell <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-05 13:23:00 -05:00
stephen hemminger f7d9821a6a bonding: fix error handling if slave is busy (v2)
If slave device already has a receive handler registered, then the
error unwind of bonding device enslave function is broken.

The following will leave a pointer to freed memory in the slave
device list, causing a later kernel panic.
# modprobe dummy
# ip li add dummy0-1 link dummy0 type macvlan
# modprobe bonding
# echo +dummy0 >/sys/class/net/bond0/bonding/slaves

The fix is to detach the slave (which removes it from the list)
in the unwind path.

Signed-off-by: Stephen Hemminger <[email protected]>
Reviewed-by: Nicolas de Pesloüan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-01-03 12:49:16 -05:00
Stephen Hemminger 52f33af8ac ixgbe: fix typo's
Saw typo in one message, so decided to run spell checker.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Phil Schmitt <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
2012-01-02 17:43:17 -08:00
Stephen Hemminger fa84309533 genetlink: add auto module loading
When testing L2TP support, I discovered that the l2tp module is not autoloaded
as are other netlink interfaces. There is because of lack of hook in genetlink to call
request_module and load the module.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-12-28 13:48:55 -05:00
stephen hemminger 2494654d48 netem: loss model API sizes
The new netem loss model is configured with nested netlink messages.
This code is being overly strict about sizes, and is easily confused
by padding (or possible future expansion). Also message
for gemodel is incorrect.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-12-23 16:51:18 -05:00
stephen hemminger 2c64580046 netlink: wake up netlink listeners sooner (v2)
This patch changes it to yield sooner at halfway instead. Still not a cure-all
for listener overrun if listner is slow, but works much reliably.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-12-22 22:37:19 -05:00
stephen hemminger b57ef81ff8 netlink: af_netlink cleanup (v2)
Don't inline functions that cover several lines, and do inline
the trivial ones. Also make some arguments const.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-12-22 22:37:19 -05:00