Hi,
It can be done by creating a conf file under /etc/modprobe.d/ and specifying the ring buffer value that you'd like to use. for example :
/etc/modprobe.d/ib_ipoib.conf :
options ib_ipoib send_queue_size=2048 recv_queue_size=2048
You can change it up to 8k (8192)
or with modprobe :
modprobe ib_ipoib send_queue_size=2048
modprobe ib_ipoib recv_queue_size=2048
You will have to restart the driver afterwards. Regardless, I would focus on bad links as you mention as in most cases these are the actual root cause when trying to pinpoint a congestion point.