summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-01-08veth: avoid a NULL deref in veth_stats_oneEric Dumazet
commit 2681128f0ced8a (veth: extend device features) added a NULL deref in veth_stats_one(), as veth_get_stats64() was not testing if the peer device was setup or not. At init time, we call dev_get_stats() before veth pair is fully setup. [ 178.854758] [<ffffffffa00f5677>] veth_get_stats64+0x47/0x70 [veth] [ 178.861013] [<ffffffff814f0a2d>] dev_get_stats+0x6d/0x130 [ 178.866486] [<ffffffff81504efc>] rtnl_fill_ifinfo+0x47c/0x930 [ 178.872299] [<ffffffff81505b93>] rtmsg_ifinfo+0x83/0x100 [ 178.877678] [<ffffffff81505cc6>] rtnl_configure_link+0x76/0xa0 [ 178.883580] [<ffffffffa00f52fa>] veth_newlink+0x16a/0x350 [veth] [ 178.889654] [<ffffffff815061cc>] rtnl_newlink+0x4dc/0x5e0 [ 178.895128] [<ffffffff81505e1e>] ? rtnl_newlink+0x12e/0x5e0 [ 178.900769] [<ffffffff8150587d>] rtnetlink_rcv_msg+0x11d/0x310 [ 178.906669] [<ffffffff81505760>] ? __rtnl_unlock+0x20/0x20 [ 178.912225] [<ffffffff81521f89>] netlink_rcv_skb+0xa9/0xd0 [ 178.917779] [<ffffffff81502d55>] rtnetlink_rcv+0x25/0x40 [ 178.923159] [<ffffffff815218d1>] netlink_unicast+0x1b1/0x230 [ 178.928887] [<ffffffff81521c4e>] netlink_sendmsg+0x2fe/0x3b0 [ 178.934615] [<ffffffff814dbe22>] sock_sendmsg+0xd2/0xf0 So we must check if peer was setup in veth_get_stats64() As pointed out by Ben Hutchings, priv->peer is missing proper synchronization. Adding RCU protection is a safe and well documented way to make sure we don't access about to be freed or already freed data. Reported-by: Tom Parkin <tparkin@katalix.com> Signed-off-by: Eric Dumazet <edumazet@google.com> CC: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-08chelsio: Use netdev_<level> and pr_<level>Joe Perches
Use more current logging styles. Convert printks to pr_<level> and printks with ("%s: ...", dev->name to netdev_<level>(dev, "... Add pr_fmt #defines where appropriate. Coalesce formats. Use pr_<level>_once where appropriate. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07drivers/net: delete 8390 based EISA drivers.Paul Gortmaker
The NS8390 chip was essentially the 1st widespread PC ethernet chip, starting its life on 8 bit ISA cards in the late 1980s. Even with better technologies available (bus mastering etc) the 8390 managed to get used on a few rare EISA cards in the early to mid 1990s. The EISA bus in the x86 world was largely confined to systems ranging from 486 to 586 (essentially 200MHz or lower, and less than 100MB RAM) -- i.e. machines unlikely to be still in service, and even less likely to be running a 3.9+ kernel. On top of that, only one of the five really ever was considered non-experimental; the smc-ultra32 was the one -- since it was largely just an EISA version of the popular smc-ultra ISA card. All the others had such a tiny user base that they simply never could be considered anything more than experimental. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-07drivers/net: remove orphaned references to micro channelPaul Gortmaker
We threw away the microchannel support, but the removal wasn't completely trivial since there was namespace overlap with the machine check support, and hence some orphaned dependencies survived the deletion. This attempts to sweep those up and send them to the bit-bucket. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07team: use strlcpy with ethtool_drvinfo fieldsFlavio Leitner
The fields must be null-terminated. Signed-off-by: Flavio Leitner <fbl@redhat.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07tcp: make sysctl_tcp_ecn namespace awareHannes Frederic Sowa
As per suggestion from Eric Dumazet this patch makes tcp_ecn sysctl namespace aware. The reason behind this patch is to ease the testing of ecn problems on the internet and allows applications to tune their own use of ecn. Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: David Miller <davem@davemloft.net> Cc: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07ndisc: Use struct rd_msg for redirect message.YOSHIFUJI Hideaki / 吉藤英明
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07net: splice: avoid high order page splittingEric Dumazet
splice() can handle pages of any order, but network code tries hard to split them in PAGE_SIZE units. Not quite successfully anyway, as __splice_segment() assumed poff < PAGE_SIZE. This is true for the skb->data part, not necessarily for the fragments. This patch removes this logic to give the pages as they are in the skb. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Willy Tarreau <w@1wt.eu> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07net: use ETHTOOL_FWVERS_LEN instead of ETHTOOL_BUSINFO_LEN for fw_ver stringsJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07ethtool: fix drvinfo strings set in driversJiri Pirko
Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07ethtool: set addr_assign_type to NET_ADDR_SET when addr is passed on createJiri Pirko
In case user passed address via netlink during create, NET_ADDR_PERM was set. That is not correct so fix this by setting NET_ADDR_SET. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07ethoc: fix mac address setJiri Pirko
Function ethoc_set_mac_address() was incorrectly using passed pointer as pointer to address, that is not correct. Struct sockaddr have to be be used here. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07tg3: Remove IS_ENABLED(CONFIG_HWMON) checkNithin Nayak Sujir
Commit de0a41484c47d783dd4d442914815076aa2caac2 added Kconfig logic to select HWMON and removed all the IS_ENABLED(CONFIG_HWMON) checks in the tg3.c file. It missed this one check in the header. Update version to 3.129 and update copyright year. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07tg3: Improve PCI function number detection.Michael Chan
Simplify the code to detect PCI function number on 5717, 5719, and 5720. If shared memory does not have proper signature, read the function number from register directly. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07tg3: Add NVRAM support for 5762Michael Chan
Detect NVRAM types for 5762 and read OTP firmware version. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-07tg3: Add support for new 5762 ASICMichael Chan
Add basic support for 5762 which is a 57765_PLUS class device. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04ndisc: Remove unused space at tail of skb for ndisc messages. (TAKE 3)YOSHIFUJI Hideaki / 吉藤英明
Currently, the size of skb allocated for NDISC is MAX_HEADER + LL_RESERVED_SPACE(dev) + packet length + dev->needed_tailroom, but only LL_RESERVED_SPACE(dev) bytes is "reserved" for headers. As a result, the skb looks like this (after construction of the message): head data tail end +--------------------------------------------------------------+ + | | | | +--------------------------------------------------------------+ |<-hlen---->|<---ipv6 packet------>|<--tlen-->|<--MAX_HEADER-->| =LL_ = dev RESERVED_ ->needed_ SPACE(dev) tailroom As the name implies, "MAX_HEADER" is used for headers, and should be "reserved" in prior to packet construction. Or, if some space is really required at the tail of ther skb, it should be explicitly documented. We have several option after construction of NDISC message: Option 1: head data tail end +---------------------------------------------+ + | | | +---------------------------------------------+ |<-hlen---->|<---ipv6 packet------>|<--tlen-->| =LL_ = dev RESERVED_ ->needed_ SPACE(dev) tailroom Option 2: head data tail end +--------------------------------------------------+ + | | | +--------------------------------------------------+ |<--MAX_HEADER-->|<---ipv6 packet------>|<--tlen-->| = dev ->needed_ tailroom Option 3: head data tail end +--------------------------------------------------------------+ + | | | | +--------------------------------------------------------------+ |<--MAX_HEADER-->|<-hlen---->|<---ipv6 packet------>|<--tlen-->| =LL_ = dev RESERVED_ ->needed_ SPACE(dev) tailroom Our tunnel drivers try expanding headroom and the space for tunnel encapsulation was not a mandatory space -- so we are not seeing bugs here --, but just for optimization for performance critial situations. Since NDISC messages are not performance critical unlike TCP, and as we know outgoing device, LL_RESERVED_SPACE(dev) should be just enough for the device in most (if not all) cases: LL_RESERVED_SPACE(dev) <= LL_MAX_HEADER <= MAX_HEADER Note that LL_RESERVED_SPACE(dev) is also enough for NDISC over SIT (e.g., ISATAP). So, I think Option 1 is just fine here. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04NET: FEC: dynamtic check DMA desc buff typeFrank Li
MX6 and mx28 support enhanced DMA descriptor buff to support 1588 ptp. But MX25, MX3x, MX5x can't support enhanced DMA descriptor buff. Check fec type and choose correct DMA descriptor buff type. Remove static config CONFIG_FEC_PTP. ptp function will be auto detected. Signed-off-by: Frank Li <Frank.Li@freescale.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04ethernet/broadcom/tg3: Fix sparse warning: constant 0x7fffffffffffffff is so ↵Peter Hüwe
big it is long long Sparse complains that: drivers/net/ethernet/broadcom/tg3.c:5670:55: sparse: constant 0x7fffffffffffffff is so big it is long long (on x86/32 bit) so we suffix the constant with LL in the header file. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04smsc95xx: enable dynamic autosuspendSteve Glendinning
This patch enables USB dynamic autosuspend for LAN9500A. This saves very little power in itself, but it allows power saving in upstream hubs/hosts. The earlier devices in this family (LAN9500/9512/9514) do not support this feature. Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04smsc95xx: eliminate duplicate warnings on io failureSteve Glendinning
The register read/write functions already log a warning if an access fails, so this patch removes the additional warnings logged by callers that don't add any more information. This patch makes the resulting driver smaller by not containing as many warning strings. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: introduce upper device lists and remove dev->masterDavid S. Miller
Jiri Pirko says: ==================== This is a V6 of a repost of my previous patchset: "[patch net-next v2 00/15] net: introduce upper device lists and remove dev->master" from Aug 14 The discussion around "[net-next] bonding: don't allow the master to become its slave" forced me to think about upper<->lower device connections. This patchset adds a possibility to record upper device linkage. All upper<->lower devices are converted to use this mechanism right after. That leads to dev->master removal because this info becomes redundant since "master links" have the same value. After all changes, there is no longer possible to do things as: "bond->someotherdevice->samebond" Also I think that drivers like cxgb3, qlcnic, qeth would benefit by this in future by being able to get more appropriate info about l3 addresses. v5->v6: - netdev_has_upper_dev() - added statement to comment that this is looking at the immediate upper devices only. - renamed "RTNL semaphore" -> "RTNL lock" in all comments - renamed __netdev_has_upper_dev() to __netdev_search_upper_dev() to emhasize the difference to netdev_has_upper_dev() v4->v5: - fixed missed typo in drivers/infiniband/hw/nes/nes_cm.c v3->v4: - comments in __netdev_upper_dev_link() squashed into one line - kfree_rcu used instead of call_rcu in netdev_upper_dev_unlink() v2->v3: - removed recursion in __netdev_has_upper_dev() - refreshed bits to be applicable on current net-next v1->v2: - s/unique/master/ better naming + stays closer to the past - fixed vlan err goto - original patch 15 (WARN_ON change) is squashed into the first patch ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: kill dev->masterJiri Pirko
Nobody uses this now. Remove it. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: remove no longer used netdev_set_bond_master() and netdev_set_master()Jiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04bonding: remove usage of dev->masterJiri Pirko
Benefit from new upper dev list and free bonding from dev->master usage. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04nes: remove usage of dev->masterJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04vlan: remove usage of dev->master in __vlan_find_dev_deep()Jiri Pirko
Also, since all users call __vlan_find_dev_deep() with rcu_read_lock, make no possibility to call this with rtnl mutex held only. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04qeth: ensure that __vlan_find_dev_deep() is called with rcu_read_lockJiri Pirko
Also benefit from rcu_read_lock held and use __in_dev_get_rcu() in ipv4 case. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04qlcnic: guard __vlan_find_dev_deep() by rcu_read_lockJiri Pirko
rcu_read_lock was missing here Signed-off-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04cxgb3: remove usage of dev->masterJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04netpoll: remove usage of dev->masterJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04bridge: remove usage of netdev_set_master()Jiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04team: remove usage of netdev_set_master()Jiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04rtnetlink: remove usage of dev->masterJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04vlan: add link to upper deviceJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04macvlan: add link to upper deviceJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: introduce upper device listsJiri Pirko
This lists are supposed to serve for storing pointers to all upper devices. Eventually it will replace dev->master pointer which is used for bonding, bridge, team but it cannot be used for vlan, macvlan where there might be multiple upper present. In case the upper link is replacement for dev->master, it is marked with "master" flag. New upper device list resolves this limitation. Also, the information stored in lists is used for preventing looping setups like "bond->somethingelse->samebond" Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04ll_temac: fix mac address settingJiri Pirko
Previously, when invalid address was passed to ndo_set_mac_address, random mac was generated and set. Fix this by returning -EADDRNOTAVAIL in this situation. Also polish the code around a bit. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04um: net: use eth_hw_addr_random() to generate random macJiri Pirko
Also remove unused "mac" from uml_net struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: remove unnecessary NET_ADDR_RANDOM "bitclean"Jiri Pirko
NET_ADDR_SET is set in dev_set_mac_address() no need to alter dev->addr_assign_type value in drivers. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: add address assign type "SET"Jiri Pirko
This is the way to indicate that mac address of a device has been set by dev_set_mac_address() Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: set dev->addr_assign_type correctlyJiri Pirko
Not a bitfield, but a plain value. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04net: call add_device_randomness() only after successful mac changeJiri Pirko
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-04rtnl: use dev_set_mac_address() instead of plain ndo_Jiri Pirko
Benefit from existence of dev_set_mac_address() and remove duplicate code. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-03team: update master carrier stateFlavio Leitner
Update master's carrier state when there is any change with its ports. Signed-off-by: Flavio Leitner <fbl@redhat.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-03qlcnic: fix build errorSony Chacko
Fix the following error reported by kbuild test robot. static declaration of 'qlcnic_restore_indev_addr' follows non-static declaration. Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-03qlcnic: do not duplicate infrastructure functionsStephen Rothwell
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-02qlcnic: update driver versionSigned-off-by: Sony Chacko
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-02qlcnic: remove unused definitions from header fileShahed Shaikh
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-02qlcnic: 83xx ethtool interface routinesSony Chacko
83xx ethtool interface routines Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>