Zhangfei Gao [Tue, 3 Jun 2014 05:49:37 +0000 (13:49 +0800)]
net: hisilicon: add hix5hd2 mac driver
Add support for the hix5hd2 XGMAC 1Gb ethernet device.
The controller requires two queues for tx and two queues for rx.
Controller fetch buffer from free queue and then push to used queue.
Diver should prepare free queue and free buffer from used queue.
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 3 Jun 2014 06:07:02 +0000 (23:07 -0700)]
Merge branch 'ethtool-rssh-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/net-next
Ben Hutchings says:
====================
Pull request: Fixes for new ethtool RSS commands
This addresses several problems I previously identified with the new
ETHTOOL_{G,S}RSSH commands:
1. Missing validation of reserved parameters
2. Vague documentation
3. Use of unnamed magic number
4. No consolidation with existing driver operations
I don't currently have access to suitable network hardware, but have
tested these changes with a dummy driver that can support various
combinations of operations and sizes, together with (a) Debian's ethtool
3.13 (b) ethtool 3.14 with the submitted patch to use ETHTOOL_{G,S}RSSH
and minor adjustment for fixes 1 and 3.
v2: Update RSS operations in vmxnet3 too
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Thu, 15 May 2014 00:25:27 +0000 (01:25 +0100)]
ethtool: Replace ethtool_ops::{get,set}_rxfh_indir() with {get,set}_rxfh()
ETHTOOL_{G,S}RXFHINDIR and ETHTOOL_{G,S}RSSH should work for drivers
regardless of whether they expose the hash key, unless you try to
set a hash key for a driver that doesn't expose it.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Fabio Estevam [Mon, 2 Jun 2014 18:44:30 +0000 (15:44 -0300)]
fec: Include pinctrl header file
Commit 5bbde4d2ec ("net: fec: use pinctrl PM helpers") caused the following
build error on m68k:
drivers/net/ethernet/freescale/fec_main.c: In function 'fec_enet_open':
drivers/net/ethernet/freescale/fec_main.c:1819:2: error: implicit declaration of function 'pinctrl_pm_select_default_state' [-Werror=implicit-function-declaration]
drivers/net/ethernet/freescale/fec_main.c: In function 'fec_enet_close':
drivers/net/ethernet/freescale/fec_main.c:1863:2: error: implicit declaration of function 'pinctrl_pm_select_sleep_state' [-Werror=implicit-function-declaration]
In order to fix the build error, include the linux/pinctrl/consumer.h header
file.
Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Wed, 28 May 2014 05:39:37 +0000 (22:39 -0700)]
bridge: Add bridge ifindex to bridge fdb notify msgs
(This patch was previously posted as RFC at
http://patchwork.ozlabs.org/patch/352677/)
This patch adds NDA_MASTER attribute to neighbour attributes enum for
bridge/master ifindex. And adds NDA_MASTER to bridge fdb notify msgs.
Today bridge fdb notifications dont contain bridge information.
Userspace can derive it from the port information in the fdb
notification. However this is tricky in some scenarious.
Example, bridge port delete notification comes before bridge fdb
delete notifications. And we have seen problems in userspace
when using libnl where, the bridge fdb delete notification handling code
does not understand which bridge this fdb entry is part of because
the bridge and port association has already been deleted.
And these notifications (port membership and fdb) are generated on
separate rtnl groups.
Fixing the order of notifications could possibly solve the problem
for some cases (I can submit a separate patch for that).
This patch chooses to add NDA_MASTER to bridge fdb notify msgs
because it not only solves the problem described above, but also helps
userspace avoid another lookup into link msgs to derive the master index.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Paul Gortmaker [Fri, 30 May 2014 19:39:30 +0000 (15:39 -0400)]
drivers/net: fix broadcom/bcmsysport.c compile fail on SPARC
To fix:
CC drivers/net/ethernet/broadcom/bcmsysport.o
In file included from drivers/net/ethernet/broadcom/bcmsysport.c:28:0:
drivers/net/ethernet/broadcom/bcmsysport.h:41:8: error: redefinition of 'struct tsb'
arch/sparc/include/asm/mmu_64.h:65:8: note: originally defined here
make[1]: *** [drivers/net/ethernet/broadcom/bcmsysport.o] Error 1
we change struct tsb to struct bcm_tsb in the broadcom driver in
order to avoid the namespace collision. For consistency, we also
change struct rsb to struct bcm_rsb, so the Rx/Tx symmetry is
maintained.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David Ahern [Fri, 30 May 2014 19:34:39 +0000 (13:34 -0600)]
fib_trie: use seq_file_net rather than seq->private
Make fib_triestat_seq_show consistent with other /proc/net files and
use seq_file_net.
Signed-off-by: David Ahern <dsahern@gmail.com> Cc: David S. Miller <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: James Morris <jmorris@namei.org> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Cc: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Chema Gonzalez [Fri, 30 May 2014 17:15:12 +0000 (10:15 -0700)]
net: filter: fix length calculation in BPF testsuite
The current probe_filter_length() (the function that calculates the
length of a test BPF filter) behavior is to declare the end of the
filter as soon as it finds {0, *, *, 0}. This is actually a valid
insn ("ld #0"), so any filter with includes "BPF_STMT(BPF_LD | BPF_IMM, 0)"
fails (its length is cut short).
We are changing probe_filter_length() so as to start from the end, and
declare the end of the filter as the first instruction which is not
{0, *, *, 0}. This solution produces a simpler patch than the
alternative of using an explicit end-of-filter mark. It is technically
incorrect if your filter ends up with "ld #0", but that should not
happen anyway.
We also add a new test (LD_IMM_0) that includes ld #0 (does not work
without this patch).
Signed-off-by: Chema Gonzalez <chema@google.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patchset consists of different fixes and improvements in the mvneta
and mv643xx_eth drivers. The most important change is the one that allows
to support small MSS values (see patches 2 and 6).
This is done following the Solarflare driver (see commit 7e6d06f0de3f7).
While doing this some other fixes were spotted and so they are included.
Finally, notice that the TSO support introduced a wrong DMA unmapping
of the TSO header buffers, so patches 4 and 8 provide a couple patches to
fix that in the drivers.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ezequiel Garcia [Fri, 30 May 2014 16:40:11 +0000 (13:40 -0300)]
net: mv643xx_eth: Avoid unmapping the TSO header buffers
The buffers for the TSO headers belong to a DMA coherent region which is
allocated at ndo_open() time, and released at ndo_stop() time.
Therefore, and contrary to the TSO payload descriptor buffers, the TSO header
buffers don't need to be unmapped. This commit adds a check to detect a
TSO header buffer and explicitly prevent the unmap.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ezequiel Garcia [Fri, 30 May 2014 16:40:10 +0000 (13:40 -0300)]
net: mv643xx_eth: Drop the NETDEV_TX_BUSY return path
After adding proper stop/wake thresholds, we can expect a queue to never
be full and drop the NETDEV_TX_BUSY return path. In any case, if the queue
cannot accommodate a TSO packet, the packet would be discarded.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ezequiel Garcia [Fri, 30 May 2014 16:40:09 +0000 (13:40 -0300)]
net: mv643xx_eth: Limit the TSO segments and adjust stop/wake thresholds
Currently small MSS values may require too many TSO descriptors for
the default queue size. This commit prevents this situation by fixing
the maximum supported TSO number of segments to 100 and by setting a
minimum Tx queue size. The minimum Tx queue size is set so that at
least 2 worst-case skb can be accommodated.
In addition, the queue stop and wake thresholds values are adjusted
accordingly. The queue is stopped when there's room for only 1 worst-case
skb and waked when the number of descriptors is half that value.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ezequiel Garcia [Fri, 30 May 2014 16:40:08 +0000 (13:40 -0300)]
net: mv643xx_eth: Count dropped packets properly
This commit fixes the current dropped packet count by doing it properly,
increasing the count when a packet is discarded; i.e. the packet is not
processed and the driver returns NETDEV_TX_OK.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ezequiel Garcia [Fri, 30 May 2014 16:40:07 +0000 (13:40 -0300)]
net: mvneta: Avoid unmapping the TSO header buffers
The buffers for the TSO headers belong to a DMA coherent region which is
allocated at ndo_open() time, and released at ndo_stop() time.
Therefore, and contrary to the TSO payload descriptor buffers, the TSO header
buffers don't need to be unmapped. This commit adds a check to detect a
TSO header buffer and explicitly prevent the unmap.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ezequiel Garcia [Fri, 30 May 2014 16:40:06 +0000 (13:40 -0300)]
net: mvneta: Fix missing DMA region unmap
The Tx descriptor release code currently calls dma_unmap_single() and
dev_kfree_skb_any() if the descriptor is associated with a non-NULL skb.
This is true only for the last fragment of the packet.
This is wrong, however, since every descriptor buffer is DMA mapped and needs
to be unmapped.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ezequiel Garcia [Fri, 30 May 2014 16:40:05 +0000 (13:40 -0300)]
net: mvneta: Limit the TSO segments and adjust stop/wake thresholds
Currently small MSS values may require too many TSO descriptors for
the default queue size. This commit prevents this situation by fixing
the maximum supported TSO number of segments to 100 and by setting a
minimum Tx queue size. The minimum Tx queue size is set so that at
least 2 worst-case skb can be accommodated.
In addition, the queue stop and wake thresholds values are adjusted
accordingly. The queue is stopped when there's room for only 1 worst-case
skb and waked when the number of descriptors is half that value.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 2 Jun 2014 23:01:37 +0000 (16:01 -0700)]
Merge branch 'cdc_ncm'
Bjørn Mork says:
====================
cdc_ncm: fixes and conversion to sysfs API
After considering the comments received after the ethtool coalesce
support was commited, I have ended up concluding that we should
remove it again, while we can, before it hits a release. The idea
was not well enough thought through, and all comments received
pointed to advantages of using a sysfs based API instead.
This series removes the ethtool coalesce support and replaces it
with sysfs attributes in a driver specific group under the netdev.
The first 3 patches are unrelated fixes:
patch 1: reducing truesize as discussed
patch 2: fixing a potentional buffer overrun when changing tx_max
patch 3: prevent framing errors when changing rx_max
Changes v2:
- minor editorial changes to patch 8, as suggested by Peter Stuge
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Bjørn Mork [Fri, 30 May 2014 07:31:09 +0000 (09:31 +0200)]
net: cdc_ncm: allow tuning min_tx_pkt
The min_tx_pkt variable decides the cutoff point where the driver
will stop padding out NTBs to maximum size. The padding is a tradeoff
where we use some USB bus bandwidth to allow the device to receive
fixed size buffers. Different devices will have different optimal
settings, spanning from no padding at all to padding every NTB.
There is no way to automatically figure out which setting is best
for a specific device.
The default value is a reasonable tradeoff, calculated based on the
USB packet size and out NTB max size. This may have to be changed
along with any tx_max changes.
Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Bjørn Mork [Fri, 30 May 2014 07:31:08 +0000 (09:31 +0200)]
net: cdc_ncm: export NCM Transfer Block (NTB) parameters
The mandatory GetNtbParameters control request is an important part of
the host <-> device protocol negotiation in CDC NCM (and CDC MBIM). It
gives device limits which the host must obey when configuring the
protocol aggregation variables. The driver will enforce this by
rejecting attempts to set any of the tunable variables to a value
which is not supported by the device. Exporting the parameter block
helps userspace decide which values are allowed without resorting
to trial and error.
Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Bjørn Mork [Fri, 30 May 2014 07:31:07 +0000 (09:31 +0200)]
net: cdc_ncm: drop ethtool coalesce support
The ethtool coalesce API is not applicable for this driver. Forcing
it to fit the NCM aggregation redefined the API in a driver specific
way, which is much worse than defining a clean new API. These ethtool
coalesce functions have therefore been replaced by a new sysfs API.
Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Bjørn Mork [Fri, 30 May 2014 07:31:06 +0000 (09:31 +0200)]
net: cdc_ncm: use sysfs for rx/tx aggregation tuning
Attach a driver specific sysfs group to the netdev, and use it
for the rx/tx aggregation variables.
The datagram aggregation defined by the CDC NCM specification is
specific to this device class (including CDC MBIM). Using the
ethtool interrupt coalesce API as an interface to the aggregation
parameters redefined that API in a driver specific and confusing
way. A sysfs group
- makes it clear that this is a driver specific userspace API, and
- allows us to export the real values instead of some translated
version, and
- lets us include more aggregation variables which were impossible
to force into the ethtool API.
Additionally, using sysfs allows tuning the driver on space
constrained hosts where userspace tools like ethtool are undesired.
Suggested-by: Peter Stuge <peter@stuge.se> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Bjørn Mork [Fri, 30 May 2014 07:31:05 +0000 (09:31 +0200)]
net: cdc_ncm: inform usbnet when rx buffers are reduced
It doesn't matter whether the buffer size goes up or down. We have to
keep usbnet and device syncronized to be able to split transfers at the
correct boundaries. The spec allow skipping short packets when using
max sized transfers. If we don't tell usbnet about our new expected rx
buffer size, then it will merge and/or split NTBs. The driver does not
support this, and the result will be lots of framing errors.
Fix by always reallocating usbnet rx buffers when the rx_max value
changes.
Fixes: 68864abf08f0 ("net: cdc_ncm: support rx_max/tx_max updates when running") Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Bjørn Mork [Fri, 30 May 2014 07:31:04 +0000 (09:31 +0200)]
net: cdc_ncm: always reallocate tx_curr_skb when tx_max increases
We are calling usbnet_start_xmit() to flush any remaining data,
depending on the side effect that tx_curr_skb is set to NULL,
ensuring a new allocation using the updated tx_max. But this
side effect will only happen if there were any cached data ready
to transmit. If not, then an empty tx_curr_skb is still allocated
using the old tx_max size. Free it to avoid a buffer overrun.
Fixes: 68864abf08f0 ("net: cdc_ncm: support rx_max/tx_max updates when running") Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Bjørn Mork [Fri, 30 May 2014 07:31:03 +0000 (09:31 +0200)]
net: cdc_ncm: reduce skb truesize in rx path
Cloning the big skbs we use for USB buffering chokes up TCP and
SCTP because the socket memory limits are hitting earlier than
they should. It is better to unconditionally copy the unwrapped
packets to freshly allocated skbs.
Reported-by: Jim Baxter <jim_baxter@mentor.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
dingtianhong [Fri, 30 May 2014 06:32:49 +0000 (14:32 +0800)]
macvlan: fix the problem when mac address changes for passthru mode
The macvlan dev should always have the same mac address like lowerdev
when in the passthru mode, change the mac address alone will break the
work mechanism, so when the lowerdev or macvlan mac address changes,
we should propagate the changes to another dev.
v1->v2: Allow macvlan dev to change mac address for passthru mode and propagate to
lowerdev.
v2->v3: Don't set the mac address to the lower dev's unicast address for
passthru mode when mac address changes.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Chen-Yu Tsai [Thu, 29 May 2014 14:31:40 +0000 (22:31 +0800)]
net: stmmac: Handle different error codes from platform_get_irq_byname
The following patch moved device tree interrupt resolution into
platform_get_irq_byname:
ad69674 of/irq: do irq resolution in platform_get_irq_byname()
As a result, the function no longer only return -ENXIO on error.
This breaks DT based probing of stmmac, as seen in test runs of
linux-next next-20140526 cubie2-sunxi_defconfig:
This patch makes the stmmac_platform probe function properly handle
error codes, such as returning for deferred probing, and other codes
returned by of_irq_get_by_name.
Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Please pull this remaining batch of updates intended for the 3.16 stream...
For the mac80211 bits, Johannes says:
"The remainder for -next right now is mostly fixes, and a handful of
small new things like some CSA infrastructure, the regdb script mW/dBm
conversion change and sending wiphy notifications."
For the bluetooth bits, Gustavo says:
"Some more patches for 3.16. There is nothing really special here, just a
bunch of clean ups, fixes plus some small improvements. Please pull."
For the nfc bits, Samuel says:
"We have:
- Felica (Type3) tags support for trf7970a
- Type 4b tags support for port100
- st21nfca DTS typo fix
- A few sparse warning fixes"
For the atheros bits, Kalle says:
"Ben added support for setting antenna configurations. Michal improved
warm reset so that we would not need to fall back to cold reset that
often, an issue where ath10k stripped protected flag while in monitor
mode and made module initialisation asynchronous to fix the problems
with firmware loading when the driver is linked to the kernel.
Luca removed unused channel_switch_beacon callbacks both from ath9k and
ath10k. Marek fixed Protected Management Frames (PMF) when using Action
Frames. Also we had other small fixes everywhere in the driver."
Along with that, there are a handful of updates to a variety
of drivers. This includes updates to at76c50x-usb, ath9k, b43,
brcmfmac, mwifiex, rsi, rtlwifi, and wil6210.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Mon, 2 Jun 2014 12:26:03 +0000 (05:26 -0700)]
inetpeer: get rid of ip_id_count
Ideally, we would need to generate IP ID using a per destination IP
generator.
linux kernels used inet_peer cache for this purpose, but this had a huge
cost on servers disabling MTU discovery.
1) each inet_peer struct consumes 192 bytes
2) inetpeer cache uses a binary tree of inet_peer structs,
with a nominal size of ~66000 elements under load.
3) lookups in this tree are hitting a lot of cache lines, as tree depth
is about 20.
4) If server deals with many tcp flows, we have a high probability of
not finding the inet_peer, allocating a fresh one, inserting it in
the tree with same initial ip_id_count, (cf secure_ip_id())
5) We garbage collect inet_peer aggressively.
IP ID generation do not have to be 'perfect'
Goal is trying to avoid duplicates in a short period of time,
so that reassembly units have a chance to complete reassembly of
fragments belonging to one message before receiving other fragments
with a recycled ID.
We simply use an array of generators, and a Jenkin hash using the dst IP
as a key.
ipv6_select_ident() is put back into net/ipv6/ip6_output.c where it
belongs (it is only used from this file)
secure_ip_id() and secure_ipv6_id() no longer are needed.
Rename ip_select_ident_more() to ip_select_ident_segs() to avoid
unnecessary decrement/increment of the number of segments.
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Mack [Mon, 2 Jun 2014 11:32:46 +0000 (13:32 +0200)]
of: of_mdio: export symbol of_mdiobus_link_phydev
Make of_mdiobus_link_phydev externally available.
This fixes CONFIG_OF_MDIO=m.
Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 86f6cf41272 ("net: of_mdio: add of_mdiobus_link_phydev()") Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Mack [Mon, 2 Jun 2014 11:32:45 +0000 (13:32 +0200)]
net: of_mdio: use int type for address variable
Use int rather than u32 to fix the following warning:
drivers/of/of_mdio.c:147 of_mdiobus_register() warn: unsigned 'addr' is
never less than zero.
Signed-off-by: Daniel Mack <zonque@gmail.com> Fixes: 8f8382888cba ("net: of_mdio: factor out code to parse a phy's 'reg' property") Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 2 Jun 2014 17:41:30 +0000 (10:41 -0700)]
Merge branch 'netdevsync'
Alexander Duyck says:
====================
Provide common means for device address sync
The following series implements a means for synchronizing both unicast and
multicast addresses on a device interface. The code is based on the original
implementation of dev_uc_sync that was available for syncing a VLAN to the
lower dev.
The original reason for coming up for this patch is a driver that is still in
the early stages of development. The nearest driver I could find that
appeared to have the same limitations as the driver I was working on was the
Cisco enic driver. For this reason I chose it as the first driver to make use
of this interface publicly.
However, I do not have a Cisco enic interface so I have only been able to
compile test any changes made to the driver. I tried to keep this change as
simple as possible to avoid any issues. Any help with testing would be
greatly appreciated.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Duyck [Thu, 29 May 2014 01:44:52 +0000 (18:44 -0700)]
enic: Update driver to use __dev_uc/mc_sync/unsync calls
This change updates the enic driver to make use of __dev_uc_sync and
__dev_mc_sync calls. Previously the driver was doing its own list
management by storing the mc_addr and uc_addr list in a 32 address array.
With this change the sync data is stored in the netdev_addr_list structures
and instead we just track how many addresses we have written to the device.
When we encounter 32 we stop and print a message as occurred previously with
the old approach.
Other than the core change the only other bit needed was to propagate the
constant attribute with the MAC address as there were several spots where
is twas only passed as a u8 * instead of a const u8 *.
This patch is meant to maintain the original functionality without the use
of the mc_addr and uc_addr arrays.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Duyck [Thu, 29 May 2014 01:44:46 +0000 (18:44 -0700)]
net: Add support for device specific address syncing
This change provides a function to be used in order to break the
ndo_set_rx_mode call into a set of address add and remove calls. The code
is based on the implementation of dev_uc_sync/dev_mc_sync. Since they
essentially do the same thing but with only one dev I simply named my
functions __dev_uc_sync/__dev_mc_sync.
I also implemented an unsync version of the functions as well to allow for
cleanup on close.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 2 Jun 2014 17:39:52 +0000 (10:39 -0700)]
Merge branch '6lowpan-next'
Alexander Aring says:
====================
6lowpan: fragmentation fixes
This patch series fix the 6LoWPAN fragmentation which are in two cases broken.
The first case is if we have exactly two 6LoWPAN fragments only. This is fixed
by patch "6lowpan_rtnl: fix fragmentation with two fragments".
The second case is a off by one issue if we have payload which hits the fragment
boundary.
Alexander Aring [Mon, 2 Jun 2014 11:21:58 +0000 (13:21 +0200)]
6lowpan_rtnl: fix off by one while fragmentation
This patch fix a off by one error while fragmentation. If the frag_cap
value is equal to skb_unprocessed value we need to stop the
fragmentation loop because the last fragment which has a size of
skb_unprocessed fits into the frag capability size.
Alexander Aring [Mon, 2 Jun 2014 11:21:57 +0000 (13:21 +0200)]
6lowpan_rtnl: fix fragmentation with two fragments
This patch fix the 6LoWPAN fragmentation for the case if we have exactly
two fragments. The problem is that the (skb_unprocessed >= frag_cap)
condition is always false on the second fragment after sending the first
fragment. A fragmentation with only one fragment doesn't make any sense.
The solution is that we use a do while loop here, that ensures we sending
always a minimum of two fragments if we need a fragmentation.
Emil Goode [Mon, 2 Jun 2014 09:30:50 +0000 (11:30 +0200)]
stmmac: Remove spin_lock call in stmmac_get_pauseparam()
The following patch removed unnecessary spin_lock/unlock calls
in ethtool_ops callback functions. In the second and final version
of the patch one spin_lock call was left behind.
net: driver: stmicro: Remove some useless the lock protection
This introduced the following sparse warning:
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:424:1: warning:
context imbalance in 'stmmac_get_pauseparam' -
different lock contexts for basic block
Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Boyd [Wed, 28 May 2014 20:11:12 +0000 (13:11 -0700)]
net: ks8851: Don't use regulator_get_optional()
We shouldn't be using regulator_get_optional() here. These
regulators are always present as part of the physical design and
there isn't any way to use an internal regulator or change the
source of the reference voltage via software. Given that the only
users of this driver in the kernel are DT based, this change
should be transparent to them even if they don't specify any
supplies because the regulator framework will insert dummy
supplies as needed.
Cc: Nishanth Menon <nm@ti.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 2 Jun 2014 05:17:21 +0000 (22:17 -0700)]
Merge branch 'filter-next'
Daniel Borkmann says:
====================
BPF + test suite updates
These are the last bigger BPF changes that I had in my todo
queue for now. As the first two patches from this series
contain additional test cases for the test suite, I have
rebased them on top of current net-next with the set from [1]
applied to avoid introducing any unnecessary merge conflicts.
For details, please refer to the individual patches. Test
suite runs fine with the set applied.
Daniel Borkmann [Thu, 29 May 2014 08:22:51 +0000 (10:22 +0200)]
net: filter: improve filter block macros
Commit 9739eef13c92 ("net: filter: make BPF conversion more readable")
started to introduce helper macros similar to BPF_STMT()/BPF_JUMP()
macros from classic BPF.
However, quite some statements in the filter conversion functions
remained in the old style which gives a mixture of block macros and
non block macros in the code. This patch makes the block macros itself
more readable by using explicit member initialization, and converts
the remaining ones where possible to remain in a more consistent state.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Thu, 29 May 2014 08:22:50 +0000 (10:22 +0200)]
net: filter: get rid of BPF_S_* enum
This patch finally allows us to get rid of the BPF_S_* enum.
Currently, the code performs unnecessary encode and decode
workarounds in seccomp and filter migration itself when a filter
is being attached in order to overcome BPF_S_* encoding which
is not used anymore by the new interpreter resp. JIT compilers.
Keeping it around would mean that also in future we would need
to extend and maintain this enum and related encoders/decoders.
We can get rid of all that and save us these operations during
filter attaching. Naturally, also JIT compilers need to be updated
by this.
Before JIT conversion is being done, each compiler checks if A
is being loaded at startup to obtain information if it needs to
emit instructions to clear A first. Since BPF extensions are a
subset of BPF_LD | BPF_{W,H,B} | BPF_ABS variants, case statements
for extensions can be removed at that point. To ease and minimalize
code changes in the classic JITs, we have introduced bpf_anc_helper().
Tested with test_bpf on x86_64 (JIT, int), s390x (JIT, int),
arm (JIT, int), i368 (int), ppc64 (JIT, int); for sparc we
unfortunately didn't have access, but changes are analogous to
the rest.
Joint work with Alexei Starovoitov.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Mircea Gherzan <mgherzan@gmail.com> Cc: Kees Cook <keescook@chromium.org> Acked-by: Chema Gonzalez <chemag@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Thu, 29 May 2014 08:22:49 +0000 (10:22 +0200)]
net: filter: add test for loading SKF_AD_OFF limits
This check tests that overloading BPF_LD | BPF_ABS with an
always invalid BPF extension, that is SKF_AD_MAX, fails to
make sure classic BPF behaviour is correct in filter checker.
Also, we add a test for loading at packet offset SKF_AD_OFF-1
which should pass the filter, but later on fail during runtime.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Thu, 29 May 2014 08:22:48 +0000 (10:22 +0200)]
net: filter: add slot overlapping test with fully filled M[]
Also add a test for the scratch memory store that first fills
all slots and then sucessively reads all of them back adding
up to A, and eventually returning A. This and the previous
M[] test with alternating fill/spill will detect possible JIT
errors on M[].
Suggested-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
wangweidong [Thu, 29 May 2014 02:15:30 +0000 (10:15 +0800)]
bridge: fix the unbalanced promiscuous count when add_if failed
As commit 2796d0c648c94 ("bridge: Automatically manage port
promiscuous mode."), make the add_if use dev_set_allmulti
instead of dev_set_promiscuous, so when add_if failed, we
should do dev_set_allmulti(dev, -1).
Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Reviewed-by: Amos Kong <akong@redhat.com> Acked-by: Vlad Yasevich <vyasevic@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Boyd [Wed, 28 May 2014 20:11:12 +0000 (13:11 -0700)]
net: ks8851: Don't use regulator_get_optional()
We shouldn't be using regulator_get_optional() here. These
regulators are always present as part of the physical design and
there isn't any way to use an internal regulator or change the
source of the reference voltage via software. Given that the only
users of this driver in the kernel are DT based, this change
should be transparent to them even if they don't specify any
supplies because the regulator framework will insert dummy
supplies as needed.
Cc: Nishanth Menon <nm@ti.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 2 Jun 2014 02:17:18 +0000 (19:17 -0700)]
Merge branch 'mlx4-next'
Amir Vadai says:
====================
cpumask,net: Affinity hint helper function
This patchset will set affinity hint to influence IRQs to be allocated on the
same NUMA node as the one where the card resides. As discussed in
http://www.spinics.net/lists/netdev/msg271497.html
If the number of IRQs allocated is greater than the number of local NUMA cores, all
local cores will be used first, and the rest of the IRQs will be on a remote
NUMA node.
If no NUMA support - IRQ's and cores will be mapped 1:1
Since the utility function to calculate the mapping could be useful in other mq
drivers in the kernel, it was added to cpumask.[ch]
This patchset was tested and applied on top of net-next since the first
consumer is a network device (mlx4_en). Over commit 506724c: "tg3: Override
clock, link aware and link idle mode during NVRAM dump"
I couldn't find a maintainer for cpumask.c, so only added the kernel mailing
list
Amir
Changes from V5:
- Moved the utility function from kernel/irq/manage.c to lib/cpumask.c, and
renamed it's name accordingly to cpumask_set_cpu_local_first()
- Added some comments as Thomas Gleixner suggested
- Changed -EINVAL to -EAGAIN, that describes the error situtation better.
Changes from V4:
- Patch 1/2: irq: Utility function to get affinity_hint by policy
Thank you Ben for the great review:
- Moved the function it kernel/irq/manage.c since it could be useful for
block mq devices
- Fixed Typo's
- Use cpumask_t * instead of cpumask_var_t in function header
- Restructured the function to remove NULL assignment in a cpumask_var_t
- Fix for offline local CPU's
Changes from V3:
- Patch 2/2: net/mlx4_en: Use affinity hint
- somehow patch file was corrupted
Changes from V2:
- Patch 1/2: net: Utility function to get affinity_hint by policy
- Fixed style issues
Changes from V1:
- Patch 1/2: net: Utility function to get affinity_hint by policy
- Fixed error flow to return -EINVAL on error (thanks govind)
- Patch 2/2: net/mlx4_en: Use affinity hint
- Set ring->affinity_hint to NULL on error
Changes from V0:
- Fixed small style issues
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Yuval Atias [Sun, 25 May 2014 14:47:27 +0000 (17:47 +0300)]
net/mlx4_en: Use affinity hint
The “affinity hint” mechanism is used by the user space
daemon, irqbalancer, to indicate a preferred CPU mask for irqs.
Irqbalancer can use this hint to balance the irqs between the
cpus indicated by the mask.
We wish the HCA to preferentially map the IRQs it uses to numa cores
close to it. To accomplish this, we use cpumask_set_cpu_local_first(), that
sets the affinity hint according the following policy:
First it maps IRQs to “close” numa cores. If these are exhausted, the
remaining IRQs are mapped to “far” numa cores.
Signed-off-by: Yuval Atias <yuvala@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Amir Vadai [Sun, 25 May 2014 14:47:26 +0000 (17:47 +0300)]
cpumask: Utility function to set n'th cpu - local cpu first
This function sets the n'th cpu - local cpu's first.
For example: in a 16 cores server with even cpu's local, will get the
following values:
cpumask_set_cpu_local_first(0, numa, cpumask) => cpu 0 is set
cpumask_set_cpu_local_first(1, numa, cpumask) => cpu 2 is set
...
cpumask_set_cpu_local_first(7, numa, cpumask) => cpu 14 is set
cpumask_set_cpu_local_first(8, numa, cpumask) => cpu 1 is set
cpumask_set_cpu_local_first(9, numa, cpumask) => cpu 3 is set
...
cpumask_set_cpu_local_first(15, numa, cpumask) => cpu 15 is set
Curently this function will be used by multi queue networking devices to
calculate the irq affinity mask, such that as many local cpu's as
possible will be utilized to handle the mq device irq's.
Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
====================
Netfilter/IPVS updates for net-next
This small patchset contains three accumulated Netfilter/IPVS updates,
they are:
1) Refactorize common NAT code by encapsulating it into a helper
function, similarly to what we do in other conntrack extensions,
from Florian Westphal.
2) A minor format string mismatch fix for IPVS, from Masanari Iida.
3) Add quota support to the netfilter accounting infrastructure, now
you can add quotas to accounting objects via the nfnetlink interface
and use them from iptables. You can also listen to quota
notifications from userspace. This enhancement from Mathieu Poirier.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 31 May 2014 00:51:27 +0000 (17:51 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:
====================
Intel Wired LAN Driver Updates
This series contains updates to i40e and i40evf.
Kevin updates the i40e and i40evf driver i40e_check_asq_alive() to ensure
the length register offset is non-zero which indicates that the software
has initialized the admin queue. Also removes PCTYPE definitions which are
now reserved.
Mitch enables descriptor prefetch for rings belonging to the virtual function.
Also configures the VF minimum transmit rate to 50 Mbps rather than 0 which was
be interpreted as no limit at all. Mitch found in order for the VF to achieve
its programmed transmit rate, we need to set the max credit value to 4.
Lastly fixes a Tx hang and firmware crash that happens after setting the MTU
on a VF by not using the RESETTING state during reinit, this is because
the RESETTING state means that a catastrophic hardware bad thing is happening
and the driver needs to tiptoe around and not use the admin queue or registers.
A reinit is no big deal and we can use the admin queue (and we should) so
do not set the state to RESETTING during reinit to resolve the bug.
Akeem changes the declaration of the transmit and receive rings inside
several loops to eliminate declaring the same ring every time for the
duration of the loop and declares them just once before the loop. Also fixes
the driver to clear the recovery pending bit if pf_reset fails instead of
falling through the setup process.
Anjali makes a change based on feedback from Ben Hutchings that cmd->data
needs to be reported in ETHTOOL_GRXCLSRLCNT and use a helper function to
calculate the total filter count.
Jesse removes storm control since the storm control features are not apart
of the hardware and were mistakenly left in the code.
Greg changes tx_lpi_status and rx_lpi_status from bool to u32 to avoid
sparse errors.
Shannon adds the clear_pxe AdminQ API call to tell the firmware that the
driver is taking over from PXE. In addition, relaxes the firmware API
check to allow more flexibility in handling newer NICs and NVMs in the field.
Vasu ensures that FCoE is disabled for MFP modes since it is not supported
by overriding the hardware FCoE capability.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Fri, 30 May 2014 15:48:12 +0000 (21:18 +0530)]
af_key: Replace comma with semicolon
This patch replaces a comma between expression statements by a semicolon.
A simplified version of the semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2,e;
type T;
identifier i;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Fri, 30 May 2014 15:47:13 +0000 (21:17 +0530)]
rds/tcp_listen: Replace comma with semicolon
This patch replaces a comma between expression statements by a semicolon.
A simplified version of the semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2,e;
type T;
identifier i;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Fri, 30 May 2014 15:46:05 +0000 (21:16 +0530)]
RDS/RDMA: Replace comma with semicolon
This patch replaces a comma between expression statements by a semicolon.
A simplified version of the semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2,e;
type T;
identifier i;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Ursula Braun [Wed, 28 May 2014 08:22:31 +0000 (10:22 +0200)]
s390/net: fix format string mismatches
cppcheck blamed some issues in drivers/s390/net/...
They are fixed here.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Reported-by: Toralf Foerster <toralf.foerster@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ursula Braun [Wed, 28 May 2014 08:22:29 +0000 (10:22 +0200)]
af_iucv: correct cleanup if listen backlog is full
In case of transport HIPER a sock struct is allocated for an incoming
connect request. If the backlog queue is full this socket is not
needed, but is left in the list of af_iucv sockets. Final socket
release posts console message "Attempt to release alive iucv socket".
This patch makes sure the new created socket is cleaned up correctly
if the backlog queue is full.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Reported-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
If a socket is bound to an address using before calling connect
it is usual to leave it to the network system to choose an appropriate
outgoing application name respective port address.
af_iucv on VM uses a counter and uses simple numbers as unique identifiers.
This behaviour was missing when af_iucv is used with HiperSockets.
This patch contains a simple approach to harmonize af_iucv's behaviour.
Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 31 May 2014 00:27:39 +0000 (17:27 -0700)]
Merge branch 'be2net-next'
Sathya Perla says:
====================
be2net: patch set
Patch 1 is a minor optimization for issuing multicast promisc FW cmd
only when the interface is not already in that mode.
Patch 2 provides support for VF TX-rate setting on Skyhawk-R.
Patch 3 provides support for flashing new FW flash regions.
Patches 4, 5, 6 cleanup the MCC processing (for FW cmds) code in be_cmds.c.
The MCC error reporting and event handling code are areas that needed
cleanup.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Fri, 30 May 2014 13:36:28 +0000 (19:06 +0530)]
be2net: cleanup MCC async event processing code
The MCC async event processing code has 2 issues:
a) because of long struct names the code indentation is badly broken
b) description and definitions of how an MCC completion is interpreted as
an async event are confusing (for e.g. the last word of an MCC event is
named "code", while "code" is just a sub-field of the last word.)
This patch fixes the structure definitions, comments and re-factors code
as needed.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Fri, 30 May 2014 13:36:27 +0000 (19:06 +0530)]
be2net: move async cmd processing to a separate routine
For some FW cmds, the caller just issues the cmd and doesn't wait for a
response. The response handling is done in the MCCQ compl processing context
only. Move this code into a separate routine to make be_mcc_compl_process()
more manageable.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Fri, 30 May 2014 13:36:26 +0000 (19:06 +0530)]
be2net: re-factor MCCQ error status handling code
This patch improves MCCQ error status handling in the following ways:
a) A MCC cmd completion returns a base-status and an addl-status.
So far, the routine be_mcc_compl_process() returned only the "status" value.
Now, embedd both statuses in the return value and let the caller routine access
the value of interest using base_status() and addl_status() macros.
b) Rename variables accordingly (base/addl) to avoid confusion while error
checking.
b) Some of the errors returned by FW are harmless and so an error msg is not
logged for such errors. Capture this logic in a separate routine to make the
code more readable.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Fri, 30 May 2014 13:36:25 +0000 (19:06 +0530)]
be2net: support flashing new regions on Skyhawk-R
Certain new flash regions have been added to Skyhawk-R FW image. The newer
FW images specify op_types for each region. A region is flashed only
when it's CRC doesn't match that of the region on the HW flash. While
upgrading to a new FW image the driver is expected to tolerate certain
errors.
This patch re-factors code under be_flash() to support the above scheme. Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Skyhawk-R FW supports TX-rate setting only as a % value of the link
speed, set via the SET_PROFILE_CONFIG cmd.
This patch makes the necessary changes to the FW cmd descriptors to support
the above change and also introduces checks in be_set_vf_tx_rate() to allow
only discrete values (that map to % of the link-speed).
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Fri, 30 May 2014 13:36:23 +0000 (19:06 +0530)]
be2net: skip multicast promiscuos setting in already set
Set mc-promisc (multicast promiscuous) mode on an interface, only if it is
*not already* in that mode.
Also removed logs that report interface being set to multicast
promiscous mode. In an earlier comment on the netdev list such log messages
were deemed unnecessary as this behaviour is common across most of the
ethernet drivers.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 31 May 2014 00:18:46 +0000 (17:18 -0700)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says:
====================
Please pull this batch of updates intended for 3.16...
For the mac80211 bits, Johannes says:
"Here I just have Heikki's rfkill GPIO cleanups.
The ARM/tegra patch is OK with the maintainer (Stephen). Let me know of
any problems."
and;
"We have a whole bunch of work on CSA by Andrei, Luca and Michal, but
unfortunately it doesn't seem quite complete yet so it's still disabled.
There's some TDLS work from Arik, and the rest is mostly minor fixes and
cleanups."
For the NFC bits, Samuel says:
"This is the NFC pull request for 3.16. We have:
- STMicroeectronics st21nfca support. The st21nfca is an HCI chipset and
thus relies on the HCI stack. This submission provides support for tag
redaer/writer mode (including Type 5) and device tree bindings.
- PM runtime support and a bunch of bug fixes for TI's trf7970a.
- Device tree support for NXP's pn544. Legacy platform data support is
obviously kept intact.
- NFC Tag type 4B support to the NFC Digital stack.
- SOCK_RAW type support to the raw NFC socket, and allow NCI
sniffing from that. This can be extended to report HCI frames and also
proprietarry ones like e.g. the pn533 ones."
For the iwlwifi bits, Emmanuel says:
"Eran continues to work on new devices, Eyal is still digging in
the rate control stuff, and Johannes added new functionality to the
debug system we have in place now along with a few cleanups he made
on the way. That's pretty much it."
and;
"Avri continues to work on the power code and Eran is improving the
NVM handling as a preparations for new devices on which he works
with Liad. Luca cleans up a bit the code while working on CSA. I have
the regular BT Coex stuff and a small lockdep fix. Johannes has his
regular amount of clean ups and improvements, the main one is the
ability to leave 2 chains open to improve diversity and hence the
throughput in high attenuation scenarios."
and;
"The regular amount of housekeeping here. I merged iwlwifi-fixes.git to
be able to add the patch you didn't want in wireless.git at that stage
of the -rc cycle. Luca has a few preparations for CSA implementation
and also what seems to be a bugfix for P2P but hasn't caused issues
we could notice."
For the Atheros bits, Kalle says:
"For ath10k Michal did various small fixes on how we handle
hardware/firmware problems and he also fixed two memory leaks."
Also included are a couple of pulls from the wireless tree to
avoid/resolve merge issues...
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Paul Bolle [Tue, 27 May 2014 15:07:12 +0000 (17:07 +0200)]
atm: remove commented out check
This preprocessor check is commented out ever since this file was added
during the v2.3 development cycle. It is unclear what it purpose might
have been. Whatever it was, it can safely be removed now.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: David S. Miller <davem@davemloft.net>
Ariel Elior [Tue, 27 May 2014 10:11:36 +0000 (13:11 +0300)]
bnx2x: update MAINTAINERS for bnx2x and e-mail addresses
The bnx2x development team has transferred from Broadcom to Qlogic.
This patch updates some obsolete email addresses to usable ones.
The bnx2x files contain headers with legal information from
Broadcom. Qlogic Legal depratment is taking their time coming up
with their own legal info. So this patch only updates contact
information. I will follow up with a patch for the headers once I
have the required info.
Signed-off-by: Ariel Elior <ariel.elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Nimrod Andy [Tue, 27 May 2014 07:51:08 +0000 (15:51 +0800)]
net: fec: use pinctrl PM helpers
when system suspend, need to set pins to low power state to
save IO power consumption, there are three states of pinctrl:
"default", "idle" and "sleep". Currently enet supports default
and sleep state.
Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Mon, 26 May 2014 18:17:35 +0000 (20:17 +0200)]
net: filter: use block statements in tcpdump tests
This patch converts raw opcodes for tcpdump tests into
BPF_STMT()/BPF_JUMP() combinations, which brings it into
conformity with the rest of the patches and it also makes
life easier to grasp what's going on in these particular
test cases when they ever fail. Also arrange payload from
the jump+holes test in a way as we have with other packet
payloads in the test suite.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Mon, 26 May 2014 18:17:34 +0000 (20:17 +0200)]
net: filter: test fill/spill of all M[] regs
This test for classic BPF probes stores and load combination
via X on all 16 registers of the scratch memory store. It
initially loads integer 100 and passes this value around
to each register while incrementing it every time, thus we
expect to have 116 as a result. Might be useful for JIT
testing.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Division of a 32 bit number by a 64 bit number causes the following link
error introduced by 7c2ce6e60f703 "enic: Add support for adaptive interrupt coalescing"
drivers/built-in.o: In function `enic_poll_msix':
enic_main.c:(.text+0x48710a): undefined reference to `__udivdi3'
make: *** [vmlinux] Error 1
Since numerator is 32 bit, convert denominator to 32 bit accordingly.
Fixes: 7c2ce6e60f703 ("enic: Add support for adaptive interrupt coalescing") Reported-by: Jim Davis <jim.epost@gmail.com> Cc: Christian Benvenuti <benve@cisco.com> Cc: Sujith Sankar <ssujith@cisco.com> Cc: Neel Patel <neepatel@cisco.com> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sachin Kamat [Mon, 26 May 2014 09:22:46 +0000 (14:52 +0530)]
net: tso: Export symbols for modular build
Export the symbols to fix the below errors when built as modules:
ERROR: "tso_build_data" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_build_hdr" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_start" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_count_descs" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_build_data" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
ERROR: "tso_build_hdr" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
ERROR: "tso_start" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
ERROR: "tso_count_descs" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Wed, 28 May 2014 14:23:09 +0000 (19:53 +0530)]
ehea: Introduce the use of the managed version of kzalloc
This patch moves data allocated using kzalloc to managed data allocated
using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
functions. Also, linux/device.h is added to make sure the devm_*()
routine declarations are unambiguously available.
The following Coccinelle semantic patch was used for making the change:
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Compile-Tested-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Print message if no events received. This should not happen.
If it is, it points to the problem in firmware.
Track also cases when multiple events processed in one IRQ
Print information as soon as possible - mbox pointers and
event header right after reading it. This helps to identify potential
problem with memory allocation for the event buffer.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel Mack [Sat, 24 May 2014 07:34:27 +0000 (09:34 +0200)]
net: of_mdio: don't store the length of a property if we don't need to
of_get_property() can be called with NULL as 2nd argument if the caller
is not interested in the length of a property. Use that here so we can
get rid of a variable.
Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Mack [Sat, 24 May 2014 07:34:26 +0000 (09:34 +0200)]
net: of_mdio: add of_mdiobus_link_phydev()
Add a function to walk the list of subnodes of a mdio bus and look for
a node that matches the phy's address with its 'reg' property. If found,
set the of_node pointer for the phy. This allows auto-probed pyh
devices to be augmented by information passed in via DT.
Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Mack [Sat, 24 May 2014 07:34:25 +0000 (09:34 +0200)]
net: of_mdio: factor out code to parse a phy's 'reg' property
Factor out some logic into of_mdio_parse_addr() so it can be reused
later. While at it, use of_property_read_u32() rather than open-coding
the same logic again.
Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>