Skip to content

Commit

Permalink
Add check to avoid changing the MTU while ZC interface is in use (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Nov 6, 2023
1 parent a288806 commit 3c5601c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/intel/i40e/i40e-2.17.4-zc/src/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,14 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)
int max_frame = new_mtu + I40E_PACKET_HDR_PAD;
struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back;
#ifdef HAVE_PF_RING
struct i40e_pf *adapter = i40e_netdev_to_pf(netdev);

if (atomic_read(&adapter->pfring_zc.usage_counter) > 0) {
printk("[PF_RING-ZC] %s: trying to change the MTU on %s while in use\n", __FUNCTION__, netdev->name);
return -EBUSY;
}
#endif

/* MTU < 68 is an error and causes problems on some kernels */
if ((new_mtu < 68) || (max_frame > I40E_MAX_RXBUFFER))
Expand Down

0 comments on commit 3c5601c

Please sign in to comment.