Let be given an integer $n\ge 2$ and a positive real number $p$. Find the maximum of
\[\displaystyle\sum_{i=1}^{n-1} x_ix_{i+1},\]
where $x_i$ are non-negative real numbers with sum $p$.
To find the maximum of the sum \(\sum_{i=1}^{n-1} x_i x_{i+1}\) where \(x_i\) are non-negative real numbers with sum \(p\), we will consider different cases for \(n\).

1. **Case \(n = 2\):**
   \[
   \sum_{i=1}^{n-1} x_i x_{i+1} = x_1 x_2
   \]
   Given \(x_1 + x_2 = p\), we need to maximize \(x_1 x_2\). By the AM-GM inequality:
   \[
   x_1 x_2 \leq \left(\frac{x_1 + x_2}{2}\right)^2 = \left(\frac{p}{2}\right)^2 = \frac{p^2}{4}
   \]
   The maximum is achieved when \(x_1 = x_2 = \frac{p}{2}\).

2. **Case \(n = 3\):**
   \[
   \sum_{i=1}^{n-1} x_i x_{i+1} = x_1 x_2 + x_2 x_3
   \]
   Given \(x_1 + x_2 + x_3 = p\), we need to maximize \(x_1 x_2 + x_2 x_3\). Let \(a = x_1\), \(b = x_2\), and \(c = x_3\). Then:
   \[
   a + b + c = p
   \]
   We need to maximize \(ab + bc\). Notice that:
   \[
   ab + bc = b(a + c) = b(p - b)
   \]
   This is a quadratic function in \(b\), and it is maximized when \(b = \frac{p}{2}\). Substituting \(b = \frac{p}{2}\):
   \[
   ab + bc = \frac{p}{2} \left(p - \frac{p}{2}\right) = \frac{p}{2} \cdot \frac{p}{2} = \frac{p^2}{4}
   \]
   The maximum is achieved when \(b = \frac{p}{2}\) and \(a + c = \frac{p}{2}\).

3. **Case \(n \geq 4\):**
   For \(n \geq 4\), we can use the result from the thread mentioned in the problem. We can add the term \(x_n x_1\) and still get the maximum being \(\frac{p^2}{4}\). This is because the sum \(\sum_{i=1}^{n} x_i x_{i+1}\) (with \(x_n x_1\) included) can be maximized by setting all \(x_i\) equal, i.e., \(x_i = \frac{p}{n}\). However, since \(n \geq 4\), the maximum value of the sum \(\sum_{i=1}^{n-1} x_i x_{i+1}\) without the term \(x_n x_1\) is still \(\frac{p^2}{4}\).

Conclusion:
For \(n = 2\) and \(n = 3\), the maximum value of \(\sum_{i=1}^{n-1} x_i x_{i+1}\) is \(\frac{p^2}{4}\). For \(n \geq 4\), the maximum value remains \(\frac{p^2}{4}\).

The final answer is \(\boxed{\frac{p^2}{4}}\).