Commit Graph

311686 Commits

Author SHA1 Message Date
parav.pandit@emulex.com e440cf2ca0 net: added support for 40GbE link.
1. removed code replication for tov calculation for 1G, 10G and
made is common for speed > 1G (1G, 10G, 40G, 100G).
2. defines values for #4 different 40G Phys (KR4, LF4, SR4, CR4)

Signed-off-by: Parav Pandit <parav.pandit@emulex.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:42:24 -07:00
Eric Dumazet 22911fc581 net: skb_free_datagram_locked() doesnt drop all packets
dropwatch wrongly diagnose all received UDP packets as drops.

This patch removes trace_kfree_skb() done in skb_free_datagram_locked().

Locations calling skb_free_datagram_locked() should do it on their own.

As a result, drops are accounted on the right function.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:40:57 -07:00
Thomas Graf 4c3af034fa netlink: Get rid of obsolete rtnetlink macros
Removes all RTA_GET*() and RTA_PUT*() variations, as well as the
the unused rtattr_strcmp(). Get rid of rtm_get_table() by moving
it to its only user decnet.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:36:44 -07:00
Thomas Graf 6b60978fde decnet: Do not use RTA_PUT() macros
Also, no need to trim on nlmsg_put() failure, nothing has been added
yet.  We also want to use nlmsg_end(), nlmsg_new() and nlmsg_free().

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:36:44 -07:00
Thomas Graf 74a0bd7d0e ip6mr: Do not use RTA_PUT() macros
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:36:44 -07:00
Thomas Graf 92a395e52f ipmr: Do not use RTA_PUT() macros
Also fix a needless skb tailroom check for a 4 bytes area
after after each rtnexthop block.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:36:44 -07:00
Thomas Graf 6e277ed59a inet_diag: Do not use RTA_PUT() macros
Also, no need to trim on nlmsg_put() failure, nothing has been added
yet.  We also want to use nlmsg_end(), nlmsg_new() and nlmsg_free().

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:36:44 -07:00
Thomas Graf 7b46866dd0 sock_diag: Do not use RTA_PUT() macros
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:36:43 -07:00
Thomas Graf 4245375db8 unix_diag: Do not use RTA_PUT() macros
Also, no need to trim on nlmsg_put() failure, nothing has been added
yet.  We also want to use nlmsg_end(), nlmsg_new() and nlmsg_free().

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:36:43 -07:00
Eric Dumazet c074da2810 ipv4: tcp: dont cache unconfirmed intput dst
DDOS synflood attacks hit badly IP route cache.

On typical machines, this cache is allowed to hold up to 8 Millions dst
entries, 256 bytes for each, for a total of 2GB of memory.

rt_garbage_collect() triggers and tries to cleanup things.

Eventually route cache is disabled but machine is under fire and might
OOM and crash.

This patch exploits the new TCP early demux, to set a nocache
boolean in case incoming TCP frame is for a not yet ESTABLISHED or
TIMEWAIT socket.

This 'nocache' boolean is then used in case dst entry is not found in
route cache, to create an unhashed dst entry (DST_NOCACHE)

SYN-cookie-ACK sent use a similar mechanism (ipv4: tcp: dont cache
output dst for syncookies), so after this patch, a machine is able to
absorb a DDOS synflood attack without polluting its IP route cache.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 15:34:24 -07:00
Somnath Kotur 93040ae5cc be2net: Fix to trim skb for padded vlan packets to workaround an ASIC Bug
Fixed spelling error in a comment as pointed out by DaveM.
Also refactored existing code a bit to provide placeholders for another ASIC
Bug workaround that will be checked-in soon after this.

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:35:49 -07:00
Yoshihiro Shimoda 525b8075ed net: sh_eth: add support for set_ringparam/get_ringparam
This patch supports the ethtool's set_ringparam() and get_ringparam().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:24:16 -07:00
Yoshihiro Shimoda 91c7755000 net: sh_eth: fix up the buffer pointers
After freeing the buffer, the driver should change the value of
the pointer to NULL.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:24:16 -07:00
Yoshihiro Shimoda 2ecbb783c3 net: sh_eth: remove unnecessary members/definitions
This patch removes unnecessary members in sh_th_private.
This patch also removes unnecessary definitions in sh_eth.h

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:24:16 -07:00
Yoshihiro Shimoda c26502680e net: sh_eth: remove unnecessary function
The sh_eth_timer() called mod_timer() for itself. So, this patch
removes the function.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:24:16 -07:00
Merav Sicron ebe6e21d23 bnx2x: Change bnx2x_tests_str_arr to static char
This patch changes the definition of bnx2x_tests_str_arr from char to static
char. This correction will also eliminate the sparse warning created in commit
cf2c1df62e.

Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:20:13 -07:00
Barak Witkowski 2e499d3cc1 bnx2x, bnx2fc, bnx2i, cnic: Add statistics support and FCoE capabilities advertisement
1. When FCoE offload driver is registered, copy its capabilities to the chip
   scratchpad.
2. Copy FCoE/iSCSI MAC addresses in aligned manner to chip scratchpad.
3. Add FCoE/iSCSI statistics collection support

Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:20:13 -07:00
Dan Carpenter 747cf6ed3d 6lowpan: double unlock on an error path
We already unlocked a few lines earlier here, so we can go directly to
drop without passing through unlock.  This was introduced recently in
c5d3687f6c ('6lowpan: read data from skb safely').

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27 01:16:45 -07:00
David S. Miller c3deafc526 netlink: Delete NLMSG_PUT and NLMSG_NEW.
No longer used and a poor interface as they were macros
with embedded gotos.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:15 -07:00
David S. Miller 02ef22ca40 pkt_sched: sch_api: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too, as well as remove
a useless cast.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:15 -07:00
David S. Miller 942b81653a pkt_sched: cls_api: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too, as well as remove
a useless cast.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:15 -07:00
David S. Miller 3f7a3283cc decnet: dn_table: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:15 -07:00
David S. Miller 737100e162 decnet: dn_route: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:15 -07:00
David S. Miller c64e66c67b audit: netlink: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:14 -07:00
David S. Miller e05273341c infiniband: netlink: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:14 -07:00
David S. Miller 01f534d0ae selinux: netlink: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:54:06 -07:00
David S. Miller b61bb01974 unix_diag: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too and remove useless
casts.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:41:00 -07:00
David S. Miller 8b00a53c63 pkt_sched: act_api: Move away from NLMSG_PUT().
Move away from NLMSG_NEW() as well.

And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:39:32 -07:00
David S. Miller 3da07c0c2b netfilter: nfnetlink_queue_core: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:35:27 -07:00
David S. Miller d550d09589 netfilter: nfnetlink_log: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:34:03 -07:00
David S. Miller c2bd4baf41 netfilter: ipt_ULOG: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:30:49 -07:00
David S. Miller d106352d9f inet_diag: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too, and remove useless
casts.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:28:54 -07:00
David S. Miller 77ca4ed566 decnet: dn_rtmsg: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Also, remove pointless kernel log message.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:25:55 -07:00
David S. Miller 62566ca55d netfilter: ebt_ulog: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Also, free and NULL out skb when nlmsg_put() fails and remove
pointless kernel log message.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:23:42 -07:00
David S. Miller a8edf8a690 gdm72xx: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:20:52 -07:00
David S. Miller 8786395c69 connector: Move cn_test.c away from NLMSG_PUT().
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:19:02 -07:00
Javier Martinez Canillas 85c931665d connector: use nlmsg_put() instead of NLMSG_PUT() macro.
The NLMSG_PUT() macro contains a hidden goto which makes the code hard
to audit and very error prone.

While been there also use the inline function nlmsg_data() instead of the
NLMSG_DATA() macro to do explicit type checking.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:14:20 -07:00
Jiri Pirko 4a9fbcc6d6 team: remove unused rcu_head field from team_port struct
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:09:39 -07:00
Jiri Pirko 52a4fd7780 team: do not allow to map disabled ports
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:09:39 -07:00
Jiri Pirko 122bb046bc team: fix team_adjust_ops with regard to enabled ports
team_adjust_ops should check for enabled ports, not all ports.
This may lead to division by zero. This patch fixes this.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:09:39 -07:00
alex.bluesman.smirnov@gmail.com 72fd5a8b75 mac802154: add monitor listener to TX datapath
Add monitor receive callback to the TX datapath to catch all the
data sent to transceivers.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:06:33 -07:00
alex.bluesman.smirnov@gmail.com 7b8e19b67c drivers/ieee802154: add support for the at86rf230/231 transceivers
The AT86RF231 is a feature rich, low-power 2.4 GHz radio transceiver
designed for industrial and consumer ZigBee/IEEE 802.15.4, 6LoWPAN,
RF4CE and high data rate 2.4 GHz ISM band applications.

This patch adds support for the Atmel RF230/231 radio transceivers.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:06:11 -07:00
alex.bluesman.smirnov@gmail.com 5265f46711 mac802154: mlme start request
Basic preparations to start the interface.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:06:11 -07:00
alex.bluesman.smirnov@gmail.com 66b69d4d7f mac802154: page and channel setter
A new method to set page and channel values for a transceiver
was added to the MIB.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:06:11 -07:00
alex.bluesman.smirnov@gmail.com 48e44d5057 mac802154: short address setter
A method to assign the IEEE802.15.4 short address was added to the
MIB implementation.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:06:11 -07:00
alex.bluesman.smirnov@gmail.com dcbe4f93f6 mac802154: set and get PAN id
Two methods intended to get and set the Private Area Network identifier
were added to the MIB implementation.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:06:11 -07:00
alex.bluesman.smirnov@gmail.com 32bad7e30f mac802154: add wpan device-class support
Every real 802.15.4 transceiver, which works with software MAC layer,
can be classified as a wpan device in this stack. So the wpan device
implementation provides missing link in datapath between the device
drivers and the Linux network queue.

According to the IEEE 802.15.4 standard each packet can be one of the
following types:
 - beacon
 - MAC layer command
 - ACK
 - data

This patch adds support for the data packet-type only, but this is
enough to perform data transmission and receiving over radio.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 21:06:11 -07:00
Dan Carpenter 5ac24979dc net: qmi_wwan: simplify a check in qmi_wwan_bind()
This code is easier to read if we specify which flags we want at the
condition instead of at the top of the function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 17:13:21 -07:00
David S. Miller 251da41301 ipv4: Cache ip_error() routes even when not forwarding.
And account for the fact that, when we are not forwarding, we should
bump statistic counters rather than emit an ICMP response.

RP-filter rejected lookups are still not cached.

Since -EHOSTUNREACH and -ENETUNREACH can now no longer be seen in
ip_rcv_finish(), remove those checks.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 16:27:09 -07:00
David S. Miller df67e6c9a6 ipv4: Remove unnecessary code from rt_check_expire().
IPv4 routing cache entries no longer use dst->expires, because the
metrics, PMTU, and redirect information are stored in the inetpeer
cache.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26 00:10:09 -07:00