From 99ca48e047dd4919d03f7b62634d4cf9cd86ec04 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sat, 6 Feb 2021 12:26:12 -0600 Subject: [PATCH] ixl: switch i40e_osdep.c allocations to M_IAVF The switch was made in 7d4dceec1030, introducing a dependency on `device ixl` just for the malloc type. Partially revert the change by moving the M_IXL declaration back to ixl_pf.h and switch these to M_IAVF instead. Signed-off-by: Kyle Evans --- sys/dev/ixl/i40e_osdep.c | 5 +++-- sys/dev/ixl/ixl.h | 2 -- sys/dev/ixl/ixl_pf.h | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixl/i40e_osdep.c b/sys/dev/ixl/i40e_osdep.c index 20eb02c85d6..e75ef82cc99 100644 --- a/sys/dev/ixl/i40e_osdep.c +++ b/sys/dev/ixl/i40e_osdep.c @@ -35,6 +35,7 @@ #include #include +#include "iavf.h" #include "ixl.h" /******************************************************************** @@ -51,14 +52,14 @@ i40e_dmamap_cb(void *arg, bus_dma_segment_t * segs, int nseg, int error) i40e_status i40e_allocate_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size) { - mem->va = malloc(size, M_IXL, M_NOWAIT | M_ZERO); + mem->va = malloc(size, M_IAVF, M_NOWAIT | M_ZERO); return (mem->va == NULL); } i40e_status i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem) { - free(mem->va, M_IXL); + free(mem->va, M_IAVF); mem->va = NULL; return (I40E_SUCCESS); diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 3eb0fa4f6b5..8129ad4f1a3 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -304,8 +304,6 @@ /* For stats sysctl naming */ #define IXL_QUEUE_NAME_LEN 32 -MALLOC_DECLARE(M_IXL); - #define IXL_DEV_ERR(_dev, _format, ...) \ device_printf(_dev, "%s: " _format " (%s:%d)\n", __func__, ##__VA_ARGS__, __FILE__, __LINE__) diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index c3fbdc91d35..222ab614e03 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -260,6 +260,8 @@ struct ixl_pf { "\t1 - Enable (VEB)\n" \ "Enabling this will allow VFs in separate VMs to communicate over the hardware bridge." +MALLOC_DECLARE(M_IXL); + /*** Functions / Macros ***/ /* Adjust the level here to 10 or over to print stats messages */ #define I40E_VC_DEBUG(p, level, ...) \ -- 2.30.0