1. 20 12月, 2013 1 次提交
  2. 18 12月, 2013 1 次提交
  3. 13 12月, 2013 3 次提交
    • P
      xen-netback: fix gso_prefix check · a3314f3d
      Paul Durrant 提交于
      There is a mistake in checking the gso_prefix mask when passing large
      packets to a guest. The wrong shift is applied to the bit - the raw skb
      gso type is used rather then the translated one. This leads to large packets
      being handed to the guest without the GSO metadata. This patch fixes the
      check.
      
      The mistake manifested as errors whilst running Microsoft HCK large packet
      offload tests between a pair of Windows 8 VMs. I have verified this patch
      fixes those errors.
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3314f3d
    • P
      xen-netback: napi: don't prematurely request a tx event · d9601a36
      Paul Durrant 提交于
      This patch changes the RING_FINAL_CHECK_FOR_REQUESTS in
      xenvif_build_tx_gops to a check for RING_HAS_UNCONSUMED_REQUESTS as the
      former call has the side effect of advancing the ring event pointer and
      therefore inviting another interrupt from the frontend before the napi
      poll has actually finished, thereby defeating the point of napi.
      
      The event pointer is updated by RING_FINAL_CHECK_FOR_REQUESTS in
      xenvif_poll, the napi poll function, if the work done is less than the
      budget i.e. when actually transitioning back to interrupt mode.
      Reported-by: NMalcolm Crossley <malcolm.crossley@citrix.com>
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d9601a36
    • P
      xen-netback: napi: fix abuse of budget · 10574059
      Paul Durrant 提交于
      netback seems to be somewhat confused about the napi budget parameter. The
      parameter is supposed to limit the number of skbs processed in each poll,
      but netback has this confused with grant operations.
      
      This patch fixes that, properly limiting the work done in each poll. Note
      that this limit makes sure we do not process any more data from the shared
      ring than we intend to pass back from the poll. This is important to
      prevent tx_queue potentially growing without bound.
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10574059
  4. 12 12月, 2013 1 次提交
    • P
      xen-netback: make sure skb linear area covers checksum field · d52eb0d4
      Paul Durrant 提交于
      skb_partial_csum_set requires that the linear area of the skb covers the
      checksum field. The checksum setup code in netback was only doing that
      pullup in the case when the pseudo header checksum was being recalculated
      though. This patch makes that pullup unconditional. (I pullup the whole
      transport header just for simplicity; the requirement is only for the check
      field but in the case of UDP this is the last field in the header and in the
      case of TCP it's the last but one).
      
      The lack of pullup manifested as failures running Microsoft HCK network
      tests on a pair of Windows 8 VMs and it has been verified that this patch
      fixes the problem.
      Suggested-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Reviewed-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d52eb0d4
  5. 06 12月, 2013 1 次提交
  6. 29 11月, 2013 1 次提交
  7. 29 10月, 2013 1 次提交
  8. 18 10月, 2013 3 次提交
  9. 09 10月, 2013 1 次提交
  10. 01 10月, 2013 1 次提交
    • W
      xen-netback: improve ring effeciency for guest RX · 4f0581d2
      Wei Liu 提交于
      There was a bug that netback routines netbk/xenvif_skb_count_slots and
      netbk/xenvif_gop_frag_copy disagreed with each other, which caused
      netback to push wrong number of responses to netfront, which caused
      netfront to eventually crash. The bug was fixed in 6e43fc04
      ("xen-netback: count number required slots for an skb more carefully").
      
      Commit 6e43fc04 focused on backport-ability. The drawback with the
      existing packing scheme is that the ring is not used effeciently, as
      stated in 6e43fc04.
      
      skb->data like:
          |        1111|222222222222|3333        |
      
      is arranged as:
          |1111        |222222222222|3333        |
      
      If we can do this:
          |111122222222|22223333    |
      That would save one ring slot, which improves ring effeciency.
      
      This patch effectively reverts 6e43fc04. That patch made count_slots
      agree with gop_frag_copy, while this patch goes the other way around --
      make gop_frag_copy agree with count_slots. The end result is that they
      still agree with each other, and the ring is now arranged like:
          |111122222222|22223333    |
      
      The patch that improves packing was first posted by Xi Xong and Matt
      Wilson. I only rebase it on top of net-next and rewrite commit message,
      so I retain all their SoBs. For more infomation about the original bug
      please refer to email listed below and commit message of 6e43fc04.
      
      Original patch:
      http://lists.xen.org/archives/html/xen-devel/2013-07/msg00760.htmlSigned-off-by: NXi Xiong <xixiong@amazon.com>
      Reviewed-by: NMatt Wilson <msw@amazon.com>
      [ msw: minor code cleanups, rewrote commit message, adjusted code
        to count RX slots instead of meta structures ]
      Signed-off-by: NMatt Wilson <msw@amazon.com>
      Cc: Annie Li <annie.li@oracle.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <Ian.Campbell@citrix.com>
      [ liuw: rebased on top of net-next tree, rewrote commit message, coding
        style cleanup. ]
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Acked-by: NIan Campbell <Ian.Campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f0581d2
  11. 13 9月, 2013 1 次提交
    • D
      xen-netback: count number required slots for an skb more carefully · 6e43fc04
      David Vrabel 提交于
      When a VM is providing an iSCSI target and the LUN is used by the
      backend domain, the generated skbs for direct I/O writes to the disk
      have large, multi-page skb->data but no frags.
      
      With some lengths and starting offsets, xen_netbk_count_skb_slots()
      would be one short because the simple calculation of
      DIV_ROUND_UP(skb_headlen(), PAGE_SIZE) was not accounting for the
      decisions made by start_new_rx_buffer() which does not guarantee
      responses are fully packed.
      
      For example, a skb with length < 2 pages but which spans 3 pages would
      be counted as requiring 2 slots but would actually use 3 slots.
      
      skb->data:
      
          |        1111|222222222222|3333        |
      
      Fully packed, this would need 2 slots:
      
          |111122222222|22223333    |
      
      But because the 2nd page wholy fits into a slot it is not split across
      slots and goes into a slot of its own:
      
          |1111        |222222222222|3333        |
      
      Miscounting the number of slots means netback may push more responses
      than the number of available requests.  This will cause the frontend
      to get very confused and report "Too many frags/slots".  The frontend
      never recovers and will eventually BUG.
      
      Fix this by counting the number of required slots more carefully.  In
      xen_netbk_count_skb_slots(), more closely follow the algorithm used by
      xen_netbk_gop_skb() by introducing xen_netbk_count_frag_slots() which
      is the dry-run equivalent of netbk_gop_frag_copy().
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6e43fc04
  12. 29 8月, 2013 3 次提交
  13. 02 7月, 2013 1 次提交
  14. 24 6月, 2013 1 次提交
  15. 13 6月, 2013 1 次提交
  16. 24 5月, 2013 1 次提交
  17. 18 5月, 2013 2 次提交
  18. 03 5月, 2013 3 次提交
  19. 23 4月, 2013 2 次提交
    • W
      xen-netback: don't disconnect frontend when seeing oversize packet · 03393fd5
      Wei Liu 提交于
      Some frontend drivers are sending packets > 64 KiB in length. This length
      overflows the length field in the first slot making the following slots have
      an invalid length.
      
      Turn this error back into a non-fatal error by dropping the packet. To avoid
      having the following slots having fatal errors, consume all slots in the
      packet.
      
      This does not reopen the security hole in XSA-39 as if the packet as an
      invalid number of slots it will still hit fatal error case.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      03393fd5
    • W
      xen-netback: coalesce slots in TX path and fix regressions · 2810e5b9
      Wei Liu 提交于
      This patch tries to coalesce tx requests when constructing grant copy
      structures. It enables netback to deal with situation when frontend's
      MAX_SKB_FRAGS is larger than backend's MAX_SKB_FRAGS.
      
      With the help of coalescing, this patch tries to address two regressions
      avoid reopening the security hole in XSA-39.
      
      Regression 1. The reduction of the number of supported ring entries (slots)
      per packet (from 18 to 17). This regression has been around for some time but
      remains unnoticed until XSA-39 security fix. This is fixed by coalescing
      slots.
      
      Regression 2. The XSA-39 security fix turning "too many frags" errors from
      just dropping the packet to a fatal error and disabling the VIF. This is fixed
      by coalescing slots (handling 18 slots when backend's MAX_SKB_FRAGS is 17)
      which rules out false positive (using 18 slots is legit) and dropping packets
      using 19 to `max_skb_slots` slots.
      
      To avoid reopening security hole in XSA-39, frontend sending packet using more
      than max_skb_slots is considered malicious.
      
      The behavior of netback for packet is thus:
      
          1-18            slots: valid
         19-max_skb_slots slots: drop and respond with an error
         max_skb_slots+   slots: fatal error
      
      max_skb_slots is configurable by admin, default value is 20.
      
      Also change variable name from "frags" to "slots" in netbk_count_requests.
      
      Please note that RX path still has dependency on MAX_SKB_FRAGS. This will be
      fixed with separate patch.
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2810e5b9
  20. 13 4月, 2013 1 次提交
  21. 11 4月, 2013 1 次提交
  22. 28 3月, 2013 1 次提交
  23. 27 3月, 2013 1 次提交
    • J
      netback: set transport header before passing it to kernel · f9ca8f74
      Jason Wang 提交于
      Currently, for the packets receives from netback, before doing header check,
      kernel just reset the transport header in netif_receive_skb() which pretends non
      l4 header. This is suboptimal for precise packet length estimation (introduced
      in 1def9238: net_sched: more precise pkt_len computation) which needs correct l4
      header for gso packets.
      
      The patch just reuse the header probed by netback for partial checksum packets
      and tries to use skb_flow_dissect() for other cases, if both fail, just pretend
      no l4 header.
      
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9ca8f74
  24. 26 3月, 2013 1 次提交
  25. 20 2月, 2013 1 次提交
  26. 19 2月, 2013 1 次提交
  27. 15 2月, 2013 1 次提交
  28. 08 2月, 2013 3 次提交