IB/mthca: Factor out setting WQE remote address and atomic segment entries