UDP does not have built-in flow control. Which means unless the server is not guaranteed to process datagrams faster than the client sends them, you will eventually have a full receive buffer and the network stack will discard incoming packets. This is irrespective of setting a larger buffer size (that only delays the problem, but doesn't fix it).
Therefore, if you know for certain that the rate at which packets are being sent, say 50 per second or so, is something your server can comfortably cope with (in the worst case, not in the best case!), you are good with a simple blocking recvfrom
.
Otherwise, unless losing large amounts of packets is a non-issue, you need to implement some way of flow control which is similar to what TCP is doing. For example: client is allowed to send max 20 packets, plus one packet for every answer packet received, as a very very easy algorithm.
Another (apparent) solution would be to offload the processing and sending of an answer to some worker threads, but like increasing buffer sizes, this only shifts the problem backwards a bit, it doesn't solve it. Also, the server design is much more complicated.
Still, if the client can send data at virtually infinite speed (say, 12-14 million packets per second on 10G), it will eventually outrun your processing capacity, if the worker threads cannot cope with that volume.