ONEMASK is something like 0x01010101 (twice as long for 64-bit). We're trying to count UTF-8 continuation bytes, which all start with 10xxxxxx (leading bytes are either 0xxxxxxx or 11xxxxxx). So ((u & (ONEMASK * 0x80)) >> 7) is ((u & 0x80808080) >> 7), which is a mask with a 0x01 byte for every corresponding 1xxxxxxx byte, and 0x00 otherwise. Then the & (~u >> 6) masks out the x1xxxxxx bytes, leaving a 0x01 byte for only the 10xxxxxx bytes.
The multiplication by ONEMASK is a quick way to compute u + (u << 8) + (u << 16) + ... (since u * ONEMASK == u * 0x01 + u * 0x0100 + u * 0x010000 + ...). There's no hex carries that can occur (at most 8 1's added together), so grabbing the leftmost byte is equivalent to just adding each byte of u together, which counts the number of 0x01 bytes in u. For example:
u = 0x000063C3B474C3A9 (côté)
((u & 0x8080808080808080) >> 7) == 0x0000000101000101
~u >> 6 == 0x03FFFE70F12E2CF1
u = 0x0000000101000101 & 0x03FFFE70F12E2CF1 == 0x0000000001000001
u * 0x0101010101010101 ==
0x00|00000001000001
0x00|00000100000100
0x00|00010000010000
0x00|01000001000000
0x01|00000100000000
0x00|00010000000000
0x00|01000000000000
+ 0x01|00000000000000
--------------------
0x02|02020202010101
Notice how the value of the leftmost byte is just the sum of all the separate bytes in u. In this case, we find that there are 2 UTF-8 trailing bytes in u (the second bytes of ô and é).