diff options
author | Eric Cheng <none@none> | 2008-12-04 18:16:10 -0800 |
---|---|---|
committer | Eric Cheng <none@none> | 2008-12-04 18:16:10 -0800 |
commit | da14cebe459d3275048785f25bd869cb09b5307f (patch) | |
tree | a394d2c61ec4d7591782a4a5db4e3a157c3ca89a /usr/src/uts/common/sys/softmac_impl.h | |
parent | 03361682bf38acf5bcc36ee83a0d6277731eee68 (diff) | |
download | illumos-gate-da14cebe459d3275048785f25bd869cb09b5307f.tar.gz |
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
6498311 Crossbow - Network Virtualization and Resource Management
6402493 DLPI provider loopback behavior should be improved
6453165 move mac capabs definitions outside mac.h
6338667 Need ability to use NAT for non-global zones
6692884 several threads hung due to deadlock scenario between aggr and mac
6768302 dls: soft_ring_bind/unbind race can panic in thread_affinity_set with cpu_id == -1
6635849 race between lacp_xmit_sm() and aggr_m_stop() ends in panic
6742712 potential message double free in the aggr driver
6754299 a potential race between aggr_m_tx() and aggr_port_delete()
6485324 mi_data_lock recursively held when enabling promiscuous mode on an aggregation
6442559 Forwarding perf bottleneck due to mac_rx() calls
6505462 assertion failure after removing a port from a snooped aggregation
6716664 need to add src/dst IP address to soft ring fanout
--HG--
rename : usr/src/uts/common/io/dls/dls_soft_ring.c => usr/src/uts/common/io/mac/mac_soft_ring.c
rename : usr/src/uts/common/inet/ip/ip_cksum.c => usr/src/uts/common/os/ip_cksum.c
rename : usr/src/uts/common/inet/sctp_crc32.c => usr/src/uts/common/os/sctp_crc32.c
rename : usr/src/uts/common/sys/dls_soft_ring.h => usr/src/uts/common/sys/mac_soft_ring.h
Diffstat (limited to 'usr/src/uts/common/sys/softmac_impl.h')
-rw-r--r-- | usr/src/uts/common/sys/softmac_impl.h | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/usr/src/uts/common/sys/softmac_impl.h b/usr/src/uts/common/sys/softmac_impl.h index 3fcfc97415..5f9d1401a7 100644 --- a/usr/src/uts/common/sys/softmac_impl.h +++ b/usr/src/uts/common/sys/softmac_impl.h @@ -26,8 +26,6 @@ #ifndef _SYS_SOFTMAC_IMPL_H #define _SYS_SOFTMAC_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/ethernet.h> #include <sys/taskq.h> @@ -37,6 +35,9 @@ #include <sys/stream.h> #include <sys/dlpi.h> #include <sys/mac.h> +#include <sys/mac_provider.h> +#include <sys/mac_client.h> +#include <sys/mac_client_priv.h> #include <sys/mac_ether.h> #ifdef __cplusplus @@ -68,14 +69,20 @@ typedef struct softmac_lower_s { boolean_t sl_pending_ioctl; mblk_t *sl_ack_mp; - mac_resource_handle_t sl_handle; ldi_handle_t sl_lh; } softmac_lower_t; -enum softmac_state { +typedef enum { SOFTMAC_INITIALIZED, SOFTMAC_READY -}; +} softmac_lower_state_t; + +typedef enum { + SOFTMAC_UNINIT, + SOFTMAC_ATTACH_INPROG, + SOFTMAC_ATTACH_DONE, + SOFTMAC_DETACH_INPROG, +} softmac_state_t; typedef struct softmac_dev_s { dev_t sd_dev; @@ -86,8 +93,12 @@ typedef struct softmac_dev_s { */ #define SOFTMAC_GLDV3 0x01 #define SOFTMAC_NOSUPP 0x02 -#define SOFTMAC_ATTACH_DONE 0x04 -#define SOFTMAC_NEED_RECREATE 0x08 +#define SOFTMAC_NEED_RECREATE 0x04 +#define SOFTMAC_NOTIFY_QUIT 0x08 + +#define SMAC_NONZERO_NODECNT(softmac) \ + ((softmac->smac_softmac[0] != NULL) + \ + (softmac->smac_softmac[1] != NULL)) /* * The softmac structure allows all minor nodes (at most two, style-1 and @@ -111,18 +122,14 @@ typedef struct softmac { uint32_t smac_cnt; /* # of minor nodes for this device */ /* - * The following fields are protected by softmac_hash_lock. - */ - /* + * The following fields are protected by smac_mutex. + * * The smac_hold_cnt field increases when softmac_hold_device() is * called to force the dls_vlan_t of the device to be created. The * device pre-detach fails if this counter is not 0. */ + softmac_state_t smac_state; uint32_t smac_hold_cnt; - - /* - * The following fields are protected by smac_lock. - */ kmutex_t smac_mutex; kcondvar_t smac_cv; uint32_t smac_flags; @@ -145,6 +152,16 @@ typedef struct softmac { uint32_t smac_attached_left; /* + * Thread handles the DL_NOTIFY_IND message from the lower stream. + */ + kthread_t *smac_notify_thread; + /* + * Head and tail of the DL_NOTIFY_IND messsages. + */ + mblk_t *smac_notify_head; + mblk_t *smac_notify_tail; + + /* * The remaining fields are used to register the MAC for a legacy * device. They are set in softmac_mac_register() and do not change. * One can access them when mac_register() is done without locks. @@ -177,11 +194,8 @@ typedef struct softmac { dl_capab_mdt_t smac_mdt_capab; boolean_t smac_mdt; - /* - * The following fields are protected by smac_lock - */ - krwlock_t smac_lock; - enum softmac_state smac_state; + /* Following fields protected by the mac perimeter */ + softmac_lower_state_t smac_lower_state; /* Lower stream structure */ softmac_lower_t *smac_lower; } softmac_t; @@ -193,9 +207,6 @@ typedef struct smac_ioc_start_s { #define SMAC_IOC ('S' << 24 | 'M' << 16 | 'C' << 8) #define SMAC_IOC_START (SMAC_IOC | 0x01) -#define SOFTMAC_BLANK_TICKS 128 -#define SOFTMAC_BLANK_PKT_COUNT 8 - extern dev_info_t *softmac_dip; #define SOFTMAC_DEV_NAME "softmac" @@ -217,9 +228,9 @@ extern int softmac_m_unicst(void *, const uint8_t *); extern void softmac_m_ioctl(void *, queue_t *, mblk_t *); extern int softmac_m_stat(void *, uint_t, uint64_t *); extern mblk_t *softmac_m_tx(void *, mblk_t *); -extern void softmac_m_resources(void *); extern int softmac_proto_tx(softmac_lower_t *, mblk_t *, mblk_t **); extern void softmac_ioctl_tx(softmac_lower_t *, mblk_t *, mblk_t **); +extern void softmac_notify_thread(void *); #ifdef __cplusplus } |