From: Vladimir Sokolovsky <vlad-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 0/2] Add support for enhanced atomic operations
Date: Tue, 02 Feb 2010 12:44:29 +0200 [thread overview]
Message-ID: <4B68020D.4080401@dev.mellanox.co.il> (raw)
In-Reply-To: <52BD554704A742B18E3F2F8F2B00B9FE-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
Sean Hefty wrote:
>> This patchset adds support for the following enhanced atomic operations:
>> - Masked atomic compare and swap
>> - Masked atomic fetch and add
>
> Can you explain these in more detail? How exactly is a mask used? Are there
> any restrictions on the format of the mask? How is the mask carried over the
> wire? etc.
>
> --
Masked Compare and Swap (MskCmpSwap)
The MskCmpSwap atomic operation is an extension to the CmpSwap operation defined in the IB
spec. MskCmpSwap allows the user to select a portion of the 64 bit target data for the “compare”
check as well as to restrict the swap to a (possibly different) portion. The pseudo code below
describes the operation:
-----
atomic_response = *va
if (((cmp XOR *va) AND cmp_mask) is ZERO) then
*va = (*va AND NOT(swap_mask)) OR (swap AND swap_mask)
return atomic_response
-----
The additional operands are carried in the Extended Transport Header. Atomic response generation
and packet format for MskCmpSwap is as for standard IB Atomic operations.
Masked Fetch and Add (MFetchAdd)
The MFetchAdd Atomic operation extends the functionality of the standard IB FetchAdd by
allowing the user to split the target into multiple fields of selectable length. The atomic add is done
independently on each one of this fields. A bit set in the field_boundary parameter specifies the
field boundaries. The pseudo code below describes the operation:
------------
bit_adder(ci, b1, b2, *co)
{
value = ci + b1 + b2;
if (value & 2)
*co = 1
else
*co = 0
return value & 1
}
mask = 1
carry = 0
atomic_response = *va
#define MASK_IS_SET(mask, attr) (((mask)&(attr))!=0)
for i = 0 to 63
{
if ( i != 0 )
mask = mask << 1;
bit_add_res = bit_adder(carry, MASK_IS_SET(atomic_response, mask), MASK_IS_SET(add_value, mask), &new_carry)
if (bit_add_res)
atomic_response |= mask
carry = ((new_carry) && (!MASK_IS_SET(cmp_mask, mask)))
}
return atomic_response
------------
The additional operands are carried in the Extended Transport Header. Atomic response generation
and packet format for MFetchAdd is as for standard IB Atomic operations.
Regards,
Vladimir
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-02-02 10:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 15:59 [PATCH 0/2] Add support for enhanced atomic operations Vladimir Sokolovsky
[not found] ` <4B66FA54.6030408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-02-01 22:11 ` Sean Hefty
[not found] ` <52BD554704A742B18E3F2F8F2B00B9FE-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-02-02 10:44 ` Vladimir Sokolovsky [this message]
[not found] ` <4B68020D.4080401-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-02-02 15:54 ` Hal Rosenstock
[not found] ` <f0e08f231002020754h482ba0f7xe35a78a72cc165e8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-02 16:13 ` Håkon Bugge
2010-02-03 0:02 ` Sean Hefty
[not found] ` <F1F846D4754246DC862643839C4CB216-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-02-03 8:01 ` Vladimir Sokolovsky
[not found] ` <4B692D67.5040006-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-02-11 14:08 ` Hal Rosenstock
[not found] ` <f0e08f231002110608y3a70c132r813d3472f82382d2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-14 13:24 ` Vladimir Sokolovsky
2010-02-03 7:08 ` Tziporet Koren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B68020D.4080401@dev.mellanox.co.il \
--to=vlad-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox