From the Super Mario Wiki
A Swirly Spinner is a yellow disk with red arrows on it, pointing either left or right. Swirly Spinners are always set partially inside walls. To activate a Swirly Spinner, Wario must perform a Wild Swing-Ding in the direction of the arrows – clockwise if they point to the right, counterclockwise if they point left. The Swirly Spinner will then open a nearby gate, allowing Wario to continue. However, the gate will slowly close over time, so Wario must hurry.