Optimizing remote procedure calls in datacenters using hardware/software co-design