13 Apr, 2016

21 commits

  • This patch moves the 802.15.4 link layer specific structures to generic
    6lowpan. This is necessary for special 802.15.4 6lowpan handling in
    6lowpan generic layer.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes the naming for interface private data for lowpan
    intefaces. The current private data scheme is:

    -------------------------------------------------
    | 6LoWPAN Generic | LinkLayer 6LoWPAN |
    -------------------------------------------------

    the current naming schemes are:

    - 6LoWPAN Generic:
    - lowpan_priv
    - LinkLayer 6LoWPAN:
    - BTLE
    - lowpan_dev
    - 802.15.4:
    - lowpan_dev_info

    the new naming scheme with this patch will be:

    - 6LoWPAN Generic:
    - lowpan_dev
    - LinkLayer 6LoWPAN:
    - BTLE
    - lowpan_btle_dev
    - 802.15.4:
    - lowpan_802154_dev

    Signed-off-by: Alexander Aring
    Reviewed-by: Stefan Schmidt
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • The short address is unique in combination with the panid. This patch
    will add the panid for generating an ieee802154 address hash.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • The generation of autoconfigured IPv6 link-local addresses starts with a
    notification on interface up.

    To handle autoconfiguration according to RFC 4944 requires pan id and
    short address to generate an autoconfigured link-local address. This
    patch will avoid changing of these link-layer address configuration
    while lowpan interface is up.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch introduce some short address handling functionality into
    ieee802154 headers.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch removes some const from non-pointer types and fixes the
    function name for the ieee802154_is_valid_extended_unicast_addr
    comment.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • We set the TXNSECEN bit of register TXNCON to on when transmitting a
    security-enabled frame, as described in section 3.12.2 of the MRF
    datasheet.

    Signed-off-by: Alexander Aring
    Signed-off-by: Alexandre Macabies
    Reviewed-by: Stefan Schmidt
    Acked-by: Alan Ott
    Signed-off-by: Marcel Holtmann

    Alexandre Macabies
     
  • When receiving a security-enabled IEEE 802.15.4 frame, the MRF24J40
    triggers a SECIF interrupt that needs to be handled for RX processing
    to keep functioning properly.

    This patch enables the SECIF interrupt and makes the MRF ignores all
    hardware processing of security-enabled frames, that is handled by the
    ieee802154 stack instead.

    Signed-off-by: Alexander Aring
    Signed-off-by: Alexandre Macabies
    Reviewed-by: Stefan Schmidt
    Acked-by: Alan Ott
    Signed-off-by: Marcel Holtmann

    Alexandre Macabies
     
  • ieee802154_is_secen checks if the 802.15.4 security bit is set in the
    frame control field.

    Signed-off-by: Alexander Aring
    Signed-off-by: Alexandre Macabies
    Reviewed-by: Stefan Schmidt
    Acked-by: Alan Ott
    Signed-off-by: Marcel Holtmann

    Alexandre Macabies
     
  • John Crispin says:

    ====================
    net: mediatek: make the driver pass stress tests

    While testing the driver we managed to get the TX path to stall and fail
    to recover. When dual MAC support was added to the driver, the whole queue
    stop/wake code was not properly adapted. There was also a regression in the
    locking of the xmit function. The fact that watchdog_timeo was not set and
    that the tx_timeout code failed to properly reset the dma, irq and queue
    just made the mess complete.

    This series make the driver pass stress testing. With this series applied
    the testbed has been running for several days and still has not locked up.
    We have a second setup that has a small hack patch applied to randomly stop
    irqs and/or one of the queues and successfully manages to recover from these
    simulated tx stalls.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The QID field gets set to the mac id. This made the DMA linked list queue
    the traffic of each MAC on a different internal queue. However during long
    term testing we found that this will cause traffic stalls as the multi
    queue setup requires a more complete initialisation which is not part of
    the upstream driver yet.

    This patch removes the code setting the QID field, resulting in all
    traffic ending up in queue 0 which works without any special setup.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • The worker always touches both netdevs. It is ethernet core and not MAC
    specific. We only need one worker, which belongs into the ethernets core
    struct.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • The driver supports 2 MACs. Both run on the same DMA ring. If we hit a TX
    timeout we need to stop both netdevs before restarting them again. If we
    don't do this, mtk_stop() wont shutdown DMA and the consecutive call to
    mtk_open() wont restart DMA and enable IRQs.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • Inside the TX path there is a lock inside the tx_map function. This is
    however too late. The patch moves the lock to the start of the xmit
    function right before the free count check of the DMA ring happens.
    If we do not do this, the code becomes racy leading to TX stalls and
    dropped packets. This happens as there are 2 netdevs running on the
    same physical DMA ring.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • The driver supports 2 MACs. Both run on the same DMA ring. If we go
    above/below the TX rings threshold value, we always need to wake/stop
    the queue of both devices. Not doing to can cause TX stalls and packet
    drops on one of the devices.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • HW reset is triggered in the mtk_hw_init() function. There is no need to
    also reset the core during probe.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • The code used to also support the PDMA engine, which had 2 packet pointers
    per descriptor. Because of this we had to divide the result by 2 and round
    it up. This is no longer needed as the code only supports QDMA.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • The original commit failed to set watchdog_timeo. This patch sets
    watchdog_timeo to HZ.

    Signed-off-by: John Crispin
    Signed-off-by: David S. Miller

    John Crispin
     
  • Pablo Neira Ayuso says:

    ====================
    Netfilter updates for net-next

    The following patchset contains the first batch of Netfilter updates for
    your net-next tree.

    1) Define pr_fmt() in nf_conntrack, from Weongyo Jeong.

    2) Define and register netfilter's afinfo for the bridge family,
    this comes in preparation for native nfqueue's bridge for nft,
    from Stephane Bryant.

    3) Add new attributes to store layer 2 and VLAN headers to nfqueue,
    also from Stephane Bryant.

    4) Parse new NFQA_VLAN and NFQA_L2HDR nfqueue netlink attributes
    coming from userspace, from Stephane Bryant.

    5) Use net->ipv6.devconf_all->hop_limit instead of hardcoded hop_limit
    in IPv6 SYNPROXY, from Liping Zhang.

    6) Remove unnecessary check for dst == NULL in nf_reject_ipv6,
    from Haishuang Yan.

    7) Deinline ctnetlink event report functions, from Florian Westphal.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Not performance critical, it is only invoked when an expectation is
    added/destroyed.

    While at it, kill unused nf_ct_expect_event() wrapper.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     
  • Way too large; move it to nf_conntrack_ecache.c.
    Reduces total object size by 1216 byte on my machine.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     

12 Apr, 2016

19 commits

  • …etooth/bluetooth-next

    Johan Hedberg says:

    ====================
    pull request: bluetooth-next 2016-04-12

    Here's a set of Bluetooth & 802.15.4 patches intended for the 4.7 kernel:

    - Fix for race condition in vhci driver
    - Memory leak fix for ieee802154/adf7242 driver
    - Improvements to deal with single-mode (LE-only) Bluetooth controllers
    - Fix for allowing the BT_SECURITY_FIPS security level
    - New BCM2E71 ACPI ID
    - NULL pointer dereference fix fox hci_ldisc driver

    Let me know if there are any issues pulling. Thanks.
    ====================

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

    David S. Miller
     
  • MDIO devices can be stacked upon each other. The current code supports
    two levels, which until recently has been enough for a DSA mdio bus on
    top of another bus. Now we have hardware which has an MDIO mux in the
    middle.

    Define an MDIO MUTEX class with three levels.

    Signed-off-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Andrew Lunn
     
  • David Howells says:

    ====================
    RxRPC: 2nd rewrite part 1

    Okay, I'm in the process of rewriting the RxRPC rewrite. The primary aim of
    this second rewrite is to strictly control the number of active connections we
    know about and to get rid of connections we don't need much more quickly.

    On top of this, there are fixes to the protocol handling which will all occur
    in later parts.

    Here's the first set of patches from the second go, aimed at net-next. These
    are all fixes and cleanups preparatory to the main event.

    Notable parts of this set include:

    (1) A fix for the AFS filesystem to wait for outstanding calls to complete
    before closing the RxRPC socket.

    (2) Differentiation of local and remote abort codes. At a future point
    userspace will get to see this via control message data on recvmsg().

    (3) Absorb the rxkad module into the af_rxrpc module to prevent a dependency
    loop.

    (4) Create a null security module and unconditionalise calls into the
    security module that's in force (there will always be a security module
    applied to a connection, even if it's just the null one).
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Create a null security type for security index 0 and get rid of all
    conditional calls to the security operations. We expect normally to be
    using security, so this should be of little negative impact.

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • Absorb the rxkad security module into the af_rxrpc module so that there's
    only one module file. This avoids a circular dependency whereby rxkad pins
    af_rxrpc and cached connections pin rxkad but can't be manually evicted
    (they will expire eventually and cease pinning).

    With this change, af_rxrpc can just be unloaded, despite having cached
    connections.

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • Don't assume transport address family and size when using the peer address
    to send a packet. Instead, use the start of the transport address rather
    than any particular element of the union and use the transport address
    length noted inside the sockaddr_rxrpc struct.

    This will be necessary when IPv6 support is introduced.

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • Don't pass gfp around in incoming call handling functions, but rather hard
    code it at the points where we actually need it since the value comes from
    within the rxrpc driver and is always the same.

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • In the rxrpc_connection and rxrpc_call structs, there's one field to hold
    the abort code, no matter whether that value was generated locally to be
    sent or was received from the peer via an abort packet.

    Split the abort code fields in two for cleanliness sake and add an error
    field to hold the Linux error number to the rxrpc_call struct too
    (sometimes this is generated in a context where we can't return it to
    userspace directly).

    Furthermore, add a skb mark to indicate a packet that caused a local abort
    to be generated so that recvmsg() can pick up the correct abort code. A
    future addition will need to be to indicate to userspace the difference
    between aborts via a control message.

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • Static arrays of strings should be const char *const[].

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • Move some miscellaneous bits out into their own file to make it easier to
    split the call handling.

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • Disable a debugging statement that has been left enabled

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • The afs filesystem needs to wait for any outstanding asynchronous calls
    (such as FS.GiveUpCallBacks cleaning up the callbacks lodged with a server)
    to complete before closing the AF_RXRPC socket when unloading the module.

    This may occur if the module is removed too quickly after unmounting all
    filesystems. This will produce an error report that looks like:

    AFS: Assertion failed
    1 == 0 is false
    0x1 == 0x0 is false
    ------------[ cut here ]------------
    kernel BUG at ../fs/afs/rxrpc.c:135!
    ...
    RIP: 0010:[] afs_close_socket+0xec/0x107 [kafs]
    ...
    Call Trace:
    [] afs_exit+0x1f/0x57 [kafs]
    [] SyS_delete_module+0xec/0x17d
    [] entry_SYSCALL_64_fastpath+0x12/0x6b

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • Willem de Bruijn says:

    ====================
    net: fix udp pull header breakage

    Commit e6afc8ace6dd ("udp: remove headers from UDP packets before
    queueing") modified udp receive processing to pull headers before
    enqueue and to not expect them on dequeue.

    The patch missed protocols on top of udp with in-kernel
    implementations that have their own skb_recv_datagram calls and
    dequeue logic. Modify these datapaths to also no longer expect
    a udp header at skb->data.

    Sunrpc and rxrpc are the only two protocols that call this
    function and contain references to udphr (some others, like tipc,
    are based on encap_rcv, which acts before enqueue, before the
    the header pull).
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Commit e6afc8ace6dd modified the udp receive path by pulling the udp
    header before queuing an skbuff onto the receive queue.

    Rxrpc also calls skb_recv_datagram to dequeue an skb from a udp
    socket. Modify this receive path to also no longer expect udp
    headers.

    Fixes: e6afc8ace6dd ("udp: remove headers from UDP packets before queueing")

    Signed-off-by: Willem de Bruijn
    Tested-by: Thierry Reding
    Signed-off-by: David S. Miller

    Willem de Bruijn
     
  • Commit e6afc8ace6dd modified the udp receive path by pulling the udp
    header before queuing an skbuff onto the receive queue.

    Sunrpc also calls skb_recv_datagram to dequeue an skb from a udp
    socket. Modify this receive path to also no longer expect udp
    headers.

    Fixes: e6afc8ace6dd ("udp: remove headers from UDP packets before queueing")

    Reported-by: Franklin S Cooper Jr.
    Signed-off-by: Willem de Bruijn
    Tested-by: Thierry Reding
    Signed-off-by: David S. Miller

    Willem de Bruijn
     
  • Multipath route lookups should consider knowledge about next hops and not
    select a hop that is known to be failed.

    Example:

    [h2] [h3] 15.0.0.5
    | |
    3| 3|
    [SP1] [SP2]--+
    1 2 1 2
    | | /-------------+ |
    | \ / |
    | X |
    | / \ |
    | / \---------------\ |
    1 2 1 2
    12.0.0.2 [TOR1] 3-----------------3 [TOR2] 12.0.0.3
    4 4
    \ /
    \ /
    \ /
    -------| |-----/
    1 2
    [TOR3]
    3|
    |
    [h1] 12.0.0.1

    host h1 with IP 12.0.0.1 has 2 paths to host h3 at 15.0.0.5:

    root@h1:~# ip ro ls
    ...
    12.0.0.0/24 dev swp1 proto kernel scope link src 12.0.0.1
    15.0.0.0/16
    nexthop via 12.0.0.2 dev swp1 weight 1
    nexthop via 12.0.0.3 dev swp1 weight 1
    ...

    If the link between tor3 and tor1 is down and the link between tor1
    and tor2 then tor1 is effectively cut-off from h1. Yet the route lookups
    in h1 are alternating between the 2 routes: ping 15.0.0.5 gets one and
    ssh 15.0.0.5 gets the other. Connections that attempt to use the
    12.0.0.2 nexthop fail since that neighbor is not reachable:

    root@h1:~# ip neigh show
    ...
    12.0.0.3 dev swp1 lladdr 00:02:00:00:00:1b REACHABLE
    12.0.0.2 dev swp1 FAILED
    ...

    The failed path can be avoided by considering known neighbor information
    when selecting next hops. If the neighbor lookup fails we have no
    knowledge about the nexthop, so give it a shot. If there is an entry
    then only select the nexthop if the state is sane. This is similar to
    what fib_detect_death does.

    To maintain backward compatibility use of the neighbor information is
    based on a new sysctl, fib_multipath_use_neigh.

    Signed-off-by: David Ahern
    Reviewed-by: Julian Anastasov
    Signed-off-by: David S. Miller

    David Ahern
     
  • Grygorii Strashko says:

    ====================
    drivers: net: cpsw: fix ale calls and drop host_port field from cpsw_priv

    This clean up series intended to:
    - fix port_mask parameters in ale calls and drop unnecessary shifts
    - drop host_port field from struct cpsw_priv
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The host_port field is constantly assigned to 0 and this value has
    never changed (since time when cpsw driver was introduced. More over,
    if this field will be assigned to non 0 value it will break current
    driver functionality.

    Hence, there are no reasons to continue maintaining this host_port
    field and it can be removed, and the HOST_PORT_NUM and ALE_PORT_HOST
    defines can be used instead.

    Signed-off-by: Grygorii Strashko
    Signed-off-by: David S. Miller

    Grygorii Strashko
     
  • ALE APIs expect to receive port masks as input values for arguments
    port_mask, untag, reg_mcast, unreg_mcast. But there are few places in
    code where port masks are passed left-shifted by cpsw_priv->host_port,
    like below:

    cpsw_ale_add_vlan(priv->ale, priv->data.default_vlan,
    ALE_ALL_PORTS << priv->host_port,
    ALE_ALL_PORTS << priv->host_port, 0, 0);

    and cpsw is still working just because priv->host_port == 0
    and has never ever been changed.

    Hence, fix port_mask parameters in ALE APIs calls and drop
    "<< priv->host_port" from all places where it's used to
    shift valid port mask.

    Signed-off-by: Grygorii Strashko
    Signed-off-by: David S. Miller

    Grygorii Strashko