aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0e2a19e58923..8dfc75250583 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -47,8 +47,16 @@ module_param(gso, bool, 0444);
47 */ 47 */
48DECLARE_EWMA(pkt_len, 1, 64) 48DECLARE_EWMA(pkt_len, 1, 64)
49 49
50/* With mergeable buffers we align buffer address and use the low bits to
51 * encode its true size. Buffer size is up to 1 page so we need to align to
52 * square root of page size to ensure we reserve enough bits to encode the true
53 * size.
54 */
55#define MERGEABLE_BUFFER_MIN_ALIGN_SHIFT ((PAGE_SHIFT + 1) / 2)
56
50/* Minimum alignment for mergeable packet buffers. */ 57/* Minimum alignment for mergeable packet buffers. */
51#define MERGEABLE_BUFFER_ALIGN max(L1_CACHE_BYTES, 256) 58#define MERGEABLE_BUFFER_ALIGN max(L1_CACHE_BYTES, \
59 1 << MERGEABLE_BUFFER_MIN_ALIGN_SHIFT)
52 60
53#define VIRTNET_DRIVER_VERSION "1.0.0" 61#define VIRTNET_DRIVER_VERSION "1.0.0"
54 62
@@ -1415,6 +1423,7 @@ static const struct net_device_ops virtnet_netdev = {
1415#ifdef CONFIG_NET_RX_BUSY_POLL 1423#ifdef CONFIG_NET_RX_BUSY_POLL
1416 .ndo_busy_poll = virtnet_busy_poll, 1424 .ndo_busy_poll = virtnet_busy_poll,
1417#endif 1425#endif
1426 .ndo_features_check = passthru_features_check,
1418}; 1427};
1419 1428
1420static void virtnet_config_changed_work(struct work_struct *work) 1429static void virtnet_config_changed_work(struct work_struct *work)