Message ID | 20211129045503.20217-1-xiangxia.m.yue@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | [net,v3,1/3] net: core: set skb useful vars in __bpf_tx_skb | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net |
netdev/fixes_present | success | Fixes tag present in non-next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | warning | Series does not have a cover letter |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 38 this patch: 38 |
netdev/cc_maintainers | warning | 1 maintainers not CCed: bpf@vger.kernel.org |
netdev/build_clang | success | Errors and warnings before: 20 this patch: 20 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/verify_fixes | success | Fixes tag looks correct |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 29 this patch: 29 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 20 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
bpf/vmtest-bpf-next-PR | success | PR summary |
bpf/vmtest-bpf | fail | VM_Test |
bpf/vmtest-bpf-PR | fail | PR summary |
bpf/vmtest-bpf-next | success | VM_Test |
diff --git a/net/core/filter.c b/net/core/filter.c index 8271624a19aa..225dc8743863 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -2107,9 +2107,19 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) return -ENETDOWN; } - skb->dev = dev; + /* The target netdevice (e.g. ifb) may use the: + * - skb_iif, bpf_redirect may be invoked in ingress or egress path. + * - redirected + * - from_ingress + */ + skb->skb_iif = skb->dev->ifindex; +#ifdef CONFIG_NET_CLS_ACT + skb_set_redirected(skb, skb->tc_at_ingress); +#else skb->tstamp = 0; +#endif + skb->dev = dev; dev_xmit_recursion_inc(); ret = dev_queue_xmit(skb); dev_xmit_recursion_dec();