  We show that the exact partition function of U(N) six-dimensional gauge
theory with eight supercharges on C^2 x S^2 provides the quantization of the
integrable system of hydrodynamic type known as gl(N) periodic Intermediate
Long Wave (ILW). We characterize this system as the hydrodynamic limit of
elliptic Calogero-Moser integrable system. We compute the Bethe equations from
the effective gauged linear sigma model on S^2 with target space the ADHM
instanton moduli space, whose mirror computes the Yang-Yang function of gl(N)
ILW. The quantum Hamiltonians are given by the local chiral ring observables of
the six-dimensional gauge theory. As particular cases, these provide the gl(N)
Benjamin-Ono and Korteweg-de Vries quantum Hamiltonians. In the four
dimensional limit, we identify the local chiral ring observables with the
conserved charges of Heisenberg plus W_N algebrae, thus providing a gauge
theoretical proof of AGT correspondence.
