[ovs-dev] [PATCH] test-atomic: Drop atomic read-modify-write tests for the moment.

Ethan Jackson ethan at nicira.com
Sat Jun 29 07:37:18 UTC 2013


Looks fine to me as well.  Disappointing that checking the gcc version
isn't sufficient.  Why aren't they in XenServer?  They're running some
weird non-standard gcc?

At any rate, I'd like to get to the proposed long term solution
soonish.  I'm pretty sure we'll at least need atomic add and subtract.
 And as OVS get's ported to weirder and weirder platforms, having this
sort of test is useful.

Acked-by: Ethan Jackson <ethan at nicira.com>


On Fri, Jun 28, 2013 at 10:21 PM, Justin Pettit <jpettit at nicira.com> wrote:
> I don't fully get what's going on here, but the removal looks correct.  Assuming it allows builds to complete, it's better than what was there.  :-)
>
> --Justin
>
>
> On Jun 28, 2013, at 8:56 PM, Ben Pfaff <blp at nicira.com> wrote:
>
>> XenServer builds are failing because of link errors reporting that
>> __sync_fetch_and_<op>_<size> were not found, for <op> in add/sub/and/xor/or
>> and <size> in 1/2/4/8.  We're not actually using these RMW operations yet,
>> so as a stopgap measure just drop the tests.
>>
>> The correct long-term fix is probably to do Autoconf linkage tests for
>> these operations instead of just testing the GCC version (if we really need
>> the operations at all).
>>
>> Signed-off-by: Ben Pfaff <blp at nicira.com>
>> ---
>> tests/test-atomic.c |   27 +--------------------------
>> 1 file changed, 1 insertion(+), 26 deletions(-)
>>
>> diff --git a/tests/test-atomic.c b/tests/test-atomic.c
>> index 27bf552..21d8c9e 100644
>> --- a/tests/test-atomic.c
>> +++ b/tests/test-atomic.c
>> @@ -22,7 +22,7 @@
>> #define TEST_ATOMIC_TYPE(ATOMIC_TYPE, BASE_TYPE)        \
>>     {                                                   \
>>         ATOMIC_TYPE x = ATOMIC_VAR_INIT(1);             \
>> -        BASE_TYPE value, orig;                          \
>> +        BASE_TYPE value;                                \
>>                                                         \
>>         atomic_read(&x, &value);                        \
>>         ovs_assert(value == 1);                         \
>> @@ -34,31 +34,6 @@
>>         atomic_init(&x, 3);                             \
>>         atomic_read(&x, &value);                        \
>>         ovs_assert(value == 3);                         \
>> -                                                        \
>> -        atomic_add(&x, 1, &orig);                       \
>> -        ovs_assert(orig == 3);                          \
>> -        atomic_read(&x, &value);                        \
>> -        ovs_assert(value == 4);                         \
>> -                                                        \
>> -        atomic_sub(&x, 2, &orig);                       \
>> -        ovs_assert(orig == 4);                          \
>> -        atomic_read(&x, &value);                        \
>> -        ovs_assert(value == 2);                         \
>> -                                                        \
>> -        atomic_or(&x, 6, &orig);                        \
>> -        ovs_assert(orig == 2);                          \
>> -        atomic_read(&x, &value);                        \
>> -        ovs_assert(value == 6);                         \
>> -                                                        \
>> -        atomic_and(&x, 10, &orig);                      \
>> -        ovs_assert(orig == 6);                          \
>> -        atomic_read(&x, &value);                        \
>> -        ovs_assert(value == 2);                         \
>> -                                                        \
>> -        atomic_xor(&x, 10, &orig);                      \
>> -        ovs_assert(orig == 2);                          \
>> -        atomic_read(&x, &value);                        \
>> -        ovs_assert(value == 8);                         \
>>     }
>>
>> int
>> --
>> 1.7.10.4
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
X-CudaMail-Whitelist-To: dev at openvswitch.org



More information about the dev mailing list