struct ibv_wc wc;
int ret;
uint16_t credits_requested;
- uint32_t credits_granted;
+ uint16_t credits_granted;
+ uint32_t send_credits;
uint16_t flags;
uint32_t data_offset;
struct smb_direct_io *io = NULL;
c->state.receive_credits -= 1;
c->state.receive_credit_target = credits_requested;
- credits_granted += c->state.send_credits;
- if (credits_granted > c->state.send_credit_target) {
+ send_credits = c->state.send_credits + credits_granted;
+ if (send_credits > c->state.send_credit_target) {
+smb_direct_connection_debug_credits(c, "wrong RECV",io, __location__, __func__);
status = NT_STATUS_INVALID_NETWORK_RESPONSE;
- DEBUG(0,("%s:%s: ret[%d] errno[%d] status[%s]\n",
- __location__, __FUNCTION__, ret, errno, nt_errstr(status)));
+ DEBUG(0,("%s:%s: credits_granted[%u] send_credits[%u] ret[%d] errno[%d] status[%s]\n",
+ __location__, __FUNCTION__,
+ (unsigned)credits_granted, (unsigned)send_credits,
+ ret, errno, nt_errstr(status)));
smb_direct_connection_disconnect(c, status);
return;
}
- c->state.send_credits = credits_granted;
+ c->state.send_credits = send_credits;
smb_direct_connection_debug_credits(c, "GOT_RECV", io, __location__, __FUNCTION__);