1. 04 5月, 2013 1 次提交
    • K
      sky2: Fix crash on receiving VLAN frames · 88dccf5b
      Kirill Smelkov 提交于
      After recent 86a9bad3 (net: vlan: add protocol argument to packet
      tagging functions) my sky2 started to crash on receive of tagged
      frames, with backtrace similar to
      
          #CRASH!!!
          vlan_do_receive
          __netif_receive_skb_core
          __netif_receive_skb
          netif_receive_skb
          sky2_poll
          ...
          __net_rx_action
          __do_softirq
      
      The problem turned out to be:
      
          1) sky2 copies small packets from ring on RX, and in its
             receive_copy() skb header is copied manually field, by field, and
             only for some fields;
      
          2) 86a9bad3  added skb->vlan_proto, which vlan_untag() or
             __vlan_hwaccel_put_tag() set, and which is later used in
             vlan_do_receive().
      
             That patch updated copy_skb_header() for newly introduced
             skb->vlan_proto, but overlooked the need to also copy it in sky2's
             receive_copy().
      
      Because of 2, we have the following scenario:
      
          - frame is received and tagged in a ring, by sky2_rx_tag(). Both
            skb->vlan_proto and skb->vlan_tci are set;
      
          - later skb is decided to be copied, but skb->vlan_proto is
            forgotten and becomes 0.
      
          - in the beginning of vlan_do_receive() we call
      
              __be16 vlan_proto = skb->vlan_proto;
              vlan_dev = vlan_find_dev(skb->dev, vlan_proto, vlan_id);
      
            which eventually invokes
      
              vlan_proto_idx(vlan_proto)
      
            and that routine BUGs for everything except ETH_P_8021Q and
            ETH_P_8021AD.
      
            Oops.
      
      Fix it.
      
      P.S.
      
      Stephen, I wonder, why copy_skb_header() is not used in
      sky2.c::receive_copy() ? Problems, where receive_copy was updated field
      by field showed several times already, e.g.
      
          3f42941b    (sky2: propogate rx hash when packet is copied)
          e072b3fa    (sky2: fix receive length error in mixed non-VLAN/VLAN traffic)
      
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: Mirko Lindner <mlindner@marvell.com>
      Signed-off-by: NKirill Smelkov <kirr@mns.spb.ru>
      Acked-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88dccf5b
  2. 20 4月, 2013 2 次提交
  3. 30 3月, 2013 1 次提交
  4. 05 2月, 2013 1 次提交
  5. 09 1月, 2013 1 次提交
  6. 08 12月, 2012 1 次提交
  7. 04 12月, 2012 2 次提交
  8. 08 10月, 2012 1 次提交
    • P
      drivers/net/ethernet/marvell/sky2.c: fix error return code · 0bd8ba18
      Peter Senna Tschudin 提交于
      The function sky2_probe() return 0 for success and negative value
      for most of its internal tests failures. There are two exceptions
      that are error cases going to err_out*:. For this two cases, the
      function abort its success execution path, but returns non negative
      value, making it dificult for a caller function to notice the error.
      
      This patch fixes the error cases that do not return negative values.
      
      This was found by Coccinelle, but the code change was made by hand.
      This patch is not robot generated.
      
      A simplified version of the semantic match that finds this problem is
      as follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      (
      if@p1 (\(ret < 0\|ret != 0\))
       { ... return ret; }
      |
      ret@p1 = 0
      )
      ... when != ret = e1
          when != &ret
      *if(...)
      {
        ... when != ret = e2
            when forall
       return ret;
      }
      // </smpl>
      Signed-off-by: NPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0bd8ba18
  9. 09 7月, 2012 2 次提交
  10. 08 6月, 2012 1 次提交
  11. 02 5月, 2012 2 次提交
  12. 05 4月, 2012 1 次提交
  13. 04 4月, 2012 1 次提交
  14. 03 4月, 2012 1 次提交
  15. 22 3月, 2012 1 次提交
  16. 01 2月, 2012 1 次提交
  17. 30 11月, 2011 1 次提交
  18. 23 11月, 2011 1 次提交
  19. 18 11月, 2011 2 次提交
  20. 17 11月, 2011 8 次提交
  21. 09 11月, 2011 1 次提交
  22. 05 11月, 2011 1 次提交
  23. 19 10月, 2011 1 次提交
  24. 14 10月, 2011 1 次提交
  25. 08 10月, 2011 1 次提交
  26. 07 10月, 2011 1 次提交
  27. 27 9月, 2011 1 次提交
    • S
      sky2: manage irq better on single port card · 0bdb0bd0
      stephen hemminger 提交于
      Most sky2 hardware only has a single port, although some variations of the
      chip support two interfaces.  For the single port case, use the standard
      Ethernet driver convention of allocating IRQ when device is brought up
      rather than at probe time.
      
      Also, change the error handling of dual port cards so that if second
      port can not be brought up, then just fail. No point in continuing, since
      the failure is most certainly because of out of memory.
      
      The dual port sky2 device has a single irq and a single status ring,
      therefore it has a single NAPI object shared by both ports.
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0bdb0bd0
  28. 23 9月, 2011 1 次提交