Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: fsl: dpio: add congestion notification support

Add support for Congestion State Change Notifications (CSCN), which
allow DPIO users to be notified when a congestion group changes its
state (due to hitting the entrance / exit threshold).

Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Horia Geantă and committed by
Herbert Xu
55d01102 009447a0

+15
+15
include/soc/fsl/dpaa2-global.h
··· 174 174 return (const struct dpaa2_fd *)&dq->dq.fd[0]; 175 175 } 176 176 177 + #define DPAA2_CSCN_SIZE sizeof(struct dpaa2_dq) 178 + #define DPAA2_CSCN_ALIGN 16 179 + #define DPAA2_CSCN_STATE_CG BIT(0) 180 + 181 + /** 182 + * dpaa2_cscn_state_congested() - Check congestion state 183 + * @cscn: congestion SCN (delivered to WQ or memory) 184 + * 185 + i * Return true is congested. 186 + */ 187 + static inline bool dpaa2_cscn_state_congested(struct dpaa2_dq *cscn) 188 + { 189 + return !!(cscn->scn.state & DPAA2_CSCN_STATE_CG); 190 + } 191 + 177 192 #endif /* __FSL_DPAA2_GLOBAL_H */