There are a couple of things to notice here.
First, it is not clear if 'udiff' is of type Function or
Vector. The vector containing the Function 'udiffs's dofs can be obtained
by the udiff.vector().
Notice also that several packages have functions 'inner'.
I assume in the above code that you use the ufl function inner.
If so you need udiff to be a function and you would need to assemble.
Hence, something like:
d = inner(udiff, udiff)*dx
d = sqrt(d)
If udiff is of type Vector, you may use (for instance)
the numpy function inner:
d = inner(Mv_u.array(), udiff.array())