ring: add a function to return the ring size