1. 21 3月, 2013 3 次提交
    • C
      gianfar: Remove redundant programming of [rt]xic registers · 5d9657d8
      Claudiu Manoil 提交于
      For Multi Q Multi Group (MQ_MG_MODE) mode, the Rx/Tx colescing registers [rt]xic
      are aliased with the [rt]xic0 registers (coalescing setting regs for Q0). This
      avoids programming twice in a row the coalescing registers for the Rx/Tx hw Q0.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d9657d8
    • C
      gianfar: Poll only active Rx queues · 6be5ed3f
      Claudiu Manoil 提交于
      Split the napi budget fairly among the active queues only, instead
      of dividing it by the total number of Rx queues assigned to the
      given interrupt group.
      Use the h/w indication field RXFi in rstat (receive status register)
      to identify the active rx queues from the current interrupt group
      (i.e. receive event occured on ring i, if ring i is part of the current
      interrupt group). This indication field in rstat, RXFi i=0..7,
      allows us to find out on which queues of the same interrupt group
      do we have incomming traffic once we entered the polling routine for
      the given interrupt group. After servicing the ring i, the corresponding
      bit RXFi will be written with 1 to clear the active queue indication for
      that ring.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6be5ed3f
    • C
      gianfar: Fix tx napi polling · c233cf40
      Claudiu Manoil 提交于
      There are 2 issues with the current napi poll routine, with regards
      to tx ring cleanup:
      1) for multi-queue devices (MQ_MG_MODE), should tx_bit_map != rx_bit_map,
      which is possible (and supported in h/w) if the DT property "fsl,tx-bit-map"
      holds a different value than rx_bit_map, the current polling routine will
      service the wrong Tx queues in this case (i.e. the interrupt group will
      receive interrupts from tx queues that it will not service)
      2) Tx cleanup completion consumes napi budget, whereas the napi budget
      should be reserved for Rx work only.
      
      The patch fixes these issues and provides a clean napi polling routine.
      Napi poll completion is reached when all the Rx queues have been
      serviced and there is no Tx work to do.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c233cf40
  2. 15 3月, 2013 1 次提交
  3. 25 2月, 2013 1 次提交
  4. 15 2月, 2013 6 次提交
    • C
      gianfar: Fix and cleanup Rx FCB indication · ba779711
      Claudiu Manoil 提交于
      This fixes a less obvious error on one hand, and prevents futher
      similar errors by disambiguating and optimizing RxFCB indication,
      on the other hand.
      
      The error consists in NETIF_F_HW_VLAN_TX flag being used as an
      indication of Rx FCB insertion. This happened as soon gfar_uses_fcb(),
      which despite its name indicates Rx FCB insertion, started
      incorporating is_vlan_on().
      is_vlan_on(), on the other hand, is also a misleading construct because
      we need to differentiate b/w hw VLAN extraction/VLEX (marked by VLAN_RX
      flag) and hw VLAN insertion/VLINS (VLAN_TX flag), which are different
      mechanisms using different types of FCBs.
      
      The hw spec for the RxFCB feature is as follows:
      In the case of RxBD rings, FCBs (Frame Control Block) are inserted by
      the eTSEC whenever RCTRL[PRSDEP] is set to a non-zero value. Only one
      FCB is inserted per frame (in the buffer pointed to by the RxBD with
      bit F set). TOE acceleration for receive is enabled for all rx frames
      in this case.
      
      This patch introduces priv->uses_rxfcb field to quickly signal RxFCB
      insertion in accordance with the specification above.
      
      The dependency on FSL_GIANFAR_DEV_HAS_TIMER was also eliminated as
      another source of confusion. The actual dependency is to priv->hwts_rx_en.
      Upon changing priv->hwts_rx_en via IOCTL, the gfar device is being
      restarted and on init_mac() the priv->hwts_rx_en flag determines RxFCB
      insertion, and rctrl is programmed accordingly. The patch takes care
      of this case too.
      
      Though maybe not as self documenting as the inlining version uses_fcb(),
      priv->uses_rxfcb has the main purpose to quickly signal, on the hot path,
      that the incoming frame has a *Rx* FCB block inserted which needs to be
      pulled out before passing the skb to the stack. This is a performance
      critical operation, it needs to happen fast, that's why uses_rxfcb is
      placed in the first cacheline of gfar_private.
      This is also why a cached rctrl cannot be used instead: 1) because
      we don't have 32 bits available in the first cacheline of gfar_priv
      (but only 16); 2) bit operations are expensive on the hot path.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba779711
    • C
      gianfar: Remove wrong buffer size conditioning to VLAN h/w offload · 13f228da
      Claudiu Manoil 提交于
      The controller's ref manual states clearly that when the hw Rx vlan
      offload feature is enabled, meaning that the VLEX bit from RCTRL is
      correctly enabled, then the hw performs automatic VLAN tag extraction
      and deletion from the ethernet frames. So there's no point in trying to
      increase the rx buff size when rxvlan is on, as the frame is actually
      smaller.
      And the Tx vlan hw accel feature (VLINS) has nothing to do with rx buff
      size computation.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      13f228da
    • C
      gianfar: gfar_process_frame returns void · 61db26c6
      Claudiu Manoil 提交于
      No return code is expected from gfar_process_frame(), hence
      change it to return void.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61db26c6
    • C
      gianfar: GRO_DROP is unlikely · bd9e89f2
      Claudiu Manoil 提交于
      The change is significant since it affects the rx hot path.
      Paul observed and documented the effects at asm level, see
      below:
      
      "It turns out that it does make a difference, since gfar_process_frame
      gets inlined, and so the increment code gets moved out of line (I have
      marked the if statment with * and the increment code within "-----"):
      
        ------------------------- as is currently ------------------
           4d14:       80 61 00 18     lwz     r3,24(r1)
           4d18:       7f c4 f3 78     mr      r4,r30
           4d1c:       48 00 00 01     bl      4d1c <gfar_clean_rx_ring+0x10c>
        *  4d20:       2f 83 00 04     cmpwi   cr7,r3,4
           4d24:       40 9e 00 1c     bne-    cr7,4d40
      <gfar_clean_rx_ring+0x130>
              ----------------------------
           4d28:       81 3c 01 f8     lwz     r9,504(r28)
           4d2c:       81 5c 01 fc     lwz     r10,508(r28)
           4d30:       31 4a 00 01     addic   r10,r10,1
           4d34:       7d 29 01 94     addze   r9,r9
           4d38:       91 3c 01 f8     stw     r9,504(r28)
           4d3c:       91 5c 01 fc     stw     r10,508(r28)
              ----------------------------
           4d40:       a0 1f 00 24     lhz     r0,36(r31)
           4d44:       81 3f 00 00     lwz     r9,0(r31)
           4d48:       7f a4 eb 78     mr      r4,r29
           4d4c:       7f e3 fb 78     mr      r3,r31
      
        -------------------------- unlikely ------------------------
           4d14:       80 61 00 18     lwz     r3,24(r1)
           4d18:       7f c4 f3 78     mr      r4,r30
           4d1c:       48 00 00 01     bl      4d1c <gfar_clean_rx_ring+0x10c>
        *  4d20:       2f 83 00 04     cmpwi   cr7,r3,4
           4d24:       41 9e 03 94     beq-    cr7,50b8
      <gfar_clean_rx_ring+0x4a8>
           4d28:       a0 1f 00 24     lhz     r0,36(r31)
           4d2c:       81 3f 00 00     lwz     r9,0(r31)
           4d30:       7f a4 eb 78     mr      r4,r29
           4d34:       7f e3 fb 78     mr      r3,r31
      [...]
           50b8:       81 3c 01 f8     lwz     r9,504(r28)
           50bc:       81 5c 01 fc     lwz     r10,508(r28)
           50c0:       31 4a 00 01     addic   r10,r10,1
           50c4:       7d 29 01 94     addze   r9,r9
           50c8:       91 3c 01 f8     stw     r9,504(r28)
           50cc:       91 5c 01 fc     stw     r10,508(r28)
           50d0:       4b ff fc 58     b       4d28 <gfar_clean_rx_ring+0x118>
      
      So, the increment does actually get moved ~1k away."
      
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd9e89f2
    • C
      gianfar: Add device ref (dev) in gfar_private · 369ec162
      Claudiu Manoil 提交于
      Use device pointer (dev) to simplify the code and to
      avoid double indirections, especially on the hot path.
      
      Basically, instead of accessing priv to get the ofdev
      reference and then accessing the ofdev structure to
      dereference the needed dev pointer, we will get the
      dev pointer directly from priv.
      
      The dev pointer is required on the hot path, see gfar_new_rxbdp
      or gfar_clean_rx_ring (or xmit), and this patch makes
      it available directly from priv's 1st cacheline.
      
      This change is reflected at asm level too, taking (the hot)
      gfar_new_rxbdp():
      initial version -
          18c0:	7c 7e 1b 78 	mr      r30,r3
      
          18d0:	81 69 04 3c 	lwz     r11,1084(r9)
      
          18d8:	34 6b 00 10 	addic.  r3,r11,16
          18dc:	41 82 00 08 	beq-    18e4
      
      patched version -
          18d0:	80 69 04 38 	lwz     r3,1080(r9)
      
          18d8:	2f 83 00 00 	cmpwi   cr7,r3,0
          18dc:	41 9e 00 08 	beq-    cr7,18e4
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      369ec162
    • C
      gianfar: Remove unused device_node ref in gfar_private · 41a20609
      Claudiu Manoil 提交于
      Remove unused device node pointer.
      Remove duplicated SET_NETDEV_DEV().
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41a20609
  5. 13 2月, 2013 1 次提交
    • P
      gianfar: convert u64 status counters to atomic64_t · 212079df
      Paul Gortmaker 提交于
      While looking at some asm dump for an unrelated change, Eric
      noticed in the following stats count increment code:
      
          50b8:       81 3c 01 f8     lwz     r9,504(r28)
          50bc:       81 5c 01 fc     lwz     r10,508(r28)
          50c0:       31 4a 00 01     addic   r10,r10,1
          50c4:       7d 29 01 94     addze   r9,r9
          50c8:       91 3c 01 f8     stw     r9,504(r28)
          50cc:       91 5c 01 fc     stw     r10,508(r28)
      
      that a 64 bit counter was used on ppc-32 without sync
      and hence the "ethtool -S" output was racy.
      
      Here we convert all the values to use atomic64_t so that
      the output will always be consistent.
      Reported-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      212079df
  6. 09 2月, 2013 1 次提交
  7. 05 2月, 2013 1 次提交
    • P
      gianfar: dont conditionally alloc Rx/Err irq structs · 7c1e7e99
      Paul Gortmaker 提交于
      Commit ee873fda
      
          "gianfar: Pack struct gfar_priv_grp into three cachelines"
      
      causes the following null dereference at driver init on sbc8548:
      
         libphy: Freescale PowerQUICC MII Bus: probed
         Unable to handle kernel paging request for data at address 0x00000000
         Faulting instruction address: 0xc01d6a38
         Oops: Kernel access of bad area, sig: 11 [#1]
         [...]
         NIP [c01d6a38] gfar_parse_group+0x228/0x280
         LR [c01d6a34] gfar_parse_group+0x224/0x280
         Call Trace:
         [ef82dd60] [c01d6a34] gfar_parse_group+0x224/0x280 (unreliable)
         [ef82dd90] [c01d73a4] gfar_probe+0x284/0xfe0
      
      The reason is that the commit also changed the allocation of the
      Rx and error handling irq structs to be skipped for !MQ_MG_MODE.
      In the !MQ_MG_MODE case, only the Tx irq struct is allocated.
      
      Digging further, we see that MQ_MG_MODE is set only if we find
      the OF compatible string "fsl,etsec2".
      
      A quick grep in the dts directory shows lots of boards that support
      Rx/Tx/Err, but without this specific compat string.  And hence they
      go after the unallocated Rx/Error structs and cause the above oops.
      
      Hence such a change can not be deployed until all the dts files
      are updated and sufficiently deployed.  Further, the optimization
      is of limited value, since the kmalloc'd struct in question has only
      a single unsigned int, and an (IFNAMSIZ + 6) sized string.
      
      Note that no changes to the freeing code are needed here, as it
      already did an unconditional free of Rx/Tx/Error gfar_irqinfo.
      
      Cc: Claudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c1e7e99
  8. 30 1月, 2013 2 次提交
  9. 24 1月, 2013 1 次提交
  10. 10 11月, 2012 2 次提交
  11. 07 10月, 2012 1 次提交
    • E
      net: remove skb recycling · acb600de
      Eric Dumazet 提交于
      Over time, skb recycling infrastructure got litle interest and
      many bugs. Generic rx path skb allocation is now using page
      fragments for efficient GRO / TCP coalescing, and recyling
      a tx skb for rx path is not worth the pain.
      
      Last identified bug is that fat skbs can be recycled
      and it can endup using high order pages after few iterations.
      
      With help from Maxime Bizon, who pointed out that commit
      87151b86 (net: allow pskb_expand_head() to get maximum tailroom)
      introduced this regression for recycled skbs.
      
      Instead of fixing this bug, lets remove skb recycling.
      
      Drivers wanting really hot skbs should use build_skb() anyway,
      to allocate/populate sk_buff right before netif_receive_skb()
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      acb600de
  12. 25 9月, 2012 1 次提交
    • C
      gianfar: Change default HW Tx queue scheduling mode · b98b8bab
      Claudiu Manoil 提交于
      This is primarily to address transmission timeout occurrences, when
      multiple H/W Tx queues are being used concurrently. Because in
      the priority scheduling mode the controller does not service the
      Tx queues equally (but in ascending index order), Tx timeouts are
      being triggered rightaway for a basic test with multiple simultaneous
      connections like:
      iperf -c <server_ip> -n 100M -P 8
      
      resulting in kernel trace:
      NETDEV WATCHDOG: eth1 (fsl-gianfar): transmit queue <X> timed out
      ------------[ cut here ]------------
      WARNING: at net/sched/sch_generic.c:255
      ...
      and controller reset during intense traffic, and possibly further
      complications.
      
      This patch changes the default H/W Tx scheduling setting (TXSCHED)
      for multi-queue devices, from priority scheduling mode to a weighted
      round robin mode with equal weights for all H/W Tx queues, and
      addresses the issue above.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b98b8bab
  13. 31 8月, 2012 2 次提交
  14. 10 7月, 2012 1 次提交
  15. 29 6月, 2012 1 次提交
  16. 06 6月, 2012 4 次提交
  17. 23 5月, 2012 1 次提交
  18. 22 4月, 2012 1 次提交
  19. 26 3月, 2012 1 次提交
  20. 19 3月, 2012 1 次提交
  21. 16 3月, 2012 2 次提交
  22. 31 1月, 2012 1 次提交
  23. 13 1月, 2012 2 次提交
  24. 29 11月, 2011 1 次提交
    • A
      net/ethernet: convert drivers/net/ethernet/* to use module_platform_driver() · db62f684
      Axel Lin 提交于
      This patch converts the drivers in drivers/net/ethernet/* to use the
      module_platform_driver() macro which makes the code smaller and a bit
      simpler.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Pantelis Antoniou <pantelis.antoniou@gmail.com>
      Cc: Vitaly Bordug <vbordug@ru.mvista.com>
      Cc: Wan ZongShun <mcuos.com@gmail.com>
      Cc: Nicolas Pitre <nico@fluxnic.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Jiri Pirko <jpirko@redhat.com>
      Cc: Daniel Hellstrom <daniel@gaisler.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Richard Cochran <richard.cochran@omicron.at>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Sebastian Poehn <sebastian.poehn@belden.com>
      Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Acked-by: NWan ZongShun <mcuos.com@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db62f684
  25. 17 11月, 2011 1 次提交