Lines Matching refs:flent
45 #define FLOW_REFHOLD(flent) { \
46 DTRACE_PROBE1(flow_refhold, flow_entry_t *, (flent)); \
47 mutex_enter(&(flent)->fe_lock); \
48 (flent)->fe_refcnt++; \
49 mutex_exit(&(flent)->fe_lock); \
59 #define FLOW_TRY_REFHOLD(flent, err) { \
60 DTRACE_PROBE1(flow_refhold, flow_entry_t *, (flent)); \
62 mutex_enter(&(flent)->fe_lock); \
63 if ((flent)->fe_flags & (FE_INCIPIENT | FE_QUIESCE | FE_CONDEMNED | \
67 (flent)->fe_refcnt++; \
68 mutex_exit(&(flent)->fe_lock); \
71 #define FLOW_REFRELE(flent) { \
72 DTRACE_PROBE1(flow_refrele, flow_entry_t *, (flent)); \
73 mutex_enter(&(flent)->fe_lock); \
74 ASSERT((flent)->fe_refcnt != 0); \
75 (flent)->fe_refcnt--; \
76 if ((flent)->fe_flags & FE_WAITER) { \
77 ASSERT((flent)->fe_refcnt != 0); \
78 cv_signal(&(flent)->fe_cv); \
79 mutex_exit(&(flent)->fe_lock); \
80 } else if ((flent)->fe_refcnt == 0) { \
81 mac_flow_destroy(flent); \
83 mutex_exit(&(flent)->fe_lock); \
87 #define FLOW_USER_REFHOLD(flent) { \
88 mutex_enter(&(flent)->fe_lock); \
89 (flent)->fe_user_refcnt++; \
90 mutex_exit(&(flent)->fe_lock); \
93 #define FLOW_USER_REFRELE(flent) { \
94 mutex_enter(&(flent)->fe_lock); \
95 ASSERT((flent)->fe_user_refcnt != 0); \
96 if (--(flent)->fe_user_refcnt == 0 && \
97 ((flent)->fe_flags & FE_WAITER)) \
98 cv_signal(&(flent)->fe_cv); \
99 mutex_exit(&(flent)->fe_lock); \
102 #define FLOW_FINAL_REFRELE(flent) { \
103 ASSERT(flent->fe_refcnt == 1 && flent->fe_user_refcnt == 0); \
104 FLOW_REFRELE(flent); \
108 * Mark or unmark the flent with a bit flag
110 #define FLOW_MARK(flent, flag) { \
111 mutex_enter(&(flent)->fe_lock); \
112 (flent)->fe_flags |= flag; \
113 mutex_exit(&(flent)->fe_lock); \
116 #define FLOW_UNMARK(flent, flag) { \
117 mutex_enter(&(flent)->fe_lock); \
118 (flent)->fe_flags &= ~flag; \
119 mutex_exit(&(flent)->fe_lock); \
122 #define FLENT_TO_MIP(flent) \
123 (flent->fe_mbg != NULL ? mac_bcast_grp_mip(flent->fe_mbg) : \
124 ((mac_client_impl_t *)flent->fe_mcip)->mci_mip)
247 * flent typically by a mac_flow_lookup() dynamically holds a ref.
249 * or downcalls from the stack using this flent. Structures pointing
250 * to the flent or flent inserted in lists don't count towards this
252 * thread doing a teardown operation deletes the flent, after waiting
260 * generated flows. This refcnt only protects the flent itself
261 * from disappearing and helps walkers to read the flent info such
262 * as flow spec. However the flent may be quiesced and the SRS could