aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2013-05-03tipc: cosmetic: clean up comments and break a long lineGerlando Falauto1-6/+7
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02drivers: net: cpsw: irq not disabled in cpsw isr in particular sequenceMugunthan V N1-1/+1
In CPSW NAPI, after processing all interrupts IRQ is enabled and then book keeping irq_enabled is updated. In random cases when a packet is transmitted or received between processing packets and IRQ enabled, then just after enabled IRQ and before irq_enabled is updated, ISR is called so IRQs are not disabled as irq_enabled is still false and CPU gets locked in CPSW ISR. By changing the sequence as update the irq_enabled and then enable IRQ fixes the issue. This issue is not captured always as it is a timing issue whether Tx or Rx IRQ is invoked between packet processing and enable IRQ. Cc: Sebastian Siewior <bigeasy@linutronix.de> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02xen-netback: better names for thresholdsWei Liu1-20/+29
This patch only changes some names to avoid confusion. In this patch we have: MAX_SKB_SLOTS_DEFAULT -> FATAL_SKB_SLOTS_DEFAULT max_skb_slots -> fatal_skb_slots #define XEN_NETBK_LEGACY_SLOTS_MAX XEN_NETIF_NR_SLOTS_MIN The fatal_skb_slots is the threshold to determine whether a packet is malicious. XEN_NETBK_LEGACY_SLOTS_MAX is the maximum slots a valid packet can have at this point. It is defined to be XEN_NETIF_NR_SLOTS_MIN because that's guaranteed to be supported by all backends. Suggested-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02xen-netback: avoid allocating variable size array on stackWei Liu1-2/+14
Tune xen_netbk_count_requests to not touch working array beyond limit, so that we can make working array size constant. Suggested-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02xen-netback: remove redundent parameter in netbk_count_requestsWei Liu1-4/+2
Tracking down from the caller, first_idx is always equal to vif->tx.req_cons. Remove it to avoid confusion. Suggested-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02be2net: Fix to fail probe if MSI-X enable fails for a VFSomnath Kotur1-7/+15
As per SPEC, INTx mode is not supported on VFs. So if enable_msix fails, then just fail probe. Also bail out of be_open if irq_register fails. Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02be2net: avoid napi_disable() when it has not been enabledSomnath Kotur2-2/+7
When RQ creation fails in be_open(), driver jumps to be_close() where napi_disable() is done without a prior napi_enable(); leading to a hang. This change is needed as there is no way to see if napi is enable/disabled. Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02be2net: Fix firmware download for LancerSomnath Kotur1-1/+1
Increasing the timeout value of write_object command to 60 seconds as 30 second timeout was found to be not enough for the command to complete. Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02be2net: Fix to receive Multicast Packets when Promiscuous mode is enabled on certain devicesAjit Khaparde1-2/+4
When a user requests Promiscuous mode on SkyHawk-R devices, the FW enables Desparate Promiscuous mode. Due to this, we need to explicitly enable Multicast Promiscuous mode so that Multicast packets are received as well. This patch fixes that. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02be2net: Fix to show tx priority pause counter in ethtool -SAjit Khaparde2-0/+2
The tx priority pause count is available with the driver. But we were not showing it. This change should fix it and display it in ethtool stats. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02be2net: Fix to use 32-bit stats to report rx_drops_no_fragmentAjit Khaparde1-6/+17
Only BE devices provide 16-bit counter for rx_drops_no_fragment. All other devices provide a 32-bit counter for this stat. Use the 32-bit value where available. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02be2net: Fix to use version 2 of cq_create for SkyHawk-R devicesAjit Khaparde2-14/+15
SkyHawk-R devices should use v2 of cq_create command. BE3/BE2 devices can use version 0 of the command to create a CQ. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02net: vlan,ethtool: netdev_features_t is more than 32 bitBjørn Mork2-2/+2
Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02net: use netdev_features_t in skb_needs_linearize()Patrick McHardy1-1/+1
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-02ipc_schedule_free() can do vfree() directly nowAl Viro1-87/+16
Commit 32fcfd40715e ("make vfree() safe to call from interrupt contexts") made it safe to do vfree directly from the RCU callback, which allows us to simplify ipc/util.c a lot by getting rid of the differences between vmalloc/kmalloc memory. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-02net: Restore NETIF_F_* bit ordering.David Miller1-6/+6
Commit 8ad227ff89a7 ("net: vlan: add 802.1ad support") added some new NETIF_F_* features bits, but it added them in the middle of existing values. Userland depends upon the flag bits via the per-netdevice 'flags' sysfs file. So restore the previous ordering by adding the new flags at the end. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-01linkage.h: fix build breakage due to symbol prefix handlingJames Hogan1-5/+2
Al's commit e1b5bb6d1236 ("consolidate cond_syscall and SYSCALL_ALIAS declarations") broke the build on blackfin and metag due to the following code: #ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x #else #define SYMBOL_NAME(x) x #endif #endif #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x)) __stringify literally stringifies CONFIG_SYMBOL_PREFIX ##x, so you get lines like this in kernel/sys_ni.s: .weak CONFIG_SYMBOL_PREFIXsys_quotactl .set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscall The patches in Rusty's modules-next tree such as "CONFIG_SYMBOL_PREFIX: cleanup." cleans up the whole mess around symbol prefixes, so this patch just attempts to fix the build in the meantime. The intermediate definition of SYMBOL_NAME above isn't used and is incorrect when CONFIG_SYMBOL_PREFIX is defined as CONFIG_SYMBOL_PREFIX is a quoted string literal, so define __SYMBOL_NAME directly depending on CONFIG_SYMBOL_PREFIX. Signed-off-by: James Hogan <james.hogan@imgtec.com> Mea-culpa-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Mike Frysinger <vapier@gentoo.org> Cc: uclinux-dist-devel@blackfin.uclinux.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-01don't bother with deferred freeing of fdtablesAl Viro2-67/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.hDavid Howells3-218/+230
Move non-public declarations and definitions from linux/proc_fs.h to fs/proc/internal.h. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Make the PROC_I() and PDE() macros internal to procfsDavid Howells4-17/+28
Make the PROC_I() and PDE() macros internal to procfs. This means making PDE_DATA() out of line. This could be made more optimal by storing PDE()->data into inode->i_private. Also provide a __PDE_DATA() that is inline and internal to procfs. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Supply a function to remove a proc entry by PDEDavid Howells14-73/+33
Supply a function (proc_remove()) to remove a proc entry (and any subtree rooted there) by proc_dir_entry pointer rather than by name and (optionally) root dir entry pointer. This allows us to eliminate all remaining pde->name accesses outside of procfs. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Grant Likely <grant.likely@linaro.or> cc: linux-acpi@vger.kernel.org cc: openipmi-developer@lists.sourceforge.net cc: devicetree-discuss@lists.ozlabs.org cc: linux-pci@vger.kernel.org cc: netdev@vger.kernel.org cc: netfilter-devel@vger.kernel.org cc: alsa-devel@alsa-project.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01take cgroup_open() and cpuset_open() to fs/proc/base.cAl Viro5-31/+35
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01ppc: Clean up scanlogDavid Howells1-18/+11
Clean up the pseries scanlog driver's use of procfs: (1) Don't need to save the proc_dir_entry pointer as we have the filename to remove with. (2) Save the scan log buffer pointer in a static variable (there is only one of it) and don't save it in the PDE (which doesn't have a destructor). Signed-off-by: David Howells <dhowells@redhat.com> cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> cc: Paul Mackerras <paulus@samba.org> cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01ppc: Clean up rtas_flash driver somewhatDavid Howells1-248/+204
Clean up some of the problems with the rtas_flash driver: (1) It shouldn't fiddle with the internals of the procfs filesystem (altering pde->count). (2) If pid namespaces are in effect, then you can get multiple inodes connected to a single pde, thereby rendering the pde->count > 2 test useless. (3) The pde->count fudging doesn't work for forked, dup'd or cloned file descriptors, so add static mutexes and use them to wrap access to the driver through read, write and release methods. (4) The driver can only handle one device, so allocate most of the data previously attached to the pde->data as static variables instead (though allocate the validation data buffer with kmalloc). (5) We don't need to save the pde pointers as long as we have the filenames available for removal. (6) Don't try to multiplex what the update file read method does based on the filename. Instead provide separate file ops and split the function. Whilst we're at it, tabulate the procfile information and loop through it when creating or destroying them rather than manually coding each one. [Folded fixes from Vasant Hegde <hegdevasant@linux.vnet.ibm.com>] Signed-off-by: David Howells <dhowells@redhat.com> cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> cc: Paul Mackerras <paulus@samba.org> cc: Anton Blanchard <anton@samba.org> cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01hostap: proc: Use remove_proc_subtree()David Howells1-19/+1
Use remove_proc_subtree() rather than remove_proc_entry() to remove a device-specific proc directory and all its children. Signed-off-by: David Howells <dhowells@redhat.com> cc: Jouni Malinen <j@w1.fi> cc: Johannes Berg <johannes@sipsolutions.net> cc: linux-wireless@vger.kernel.org cc: devel@driverdev.osuosl.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01drm: proc: Use remove_proc_subtree()David Howells1-15/+7
Use remove_proc_subtree() rather than remove_proc_entry() to remove a minor-specific drm proc directory and all its children. Things could theoretically be improved by storing the drm_minor pointer in the minor-specific dir proc_dir_entry struct data and then scrapping the list of proc files - but that's shared with the debugfs interface where you can't do that, so I don't see an easy way of doing it. Signed-off-by: David Howells <dhowells@redhat.com> cc: dri-devel@lists.freedesktop.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01drm: proc: Use minor->index to label things, not PDE->nameDavid Howells3-11/+7
Use minor->index to label things, not the name field from the proc_dir_entry of the /proc/dwm/<minor>/ directory. Also, use "%u" not "%d" to render the value and use a 12-byte buffer in which to render the integer, not a 16-byte buffer. The longest string an unsigned int can give you is 10 chars (4294967295) plus a NUL, so round up to 12 as the stack is likely to be 4- or 8-byte aligned. Signed-off-by: David Howells <dhowells@redhat.com> cc: dri-devel@lists.freedesktop.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01drm: Constify drm_proc_list[]David Howells2-4/+4
Constify drm_proc_list[] and related pointers. Signed-off-by: David Howells <dhowells@redhat.com> cc: dri-devel@lists.freedesktop.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01zoran: Don't print proc_dir_entry data in debugDavid Howells1-1/+1
Don't print proc_dir_entry data in debug as we're soon to have no direct access to the contents of the PDE. Print what was put in there instead. Signed-off-by: David Howells <dhowells@redhat.com> cc: mjpeg-users@lists.sourceforge.net cc: linux-media@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()David Howells1-11/+18
Don't access the proc_dir_entry in ReiserFS's r_open(), r_start() r_show() procfs interface functions. ReiserFS stores the ->show() method pointer in PDE->data and the super_block pointer in PDE->parent->data. This isn't changing. Currently, ReiserFS passes the PDE pointer into seq_file::private from r_open() so that r_start() and r_show() can then access it. Instead, use seq_open_private() to allocate a two-pointer struct that's passed through seq_file::private and put the ->show() method and the sb pointers in there. Signed-off-by: David Howells <dhowells@redhat.com> cc: reiserfs-devel@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Supply an accessor for getting the data from a PDE's parentDavid Howells5-3/+11
Supply an accessor function for getting the private data from the parent proc_dir_entry struct of the proc_dir_entry struct associated with an inode. ReiserFS, for instance, stores the super_block pointer in the proc directory it makes for that super_block, and a pointer to the respective seq_file show function in each of the proc files in that directory. This allows a reduction in the number of file_operations structs, open functions and seq_operations structs required. The problem otherwise is that each show function requires two pieces of data but only has storage for one per PDE (and this has no release function). Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Jerry Chuang <jerry-chuang@realtek.com> cc: Maxim Mikityanskiy <maxtram95@gmail.com> cc: YAMANE Toshiaki <yamanetoshi@gmail.com> cc: linux-wireless@vger.kernel.org cc: linux-scsi@vger.kernel.org cc: devel@driverdev.osuosl.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01airo: Use remove_proc_subtree()David Howells1-36/+13
Use remove_proc_subtree() to remove the airo device subdir and all its children instead of doing it manually. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-wireless@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01rtl8192u: Don't need to save device proc dir PDEDavid Howells2-13/+6
Don't need to save the PDE of a directory created under /proc/net/rtl8192/ as we can use proc subtree deletion to get rid of it and all its children. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Jerry Chuang <jerry-chuang@realtek.com> cc: linux-wireless@vger.kernel.org cc: devel@driverdev.osuosl.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01rtl8187se: Use a dir under /proc/net/r8180/David Howells2-19/+8
Create a dir under /proc/net/r8180/ named for the device and create that device's files under there. This means that there won't be a problem for multiple devices in the system (if such is possible) and it means we don't need to save the 'device directory' PDE any more as we can just do a proc subtree removal. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Maxim Mikityanskiy <maxtram95@gmail.com> cc: YAMANE Toshiaki <yamanetoshi@gmail.com> cc: linux-wireless@vger.kernel.org cc: devel@driverdev.osuosl.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Add proc_mkdir_data()David Howells6-33/+28
Add proc_mkdir_data() to allow procfs directories to be created that are annotated at the time of creation with private data rather than doing this post-creation. This means no access is then required to the proc_dir_entry struct to set this. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Neela Syam Kolli <megaraidlinux@lsi.com> cc: Jerry Chuang <jerry-chuang@realtek.com> cc: linux-scsi@vger.kernel.org cc: devel@driverdev.osuosl.org cc: linux-wireless@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}David Howells5-37/+38
Move some bits from linux/proc_fs.h to linux/of.h, signal.h and tty.h. Also move proc_tty_init() and proc_device_tree_init() to fs/proc/internal.h as they're internal to procfs. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> cc: devicetree-discuss@lists.ozlabs.org cc: linux-arch@vger.kernel.org cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Jri Slaby <jslaby@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Move PDE_NET() to fs/proc/proc_net.cDavid Howells2-5/+4
Move PDE_NET() to fs/proc/proc_net.c as that's where the only user is. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Split the namespace stuff out into linux/proc_ns.hDavid Howells15-92/+109
Split the proc namespace stuff out into linux/proc_ns.h. Signed-off-by: David Howells <dhowells@redhat.com> cc: netdev@vger.kernel.org cc: Serge E. Hallyn <serge.hallyn@ubuntu.com> cc: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Move proc_fd() to fs/proc/fd.hDavid Howells2-5/+5
Move proc_fd() to fs/proc/fd.h. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Uninline pid_delete_dentry()David Howells2-9/+14
Uninline pid_delete_dentry() as it's only used by three function pointers. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01proc: Supply PDE attribute setting accessor functionsDavid Howells14-35/+40
Supply accessor functions to set attributes in proc_dir_entry structs. The following are supplied: proc_set_size() and proc_set_user(). Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> cc: linuxppc-dev@lists.ozlabs.org cc: linux-media@vger.kernel.org cc: netdev@vger.kernel.org cc: linux-wireless@vger.kernel.org cc: linux-pci@vger.kernel.org cc: netfilter-devel@vger.kernel.org cc: alsa-devel@alsa-project.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01filter: fix va_list build errorXi Wang1-0/+1
This patch fixes the following build error. In file included from include/linux/filter.h:52:0, from arch/arm/net/bpf_jit_32.c:14: include/linux/printk.h:54:2: error: unknown type name ‘va_list’ include/linux/printk.h:105:21: error: unknown type name ‘va_list’ include/linux/printk.h:108:30: error: unknown type name ‘va_list’ Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01af_unix: fix a fatal race with bit fieldsEric Dumazet2-8/+9
Using bit fields is dangerous on ppc64/sparc64, as the compiler [1] uses 64bit instructions to manipulate them. If the 64bit word includes any atomic_t or spinlock_t, we can lose critical concurrent changes. This is happening in af_unix, where unix_sk(sk)->gc_candidate/ gc_maybe_cycle/lock share the same 64bit word. This leads to fatal deadlock, as one/several cpus spin forever on a spinlock that will never be available again. A safer way would be to use a long to store flags. This way we are sure compiler/arch wont do bad things. As we own unix_gc_lock spinlock when clearing or setting bits, we can use the non atomic __set_bit()/__clear_bit(). recursion_level can share the same 64bit location with the spinlock, as it is set only with this spinlock held. [1] bug fixed in gcc-4.8.0 : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52080 Reported-by: Ambrose Feinstein <ambrose@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01bnx2x: Prevent memory leak when cnic is absentYuval Mintz1-0/+2
bnx2x driver allocates searcher T2 tables, but it releases that memory during unload only released if the cnic is loaded. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01bnx2x: correct reading of speed capabilitiesYaniv Rosner1-2/+4
When the bnx2x driver reads the port configuration - mask irrelevant bits. Without this change, the unintended bits may cause the driver to needlessly toggle the link, as a comparison in the link flap avoidance flow will show that the old link did not advertise the same capabilities and thus cannot be retained. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01net: sctp: attribute printl with __printf for gcc fmt checksDaniel Borkmann1-1/+1
Let GCC check for format string errors in sctp's probe printl function. This patch fixes the warning when compiled with W=1: net/sctp/probe.c:73:2: warning: function might be possible candidate for 'gnu_printf' format attribute [-Wmissing-format-attribute] Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01netlink: kconfig: move mmap i/o into netlink kconfigDaniel Borkmann2-9/+9
Currently, in menuconfig, Netlink's new mmaped IO is the very first entry under the ``Networking support'' item and comes even before ``Networking options'': [ ] Netlink: mmaped IO Networking options ---> ... Lets move this into ``Networking options'' under netlink's Kconfig, since this might be more appropriate. Introduced by commit ccdfcc398 (``netlink: mmaped netlink: ring setup''). Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01netpoll: convert mutex into a semaphoreNeil Horman2-8/+8
Bart Van Assche recently reported a warning to me: <IRQ> [<ffffffff8103d79f>] warn_slowpath_common+0x7f/0xc0 [<ffffffff8103d7fa>] warn_slowpath_null+0x1a/0x20 [<ffffffff814761dd>] mutex_trylock+0x16d/0x180 [<ffffffff813968c9>] netpoll_poll_dev+0x49/0xc30 [<ffffffff8136a2d2>] ? __alloc_skb+0x82/0x2a0 [<ffffffff81397715>] netpoll_send_skb_on_dev+0x265/0x410 [<ffffffff81397c5a>] netpoll_send_udp+0x28a/0x3a0 [<ffffffffa0541843>] ? write_msg+0x53/0x110 [netconsole] [<ffffffffa05418bf>] write_msg+0xcf/0x110 [netconsole] [<ffffffff8103eba1>] call_console_drivers.constprop.17+0xa1/0x1c0 [<ffffffff8103fb76>] console_unlock+0x2d6/0x450 [<ffffffff8104011e>] vprintk_emit+0x1ee/0x510 [<ffffffff8146f9f6>] printk+0x4d/0x4f [<ffffffffa0004f1d>] scsi_print_command+0x7d/0xe0 [scsi_mod] This resulted from my commit ca99ca14c which introduced a mutex_trylock operation in a path that could execute in interrupt context. When mutex debugging is enabled, the above warns the user when we are in fact exectuting in interrupt context interrupt context. After some discussion, It seems that a semaphore is the proper mechanism to use here. While mutexes are defined to be unusable in interrupt context, no such condition exists for semaphores (save for the fact that the non blocking api calls, like up and down_trylock must be used when in irq context). Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Reported-by: Bart Van Assche <bvanassche@acm.org> CC: Bart Van Assche <bvanassche@acm.org> CC: David Miller <davem@davemloft.net> CC: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01netlink: Fix skb ref counting.Pravin B Shelar1-1/+0
Commit f9c2288837ba072b21dba955f04a4c97eaa77b1e (netlink: implement memory mapped recvmsg) increamented skb->users ref count twice for a dump op which does not look right. Following patch fixes that. CC: Patrick McHardy <kaber@trash.net> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01init: Do not warn on non-zero initcall returnSteven Rostedt1-4/+1
Commit f91eb62f71b3 ("init: scream bloody murder if interrupts are enabled too early") added three new warnings. The first two seemed reasonable, but the third included a warning when an initcall returned non-zero. Although, the third WARN() does include an imbalanced preempt disabled, or irqs disable, it shouldn't warn if it only had an initcall that just returns non-zero. In fact, according to Linus, it shouldn't print at all. As it only prints with initcall_debug set, and that already shows enough information to fix things. Link: http://lkml.kernel.org/r/CA+55aFzaBC5SFi7=F2mfm+KWY5qTsBmOqgbbs8E+LUS8JK-sBg@mail.gmail.com Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>