1. 08 Jan, 2017 11 commits
    • Michael Scherban's avatar
      net: netcp: store network statistics in 64 bits · 6a8162e9
      Michael Scherban authored
      Previously the network statistics were stored in 32 bit variable
      which can cause some stats to roll over after several minutes of
      high traffic. This implements 64 bit storage so larger numbers
      can be stored.
      Signed-off-by: default avatarMichael Scherban <m-scherban@ti.com>
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a8162e9
    • Karicheri, Muralidharan's avatar
      net: netcp: remove the redundant memmov() · aa255101
      Karicheri, Muralidharan authored
      The psdata is populated with command data by netcp modules
      to the tail of the buffer and set_words() copy the same
      to the front of the psdata. So remove the redundant memmov
      function call.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa255101
    • Karicheri, Muralidharan's avatar
      net: netcp: extract eflag from desc for rx_hook handling · 69d707d0
      Karicheri, Muralidharan authored
      Extract the eflag bits from the received desc and pass it down
      the rx_hook chain to be available for netcp modules. Also the
      psdata and epib data has to be inspected by the netcp modules.
      So the desc can be freed only after returning from the rx_hook.
      So move knav_pool_desc_put() after the rx_hook processing.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69d707d0
    • David S. Miller's avatar
      Merge branch 'cpsw-cpdma-DDR' · b14ad90c
      David S. Miller authored
      Grygorii Strashko says:
      
      ====================
      net: ethernet: ti: cpsw: support placing CPDMA descriptors into DDR
      
      This series intended to add support for placing CPDMA descriptors into
      DDR by introducing new module parameter "descs_pool_size" to specify
      size of descriptor's pool. The "descs_pool_size" defines total number
      of CPDMA CPPI descriptors to be used for both ingress/egress packets
      processing. If not specified - the default value 256 will be used
      which will allow to place descriptor's pool into the internal CPPI
      RAM.
      
      In addition, added ability to re-split CPDMA pool of descriptors
      between RX and TX path via ethtool '-G' command wich will allow to
      configure and fix number of descriptors used by RX and TX path, which,
      then, will be split between RX/TX channels proportionally depending on
      number of RX/TX channels and its weight.
      
      This allows significantly to reduce UDP packets drop rate for
      bandwidth >301 Mbits/sec (am57x).
      
      Before enabling this feature, the am437x SoC has to be fixed as it's
      proved that it's not working when CPDMA descriptors placed in DDR.
      So, the patch 1 fixes this issue.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b14ad90c
    • Grygorii Strashko's avatar
      Documentation: DT: net: cpsw: remove no_bd_ram property · c40d8883
      Grygorii Strashko authored
      Even if no_bd_ram property is described in TI CPSW bindings the support for
      it has never been introduced in CPSW driver, so there are no real users of
      it. Hence, remove no_bd_ram property from documentation and DT files.
      
      Cc: 'Rob Herring <robh+dt@kernel.org>'
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c40d8883
    • Grygorii Strashko's avatar
      net: ethernet: ti: cpsw: add support for ringparam configuration · be034fc1
      Grygorii Strashko authored
      The CPDMA uses one pool of descriptors for both RX and TX which by default
      split between all channels proportionally depending on total number of
      CPDMA channels and number of TX and RX channels. As result, more
      descriptors will be consumed by TX path if there are more TX channels and
      there is no way now to dedicate more descriptors for RX path.
      
      So, add the ability to re-split CPDMA pool of descriptors between RX and TX
      path via ethtool '-G' command wich will allow to configure and fix number
      of descriptors used by RX and TX path, which, then, will be split between
      RX/TX channels proportionally depending on RX/TX channels number and
      weight. ethtool '-G' command will accept only number of RX entries and rest
      of descriptors will be arranged for TX automatically.
      
      Command:
        ethtool -G <devname> rx <number of descriptors>
      
      defaults and limitations:
      - minimum number of rx descriptors is 10% of total number of descriptors in
        CPDMA pool
      - maximum number of rx descriptors is 90% of total number of descriptors in
        CPDMA pool
      - by default, descriptors will be split equally between RX/TX path
      - any values passed in "tx" parameter will be ignored
      
      Usage:
      
       # ethtool -g eth0
      	Pre-set maximums:
      	RX:             7372
      	RX Mini:        0
      	RX Jumbo:       0
      	TX:             0
      	Current hardware settings:
      	RX:             4096
      	RX Mini:        0
      	RX Jumbo:       0
      	TX:             4096
      
       # ethtool -G eth0 rx 7372
       # ethtool -g eth0
      	Ring parameters for eth0:
      	Pre-set maximums:
      	RX:             7372
      	RX Mini:        0
      	RX Jumbo:       0
      	TX:             0
      	Current hardware settings:
      	RX:             7372
      	RX Mini:        0
      	RX Jumbo:       0
      	TX:             820
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be034fc1
    • 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 20 commits