nine/pipe: optimize convert_dsa_state a bit