dev_err(dev, "Rebuild failed, unload and reload driver\n");
}
+/**
+ * ice_max_xdp_frame_size - returns the maximum allowed frame size for XDP
+ * @vsi: Pointer to VSI structure
+ */
+static int ice_max_xdp_frame_size(struct ice_vsi *vsi)
+{
+ if (PAGE_SIZE >= 8192 || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags))
+ return ICE_RXBUF_2048 - XDP_PACKET_HEADROOM;
+ else
+ return ICE_RXBUF_3072;
+}
+
/**
* ice_change_mtu - NDO callback to change the MTU
* @netdev: network interface device structure
}
if (ice_is_xdp_ena_vsi(vsi)) {
- int frame_size = ICE_RXBUF_2048 - XDP_PACKET_HEADROOM;
+ int frame_size = ice_max_xdp_frame_size(vsi);
if (new_mtu + ICE_ETH_PKT_HDR_PAD > frame_size) {
netdev_err(netdev, "max MTU for XDP usage is %d\n",
- frame_size);
+ frame_size - ICE_ETH_PKT_HDR_PAD);
return -EINVAL;
}
}