lkml.org 
[lkml]   [2017]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [[PATCH v1] 11/37] [CIFS] SMBD: Post a receive request
> +	switch(response->type) {
> + case SMBD_TRANSFER_DATA:
> + data_transfer = (struct smbd_data_transfer *) response->packet;

Maybe add a little helper for the packet data to hide these cast, e.g.

static inline void *smbd_payload(struct cifs_rdma_response *resp)
{
return (void *)response->packet;
}


> + atomic_dec(&info->receive_credits);
> + atomic_set(&info->receive_credit_target,
> + le16_to_cpu(data_transfer->credits_requested));
> + atomic_add(le16_to_cpu(data_transfer->credits_granted),
> + &info->send_credits);

That's a lot of atomic ops in the fast path handler. Also remember
that atomic_set isn't really atomic vs other callers.

\
 
 \ /
  Last update: 2017-08-13 12:19    [W:0.575 / U:1.664 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site