Fix build with FreeBSD 13-CURRENT
cover Fix build with FreeBSD 13-CURRENT
The FreeBSD CI system is reporting errors with DPDK on the current head of the FreeBSD development branch for FreeBSD 13. Ahead of BSD 13's release, we need to apply fixes to ensure DPDK continues to compile on the various versions.
Bruce Richardson (2):
eal/freebsd: update CPU macro for FreeBSD 13 support kernel/freebsd: update contigmem for FreeBSD 13
kernel/freebsd/contigmem/contigmem.c | 7 +++++-- lib/librte_eal/freebsd/eal/include/rte_os.h | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-)
Signature · 1 line
2.24.1
PATCH 1/2 eal/freebsd: update CPU macro for FreeBSD 13 support
In (currently unreleased) FreeBSD 13, the CPU_NAND macro has been renamed to CPU_ANDNOT, so we need to use different DPDK-specific macros depending on what system-defined ones are present.
--- lib/librte_eal/freebsd/eal/include/rte_os.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
lib/librte_eal/freebsd/eal/include/rte_os.h +12 -0
@@ -29,6 +29,9 @@ typedef cpuset_t rte_cpuset_t;CPU_COPY (&tmp, dst); \ } while (0)#define RTE_CPU_FILL (set) CPU_FILL(set) + +/* In FreeBSD 13 CPU_NAND macro is CPU_ANDNOT */ +#ifdef CPU_NAND #define RTE_CPU_NOT (dst, src) do \ { \ cpuset_t tmp; \
@@ -36,5 +39,14 @@ typedef cpuset_t rte_cpuset_t;CPU_NAND (&tmp, src); \CPU_COPY (&tmp, dst); \ } while (0) +#else +#define RTE_CPU_NOT (dst, src) do \ +{ \ + cpuset_t tmp; \ + CPU_FILL(&tmp); \ + CPU_ANDNOT(&tmp, src); \ + CPU_COPY(&tmp, dst); \ +} while (0) +#endif #endif /* _RTE_OS_H_ */
Signature · 1 line
2.24.1
PATCH 2/2 kernel/freebsd: update contigmem for FreeBSD 13
In reply to Bruce RichardsonFreeBSD 13 has changed the definition of vm_page_replace so we need to have slightly different code paths around this function depending on the BSD version.
--- kernel/freebsd/contigmem/contigmem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/freebsd/contigmem/contigmem.c +5 -2
@@ -297,19 +297,22 @@ contigmem_cdev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot,VM_OBJECT_WLOCK (object);vm_page_updatefake (page, paddr, memattr); }else { -vm_page_t mret;/* * Replace the passed in reqpage page with our own fake page and * free up the original page. */ page =vm_page_getfake (paddr, memattr);VM_OBJECT_WLOCK (object); - mret =vm_page_replace (page, object, (*mres)->pindex); +#if __FreeBSD__ >=13 +vm_page_replace (page, object, (*mres)->pindex, *mres); +#else +vm_page_t mret =vm_page_replace (page, object, (*mres)->pindex);KASSERT (mret == *mres, ("invalid page replacement, old=%p, ret=%p" , *mres, mret));vm_page_lock (mret);vm_page_free (mret);vm_page_unlock (mret); +#endif *mres = page; }
Signature · 1 line
2.24.1
Thomas Monjalon
Applied03/01/2020 12:52, Bruce Richardson:
Quoted 8 lines
The FreeBSD CI system is reporting errors with DPDK on the current head of the FreeBSD development branch for FreeBSD 13. Ahead of BSD 13's release, we need to apply fixes to ensure DPDK continues to compile on the various versions.
Bruce Richardson (2):
eal/freebsd: update CPU macro for FreeBSD 13 support kernel/freebsd: update contigmem for FreeBSD 13
Applied, thanks