| .. | .. |
|---|
| 6729 | 6729 | } |
|---|
| 6730 | 6730 | |
|---|
| 6731 | 6731 | /** |
|---|
| 6732 | + * ixgbe_max_xdp_frame_size - returns the maximum allowed frame size for XDP |
|---|
| 6733 | + * @adapter: device handle, pointer to adapter |
|---|
| 6734 | + */ |
|---|
| 6735 | +static int ixgbe_max_xdp_frame_size(struct ixgbe_adapter *adapter) |
|---|
| 6736 | +{ |
|---|
| 6737 | + if (PAGE_SIZE >= 8192 || adapter->flags2 & IXGBE_FLAG2_RX_LEGACY) |
|---|
| 6738 | + return IXGBE_RXBUFFER_2K; |
|---|
| 6739 | + else |
|---|
| 6740 | + return IXGBE_RXBUFFER_3K; |
|---|
| 6741 | +} |
|---|
| 6742 | + |
|---|
| 6743 | +/** |
|---|
| 6732 | 6744 | * ixgbe_change_mtu - Change the Maximum Transfer Unit |
|---|
| 6733 | 6745 | * @netdev: network interface device structure |
|---|
| 6734 | 6746 | * @new_mtu: new value for maximum frame size |
|---|
| .. | .. |
|---|
| 6739 | 6751 | { |
|---|
| 6740 | 6752 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
|---|
| 6741 | 6753 | |
|---|
| 6742 | | - if (adapter->xdp_prog) { |
|---|
| 6743 | | - int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + |
|---|
| 6744 | | - VLAN_HLEN; |
|---|
| 6745 | | - int i; |
|---|
| 6754 | + if (ixgbe_enabled_xdp_adapter(adapter)) { |
|---|
| 6755 | + int new_frame_size = new_mtu + IXGBE_PKT_HDR_PAD; |
|---|
| 6746 | 6756 | |
|---|
| 6747 | | - for (i = 0; i < adapter->num_rx_queues; i++) { |
|---|
| 6748 | | - struct ixgbe_ring *ring = adapter->rx_ring[i]; |
|---|
| 6749 | | - |
|---|
| 6750 | | - if (new_frame_size > ixgbe_rx_bufsz(ring)) { |
|---|
| 6751 | | - e_warn(probe, "Requested MTU size is not supported with XDP\n"); |
|---|
| 6752 | | - return -EINVAL; |
|---|
| 6753 | | - } |
|---|
| 6757 | + if (new_frame_size > ixgbe_max_xdp_frame_size(adapter)) { |
|---|
| 6758 | + e_warn(probe, "Requested MTU size is not supported with XDP\n"); |
|---|
| 6759 | + return -EINVAL; |
|---|
| 6754 | 6760 | } |
|---|
| 6755 | 6761 | } |
|---|
| 6756 | 6762 | |
|---|
| .. | .. |
|---|
| 8403 | 8409 | struct ixgbe_adapter *adapter = q_vector->adapter; |
|---|
| 8404 | 8410 | |
|---|
| 8405 | 8411 | if (unlikely(skb_tail_pointer(skb) < hdr.network + |
|---|
| 8406 | | - VXLAN_HEADROOM)) |
|---|
| 8412 | + vxlan_headroom(0))) |
|---|
| 8407 | 8413 | return; |
|---|
| 8408 | 8414 | |
|---|
| 8409 | 8415 | /* verify the port is recognized as VXLAN */ |
|---|