xdp_umem.c (9116e5e2b1fff71dce501d971e86a3695acc3dba) xdp_umem.c (77cd0d7b3f257fd0e3096b4fdcff1a7d38e99e10)
1// SPDX-License-Identifier: GPL-2.0
2/* XDP user-space packet buffer
3 * Copyright(c) 2018 Intel Corporation.
4 */
5
6#include <linux/init.h>
7#include <linux/sched/mm.h>
8#include <linux/sched/signal.h>

--- 92 unchanged lines hidden (view full) ---

101
102 err = xdp_reg_umem_at_qid(dev, umem, queue_id);
103 if (err)
104 return err;
105
106 umem->dev = dev;
107 umem->queue_id = queue_id;
108
1// SPDX-License-Identifier: GPL-2.0
2/* XDP user-space packet buffer
3 * Copyright(c) 2018 Intel Corporation.
4 */
5
6#include <linux/init.h>
7#include <linux/sched/mm.h>
8#include <linux/sched/signal.h>

--- 92 unchanged lines hidden (view full) ---

101
102 err = xdp_reg_umem_at_qid(dev, umem, queue_id);
103 if (err)
104 return err;
105
106 umem->dev = dev;
107 umem->queue_id = queue_id;
108
109 if (flags & XDP_USE_NEED_WAKEUP) {
110 umem->flags |= XDP_UMEM_USES_NEED_WAKEUP;
111 /* Tx needs to be explicitly woken up the first time.
112 * Also for supporting drivers that do not implement this
113 * feature. They will always have to call sendto().
114 */
115 xsk_set_tx_need_wakeup(umem);
116 }
117
109 dev_hold(dev);
110
111 if (force_copy)
112 /* For copy-mode, we are done. */
113 return 0;
114
115 if (!dev->netdev_ops->ndo_bpf || !dev->netdev_ops->ndo_xsk_wakeup) {
116 err = -EOPNOTSUPP;

--- 303 unchanged lines hidden ---
118 dev_hold(dev);
119
120 if (force_copy)
121 /* For copy-mode, we are done. */
122 return 0;
123
124 if (!dev->netdev_ops->ndo_bpf || !dev->netdev_ops->ndo_xsk_wakeup) {
125 err = -EOPNOTSUPP;

--- 303 unchanged lines hidden ---