tree:
https://github.com/dsahern/linux xdp/egress-v5-02
head: 59db5d887fd7d43e980f9e9da9c3b13593abfcdc
commit: 7f3d6a87fa798b9e26e9f6dfe13f4a0d5357bcb1 [5/9] net: Support xdp in the Tx path for
xdp_frames
config: um-allmodconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
git checkout 7f3d6a87fa798b9e26e9f6dfe13f4a0d5357bcb1
# save the attached .config to linux build tree
make ARCH=um
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
> net/core/dev.c:4679:17: warning: 'struct xdp_txq_info'
declared inside parameter list will not be visible outside of this definition or
declaration
struct xdp_txq_info *txq)
^~~~~~~~~~~~
net/core/dev.c: In function '__xdp_egress_frame':
> net/core/dev.c:4689:6: error: 'struct xdp_buff' has no
member named 'txq'; did you mean 'rxq'?
xdp.txq = txq;
^~~
rxq
net/core/dev.c: In function 'do_xdp_egress':
> net/core/dev.c:4728:10: error: variable 'txq' has
initializer but incomplete type
struct xdp_txq_info txq = { .dev = dev };
^~~~~~~~~~~~
> net/core/dev.c:4728:32: error: 'struct xdp_txq_info' has
no member named 'dev'
struct xdp_txq_info txq = { .dev = dev };
^~~
> net/core/dev.c:4728:38: warning: excess elements in struct
initializer
struct xdp_txq_info txq = { .dev = dev };
^~~
net/core/dev.c:4728:38: note: (near initialization for 'txq')
> net/core/dev.c:4728:23: error: storage size of 'txq'
isn't known
struct xdp_txq_info txq = { .dev = dev };
^~~
net/core/dev.c:4728:23: warning: unused variable 'txq' [-Wunused-variable]
vim +4689 net/core/dev.c
4675
4676 static u32 __xdp_egress_frame(struct net_device *dev,
4677 struct bpf_prog *xdp_prog,
4678 struct xdp_frame *xdp_frame,
4679 struct xdp_txq_info *txq)
4680 {
4681 struct xdp_buff xdp;
4682 u32 act;
4683
4684 xdp.data_hard_start = xdp_frame->data - xdp_frame->headroom
4685 - sizeof(*xdp_frame);
4686 xdp.data = xdp_frame->data;
4687 xdp.data_end = xdp.data + xdp_frame->len;
4688 xdp.data_meta = xdp.data - xdp_frame->metasize;
4689 xdp.txq = txq;
4690
4691 act = bpf_prog_run_xdp(xdp_prog, &xdp);
4692 switch (act) {
4693 case XDP_DROP:
4694 fallthrough;
4695 case XDP_PASS:
4696 break;
4697 case XDP_TX:
4698 fallthrough;
4699 case XDP_REDIRECT:
4700 fallthrough;
4701 default:
4702 bpf_warn_invalid_xdp_action(act);
4703 fallthrough;
4704 case XDP_ABORTED:
4705 trace_xdp_exception(dev, xdp_prog, act);
4706 act = XDP_DROP;
4707 break;
4708 }
4709
4710 /* if not dropping frame, readjust pointers in case
4711 * program made changes to the buffer
4712 */
4713 if (act != XDP_DROP) {
4714 if (unlikely(!update_xdp_frame(&xdp, xdp_frame)))
4715 return XDP_DROP;
4716 }
4717
4718 return act;
4719 }
4720
4721 unsigned int do_xdp_egress(struct net_device *dev, struct xdp_frame **frames,
4722 unsigned int count)
4723 {
4724 struct bpf_prog *xdp_prog;
4725
4726 xdp_prog = rcu_dereference(dev->xdp_egress_prog);
4727 if (xdp_prog) {
4728 struct xdp_txq_info txq = { .dev = dev };
4729 unsigned int i, j;
4730 u32 act;
4731
4732 for (i = 0, j = 0; i < count; i++) {
4733 struct xdp_frame *frame = frames[i];
4734
4735 act = __xdp_egress_frame(dev, xdp_prog, frame, &txq);
4736 if (act == XDP_DROP) {
4737 xdp_return_frame_rx_napi(frame);
4738 continue;
4739 }
4740
4741 frames[j] = frame;
4742 j++;
4743 }
4744 count = j;
4745 }
4746
4747 return count;
4748 }
4749
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org