| a81683c3 | 07-Mar-2017 |
Roger Pau Monné <[email protected]> |
xen/netfront: fix inbound packet flags for checksum offload
Currently netfront is setting the flags of inbound packets with the checksum not present (offloaded) to (CSUM_IP_CHECKED | CSUM_IP_VALID |
xen/netfront: fix inbound packet flags for checksum offload
Currently netfront is setting the flags of inbound packets with the checksum not present (offloaded) to (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR). According to the mbuf(9) man page this is not the correct combination of flags, it should instead be (CSUM_DATA_VALID | CSUM_PSEUDO_HDR).
Reviewed by: Wei Liu <[email protected]> MFC after: 2 weeks Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D9831
show more ...
|
| c2d12e5e | 02-Jun-2016 |
Roger Pau Monné <[email protected]> |
xen-netfront: perform an interface reset when changing options
The PV backend will only pick the new options when the interface is detached and reattached again, so perform a full reset when changin
xen-netfront: perform an interface reset when changing options
The PV backend will only pick the new options when the interface is detached and reattached again, so perform a full reset when changing options. This is very fast, and should not be noticeable by the user.
Reviewed by: Wei Liu <[email protected]> Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6658
show more ...
|
| d039b070 | 02-Jun-2016 |
Roger Pau Monné <[email protected]> |
xen-netfront: release grant references used for the shared rings
Just calling gnttab_end_foreign_access_ref doesn't free the references, instead call gnttab_end_foreign_access with a NULL page argum
xen-netfront: release grant references used for the shared rings
Just calling gnttab_end_foreign_access_ref doesn't free the references, instead call gnttab_end_foreign_access with a NULL page argument in order to have the grant references freed. The code that maps the ring (xenbus_map_ring) already uses gnttab_grant_foreign_access which takes care of allocating a grant reference.
Reviewed by: Wei Liu <[email protected]> Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6608
show more ...
|
| c21b47d8 | 02-Jun-2016 |
Roger Pau Monné <[email protected]> |
xen-netfront: fix two hotplug related issues
This patch fixes two issues seen on hot-unplug. The first one is a panic caused by calling ether_ifdetach after freeing the internal netfront queue struc
xen-netfront: fix two hotplug related issues
This patch fixes two issues seen on hot-unplug. The first one is a panic caused by calling ether_ifdetach after freeing the internal netfront queue structures. ether_ifdetach will call xn_qflush, and this needs to be done before freeing the queues. This prevents the following panic:
Fatal trap 9: general protection fault while in kernel mode cpuid = 2; apic id = 04 instruction pointer = 0x20:0xffffffff80b1687f stack pointer = 0x28:0xfffffe009239e770 frame pointer = 0x28:0xfffffe009239e780 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (thread taskq) [ thread pid 0 tid 100015 ] Stopped at strlen+0x1f: movq (%rcx),%rax db> bt Tracing pid 0 tid 100015 td 0xfffff800038a6000 strlen() at strlen+0x1f/frame 0xfffffe009239e780 kvprintf() at kvprintf+0xfa0/frame 0xfffffe009239e890 vsnprintf() at vsnprintf+0x31/frame 0xfffffe009239e8b0 kassert_panic() at kassert_panic+0x5a/frame 0xfffffe009239e920 __mtx_lock_flags() at __mtx_lock_flags+0x164/frame 0xfffffe009239e970 xn_qflush() at xn_qflush+0x59/frame 0xfffffe009239e9b0 if_detach() at if_detach+0x17e/frame 0xfffffe009239ea10 netif_free() at netif_free+0x97/frame 0xfffffe009239ea30 netfront_detach() at netfront_detach+0x11/frame 0xfffffe009239ea40 [...]
Another panic can be triggered by hot-plugging a NIC:
Fatal trap 18: integer divide fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff80902203 stack pointer = 0x28:0xfffffe00508d3660 frame pointer = 0x28:0xfffffe00508d36a0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 2960 (ifconfig) [ thread pid 2960 tid 100088 ] Stopped at xn_txq_mq_start+0x33: divl %esi,%eax db> bt Tracing pid 2960 tid 100088 td 0xfffff8000850aa00 xn_txq_mq_start() at xn_txq_mq_start+0x33/frame 0xfffffe00508d36a0 ether_output() at ether_output+0x570/frame 0xfffffe00508d3720 arprequest() at arprequest+0x433/frame 0xfffffe00508d3820 arp_ifinit() at arp_ifinit+0x49/frame 0xfffffe00508d3850 xn_ioctl() at xn_ioctl+0x1a2/frame 0xfffffe00508d3890 in_control() at in_control+0x882/frame 0xfffffe00508d3910 ifioctl() at ifioctl+0xda1/frame 0xfffffe00508d39a0 kern_ioctl() at kern_ioctl+0x246/frame 0xfffffe00508d3a00 sys_ioctl() at sys_ioctl+0x171/frame 0xfffffe00508d3ae0 amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe00508d3bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00508d3bf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8011e185a, rsp = 0x7fffffffe478, rbp = 0x7fffffffe4c0 ---
This is caused by marking the driver as active before it's fully initialized, and thus calling xn_txq_mq_start with num_queues set to 0.
Reviewed by: Wei Liu <[email protected]> Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6646
show more ...
|
| da695b05 | 02-Jun-2016 |
Roger Pau Monné <[email protected]> |
xen-netfront: switch to using an interrupt handler
In order to use custom taskqueues we would have to mask the interrupt, which is basically what is already done for an interrupt handler, or else we
xen-netfront: switch to using an interrupt handler
In order to use custom taskqueues we would have to mask the interrupt, which is basically what is already done for an interrupt handler, or else we risk loosing interrupts. This switches netfront to the same interrupt handling that was done before multiqueue support was added.
Reviewed by: Wei Liu <[email protected]> Sponsored by: Citrix Systems R&D
show more ...
|
| 2568ee67 | 02-Jun-2016 |
Roger Pau Monné <[email protected]> |
xen-netfront: always keep the Rx ring full of requests
This is based on Linux commit 1f3c2eba1e2d866ef99bb9b10ade4096e3d7607c from David Vrabel:
A full Rx ring only requires 1 MiB of memory. This
xen-netfront: always keep the Rx ring full of requests
This is based on Linux commit 1f3c2eba1e2d866ef99bb9b10ade4096e3d7607c from David Vrabel:
A full Rx ring only requires 1 MiB of memory. This is not enough memory that it is useful to dynamically scale the number of Rx requests in the ring based on traffic rates, because:
a) Even the full 1 MiB is a tiny fraction of a typically modern Linux VM (for example, the AWS micro instance still has 1 GiB of memory).
b) Netfront would have used up to 1 MiB already even with moderate data rates (there was no adjustment of target based on memory pressure).
c) Small VMs are going to typically have one VCPU and hence only one queue.
Keeping the ring full of Rx requests handles bursty traffic better than trying to converge on an optimal number of requests to keep filled.
Reviewed by: Wei Liu <[email protected]> Sponsored by: Citrix Systems R&D
show more ...
|