During probe, get the hardware-allowed max MTU by querying the device
configuration. Users can select MTU up to the device limit.
When XDP is in use, limit MTU settings so the buffer size is within
one page. And, when MTU is set to a too large value, XDP is not allowed
to run.
Also, to prevent changing MTU fails, and leaves the NIC in a bad state,
pre-allocate all buffers before starting the change. So in low memory
condition, it will return error, without affecting the NIC.
Signed-off-by: Haiyang Zhang <email address hidden>
Reviewed-by: Jesse Brandeburg <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 80f6215b450eb8e92d8b1f117abf5ecf867f963e)
Signed-off-by: Tim Gardner <email address hidden>
Acked-by: Philip Cox <email address hidden>
Acked-by: Roxana Nicolescu <email address hidden>
Signed-off-by: Tim Gardner <email address hidden>
Move out common buffer allocation code from mana_process_rx_cqe() and
mana_alloc_rx_wqe() to helper functions.
Refactor related variables so they can be changed in one place, and buffer
sizes are in sync.
Signed-off-by: Haiyang Zhang <email address hidden>
Reviewed-by: Jesse Brandeburg <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit a2917b23497e4205db32271e4e06e142a9f8a6aa)
Signed-off-by: Tim Gardner <email address hidden>
Acked-by: Philip Cox <email address hidden>
Acked-by: Roxana Nicolescu <email address hidden>
Signed-off-by: Tim Gardner <email address hidden>