diff options
author | arr <arr@FreeBSD.org> | 2002-06-14 16:59:38 +0000 |
---|---|---|
committer | arr <arr@FreeBSD.org> | 2002-06-14 16:59:38 +0000 |
commit | ddf3317becaf1f927336e43f96f900868c8d0a80 (patch) | |
tree | f5a02eaff404955298bf324f2af9ffc25b5473bc /sys/dev/hfa | |
parent | 1fa61e7038c01fdffbb282d50c1dd03ea22c4622 (diff) | |
download | FreeBSD-src-ddf3317becaf1f927336e43f96f900868c8d0a80.zip FreeBSD-src-ddf3317becaf1f927336e43f96f900868c8d0a80.tar.gz |
- Turn the hea and hfa HARP storage pools into UMA zones and insert
the necesary uma_zcreate() and uma_zdestroy calls into module loading
handler and the device attach handling.
- Change the related HARP netatm code to use UMA zone functions when
dealing with the zones that were formerly the ATM interface (hea, hfa)
storage pools.
- Have atm_physif_freenifs() now get passed an uma_zone_t so that we can
properly free the allocated NIF's back to their zone.
This should be the last commit to remove any code that makes use of the
netatm storage pool api. I will be removing the api code within the near
future.
Reviewed by: mdodd
Diffstat (limited to 'sys/dev/hfa')
-rw-r--r-- | sys/dev/hfa/fore_globals.c | 18 | ||||
-rw-r--r-- | sys/dev/hfa/fore_include.h | 4 | ||||
-rw-r--r-- | sys/dev/hfa/fore_load.c | 4 | ||||
-rw-r--r-- | sys/dev/hfa/fore_var.h | 4 | ||||
-rw-r--r-- | sys/dev/hfa/hfa_freebsd.c | 20 |
5 files changed, 28 insertions, 22 deletions
diff --git a/sys/dev/hfa/fore_globals.c b/sys/dev/hfa/fore_globals.c index 316381e..78e57e6 100644 --- a/sys/dev/hfa/fore_globals.c +++ b/sys/dev/hfa/fore_globals.c @@ -57,6 +57,8 @@ #include <dev/hfa/fore_stats.h> #include <dev/hfa/fore_var.h> +#include <vm/uma.h> + #ifndef lint __RCSID("@(#) $FreeBSD$"); #endif @@ -104,20 +106,8 @@ struct stack_defn *fore_services = &fore_svaal0; /* * Storage pools */ -struct sp_info fore_nif_pool = { - "fore nif pool", /* si_name */ - sizeof(struct atm_nif), /* si_blksiz */ - 5, /* si_blkcnt */ - 52 /* si_maxallow */ -}; - -struct sp_info fore_vcc_pool = { - "fore vcc pool", /* si_name */ - sizeof(Fore_vcc), /* si_blksiz */ - 10, /* si_blkcnt */ - 100 /* si_maxallow */ -}; - +uma_zone_t fore_nif_zone; +uma_zone_t fore_vcc_zone; /* * Watchdog timer diff --git a/sys/dev/hfa/fore_include.h b/sys/dev/hfa/fore_include.h index 0c102f1..c23e0cb 100644 --- a/sys/dev/hfa/fore_include.h +++ b/sys/dev/hfa/fore_include.h @@ -101,8 +101,8 @@ extern Fore_device fore_devices[]; extern Fore_unit *fore_units[]; extern int fore_nunits; extern struct stack_defn *fore_services; -extern struct sp_info fore_nif_pool; -extern struct sp_info fore_vcc_pool; +extern uma_zone_t fore_nif_zone; +extern uma_zone_t fore_vcc_zone; extern struct atm_time fore_timer; #endif /* _FORE_INCLUDE_H */ diff --git a/sys/dev/hfa/fore_load.c b/sys/dev/hfa/fore_load.c index f937387..a50ec04 100644 --- a/sys/dev/hfa/fore_load.c +++ b/sys/dev/hfa/fore_load.c @@ -225,8 +225,8 @@ fore_pci_attach(config_id, unit) fup->fu_unit = unit; fup->fu_mtu = FORE_IFF_MTU; fup->fu_pcitag = config_id; - fup->fu_vcc_pool = &fore_vcc_pool; - fup->fu_nif_pool = &fore_nif_pool; + fup->fu_vcc_zone = fore_vcc_zone; + fup->fu_nif_zone = &fore_nif_zone; fup->fu_ioctl = fore_atm_ioctl; fup->fu_instvcc = fore_instvcc; fup->fu_openvcc = fore_openvcc; diff --git a/sys/dev/hfa/fore_var.h b/sys/dev/hfa/fore_var.h index 4c0d6c2..20856e8 100644 --- a/sys/dev/hfa/fore_var.h +++ b/sys/dev/hfa/fore_var.h @@ -237,8 +237,8 @@ typedef struct fore_unit Fore_unit; #define fu_vcc fu_cmn.cu_vcc #define fu_intrpri fu_cmn.cu_intrpri #define fu_savepri fu_cmn.cu_savepri -#define fu_vcc_pool fu_cmn.cu_vcc_pool -#define fu_nif_pool fu_cmn.cu_nif_pool +#define fu_vcc_zone fu_cmn.cu_vcc_zone +#define fu_nif_zone fu_cmn.cu_nif_zone #define fu_ioctl fu_cmn.cu_ioctl #define fu_instvcc fu_cmn.cu_instvcc #define fu_openvcc fu_cmn.cu_openvcc diff --git a/sys/dev/hfa/hfa_freebsd.c b/sys/dev/hfa/hfa_freebsd.c index 377dbbb..6609072 100644 --- a/sys/dev/hfa/hfa_freebsd.c +++ b/sys/dev/hfa/hfa_freebsd.c @@ -169,8 +169,8 @@ hfa_attach (device_t dev) */ fup->fu_unit = device_get_unit(dev); fup->fu_mtu = FORE_IFF_MTU; - fup->fu_vcc_pool = &fore_vcc_pool; - fup->fu_nif_pool = &fore_nif_pool; + fup->fu_vcc_zone = fore_vcc_zone; + fup->fu_nif_zone = fore_nif_zone; fup->fu_ioctl = fore_atm_ioctl; fup->fu_instvcc = fore_instvcc; fup->fu_openvcc = fore_openvcc; @@ -377,6 +377,19 @@ hfa_modevent (module_t mod, int what, void *arg) error = EINVAL; break; } + + fore_nif_zone = uma_zcreate("fore nif", sizeof(struct atm_nif), NULL, + NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + if (fore_nif_zone == NULL) + panic("hfa_modevent:uma_zcreate nif"); + uma_zone_set_max(fore_nif_zone, 52); + + fore_vcc_zone = uma_zcreate("fore vcc", sizeof(Fore_vcc), NULL, + NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + if (fore_vcc_zone == NULL) + panic("hfa_modevent: uma_zcreate vcc"); + uma_zone_set_max(fore_vcc_zone, 100); + /* * Initialize DMA mapping */ @@ -399,6 +412,9 @@ hfa_modevent (module_t mod, int what, void *arg) */ atm_untimeout(&fore_timer); + uma_zdestroy(fore_nif_zone); + uma_zdestroy(fore_vcc_zone); + break; default: break; |