QM_CHANNEL_SWPORTAL0
#define PORTAL_IDX(n) (n->config->channel - QM_CHANNEL_SWPORTAL0)
int idx = channel - QM_CHANNEL_SWPORTAL0;