06 Sep, 2015

1 commit


19 Aug, 2015

1 commit


13 Aug, 2015

1 commit


11 Jul, 2015

1 commit


19 Jun, 2015

1 commit


08 Jun, 2015

2 commits

  • API compliance scanning with coccinelle flagged:
    ./drivers/net/wan/dscc4.c:1036:1-33:
    WARNING: timeout (10) seems HZ dependent
    ./drivers/net/wan/dscc4.c:554:2-34:
    WARNING: timeout (10) seems HZ dependent
    ./drivers/net/wan/dscc4.c:599:2-34:
    WARNING: timeout (10) seems HZ dependent

    Numeric constants passed to schedule_timeout_*() make the effective
    timeout HZ dependent which does not seem to be the intent here.
    Fixed up by converting the constant to jiffies with msecs_to_jiffies(),
    passing 100ms (assuming HZ==100 in the original code).

    Signed-off-by: Nicholas Mc Guire
    Signed-off-by: David S. Miller

    Nicholas Mc Guire
     
  • API compliance scanning with coccinelle flagged:
    ./drivers/net/wan/cosa.c:520:2-18: WARNING:
    timeout (30) seems HZ dependent

    Numeric constants passed to schedule_timeout() make the effective
    timeout HZ dependent which makes little sense in a device probe.
    Fixed up by converting the constant to jiffies with msecs_to_jiffies()

    Signed-off-by: Nicholas Mc Guire
    Signed-off-by: David S. Miller

    Nicholas Mc Guire
     

07 Jun, 2015

1 commit


08 Apr, 2015

2 commits

  • Return a negative error code on failure.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    identifier ret; expression e1,e2;
    @@
    (
    if (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Return a negative error code on failure.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    identifier ret; expression e1,e2;
    @@
    (
    if (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

23 Feb, 2015

1 commit

  • Use helper functions to access current->state.
    Direct assignments are prone to races and therefore buggy.

    current->state = TASK_RUNNING is replaced by __set_current_state()

    Thanks to Peter Zijlstra for the exact definition of the problem.

    Suggested-By: Peter Zijlstra
    Signed-off-by: Fabian Frederick
    Acked-By: Jan "Yenya" Kasprzak
    Signed-off-by: David S. Miller

    Fabian Frederick
     

30 Jan, 2015

1 commit

  • The cosa driver is rather outdated and does not get built on most
    platforms because it requires the ISA_DMA_API symbol. However
    there are some ARM platforms that have ISA_DMA_API but no virt_to_bus,
    and they get this build error when enabling the ltpc driver.

    drivers/net/wan/cosa.c: In function 'tx_interrupt':
    drivers/net/wan/cosa.c:1768:3: error: implicit declaration of function 'virt_to_bus'
    unsigned long addr = virt_to_bus(cosa->txbuf);
    ^

    The same problem exists for the Hostess SV-11 and Sealevel Systems 4021
    drivers.

    This adds another dependency in Kconfig to avoid that configuration.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

08 Oct, 2014

1 commit

  • Testing xmit_more support with netperf and connected UDP sockets,
    I found strange dst refcount false sharing.

    Current handling of IFF_XMIT_DST_RELEASE is not optimal.

    Dropping dst in validate_xmit_skb() is certainly too late in case
    packet was queued by cpu X but dequeued by cpu Y

    The logical point to take care of drop/force is in __dev_queue_xmit()
    before even taking qdisc lock.

    As Julian Anastasov pointed out, need for skb_dst() might come from some
    packet schedulers or classifiers.

    This patch adds new helper to cleanly express needs of various drivers
    or qdiscs/classifiers.

    Drivers that need skb_dst() in their ndo_start_xmit() should call
    following helper in their setup instead of the prior :

    dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
    ->
    netif_keep_dst(dev);

    Instead of using a single bit, we use two bits, one being
    eventually rebuilt in bonding/team drivers.

    The other one, is permanent and blocks IFF_XMIT_DST_RELEASE being
    rebuilt in bonding/team. Eventually, we could add something
    smarter later.

    Signed-off-by: Eric Dumazet
    Cc: Julian Anastasov
    Signed-off-by: David S. Miller

    Eric Dumazet
     

02 Sep, 2014

2 commits


25 Aug, 2014

1 commit


15 Aug, 2014

1 commit

  • Pull DEFINE_PCI_DEVICE_TABLE removal from Bjorn Helgaas:
    "Part two of the PCI changes for v3.17:

    - Remove DEFINE_PCI_DEVICE_TABLE macro use (Benoit Taine)

    It's a mechanical change that removes uses of the
    DEFINE_PCI_DEVICE_TABLE macro. I waited until later in the merge
    window to reduce conflicts, but it's possible you'll still see a few"

    * tag 'pci-v3.17-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use

    Linus Torvalds
     

13 Aug, 2014

1 commit

  • We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
    meet kernel coding style guidelines. This issue was reported by checkpatch.

    A simplified version of the semantic patch that makes this change is as
    follows (http://coccinelle.lip6.fr/):

    //

    @@
    identifier i;
    declarer name DEFINE_PCI_DEVICE_TABLE;
    initializer z;
    @@

    - DEFINE_PCI_DEVICE_TABLE(i)
    + const struct pci_device_id i[]
    = z;

    //

    [bhelgaas: add semantic patch]
    Signed-off-by: Benoit Taine
    Signed-off-by: Bjorn Helgaas

    Benoit Taine
     

12 Aug, 2014

2 commits

  • The Linux kernel coding style guidelines suggest not using typedefs
    for structure types. This patch gets rid of the typedefs for
    port_t, card_status_t and card_t. Also, the names of the structs
    are changed to drop the _t, to make the name look less typedef-like.

    The following Coccinelle semantic patch detects two cases and a
    similar one detects the case for card_t.

    @tn1@
    type td;
    @@

    typedef struct { ... } td;

    @script:python tf@
    td << tn1.td;
    tdres;
    @@

    coccinelle.tdres = td;

    @@
    type tn1.td;
    identifier tf.tdres;
    @@

    -typedef
    struct
    + tdres
    { ... }
    -td
    ;

    @@
    type tn1.td;
    identifier tf.tdres;
    @@

    -td
    + struct tdres

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: David S. Miller

    Himangi Saraogi
     
  • The Linux kernel coding style guidelines suggest not using typedefs
    for structure types. This patch gets rid of the typedefs for
    fr_hdr and pvc_device. Also, the names of the structs are changed to
    drop the _t, to make the name look less typedef-like.

    The following Coccinelle semantic patch detects the case fr_hdr and a
    similar one detects the case for pvc_device.

    @tn1@
    type td;
    @@

    typedef struct { ... } td;

    @script:python tf@
    td << tn1.td;
    tdres;
    @@

    coccinelle.tdres = td;

    @@
    type tn1.td;
    identifier tf.tdres;
    @@

    -typedef
    struct
    + tdres
    { ... }
    -td
    ;

    @@
    type tn1.td;
    identifier tf.tdres;
    @@

    -td
    + struct tdres

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: David S. Miller

    Himangi Saraogi
     

22 Jul, 2014

1 commit


21 Jul, 2014

1 commit


18 Jul, 2014

1 commit

  • If "newmtu * 2 + 4" is too large then it can cause an integer overflow
    leading to memory corruption. Eric Dumazet suggests that 65534 is a
    reasonable upper limit.

    Btw, "newmtu" is not allowed to be a negative number because of the
    check in dev_set_mtu(), so that's ok.

    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     

17 Jul, 2014

1 commit


16 Jul, 2014

1 commit

  • Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
    all users to pass NET_NAME_UNKNOWN.

    Coccinelle patch:

    @@
    expression sizeof_priv, name, setup, txqs, rxqs, count;
    @@

    (
    -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
    +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
    |
    -alloc_netdev_mq(sizeof_priv, name, setup, count)
    +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
    |
    -alloc_netdev(sizeof_priv, name, setup)
    +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
    )

    v9: move comments here from the wrong commit

    Signed-off-by: Tom Gundersen
    Reviewed-by: David Herrmann
    Signed-off-by: David S. Miller

    Tom Gundersen
     

12 Jul, 2014

1 commit

  • There are several issues in fst_add_one() and fst_init_card():
    - invalid pointer dereference at card->ports[card->nports - 1] if
    register_hdlc_device() fails for the first port in fst_init_card();
    - fst_card_array overflow at fst_card_array[no_of_cards_added]
    because there is no checks for array overflow;
    - use after free because pointer to deallocated card is left in fst_card_array
    if something fails after fst_card_array[no_of_cards_added] = card;
    - several leaks on failure paths in fst_add_one().

    The patch fixes all the issues and makes code more readable.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Signed-off-by: David S. Miller

    Alexey Khoroshilov
     

11 Jun, 2014

1 commit

  • Use dma_addr_t for DMA address parameters and u32 for shared memory
    offset parameters.

    Do not assume that dma_addr_t is the same as unsigned long; it will
    not be in PAE configurations. Truncate DMA addresses to 32 bits when
    printing them. This is OK because the DMA mask for this device is
    32-bit (per default).

    Also rename the DMA address parameters from 'skb' to 'dma'.

    Compile-tested only.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

03 Jun, 2014

1 commit


16 May, 2014

1 commit

  • Netdev_priv is an accessor function, and has no purpose if its result is
    not used.

    A simplified version of the semantic match that fixes this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@ local idexpression x; @@
    -x = netdev_priv(...);
    ... when != x
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

15 Apr, 2014

1 commit


10 Feb, 2014

1 commit


26 Jan, 2014

1 commit

  • Pull networking updates from David Miller:

    1) BPF debugger and asm tool by Daniel Borkmann.

    2) Speed up create/bind in AF_PACKET, also from Daniel Borkmann.

    3) Correct reciprocal_divide and update users, from Hannes Frederic
    Sowa and Daniel Borkmann.

    4) Currently we only have a "set" operation for the hw timestamp socket
    ioctl, add a "get" operation to match. From Ben Hutchings.

    5) Add better trace events for debugging driver datapath problems, also
    from Ben Hutchings.

    6) Implement auto corking in TCP, from Eric Dumazet. Basically, if we
    have a small send and a previous packet is already in the qdisc or
    device queue, defer until TX completion or we get more data.

    7) Allow userspace to manage ipv6 temporary addresses, from Jiri Pirko.

    8) Add a qdisc bypass option for AF_PACKET sockets, from Daniel
    Borkmann.

    9) Share IP header compression code between Bluetooth and IEEE802154
    layers, from Jukka Rissanen.

    10) Fix ipv6 router reachability probing, from Jiri Benc.

    11) Allow packets to be captured on macvtap devices, from Vlad Yasevich.

    12) Support tunneling in GRO layer, from Jerry Chu.

    13) Allow bonding to be configured fully using netlink, from Scott
    Feldman.

    14) Allow AF_PACKET users to obtain the VLAN TPID, just like they can
    already get the TCI. From Atzm Watanabe.

    15) New "Heavy Hitter" qdisc, from Terry Lam.

    16) Significantly improve the IPSEC support in pktgen, from Fan Du.

    17) Allow ipv4 tunnels to cache routes, just like sockets. From Tom
    Herbert.

    18) Add Proportional Integral Enhanced packet scheduler, from Vijay
    Subramanian.

    19) Allow openvswitch to mmap'd netlink, from Thomas Graf.

    20) Key TCP metrics blobs also by source address, not just destination
    address. From Christoph Paasch.

    21) Support 10G in generic phylib. From Andy Fleming.

    22) Try to short-circuit GRO flow compares using device provided RX
    hash, if provided. From Tom Herbert.

    The wireless and netfilter folks have been busy little bees too.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2064 commits)
    net/cxgb4: Fix referencing freed adapter
    ipv6: reallocate addrconf router for ipv6 address when lo device up
    fib_frontend: fix possible NULL pointer dereference
    rtnetlink: remove IFLA_BOND_SLAVE definition
    rtnetlink: remove check for fill_slave_info in rtnl_have_link_slave_info
    qlcnic: update version to 5.3.55
    qlcnic: Enhance logic to calculate msix vectors.
    qlcnic: Refactor interrupt coalescing code for all adapters.
    qlcnic: Update poll controller code path
    qlcnic: Interrupt code cleanup
    qlcnic: Enhance Tx timeout debugging.
    qlcnic: Use bool for rx_mac_learn.
    bonding: fix u64 division
    rtnetlink: add missing IFLA_BOND_AD_INFO_UNSPEC
    sfc: Use the correct maximum TX DMA ring size for SFC9100
    Add Shradha Shah as the sfc driver maintainer.
    net/vxlan: Share RX skb de-marking and checksum checks with ovs
    tulip: cleanup by using ARRAY_SIZE()
    ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
    net/cxgb4: Don't retrieve stats during recovery
    ...

    Linus Torvalds
     

17 Jan, 2014

1 commit

  • None of these files are actually using any __init type directives
    and hence don't need to include . Most are just a
    left over from __devinit and __cpuinit removal, or simply due to
    code getting copied from one driver to the next.

    This covers everything under drivers/net except for wireless, which
    has been submitted separately.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Paul Gortmaker
     

15 Jan, 2014

1 commit


07 Jan, 2014

1 commit


20 Dec, 2013

1 commit

  • Create a new header file include/net/Space.h which contains
    prototype declaration of sbni_probe().

    Include the new header file in drivers/net/Space.c and
    drivers/net/wan/sbni.c because they use this function.

    This eliminates the following warning in wan/sbni.c:
    drivers/net/wan/sbni.c:224:12: warning: no previous prototype for ‘sbni_probe’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Signed-off-by: David S. Miller

    Rashika Kheria
     

10 Dec, 2013

4 commits