virtio_net.c (e814b958ad8857d6f7354d3a189776eb604d86dd) | virtio_net.c (8d9bc36de5fc7b64bbce7b479dbe0ffdcb31b3b5) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* A network driver using virtio. 3 * 4 * Copyright 2007 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation 5 */ 6//#define DEBUG 7#include <linux/netdevice.h> 8#include <linux/etherdevice.h> --- 3092 unchanged lines hidden (view full) --- 3101 return -EOPNOTSUPP; 3102 } 3103 3104 if (vi->mergeable_rx_bufs && !vi->any_header_sg) { 3105 NL_SET_ERR_MSG_MOD(extack, "XDP expects header/data in single page, any_header_sg required"); 3106 return -EINVAL; 3107 } 3108 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* A network driver using virtio. 3 * 4 * Copyright 2007 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation 5 */ 6//#define DEBUG 7#include <linux/netdevice.h> 8#include <linux/etherdevice.h> --- 3092 unchanged lines hidden (view full) --- 3101 return -EOPNOTSUPP; 3102 } 3103 3104 if (vi->mergeable_rx_bufs && !vi->any_header_sg) { 3105 NL_SET_ERR_MSG_MOD(extack, "XDP expects header/data in single page, any_header_sg required"); 3106 return -EINVAL; 3107 } 3108 |
3109 if (dev->mtu > max_sz) { 3110 NL_SET_ERR_MSG_MOD(extack, "MTU too large to enable XDP"); 3111 netdev_warn(dev, "XDP requires MTU less than %u\n", max_sz); | 3109 if (prog && !prog->aux->xdp_has_frags && dev->mtu > max_sz) { 3110 NL_SET_ERR_MSG_MOD(extack, "MTU too large to enable XDP without frags"); 3111 netdev_warn(dev, "single-buffer XDP requires MTU less than %u\n", max_sz); |
3112 return -EINVAL; 3113 } 3114 3115 curr_qp = vi->curr_queue_pairs - vi->xdp_queue_pairs; 3116 if (prog) 3117 xdp_qp = nr_cpu_ids; 3118 3119 /* XDP requires extra queues for XDP_TX */ --- 1009 unchanged lines hidden --- | 3112 return -EINVAL; 3113 } 3114 3115 curr_qp = vi->curr_queue_pairs - vi->xdp_queue_pairs; 3116 if (prog) 3117 xdp_qp = nr_cpu_ids; 3118 3119 /* XDP requires extra queues for XDP_TX */ --- 1009 unchanged lines hidden --- |