1. 06 Mar, 2013 1 commit
  2. 26 Feb, 2013 3 commits
    • Ben Hutchings's avatar
      sfc: Detach net device when stopping queues for reconfiguration · 29c69a48
      Ben Hutchings authored
      We must only ever stop TX queues when they are full or the net device
      is not 'ready' so far as the net core, and specifically the watchdog,
      is concerned.  Otherwise, the watchdog may fire *immediately* if no
      packets have been added to the queue in the last 5 seconds.
      
      The device is ready if all the following are true:
      
      (a) It has a qdisc
      (b) It is marked present
      (c) It is running
      (d) The link is reported up
      
      (a) and (c) are normally true, and must not be changed by a driver.
      (d) is under our control, but fake link changes may disturb userland.
      This leaves (b).  We already mark the device absent during reset
      and self-test, but we need to do the same during MTU changes and ring
      reallocation.  We don't need to do this when the device is brought
      down because then (c) is already false.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      29c69a48
    • Ben Hutchings's avatar
      sfc: Fix efx_rx_buf_offset() in the presence of swiotlb · b590ace0
      Ben Hutchings authored
      We assume that the mapping between DMA and virtual addresses is done
      on whole pages, so we can find the page offset of an RX buffer using
      the lower bits of the DMA address.  However, swiotlb maps in units of
      2K, breaking this assumption.
      
      Add an explicit page_offset field to struct efx_rx_buffer.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      b590ace0
    • Ben Hutchings's avatar
      sfc: Properly sync RX DMA buffer when it is not the last in the page · 3a68f19d
      Ben Hutchings authored
      We may currently allocate two RX DMA buffers to a page, and only unmap
      the page when the second is completed.  We do not sync the first RX
      buffer to be completed; this can result in packet loss or corruption
      if the last RX buffer completed in a NAPI poll is the first in a page
      and is not DMA-coherent.  (In the middle of a NAPI poll, we will
      handle the following RX completion and unmap the page *before* looking
      at the content of the first buffer.)
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      3a68f19d
  3. 25 Feb, 2013 15 commits
  4. 24 Feb, 2013 2 commits
    • Paul Gortmaker's avatar
      gianfar: fix compile fail for NET_POLL=y due to struct packing · 62ed839d
      Paul Gortmaker authored
      Commit ee873fda ("gianfar: Pack struct
      gfar_priv_grp into three cachelines") moved the irq number and names
      off into a separate struct and created accessors for them.  However
      it was never tested with NET_POLL enabled, and so some conversions
      that were simply overlooked went undetected until now.
      
      Make the netpoll ones also use the gfar_irq() accessors.
      Reported-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Claudiu Manoil <claudiu.manoil@freescale.com>
      Cc: Jianhua Xie <jianhua.xie@freescale.com>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      62ed839d
    • Cong Wang's avatar
      vlan: adjust vlan_set_encap_proto() for its callers · da8c8724
      Cong Wang authored
      There are two places to call vlan_set_encap_proto():
      vlan_untag() and __pop_vlan_tci().
      
      vlan_untag() assumes skb->data points after mac addr, otherwise
      the following code
      
              vhdr = (struct vlan_hdr *) skb->data;
              vlan_tci = ntohs(vhdr->h_vlan_TCI);
              __vlan_hwaccel_put_tag(skb, vlan_tci);
      
              skb_pull_rcsum(skb, VLAN_HLEN);
      
      won't be correct. But __pop_vlan_tci() assumes points _before_
      mac addr.
      
      In vlan_set_encap_proto(), it looks for some magic L2 value
      after mac addr:
      
              rawp = skb->data;
              if (*(unsigned short *) rawp == 0xFFFF)
      	...
      
      Therefore __pop_vlan_tci() is obviously wrong.
      
      A quick fix is avoiding using skb->data in vlan_set_encap_proto(),
      use 'vhdr+1' is always correct in both cases.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jesse Gross <jesse@nicira.com>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Acked-by: default avatarJesse Gross <jesse@nicira.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da8c8724
  5. 23 Feb, 2013 5 commits
  6. 22 Feb, 2013 9 commits
  7. 21 Feb, 2013 5 commits