From: kbuild test robot <lkp@intel.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: kbuild-all@01.org, netdev@vger.kernel.org,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
Daniel Borkmann <daniel@iogearbox.net>,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
Eyal Birger <eyal.birger@gmail.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next v4 3/4] net/tc: introduce TC_ACT_REINSERT.
Date: Sun, 29 Jul 2018 11:34:13 +0800 [thread overview]
Message-ID: <201807291154.vOeF0Y6M%fengguang.wu@intel.com> (raw)
In-Reply-To: <9f1f9426acce7764e0376a1bcfb44b49f6e15eb3.1532611319.git.pabeni@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 5330 bytes --]
Hi Paolo,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Paolo-Abeni/TC-refactor-act_mirred-packets-re-injection/20180729-102154
config: x86_64-randconfig-u0-07291027 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/current.h:5:0,
from include/linux/sched.h:12,
from include/linux/uaccess.h:5,
from net/core/dev.c:75:
net/core/dev.c: In function 'netif_receive_generic_xdp':
net/core/dev.c:4255:28: error: 'struct sk_buff' has no member named 'tc_redirected'
if (skb_cloned(skb) || skb->tc_redirected)
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
>> net/core/dev.c:4255:2: note: in expansion of macro 'if'
if (skb_cloned(skb) || skb->tc_redirected)
^
net/core/dev.c:4255:28: error: 'struct sk_buff' has no member named 'tc_redirected'
if (skb_cloned(skb) || skb->tc_redirected)
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
>> net/core/dev.c:4255:2: note: in expansion of macro 'if'
if (skb_cloned(skb) || skb->tc_redirected)
^
net/core/dev.c:4255:28: error: 'struct sk_buff' has no member named 'tc_redirected'
if (skb_cloned(skb) || skb->tc_redirected)
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^
>> net/core/dev.c:4255:2: note: in expansion of macro 'if'
if (skb_cloned(skb) || skb->tc_redirected)
^
vim +/if +4255 net/core/dev.c
4241
4242 static u32 netif_receive_generic_xdp(struct sk_buff *skb,
4243 struct xdp_buff *xdp,
4244 struct bpf_prog *xdp_prog)
4245 {
4246 struct netdev_rx_queue *rxqueue;
4247 void *orig_data, *orig_data_end;
4248 u32 metalen, act = XDP_DROP;
4249 int hlen, off;
4250 u32 mac_len;
4251
4252 /* Reinjected packets coming from act_mirred or similar should
4253 * not get XDP generic processing.
4254 */
> 4255 if (skb_cloned(skb) || skb->tc_redirected)
4256 return XDP_PASS;
4257
4258 /* XDP packets must be linear and must have sufficient headroom
4259 * of XDP_PACKET_HEADROOM bytes. This is the guarantee that also
4260 * native XDP provides, thus we need to do it here as well.
4261 */
4262 if (skb_is_nonlinear(skb) ||
4263 skb_headroom(skb) < XDP_PACKET_HEADROOM) {
4264 int hroom = XDP_PACKET_HEADROOM - skb_headroom(skb);
4265 int troom = skb->tail + skb->data_len - skb->end;
4266
4267 /* In case we have to go down the path and also linearize,
4268 * then lets do the pskb_expand_head() work just once here.
4269 */
4270 if (pskb_expand_head(skb,
4271 hroom > 0 ? ALIGN(hroom, NET_SKB_PAD) : 0,
4272 troom > 0 ? troom + 128 : 0, GFP_ATOMIC))
4273 goto do_drop;
4274 if (skb_linearize(skb))
4275 goto do_drop;
4276 }
4277
4278 /* The XDP program wants to see the packet starting at the MAC
4279 * header.
4280 */
4281 mac_len = skb->data - skb_mac_header(skb);
4282 hlen = skb_headlen(skb) + mac_len;
4283 xdp->data = skb->data - mac_len;
4284 xdp->data_meta = xdp->data;
4285 xdp->data_end = xdp->data + hlen;
4286 xdp->data_hard_start = skb->data - skb_headroom(skb);
4287 orig_data_end = xdp->data_end;
4288 orig_data = xdp->data;
4289
4290 rxqueue = netif_get_rxqueue(skb);
4291 xdp->rxq = &rxqueue->xdp_rxq;
4292
4293 act = bpf_prog_run_xdp(xdp_prog, xdp);
4294
4295 off = xdp->data - orig_data;
4296 if (off > 0)
4297 __skb_pull(skb, off);
4298 else if (off < 0)
4299 __skb_push(skb, -off);
4300 skb->mac_header += off;
4301
4302 /* check if bpf_xdp_adjust_tail was used. it can only "shrink"
4303 * pckt.
4304 */
4305 off = orig_data_end - xdp->data_end;
4306 if (off != 0) {
4307 skb_set_tail_pointer(skb, xdp->data_end - xdp->data);
4308 skb->len -= off;
4309
4310 }
4311
4312 switch (act) {
4313 case XDP_REDIRECT:
4314 case XDP_TX:
4315 __skb_push(skb, mac_len);
4316 break;
4317 case XDP_PASS:
4318 metalen = xdp->data - xdp->data_meta;
4319 if (metalen)
4320 skb_metadata_set(skb, metalen);
4321 break;
4322 default:
4323 bpf_warn_invalid_xdp_action(act);
4324 /* fall through */
4325 case XDP_ABORTED:
4326 trace_xdp_exception(skb->dev, xdp_prog, act);
4327 /* fall through */
4328 case XDP_DROP:
4329 do_drop:
4330 kfree_skb(skb);
4331 break;
4332 }
4333
4334 return act;
4335 }
4336
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34296 bytes --]
next prev parent reply other threads:[~2018-07-29 6:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 14:34 [PATCH net-next v4 0/4] TC: refactor act_mirred packets re-injection Paolo Abeni
2018-07-26 14:34 ` [PATCH net-next v4 1/4] net/sched: user-space can't set unknown tcfa_action values Paolo Abeni
2018-07-27 0:28 ` Marcelo Ricardo Leitner
2018-07-27 13:08 ` Paolo Abeni
2018-07-26 14:34 ` [PATCH net-next v4 2/4] tc/act: remove unneeded RCU lock in action callback Paolo Abeni
2018-07-26 14:34 ` [PATCH net-next v4 3/4] net/tc: introduce TC_ACT_REINSERT Paolo Abeni
2018-07-26 23:29 ` Cong Wang
2018-07-29 3:21 ` kbuild test robot
2018-07-29 3:34 ` kbuild test robot [this message]
2018-07-26 14:35 ` [PATCH net-next v4 4/4] act_mirred: use TC_ACT_REINSERT when possible Paolo Abeni
2018-07-26 23:27 ` Cong Wang
2018-07-29 2:58 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201807291154.vOeF0Y6M%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eyal.birger@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kbuild-all@01.org \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.