You don't have to use local statistic for this, there already is one in the dev struct i.e dev->data->rx_mbuf_alloc_failed. The problem is you need the DPDK port number to find what dev is.
I think the diff id that dev->data->rx_mbuf_alloc_failed would reflect the pure HW(NIC) failed allocations where as the local alloc_failed would reflect the failed allocations on the xdp side. Both should be accounted for.