1. 08 Jan, 2017 5 commits
    • Grygorii Strashko's avatar
      net: ethernet: ti: cpsw: add support for descs pool size configuration · 90225bf0
      Grygorii Strashko authored
      The CPSW CPDMA can process buffer descriptors placed as in internal
      CPPI RAM as in DDR. This patch adds support in CPSW and CPDMA for
      descs_pool_size mudule parameter, which defines total number of CPDMA CPPI
      descriptors to be used for both ingress/egress packets processing:
       - memory size, required for CPDMA descriptor pool, is calculated basing
      on number of descriptors specified by user in descs_pool_size and
      CPDMA descriptor size and allocated from coherent memory (CMA area);
       - CPDMA descriptor pool will be allocated in DDR if pool memory size >
      internal CPPI RAM or use internal CPPI RAM otherwise;
       - if descs_pool_size not specified in DT - the default value 256 will
      be used which will allow to place CPDMA descriptors pool into the
      internal CPPI RAM (current default behaviour);
       - CPDMA will ignore descs_pool_size if descs_pool_size = 0 for
      backward comaptiobility with davinci_emac.
      
      descs_pool_size is boot time setting and can't be changed once
      CPSW/CPDMA is initialized.
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90225bf0
    • Grygorii Strashko's avatar
      net: ethernet: ti: cpdma: use devm_ioremap · 7f3b490a
      Grygorii Strashko authored
      Use devm_ioremap() and simplify the code.
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f3b490a
    • Grygorii Strashko's avatar
      net: ethernet: ti: cpdma: minimize number of parameters in cpdma_desc_pool_create/destroy() · 5fcc40a9
      Grygorii Strashko authored
      Update cpdma_desc_pool_create/destroy() to accept only one parameter
      struct cpdma_ctlr*, as this structure contains all required
      information for pool creation/destruction.
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5fcc40a9
    • Grygorii Strashko's avatar
      net: ethernet: ti: cpdma: fix desc re-queuing · 12a303e3
      Grygorii Strashko authored
      The currently processing cpdma descriptor with EOQ flag set may
      contain two values in Next Descriptor Pointer field:
      - valid pointer: means CPDMA missed addition of new desc in queue;
      - null: no more descriptors in queue.
      In the later case, it's not required to write to HDP register, but now
      CPDMA does it.
      
      Hence, add additional check for Next Descriptor Pointer != null in
      cpdma_chan_process() function before writing in HDP register.
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12a303e3
    • Grygorii Strashko's avatar
      net: ethernet: ti: cpdma: am437x: allow descs to be plased in ddr · a6c83ccf
      Grygorii Strashko authored
      It's observed that cpsw/cpdma is not working properly when CPPI
      descriptors are placed in DDR instead of internal CPPI RAM on am437x
      SoC:
      - rx/tx silently stops processing packets;
      - or - after boot it's working for sometime, but stuck once Network
      load is increased (ping is working, but iperf is not).
      (The same issue has not been reproduced on am335x and am57xx).
      
      It seems that write to HDP register processed faster by interconnect
      than writing of descriptor memory buffer in DDR, which is probably
      caused by store buffer / write buffer differences as these functions
      are implemented differently across devices. So, to fix this i come up
      with two minimal, required changes:
      
      1) all accesses to the channel register HDP/CP/RXFREE registers should
      be done using sync IO accessors readl()/writel(), because all previous
      memory writes writes have to be completed before starting channel
      (write to HDP) or completing desc processing.
      
      2) the change 1 only doesn't work on am437x and additional reading of
      desc's field is required right after the new descriptor was filled
      with data and before pointer on it will be stored in
      prev_desc->hw_next field or HDP register.
      
      In addition, to above changes this patch eliminates all relaxed ordering
      I/O accessors in this driver as suggested by David Miller to avoid such
      kind of issues in the future, but with one exception - relaxed IO accessors
      will still be used to fill desc in cpdma_chan_submit(), which is safe as
      there is read barrier at the end of write sequence, and because sync IO
      accessors usage here will affect on net performance.
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6c83ccf
  2. 07 Jan, 2017 9 commits
  3. 06 Jan, 2017 23 commits
  4. 05 Jan, 2017 3 commits
    • Sowmini Varadhan's avatar
      tools: psock_tpacket: block Rx until socket filter has been added and socket... · c1878f7a
      Sowmini Varadhan authored
      tools: psock_tpacket: block Rx until socket filter has been added and socket has been bound to loopback.
      
      Packets from any/all interfaces may be queued up on the PF_PACKET socket
      before it is bound to the loopback interface by psock_tpacket, and
      when these are passed up by the kernel, they could interfere
      with the Rx tests.
      
      Avoid interference from spurious packet by blocking Rx until the
      socket filter has been set up, and the packet has been bound to the
      desired (lo) interface. The effective sequence is
      	socket(PF_PACKET, SOCK_RAW, 0);
      	set up ring
      	Invoke SO_ATTACH_FILTER
      	bind to sll_protocol set to ETH_P_ALL, sll_ifindex for lo
      After this sequence, the only packets that will be passed up are
      those received on loopback that pass the attached filter.
      Signed-off-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1878f7a
    • Soheil Hassas Yeganeh's avatar
      tcp: provide timestamps for partial writes · ad02c4f5
      Soheil Hassas Yeganeh authored
      For TCP sockets, TX timestamps are only captured when the user data
      is successfully and fully written to the socket. In many cases,
      however, TCP writes can be partial for which no timestamp is
      collected.
      
      Collect timestamps whenever any user data is (fully or partially)
      copied into the socket. Pass tcp_write_queue_tail to tcp_tx_timestamp
      instead of the local skb pointer since it can be set to NULL on
      the error path.
      
      Note that tcp_write_queue_tail can be NULL, even if bytes have been
      copied to the socket. This is because acknowledgements are being
      processed in tcp_sendmsg(), and by the time tcp_tx_timestamp is
      called tcp_write_queue_tail can be NULL. For such cases, this patch
      does not collect any timestamps (i.e., it is best-effort).
      
      This patch is written with suggestions from Willem de Bruijn and
      Eric Dumazet.
      
      Change-log V1 -> V2:
      	- Use sockc.tsflags instead of sk->sk_tsflags.
      	- Use the same code path for normal writes and errors.
      Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarYuchung Cheng <ycheng@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad02c4f5
    • David S. Miller's avatar
      Merge tag 'rxrpc-rewrite-20170105' of... · 37e65dc1
      David S. Miller authored
      Merge tag 'rxrpc-rewrite-20170105' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
      
      David Howells says:
      
      ====================
      rxrpc: Update tracing and proc interfaces
      
      This set of patches fixes and extends tracing:
      
       (1) Fix the handling of enum-to-string translations so that external
           tracing tools can make use of it by using TRACE_DEFINE_ENUM.
      
       (2) Extend a couple of tracepoints to export some extra available
           information and add three new tracepoints to allow monitoring of
           received DATA packets, call disconnection and improper/implicit call
           termination.
      
      and adds a bit more procfs-exported information:
      
       (3) Show a call's hard-ACK cursors in /proc/net/rxrpc_calls.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37e65dc1