04 Apr, 2010

25 commits

  • This patch adds documentation about the L2TPv3 functionality.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch adds support for static (unmanaged) L2TPv3 tunnels, where
    the tunnel socket is created by the kernel rather than being created
    by userspace. This means L2TP tunnels and sessions can be created
    manually, without needing an L2TP control protocol implemented in
    userspace. This might be useful where the user wants a simple ethernet
    over IP tunnel.

    A patch to iproute2 adds a new command set under "ip l2tp" to make use
    of this feature. This will be submitted separately.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • The existing pppol2tp driver exports debug info to
    /proc/net/pppol2tp. Rather than adding info to that file for the new
    functionality added in this patch series, we add new files in debugfs,
    leaving the old /proc file for backwards compatibility (L2TPv2 only).

    Currently only one file is provided: l2tp/tunnels, which lists
    internal debug info for all l2tp tunnels and sessions. More files may
    be added later. The info is for debug and problem analysis only -
    userspace apps should use netlink to obtain status about l2tp tunnels
    and sessions.

    Although debugfs does not support net namespaces, the tunnels and
    sessions dumped in l2tp/tunnels are only those in the net namespace of
    the process reading the file.

    Signed-off-by: James Chapman
    Signed-off-by: David S. Miller

    James Chapman
     
  • This driver presents a regular net_device for each L2TP ethernet
    pseudowire instance. These interfaces are named l2tpethN by default,
    though userspace can specify an alternative name when the L2TP
    session is created, if preferred. When the pseudowire is established,
    regular Linux networking utilities may be used to configure the
    interface, i.e. give it IP address info or add it to a bridge. Any
    data passed over the interface is carried over an L2TP tunnel.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • Reader/write locks are discouraged because they are slower than spin
    locks. So this patch converts the rwlocks used in the per_net structs
    to rcu.

    Signed-off-by: James Chapman
    Signed-off-by: David S. Miller

    James Chapman
     
  • In L2TPv3, we need to create/delete/modify/query L2TP tunnel and
    session contexts. The number of parameters is significant. So let's
    use netlink. Userspace uses this API to control L2TP tunnel/session
    contexts in the kernel.

    The previous pppol2tp driver was managed using [gs]etsockopt(). This
    API is retained for backwards compatibility. Unlike L2TPv2 which
    carries only PPP frames, L2TPv3 can carry raw ethernet frames or other
    frame types and these do not always have an associated socket
    family. Therefore, we need a way to use L2TP sessions that doesn't
    require a socket type for each supported frame type. Hence netlink is
    used.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • This lets kernel modules which use genl netlink APIs serialize netlink
    processing.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch adds a new L2TPIP socket family and modifies the core to
    handle the case where there is no UDP header in the L2TP
    packet. L2TP/IP uses IP protocol 115. Since L2TP/UDP and L2TP/IP
    packets differ in layout, the datapath packet handling code needs
    changes too. Userspace uses an L2TPIP socket instead of a UDP socket
    when IP encapsulation is required.

    We can't use raw sockets for this because the semantics of raw sockets
    don't lend themselves to the socket-per-tunnel model - we need to

    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch makes changes to the L2TP PPP code for L2TPv3.

    The existing code has some assumptions about the L2TP header which are
    broken by L2TPv3. Also the sockaddr_pppol2tp structure of the original
    code is too small to support the increased size of the L2TPv3 tunnel
    and session id, so a new sockaddr_pppol2tpv3 structure is needed. In
    the socket calls, the size of this structure is used to tell if the
    operation is for L2TPv2 or L2TPv3.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • The L2TPv3 protocol changes the layout of the L2TP packet
    header. Tunnel and session ids change from 16-bit to 32-bit values,
    data sequence numbers change from 16-bit to 24-bit values and PPP-specific
    fields are moved into protocol-specific subheaders.

    Although this patch introduces L2TPv3 protocol support, there are no
    userspace interfaces to create L2TPv3 sessions yet.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • When dumping L2TP PPP sessions using /proc/net/pppol2tp, get the
    assigned PPP device name from PPP using ppp_dev_name().

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • ppp_dev_name() gives PPP users visibility of a ppp channel's device
    name. This can be used by L2TP drivers to dump the assigned PPP
    interface name.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch splits the pppol2tp driver into separate L2TP and PPP parts
    to prepare for L2TPv3 support. In L2TPv3, protocols other than PPP can
    be carried, so this split creates a common L2TP core that will handle
    the common L2TP bits which protocol support modules such as PPP will
    use.

    Note that the existing pppol2tp module is split into l2tp_core and
    l2tp_ppp by this change.

    There are no feature changes here. Internally, however, there are
    significant changes, mostly to handle the separation of PPP-specific
    data from the L2TP session and to provide hooks in the core for
    modules like PPP to access.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch moves the existing pppol2tp driver from drivers/net into a
    new net/l2tp directory, which is where the upcoming L2TPv3 code will
    live. The existing CONFIG_PPPOL2TP config option is left in its
    current place to avoid "make oldconfig" issues when an existing
    pppol2tp user takes this change. (This is the same approach used for
    the pppoatm driver, which moved to net/atm.)

    There are no code changes. The existing drivers/net/pppol2tp.c is
    simply moved to net/l2tp.

    Signed-off-by: James Chapman
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    James Chapman
     
  • Converts the list and the core manipulating with it to be the same as uc_list.

    +uses two functions for adding/removing mc address (normal and "global"
    variant) instead of a function parameter.
    +removes dev_mcast.c completely.
    +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
    manipulation with lists on a sandbox (used in bonding and 80211 drivers)

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • +little renaming of unicast functions to be smooth with multicast ones

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Amit Kumar Salecha
     
  • cpu_to_le32 was missing and used improperly.

    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Amit Kumar Salecha
     
  • Interface should be visible even if resource allocation fails.
    netif_device_attach should be called for every netif_device_detach.

    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Amit Kumar Salecha
     
  • Add debug print in driver, can be tuned by ethtool msg level
    callback.

    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Amit Kumar Salecha
     
  • o USE/Read IDC defined timeout value from ROM.
    o While resetting chip, don't wait for other pci-func to respond,
    more than reset_ack_timeo seconds,

    Signed-off-by: Sucheta Chakraborty
    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Sucheta Chakraborty
     
  • Fix incorrect offset calculation and remove unnecessary remap
    of the region in bar 0 to access onchip memory.

    This was leading to read incorrect values by debug tools.

    Signed-off-by: Dhananjay Phadke
    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Dhananjay Phadke
     
  • All QLogic converged NICs have 128-bit 128MB on card memory.
    Fix the limit check from 64MB to 128MB and remove unnecessary
    64-bit read/write checks.

    Signed-off-by: Dhananjay Phadke
    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Dhananjay Phadke
     
  • Check the access by tools for hardware queue engine and handle it
    separately than other block registers, otherwise incorrect data
    is returned.

    Signed-off-by: Dhananjay Phadke
    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Dhananjay Phadke
     
  • Rarely: Fw file size can be unaligned to 8.

    Signed-off-by: Amit Kumar Salecha
    Signed-off-by: David S. Miller

    Amit Kumar Salecha
     

03 Apr, 2010

3 commits

  • Signed-off-by: David Woodhouse
    Signed-off-by: David S. Miller

    David Woodhouse
     
  • We don't use the normal hotplug mechanism because it doesn't work. It will
    load the module some time after the device appears, but that's not good
    enough for us -- we need the driver loaded _immediately_ because otherwise
    the NIC driver may just abort and then the phy 'device' goes away.

    [bwh: s/phy/mdio/ in module alias, kerneldoc for struct mdio_device_id]

    Signed-off-by: David Woodhouse
    Signed-off-by: Ben Hutchings
    Acked-by: Andy Fleming
    Signed-off-by: David S. Miller

    David Woodhouse
     
  • Followup to commit 5acbbd428db47b12f137a8a2aa96b3c0a96b744e
    (net: change illegal_highdma to use dma_mask)

    If dev->dev.parent is NULL, we should not try to dereference it.

    Dont force inline illegal_highdma() as its pretty big now.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

02 Apr, 2010

12 commits

  • - Patch adds support to enable PCI SRIOV in the driver and changes to handle initialization of PCI virtual functions.
    - Function handler to change mac addresses for VF from its corresponding PF.

    Signed-off-by: Sarveshwar Bandi
    Signed-off-by: David S. Miller

    Sarveshwar Bandi
     
  • Signed-off-by: Alexander Kurz
    Signed-off-by: David S. Miller

    Alexander Kurz
     
  • BugLink: http://bugs.launchpad.net/bugs/457878

    v2:
    - remove duplicated phy_speed caculation
    - fix the phy_speed caculation according to the DataSheet

    v1:
    - removed old MII phy control code
    - add phylib supporting
    - add ethtool interface to make user space NetworkManager works

    Tested on Freescale i.MX51 Babbage board.

    This patch is based on a patch from Frederic Rodo

    Cc: Frederic Rodo
    Signed-off-by: Bryan Wu
    Acked-by: Amit Kucheria
    Acked-by: Sascha Hauer
    Signed-off-by: David S. Miller

    Bryan Wu
     
  • Robert Hancock pointed out two problems about NETIF_F_HIGHDMA:

    -Many drivers only set the flag when they detect they can use 64-bit DMA,
    since otherwise they could receive DMA addresses that they can't handle
    (which on platforms without IOMMU/SWIOTLB support is fatal). This means that if
    64-bit support isn't available, even buffers located below 4GB will get copied
    unnecessarily.

    -Some drivers set the flag even though they can't actually handle 64-bit DMA,
    which would mean that on platforms without IOMMU/SWIOTLB they would get a DMA
    mapping error if the memory they received happened to be located above 4GB.

    http://lkml.org/lkml/2010/3/3/530

    We can use the dma_mask if we need bouncing or not here. Then we can
    safely fix drivers that misuse NETIF_F_HIGHDMA.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: David S. Miller

    FUJITA Tomonori
     
  • Adding GRO support on top of the HW LRO (TPA) support –
    there is no measurable performance drawback of adding GRO
    on top of it, and it allows better performance when LRO (TPA)
    is turned off for virtualization or bridging.

    Signed-off-by: Dmitry Kravkov
    Signed-off-by: Eilon Greenstein
    Signed-off-by: David S. Miller

    Dmitry Kravkov
     
  • Group all per-cpu data to one structure instead of having many
    globals. Also prepare the internals so that we can have multiple
    instances of the flow cache if needed.

    Only the kmem_cache is left as a global as all flow caches share
    the same element size, and benefit from using a common cache.

    Signed-off-by: Timo Teras
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Timo Teräs
     
  • All of the code considers ->dead as a hint that the cached policy
    needs to get refreshed. The read side can just drop the read lock
    without any side effects.

    The write side needs to make sure that it's written only exactly
    once. Only possible race is at xfrm_policy_kill(). This is fixed
    by checking result of __xfrm_policy_unlink() when needed. It will
    always succeed if the policy object is looked up from the hash
    list (so some checks are removed), but it needs to be checked if
    we are trying to unlink policy via a reference (appropriate
    checks added).

    Since policy->walk.dead is written exactly once, it no longer
    needs to be protected with a write lock.

    Signed-off-by: Timo Teras
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Timo Teräs
     
  • Add missing check for policy direction verification. This is
    especially important since without this xfrm_user may end up
    deleting per-socket policy which is not allowed.

    Signed-off-by: Timo Teras
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Timo Teräs
     
  • The xfrm state genid only needs to be matched against the copy
    saved in xfrm_dst. So we don't need a global genid at all. In
    fact, we don't even need to initialise it.

    Based on observation by Timo Teräs.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The head element of rt6_info{} is dst_entry{}, and
    IPv6 specific elements follow.

    Because elements at the end of dst_entry{} are frequently
    updated, it is not good to put frequently-used static
    elements, such as rt6i_idev, rt6i_dst or rt6i_flags in the
    same cache line.

    On the other hand, fib6_table, rt6i_node or rt6i_gateway are
    rarely used, so it is okay to stay in the same cache line.

    Let's rearrange rt6_info{}.

    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki / 吉藤英明
     
  • keep the old behavior on SMP without rps

    RPS introduces a lock operation to per cpu variable input_pkt_queue on
    SMP whenever rps is enabled or not. On SMP without RPS, this lock isn't
    needed at all.

    Signed-off-by: Changli Gao
    ----
    net/core/dev.c | 42 ++++++++++++++++++++++++++++--------------
    1 file changed, 28 insertions(+), 14 deletions(-)
    Signed-off-by: David S. Miller

    Changli Gao
     
  • In case a reset is performed, rtl8169_rx_interrupt() is called from
    process context instead of softirq context. Special care must be taken
    to call appropriate network core services (netif_rx() instead of
    netif_receive_skb()). VLAN handling also corrected.

    Reported-by: Sergey Senozhatsky
    Tested-by: Sergey Senozhatsky
    Diagnosed-by: Oleg Nesterov
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet