1. 08 1月, 2017 15 次提交
    • K
      net: netcp: ale: use ale_status to size the ale table · 7938a0d7
      Karicheri, Muralidharan 提交于
      ALE h/w on newer version of NetCP (K2E/L/G) does provide a ALE_STATUS
      register for the size of the ALE Table implemented in h/w. Currently
      for example we set ALE Table size to 1024 for NetCP ALE on
      K2E even though the ALE Status/Documentation shows it has 8192 entries.
      So take advantage of this register to read the size of ALE table supported
      and use that value in the driver for the newer version of NetCP ALE.
      For NetCP lite, ALE Table size is much less (64) and indicated by a size
      of zero in ALE_STATUS. So use that as a default for now. While at it,
      also fix the ale table size on 10G switch to 2048 per User guide
      http://www.ti.com/lit/ug/spruhj5/spruhj5.pdfSigned-off-by: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7938a0d7
    • K
      net: netcp: ale: update to support unknown vlan controls for NU switch · ca47130a
      Karicheri, Muralidharan 提交于
      In NU Ethernet switch used on some of the Keystone SoCs, there is
      separate UNKNOWNVLAN register for membership, unreg mcast flood, reg
      mcast flood and force untag egress bits in ALE. So control for these
      fields require different address offset, shift and size of field.
      As this ALE has the same version number as ALE in CPSW found on other
      SoCs, customization based on version number is not possible. So
      use a configuration parameter, nu_switch_ale, to identify the ALE
      ALE found in NU Switch. Different treatment is needed for NU Switch
      ALE due to difference in the ale table bits, separate unknown vlan
      registers etc. The register information available in ale_controls,
      needs to be updated to support the netcp NU switch h/w. So it is not
      constant array any more since it needs to be updated based
      on ALE type. The header of the file is also updated to indicate it
      supports N port switch ALE, not just 3 port. The version mask is
      3 bits in NU Switch ALE vs 8 bits on other ALE types.
      
      While at it, change the debug print to info print so that ALE
      version gets displayed in boot log.
      Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca47130a
    • K
      net: netcp: use hw capability to remove FCS word from rx packets · 4cd85a61
      Karicheri, Muralidharan 提交于
      Some of the newer Ethernet switch hw (such as that on k2e/l/g) can
      strip the Etherenet FCS from packet at the port 0 egress of the switch.
      So use this capability instead of doing it in software.
      Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cd85a61
    • K
      net: netcp: ethss: get phy-handle only if link interface is MAC-to-PHY · 0cead3a6
      Karicheri, Muralidharan 提交于
      Currently to parse phy-handle, driver doesn't check if the interface is
      MAC to PHY. This patch add this check for all MAC to PHY interface types
      supported by the driver.
      Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0cead3a6
    • M
      net: netcp: store network statistics in 64 bits · 6a8162e9
      Michael Scherban 提交于
      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: NMichael Scherban <m-scherban@ti.com>
      Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a8162e9
    • K
      net: netcp: remove the redundant memmov() · aa255101
      Karicheri, Muralidharan 提交于
      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: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa255101
    • K
      net: netcp: extract eflag from desc for rx_hook handling · 69d707d0
      Karicheri, Muralidharan 提交于
      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: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69d707d0
    • D
      Merge branch 'cpsw-cpdma-DDR' · b14ad90c
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      b14ad90c
    • G
      Documentation: DT: net: cpsw: remove no_bd_ram property · c40d8883
      Grygorii Strashko 提交于
      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: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c40d8883
    • G
      net: ethernet: ti: cpsw: add support for ringparam configuration · be034fc1
      Grygorii Strashko 提交于
      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: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be034fc1
    • G
      net: ethernet: ti: cpsw: add support for descs pool size configuration · 90225bf0
      Grygorii Strashko 提交于
      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: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90225bf0
    • G
      net: ethernet: ti: cpdma: use devm_ioremap · 7f3b490a
      Grygorii Strashko 提交于
      Use devm_ioremap() and simplify the code.
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7f3b490a
    • G
      net: ethernet: ti: cpdma: minimize number of parameters in cpdma_desc_pool_create/destroy() · 5fcc40a9
      Grygorii Strashko 提交于
      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: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5fcc40a9
    • G
      net: ethernet: ti: cpdma: fix desc re-queuing · 12a303e3
      Grygorii Strashko 提交于
      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: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12a303e3
    • G
      net: ethernet: ti: cpdma: am437x: allow descs to be plased in ddr · a6c83ccf
      Grygorii Strashko 提交于
      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: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6c83ccf
  2. 07 1月, 2017 22 次提交
  3. 06 1月, 2017 3 次提交