include/ccKVS/inline_util.h
static inline void poll_credits(struct ibv_cq* credit_recv_cq, struct ibv_wc* credit_wc, uint8_t credits[][MACHINE_NUM], int protocol)
{
	int credits_found = 0;
	credits_found = ibv_poll_cq(credit_recv_cq, MAX_CREDIT_WRS, credit_wc);
	if(credits_found > 0) {
		if(unlikely(credit_wc[credits_found -1].status != 0)) {
			fprintf(stderr, "Bad wc status when polling for credits to send a broadcast %d\n", credit_wc[credits_found -1].status);
			exit(0);
		}
		increment_credits_based_on_protocol(credits_found, credit_wc, credits, protocol);
	}
	else if(unlikely(credits_found < 0)) {
		printf("ERROR In the credit CQ\n"); exit(0);
	}
}
// Poll for credits and increment the credits according to the protocol
Poll for credits and increment the credits according to the protocol
Poll for credits and increment the credits according to the protocol
static inline void poll_credits(struct ibv_cq* credit_recv_cq, struct ibv_wc* credit_wc, uint8_t credits[][MACHINE_NUM], int protocol)
{
	int credits_found = 0;
	credits_found = ibv_poll_cq(credit_recv_cq, MAX_CREDIT_WRS, credit_wc);
	if(credits_found > 0) {
		if(unlikely(credit_wc[credits_found -1].status != 0)) {
			fprintf(stderr, "Bad wc status when polling for credits to send a broadcast %d\n", credit_wc[credits_found -1].status);
			exit(0);
		}
		increment_credits_based_on_protocol(credits_found, credit_wc, credits, protocol);
	}
	else if(unlikely(credits_found < 0)) {
		printf("ERROR In the credit CQ\n"); exit(0);
	}
}
static inline void poll_credits ( struct ibv_cq * credit_recv_cq , struct ibv_wc * credit_wc , uint8_t credits [ ] [ MACHINE_NUM ] , int protocol ) { int credits_found = 0 ; credits_found = ibv_poll_cq ( credit_recv_cq , MAX_CREDIT_WRS , credit_wc ) ; if ( credits_found > 0 ) { if ( unlikely ( credit_wc [ credits_found - 1 ] . status != 0 ) ) { fprintf ( stderr , " \n " , credit_wc [ credits_found - 1 ] . status ) ; exit ( 0 ) ; } increment_credits_based_on_protocol ( credits_found , credit_wc , credits , protocol ) ; } else if ( unlikely ( credits_found < 0 ) ) { printf ( " \n " ) ; exit ( 0 ) ; } }
Poll for credits and increment the credits according to the protocol
Poll for credits and increment the credits according to the protocol