08 Sep, 2016

21 commits

  • Update the protocol definitions in include/rxrpc/packet.h slightly:

    (1) Get rid of RXRPC_PROCESS_MAXCALLS as it's redundant (same as
    RXRPC_MAXCALLS).

    (2) In struct rxrpc_jumbo_header, put _rsvd in a union with a field called
    cksum to match struct rxrpc_wire_header.

    (3) Provide RXRPC_JUMBO_SUBPKTLEN which is the total of the amount of data
    in a non-terminal subpacket plus the following secondary header for
    the next packet included in the jumbo packet.

    Signed-off-by: David Howells

    David Howells
     
  • Fix ASSERTCMP and ASSERTIFCMP to be able to handle signed values by casting
    both parameters to the type of the first before comparing. Without this,
    both values are cast to unsigned long, which means that checks for values
    less than zero don't work.

    The downside of this is that the state enum values in struct rxrpc_call and
    struct rxrpc_connection can't be bitfields as __typeof__ can't handle them.

    Signed-off-by: David Howells

    David Howells
     
  • proc_dointvec limits the values to INT_MAX in u32 sysctl entries.
    proc_douintvec allows to write upto UINT_MAX.

    Signed-off-by: Subash Abhinov Kasiviswanathan
    Signed-off-by: David S. Miller

    subashab@codeaurora.org
     
  • Sriharsha Basavapatna says:

    ====================
    be2net: patch-set

    The following patch set contains an error recovery feature and a few
    bug fixes. Please consider applying this to the net-next tree. Thanks.

    Patch-1 Supports HW error recovery in Skyhawk/BEx adapters
    Patch-2 Fixes driver unload to issue function reset FW command
    Patch-3 Avoids issuing GET_EXT_FAT_CAPABILITIES command for VFs
    Patch-4 Avoids redundant addition of mac address in HW
    Patch-5 Fixes mac address collision in some configurations
    Patch-6 Updates driver version
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: Sriharsha Basavapatna
    Signed-off-by: David S. Miller

    Sriharsha Basavapatna
     
  • If the device mac address is updated using ndo_set_mac_address(),
    while the same mac address is already programmed, the driver does not
    detect this condition if its netdev->dev_addr has been changed. The
    driver tries to add the same mac address resulting in mac address
    collision error. This has been observed in bonding mode-5 configuration.

    To fix this, store the mac address configured in HW in the adapter
    structure. Use this to compare against the new address being updated
    to avoid collision.

    Signed-off-by: Suresh Reddy
    Signed-off-by: Sathya Perla
    Signed-off-by: Sriharsha Basavapatna
    Signed-off-by: David S. Miller

    Suresh Reddy
     
  • If a mac address is added to the uc_list and later the same mac address
    is added via ndo_set_mac_address() or vice versa, the driver does not
    detect this condition and tries to add it again. This results in a mac
    address collision error when the FW rejects it.

    Fix this by checking if the given mac address is present in uc_list while
    setting the device mac address and vice versa. Similarly skip deletion if
    the address is still in use in the other form.

    Signed-off-by: Suresh Reddy
    Signed-off-by: Sathya Perla
    Signed-off-by: Sriharsha Basavapatna
    Signed-off-by: David S. Miller

    Suresh Reddy
     
  • Driver issues OPCODE_COMMON_GET_EXT_FAT_CAPABILITIES cmd during init which
    when issued by VFs results in the logging of a cmd failure message since
    they don't have the required privilege for this cmd. Fix by checking
    privilege before issuing the cmd.

    Also fixed typo in CAPABILITIES.

    Signed-off-by: Somnath Kotur
    Signed-off-by: Sriharsha Basavapatna
    Signed-off-by: David S. Miller

    Somnath Kotur
     
  • As per SLI guideline, drivers need to issue COMMON_RESET_FUNCTION SLI
    cmd during driver unload to clean up any non-persistent state
    information.
    Issue this cmd only if VFs are not assigned to VMs as it is possible
    for PF driver to unload while it\'s VF remains functional and assigned
    to a VM.

    Signed-off-by: Somnath Kotur
    Signed-off-by: Sriharsha Basavapatna
    Signed-off-by: David S. Miller

    Somnath Kotur
     
  • This patch supports recovery from UEs caused due to Transient Parity
    Errors (TPE), in BE2, BE3 and Skyhawk adapters. This change avoids
    system reboot when such errors occur. The driver recovers from these
    errors such that the adapter resumes full operational status as prior
    to the UE.

    Following is the list of changes in the driver to support this:

    o The driver registers its UE recoverable capability with ARM FW at init
    time. This also allows the driver to know if the feature is supported in
    the FW.

    o As the UE recovery requires precise time bound processing, the driver
    creates its own error recovery work queue with a single worker thread (per
    module, shared across functions).

    o Each function runs an error detection task at an interval of 1 second as
    required by the FW. The error detection logic already exists for BEx/SH,
    but it now runs in the context of a separate worker thread.

    o When an error is detected by the task, if it is recoverable, the PF0
    driver instance initiates a soft reset, while other PF driver instances
    wait for the reset to complete and the chip to become ready. Once
    the chip is ready, all driver instances including PF0, resume to
    reinitialize the respective functions.

    o The PF0 driver checks for some recovery criteria, to determine if the
    recovery can be initiated. If the criteria is not met, the PF0 driver does
    not initiate a soft reset, it retains the existing behavior to stop
    further processing and requires a reboot to get the chip to operational
    state again.

    o To allow each function to share the workq, while also making progress in
    its recovery process, a per-function recovery state machine is used.
    The per-function tasks avoid blocking operations like msleep() while in
    this state machine (until reinit state) and instead reschedule for the
    required delay.

    o With these changes, the existing error recovery code for Lancer also
    runs in the context of the new worker thread.

    Signed-off-by: Sriharsha Basavapatna
    Signed-off-by: David S. Miller

    Sriharsha Basavapatna
     
  • On some systems (such as the Qualcomm APQ8060 Dragonboard) the
    RESET signal of the SMSC911x is not pulled up by a resistor (or
    the internal pull-up that will pull it up if the pin is not
    even connected) but instead connected to a GPIO line, so that
    the operating system must explicitly deassert RESET before use.

    Support this in the SMSC911x driver so this ethernet connector
    can be used on such targets.

    Notice that we request the line to go logical low (deassert)
    whilst the line on the actual component is active low. This
    is managed in the respective hardware description when
    specifying the GPIO line with e.g. device tree or ACPI. With
    device tree it looks like this in one case:

    reset-gpios = ;

    Which means that logically requesting the RESET line to be
    deasserted will result in the line being driven high, taking
    the device out of reset.

    Cc: Jeremy Linton
    Signed-off-by: Linus Walleij
    Reviewed-by: Jeremy Linton
    Signed-off-by: David S. Miller

    Linus Walleij
     
  • This adds device tree bindings for:

    - An optional GPIO line for releasing the RESET signal to the
    SMSC911x devices

    - An optional PME (power management event) interrupt line that
    can be utilized to wake up the system on network activity.
    This signal exist on all the SMSC911x devices, it is just not
    very often routed.

    Both these lines are routed to the SoC on the Qualcomm APQ8060
    Dragonboard and thus needs to be bound in the device tree.

    Cc: devicetree@vger.kernel.org
    Cc: Jeremy Linton
    Signed-off-by: Linus Walleij
    Acked-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Linus Walleij
     
  • Tomer Tayar says:

    ====================
    qed*: Debug data collection

    This patch series adds the support of debug data collection in the qed driver,
    and the means to extract it in the qede driver via the get_regs operation.

    Changes from V1:
    - Respin of the series after rebasing next-next.
    - Remove the first patch as it seems that its V1 version was already applied
    (commit '4102426f9b7b3627c8c23a54d70363e81c93f9b7').
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: Tomer Tayar
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Tomer Tayar
     
  • This patch adds the support for dumping and formatting the HW/FW debug data.

    Signed-off-by: Tomer Tayar
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Tomer Tayar
     
  • SOme statements in the driver only served to inform
    which functions were entered. Ftrace can do that just as good without
    needing memory. Remove the statements.

    Signed-off-by: Oliver Neukum
    Signed-off-by: David S. Miller

    Oliver Neukum
     
  • We get 4 warnings when building kernel with W=1:
    drivers/net/ethernet/qlogic/qed/qed_selftest.c:6:5: warning: no previous prototype for 'qed_selftest_memory' [-Wmissing-prototypes]
    drivers/net/ethernet/qlogic/qed/qed_selftest.c:19:5: warning: no previous prototype for 'qed_selftest_interrupt' [-Wmissing-prototypes]
    drivers/net/ethernet/qlogic/qed/qed_selftest.c:32:5: warning: no previous prototype for 'qed_selftest_register' [-Wmissing-prototypes]
    drivers/net/ethernet/qlogic/qed/qed_selftest.c:55:5: warning: no previous prototype for 'qed_selftest_clock' [-Wmissing-prototypes]

    In fact, these functions are declared in qed_selftest.h, so this patch
    add missing header dependencies.

    Signed-off-by: Baoyou Xie
    Acked-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Baoyou Xie
     
  • udp_diag_destroy does look up the IPv4 UDP hashtable for mapped
    addresses, but it gets the IPv4 address to look up from the
    beginning of the IPv6 address instead of the end.

    Tested: https://android-review.googlesource.com/269874
    Fixes: 5d77dca82839 ("net: diag: support SOCK_DESTROY for UDP sockets")
    Signed-off-by: Lorenzo Colitti
    Acked-by: Eric Dumazet
    Acked-by: David Ahern
    Signed-off-by: David S. Miller

    Lorenzo Colitti
     
  • This bug was detected by kmemleak:
    unreferenced object 0xffff8804269cc3c0 (size 64):
    comm "criu", pid 1042, jiffies 4294907360 (age 13.713s)
    hex dump (first 32 bytes):
    a0 32 cc 2c 04 88 ff ff 00 00 00 00 00 00 00 00 .2.,............
    00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de ................
    backtrace:
    [] kmemleak_alloc+0x4a/0xa0
    [] kmem_cache_alloc_trace+0x10f/0x280
    [] __netlink_diag_dump+0x26c/0x290 [netlink_diag]

    v2: don't remove a reference on a rhashtable_iter structure to
    release it from netlink_diag_dump_done

    Cc: Herbert Xu
    Fixes: ad202074320c ("netlink: Use rhashtable walk interface in diag dump")
    Signed-off-by: Andrei Vagin
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Andrey Vagin
     
  • …l/git/dhowells/linux-fs

    David Howells says:

    ====================
    rxrpc: Local abort tracepoint

    Here are two patches. They need to be applied on top of the just-posted
    call refcount overhaul patch:

    (1) Fix the return value of some call completion helpers.

    (2) Add a tracepoint that allows local aborts to be debugged.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     
  • …l/git/dhowells/linux-fs

    David Howells says:

    ====================
    rxrpc: Overhaul call refcounting

    Here's a set of mostly small patches leading up to one big one.

    The big patch at the end of the series overhauls how rxrpc_call refcounting
    is handled, making it more sane so that calls bound to user IDs are _only_
    released from socket operations or kernel API functions. Further, the
    patch stops calls from holding refs on their parent socket - which can
    prevent the socket from being cleaned up.

    The second largest patch improves the call tracking tracepoint by providing
    extra information about the situation in which gets and puts occur. This
    allows distinctions to be drawn between refs held by the socket user ID
    tree, refs held by the work queue (to be implemented by a future patch) and
    other refs.

    The other patches include a couple of cleanups and some simple alterations
    to avoid NULL pointer dereferences in the big patch.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     

07 Sep, 2016

19 commits

  • Add a tracepoint for working out where local aborts happen. Each
    tracepoint call is labelled with a 3-letter code so that they can be
    distinguished - and the DATA sequence number is added too where available.

    rxrpc_kernel_abort_call() also takes a 3-letter code so that AFS can
    indicate the circumstances when it aborts a call.

    Signed-off-by: David Howells

    David Howells
     
  • rxrpc_set_call_completion() returns bool, not int, so the ret variable
    should match this.

    rxrpc_call_completed() and __rxrpc_call_completed() should return the value
    of rxrpc_set_call_completion().

    Signed-off-by: David Howells

    David Howells
     
  • rxrpc calls shouldn't hold refs on the sock struct. This was done so that
    the socket wouldn't go away whilst the call was in progress, such that the
    call could reach the socket's queues.

    However, we can mark the socket as requiring an RCU release and rely on the
    RCU read lock.

    To make this work, we do:

    (1) rxrpc_release_call() removes the call's call user ID. This is now
    only called from socket operations and not from the call processor:

    rxrpc_accept_call() / rxrpc_kernel_accept_call()
    rxrpc_reject_call() / rxrpc_kernel_reject_call()
    rxrpc_kernel_end_call()
    rxrpc_release_calls_on_socket()
    rxrpc_recvmsg()

    Though it is also called in the cleanup path of
    rxrpc_accept_incoming_call() before we assign a user ID.

    (2) Pass the socket pointer into rxrpc_release_call() rather than getting
    it from the call so that we can get rid of uninitialised calls.

    (3) Fix call processor queueing to pass a ref to the work queue and to
    release that ref at the end of the processor function (or to pass it
    back to the work queue if we have to requeue).

    (4) Skip out of the call processor function asap if the call is complete
    and don't requeue it if the call is complete.

    (5) Clean up the call immediately that the refcount reaches 0 rather than
    trying to defer it. Actual deallocation is deferred to RCU, however.

    (6) Don't hold socket refs for allocated calls.

    (7) Use the RCU read lock when queueing a message on a socket and treat
    the call's socket pointer according to RCU rules and check it for
    NULL.

    We also need to use the RCU read lock when viewing a call through
    procfs.

    (8) Transmit the final ACK/ABORT to a client call in rxrpc_release_call()
    if this hasn't been done yet so that we can then disconnect the call.
    Once the call is disconnected, it won't have any access to the
    connection struct and the UDP socket for the call work processor to be
    able to send the ACK. Terminal retransmission will be handled by the
    connection processor.

    (9) Release all calls immediately on the closing of a socket rather than
    trying to defer this. Incomplete calls will be aborted.

    The call refcount model is much simplified. Refs are held on the call by:

    (1) A socket's user ID tree.

    (2) A socket's incoming call secureq and acceptq.

    (3) A kernel service that has a call in progress.

    (4) A queued call work processor. We have to take care to put any call
    that we failed to queue.

    (5) sk_buffs on a socket's receive queue. A future patch will get rid of
    this.

    Whilst we're at it, we can do:

    (1) Get rid of the RXRPC_CALL_EV_RELEASE event. Release is now done
    entirely from the socket routines and never from the call's processor.

    (2) Get rid of the RXRPC_CALL_DEAD state. Calls now end in the
    RXRPC_CALL_COMPLETE state.

    (3) Get rid of the rxrpc_call::destroyer work item. Calls are now torn
    down when their refcount reaches 0 and then handed over to RCU for
    final cleanup.

    (4) Get rid of the rxrpc_call::deadspan timer. Calls are cleaned up
    immediately they're finished with and don't hang around.
    Post-completion retransmission is handled by the connection processor
    once the call is disconnected.

    (5) Get rid of the dead call expiry setting as there's no longer a timer
    to set.

    (6) rxrpc_destroy_all_calls() can just check that the call list is empty.

    Signed-off-by: David Howells

    David Howells
     
  • Use rxrpc_is_service_call() rather than rxrpc_conn_is_service() if the call
    is available just in case call->conn is NULL.

    Signed-off-by: David Howells

    David Howells
     
  • Pass the connection pointer to rxrpc_post_packet_to_call() as the call
    might get disconnected whilst we're looking at it, but the connection
    pointer determined by rxrpc_data_read() is guaranteed by RCU for the
    duration of the call.

    Signed-off-by: David Howells

    David Howells
     
  • Cache the security index in the rxrpc_call struct so that we can get at it
    even when the call has been disconnected and the connection pointer
    cleared.

    Signed-off-by: David Howells

    David Howells
     
  • Use call->peer rather than call->conn->params.peer to avoid the possibility
    of call->conn being NULL and, whilst we're at it, check it for NULL before we
    access it.

    Signed-off-by: David Howells

    David Howells
     
  • Improve the call tracking tracepoint by showing more differentiation
    between some of the put and get events, including:

    (1) Getting and putting refs for the socket call user ID tree.

    (2) Getting and putting refs for queueing and failing to queue the call
    processor work item.

    Note that these aren't necessarily used in this patch, but will be taken
    advantage of in future patches.

    An enum is added for the event subtype numbers rather than coding them
    directly as decimal numbers and a table of 3-letter strings is provided
    rather than a sequence of ?: operators.

    Signed-off-by: David Howells

    David Howells
     
  • Delete rxrpc_kernel_free_skb() as it's unused.

    Signed-off-by: David Howells

    David Howells
     
  • Remove some whitespace.

    Signed-off-by: David Howells

    David Howells
     
  • gpio_to_irq does not return NO_IRQ but instead returns a negative
    error code on failure. Returning NO_IRQ from the function has no
    negative effects as we only compare the result to the expected
    interrupt number, but it's better to return a proper failure
    code for consistency, and we should remove NO_IRQ from the kernel
    entirely.

    Signed-off-by: Arnd Bergmann
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • Reported-by: Ma Yuying
    Suggested-by: Jarod Wilson
    Signed-off-by: Bert Kenward
    Reviewed-by: Jarod Wilson
    Signed-off-by: David S. Miller

    Bert Kenward
     
  • The newly added bpf_overflow_handler function is only built of both
    CONFIG_EVENT_TRACING and CONFIG_BPF_SYSCALL are enabled, but the caller
    only checks the latter:

    kernel/events/core.c: In function 'perf_event_alloc':
    kernel/events/core.c:9106:27: error: 'bpf_overflow_handler' undeclared (first use in this function)

    This changes the caller so we also skip this call if CONFIG_EVENT_TRACING
    is disabled entirely.

    Signed-off-by: Arnd Bergmann
    Fixes: aa6a5f3cb2b2 ("perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT programs")
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • We get 1 warning when building kernel with W=1:
    drivers/net/ethernet/arc/emac_mdio.c:107:5: warning: no previous prototype for 'arc_mdio_reset' [-Wmissing-prototypes]

    In fact, this function is only used in the file in which it is
    declared and don't need a declaration, but can be made static.
    so this patch marks this function with 'static'.

    Signed-off-by: Baoyou Xie
    Signed-off-by: David S. Miller

    Baoyou Xie
     
  • We get a few warnings when building kernel with W=1:
    drivers/net/usb/lan78xx.c:1182:6: warning: no previous prototype for 'lan78xx_defer_kevent' [-Wmissing-prototypes]
    drivers/net/usb/lan78xx.c:1409:5: warning: no previous prototype for 'lan78xx_nway_reset' [-Wmissing-prototypes]
    drivers/net/usb/lan78xx.c:2000:5: warning: no previous prototype for 'lan78xx_set_mac_addr' [-Wmissing-prototypes]
    ....

    In fact, these functions are only used in the file in which they are
    declared and don't need a declaration, but can be made static.
    so this patch marks these functions with 'static'.

    Signed-off-by: Baoyou Xie
    Signed-off-by: David S. Miller

    Baoyou Xie
     
  • David S. Miller
     
  • Adds support for several infrastructure operations that are done as part of
    debug data collection.

    Signed-off-by: Tomer Tayar
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Tomer Tayar
     
  • Signed-off-by: Alexander Duyck
    Tested-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • These messages are unnecessary as OOM allocation failures already do
    a dump_stack() giving more or less the same information.

    $ size drivers/net/ethernet/qlogic/qed/built-in.o* (defconfig x86-64)
    text data bss dec hex filename
    127817 27969 32800 188586 2e0aa drivers/net/ethernet/qlogic/qed/built-in.o.new
    132474 27969 32800 193243 2f2db drivers/net/ethernet/qlogic/qed/built-in.o.old

    Miscellanea:

    o Change allocs to the generally preferred forms where possible.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches