net/sched: fix wrong behavior of MPLS push/pop action
Subsystems (4)
cover net/sched: fix wrong behavior of MPLS push/pop action
this series contains two fixes for TC 'act_mpls', that try to address two problems that can be observed configuring simple 'push' / 'pop' operations:
- patch 1/2 avoids dropping non-MPLS packets that pass through the MPLS 'pop' action.
- patch 2/2 fixes corruption of the L2 header that occurs when 'push' or 'pop' actions are configured in TC egress path.
Davide Caratti (2):
net: avoid errors when trying to pop MLPS header on non-MPLS packets net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
include/linux/skbuff.h | 5 +++-- net/core/skbuff.c | 20 +++++++++++--------- net/openvswitch/actions.c | 5 +++-- net/sched/act_mpls.c | 12 ++++++++---- 4 files changed, 25 insertions(+), 17 deletions(-)
Signature · 1 line
2.21.0
PATCH 1/2 net: avoid errors when trying to pop MLPS header on non-MPLS packets
the following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress matchall action mpls pop
implicitly makes the kernel drop all packets transmitted by eth0, if they don't have a MPLS header. This behavior is uncommon: other encapsulations (like VLAN) just let the packet pass unmodified. Since the result of MPLS 'pop' operation would be the same regardless of the presence / absence of MPLS header(s) in the original packet, we can let skb_mpls_pop() return 0 when dealing with non-MPLS packets.
--- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/skbuff.c +1 -1
@@ -5536,7 +5536,7 @@ int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto)int err;if (unlikely (!eth_p_mpls (skb->protocol))) -return -EINVAL ; +return 0 ; err =skb_ensure_writable (skb, skb->mac_len +MPLS_HLEN );if (unlikely (err))
Signature · 1 line
2.21.0
Re: [PATCH net 1/2] net: avoid errors when trying to pop MLPS header on non-MPLS packets
Quoted 12 lines · Davide Caratti
the following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress matchall action mpls popimplicitly makes the kernel drop all packets transmitted by eth0, if they don't have a MPLS header. This behavior is uncommon: other encapsulations (like VLAN) just let the packet pass unmodified. Since the result of MPLS 'pop' operation would be the same regardless of the presence / absence of MPLS header(s) in the original packet, we can let
skb_mpls_pop()return 0 when dealing with non-MPLS packets.
Quoted 2 lines
Fixes 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")Signed-off-by Davide Caratti <[email protected]>
Hi Davide,
For the TC use-case I think this is correct for the reasons you explain above.
For the OVS use-case I also think it is fine because __ovs_nla_copy_actions() will ensure that MPLS POP only occurs for packets with an MPLS Ethernet protocol. That is, this condition should never occur in that use-case.
And it appears that there are no other users of this function.
I think it might be worth adding something about use-cases other than TC to the changelog, but that aside:
Quoted 20 lines
--- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/core/skbuff.c +1
-1@@ -5536,7 +5536,7 @@ int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto)int err;if (unlikely (!eth_p_mpls (skb->protocol))) -return -EINVAL ; +return 0 ; err =skb_ensure_writable (skb, skb->mac_len +MPLS_HLEN );if (unlikely (err))Signature · 1 line
2.21.0
John Hurley
Acked-byRe: [PATCH net 1/2] net: avoid errors when trying to pop MLPS header on non-MPLS packets
Quoted 14 lines · Simon Horman
Quoted 12 lines · Davide Caratti
the following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress matchall action mpls popimplicitly makes the kernel drop all packets transmitted by eth0, if they don't have a MPLS header. This behavior is uncommon: other encapsulations (like VLAN) just let the packet pass unmodified. Since the result of MPLS 'pop' operation would be the same regardless of the presence / absence of MPLS header(s) in the original packet, we can let
skb_mpls_pop()return 0 when dealing with non-MPLS packets.
Quoted 3 lines
Quoted 2 lines
Fixes 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")Signed-off-by Davide Caratti <[email protected]>
Quoted 37 lines
Hi Davide,
For the TC use-case I think this is correct for the reasons you explain above.
For the OVS use-case I also think it is fine because
__ovs_nla_copy_actions()will ensure that MPLS POP only occurs for packets with an MPLS Ethernet protocol. That is, this condition should never occur in that use-case.And it appears that there are no other users of this function.
I think it might be worth adding something about use-cases other than TC to the changelog, but that aside:
Reviewed-by Simon Horman <[email protected]>Quoted 20 lines
--- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/core/skbuff.c +1
-2@@ -5536,7 +5536,7 @@ int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto)int err;if (unlikely (!eth_p_mpls (skb->protocol))) -return -EINVAL ; +return 0 ; err =skb_ensure_writable (skb, skb->mac_len +MPLS_HLEN );if (unlikely (err)) --2.21.0
PATCH 2/2 net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
In reply to Davide Carattithe following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress protocol ip matchall \
Quoted 1 line
action mpls push protocol
mpls_uclabel0x355aabos 1
causes corruption of all IP packets transmitted by eth0. On TC egress, we can't rely on the value of skb->mac_len, because it's 0 and a MPLS 'push' operation will result in an overwrite of the first 4 octets in the packet L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same error pattern is present also in the MPLS 'pop' operation. Fix this error in act_mpls data plane, computing 'mac_len' as the difference between the network header and the mac header (when not at TC ingress), and use it in MPLS 'push'/'pop' core functions.
--- include/linux/skbuff.h | 5 +++-- net/core/skbuff.c | 18 ++++++++++-------- net/openvswitch/actions.c | 5 +++-- net/sched/act_mpls.c | 12 ++++++++---- 4 files changed, 24 insertions(+), 16 deletions(-)
include/linux/skbuff.h +3 -2
@@ -3510,8 +3510,9 @@ int skb_ensure_writable(struct sk_buff *skb, int write_len);int __skb_vlan_pop (struct sk_buff *skb,u16 *vlan_tci);int skb_vlan_pop (struct sk_buff *skb);int skb_vlan_push (struct sk_buff *skb,__be16 vlan_proto,u16 vlan_tci); -int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto); -int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto); +int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto, +int mac_len); +int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len);int skb_mpls_update_lse (struct sk_buff *skb,__be32 mpls_lse);int skb_mpls_dec_ttl (struct sk_buff *skb); struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy,
net/core/skbuff.c +10 -8
@@ -5477,12 +5477,14 @@ static void skb_mod_eth_type(struct sk_buff *skb, struct ethhdr *hdr,* @skb: buffer * @mpls_lse: MPLS label stack entry to push * @mpls_proto: ethertype of the new MPLS header (expects 0x8847 or 0x8848) +* @mac_len: length of the MAC header * * Expects skb->data at mac header. * * Returns 0 on success, -errno otherwise. */ -int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto) +int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto, +int mac_len) {struct mpls_shim_hdr *lse;int err;
@@ -5499,15 +5501,15 @@ int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto)return err;if (!skb->inner_protocol) { -skb_set_inner_network_header (skb, skb->mac_len); +skb_set_inner_network_header (skb, mac_len);skb_set_inner_protocol (skb, skb->protocol); }skb_push (skb,MPLS_HLEN );memmove (skb_mac_header (skb) -MPLS_HLEN ,skb_mac_header (skb), - skb->mac_len); + mac_len);skb_reset_mac_header (skb); -skb_set_network_header (skb, skb->mac_len); +skb_set_network_header (skb, mac_len); lse =mpls_hdr (skb); lse->label_stack_entry = mpls_lse;
@@ -5531,24 +5533,24 @@ EXPORT_SYMBOL_GPL(skb_mpls_push);* * Returns 0 on success, -errno otherwise. */ -int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto) +int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len) {int err;if (unlikely (!eth_p_mpls (skb->protocol)))return 0 ; - err =skb_ensure_writable (skb, skb->mac_len +MPLS_HLEN ); + err =skb_ensure_writable (skb, mac_len +MPLS_HLEN );if (unlikely (err))return err;skb_postpull_rcsum (skb,mpls_hdr (skb),MPLS_HLEN );memmove (skb_mac_header (skb) +MPLS_HLEN ,skb_mac_header (skb), - skb->mac_len); + mac_len);__skb_pull (skb,MPLS_HLEN );skb_reset_mac_header (skb); -skb_set_network_header (skb, skb->mac_len); +skb_set_network_header (skb, mac_len);if (skb->dev && skb->dev->type ==ARPHRD_ETHER ) {struct ethhdr *hdr;
net/openvswitch/actions.c +3 -2
@@ -165,7 +165,8 @@ static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key, {int err; - err =skb_mpls_push (skb, mpls->mpls_lse, mpls->mpls_ethertype); + err =skb_mpls_push (skb, mpls->mpls_lse, mpls->mpls_ethertype, + skb->mac_len);if (err)return err;
@@ -178,7 +179,7 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, {int err; - err =skb_mpls_pop (skb, ethertype); + err =skb_mpls_pop (skb, ethertype, skb->mac_len);if (err)return err;
net/sched/act_mpls.c +8 -4
@@ -55,7 +55,7 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,struct tcf_mpls *m =to_mpls (a);struct tcf_mpls_params *p;__be32 new_lse; -int ret; +int ret, mac_len;tcf_lastuse_update (&m->tcf_tm);bstats_cpu_update (this_cpu_ptr (m->common.cpu_bstats), skb);
@@ -63,8 +63,12 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,/* Ensure 'data' points at mac_header prior calling mpls manipulating * functions. */ -if (skb_at_tc_ingress (skb)) +if (skb_at_tc_ingress (skb)) {skb_push_rcsum (skb, skb->mac_len); + mac_len = skb->mac_len; + }else { + mac_len =skb_network_header (skb) -skb_mac_header (skb); + } ret =READ_ONCE (m->tcf_action);
@@ -72,12 +76,12 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,switch (p->tcfm_action) {case TCA_MPLS_ACT_POP : -if (skb_mpls_pop (skb, p->tcfm_proto)) +if (skb_mpls_pop (skb, p->tcfm_proto, mac_len)) goto drop;break ;case TCA_MPLS_ACT_PUSH : new_lse =tcf_mpls_get_lse (NULL , p, !eth_p_mpls (skb->protocol)); -if (skb_mpls_push (skb, new_lse, p->tcfm_proto)) +if (skb_mpls_push (skb, new_lse, p->tcfm_proto, mac_len)) goto drop;break ;case TCA_MPLS_ACT_MODIFY :
Signature · 1 line
2.21.0
Re: [PATCH net 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
Quoted 15 lines · Davide Caratti
the following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress protocol ip matchall \Quoted 1 line
action mpls push protocol
mpls_uclabel0x355aabos 1causes corruption of all IP packets transmitted by eth0. On TC egress, we can't rely on the value of
skb->mac_len, because it's 0 and a MPLS 'push' operation will result in an overwrite of the first 4 octets in the packet L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same error pattern is present also in the MPLS 'pop' operation. Fix this error inact_mplsdata plane, computing 'mac_len' as the difference between the network header and the mac header (when not at TC ingress), and use it in MPLS 'push'/'pop' core functions.
Quoted 3 lines
CC Lorenzo Bianconi <[email protected]>Fixes 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")Signed-off-by Davide Caratti <[email protected]>
Re: [PATCH net 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
Quoted 25 lines · Simon Horman
Quoted 15 lines · Davide Caratti
the following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress protocol ip matchall \Quoted 1 line
action mpls push protocol
mpls_uclabel0x355aabos 1causes corruption of all IP packets transmitted by eth0. On TC egress, we can't rely on the value of
skb->mac_len, because it's 0 and a MPLS 'push' operation will result in an overwrite of the first 4 octets in the packet L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same error pattern is present also in the MPLS 'pop' operation. Fix this error inact_mplsdata plane, computing 'mac_len' as the difference between the network header and the mac header (when not at TC ingress), and use it in MPLS 'push'/'pop' core functions.Quoted 3 lines
CC Lorenzo Bianconi <[email protected]>Fixes 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")Signed-off-by Davide Caratti <[email protected]>Reviewed-by Simon Horman <[email protected]>
John Hurley
Acked-byRe: [PATCH net 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
In reply to Simon HormanQuoted 17 lines · Simon Horman
Quoted 15 lines · Davide Caratti
the following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress protocol ip matchall \Quoted 1 line
action mpls push protocol
mpls_uclabel0x355aabos 1causes corruption of all IP packets transmitted by eth0. On TC egress, we can't rely on the value of
skb->mac_len, because it's 0 and a MPLS 'push' operation will result in an overwrite of the first 4 octets in the packet L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same error pattern is present also in the MPLS 'pop' operation. Fix this error inact_mplsdata plane, computing 'mac_len' as the difference between the network header and the mac header (when not at TC ingress), and use it in MPLS 'push'/'pop' core functions.
Quoted 4 lines
Quoted 3 lines
CC Lorenzo Bianconi <[email protected]>Fixes 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")Signed-off-by Davide Caratti <[email protected]>
Quoted 2 lines
Reviewed-by Simon Horman <[email protected]>
kbuild test robot
build botRe: [PATCH net 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
In reply to Davide CarattiThank you for the patch! Perhaps something to improve:
Hi Davide,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net/master]
url: https://github.com/0day-ci/linux/commits/Davide-Caratti/net-avoid-errors-when-trying-to-pop-MLPS-header-on-non-MPLS-packets/20191012-085439
reproduce: make htmldocs
If you fix the issue, kindly add following tag
All warnings (new ones prefixed by >>):
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:821: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1283: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:2821: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute' drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:378: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch' drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:379: warning: Function parameter or member 'ih' not described in 'amdgpu_irq_dispatch' drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:379: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch'
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:1: warning: no structured comments found
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1: warning: no structured comments found
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1: warning: 'pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie' not found
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:132: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source @atomic_obj drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:238: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source gpu_info FW provided soc bounding box struct or 0 if not drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:243: warning: Function parameter or member 'atomic_obj' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:243: warning: Function parameter or member 'backlight_link' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:243: warning: Function parameter or member 'backlight_caps' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:243: warning: Function parameter or member 'freesync_module' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:243: warning: Function parameter or member 'fw_dmcu' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:243: warning: Function parameter or member 'dmcu_fw_version' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:243: warning: Function parameter or member 'soc_bounding_box' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'register_hpd_handlers' not found
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'dm_crtc_high_irq' not found
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'dm_pflip_high_irq' not found
drivers/gpio/gpiolib-of.c:92: warning: Excess function parameter 'dev' description in 'of_gpio_need_valid_mask'
include/linux/i2c.h:337: warning: Function parameter or member 'init_irq' not described in 'i2c_client'
mm/util.c:1: warning: 'get_user_pages_fast' not found
mm/slab.c:4215: warning: Function parameter or member 'objp' not described in '__ksize'
fs/fs-writeback.c:913: warning: Excess function parameter 'nr_pages' description in 'cgroup_writeback_by_id'
fs/direct-io.c:258: warning: Excess function parameter 'offset' description in 'dio_complete'
fs/libfs.c:496: warning: Excess function parameter 'available' description in 'simple_write_end'
fs/posix_acl.c:647: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode'
fs/posix_acl.c:647: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode'
fs/posix_acl.c:647: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode'
drivers/usb/typec/bus.c:1: warning: 'typec_altmode_register_driver' not found
drivers/usb/typec/bus.c:1: warning: 'typec_altmode_unregister_driver' not found
drivers/usb/typec/class.c:1: warning: 'typec_altmode_unregister_notifier' not found
drivers/usb/typec/class.c:1: warning: 'typec_altmode_register_notifier' not found
include/linux/w1.h:277: warning: Function parameter or member 'of_match_table' not described in 'w1_family'
kernel/dma/coherent.c:1: warning: no structured comments found
include/linux/input/sparse-keymap.h:43: warning: Function parameter or member 'sw' not described in 'key_entry'
lib/genalloc.c:1: warning: 'gen_pool_add_virt' not found
lib/genalloc.c:1: warning: 'gen_pool_alloc' not found
lib/genalloc.c:1: warning: 'gen_pool_free' not found
lib/genalloc.c:1: warning: 'gen_pool_alloc_algo' not found
include/linux/bitmap.h:341: warning: Function parameter or member 'nbits' not described in 'bitmap_or_equal'
include/linux/rculist.h:374: warning: Excess function parameter 'cond' description in 'list_for_each_entry_rcu'
include/linux/rculist.h:651: warning: Excess function parameter 'cond' description in 'hlist_for_each_entry_rcu'
include/net/mac80211.h:4056: warning: Function parameter or member 'sta_set_txpwr' not described in 'ieee80211_ops'
include/net/mac80211.h:2018: warning: Function parameter or member 'txpwr' not described in 'ieee80211_sta'
include/net/cfg80211.h:1185: warning: Function parameter or member 'txpwr' not described in 'station_parameters'
include/linux/skbuff.h:888: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'list' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'head_frag' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'encapsulation' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'csum_valid' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'vlan_present' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'csum_level' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff'
include/linux/skbuff.h:888: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff'
include/net/sock.h:233: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_portpair' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_cookie' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_listener' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common'
include/net/sock.h:233: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common'
include/net/sock.h:515: warning: Function parameter or member 'sk_rx_skb_cache' not described in 'sock'
include/net/sock.h:515: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
include/net/sock.h:515: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock'
include/net/sock.h:515: warning: Function parameter or member 'sk_tx_skb_cache' not described in 'sock'
include/net/sock.h:515: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock'
include/net/sock.h:515: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock'
include/net/sock.h:515: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock'
include/net/sock.h:515: warning: Function parameter or member 'sk_bpf_storage' not described in 'sock'
include/net/sock.h:2441: warning: Function parameter or member 'tcp_rx_skb_cache_key' not described in 'DECLARE_STATIC_KEY_FALSE'
include/net/sock.h:2441: warning: Excess function parameter 'sk' description in 'DECLARE_STATIC_KEY_FALSE'
include/net/sock.h:2441: warning: Excess function parameter 'skb' description in 'DECLARE_STATIC_KEY_FALSE'
>> net/core/skbuff.c:5538: warning: Function parameter or member 'mac_len' not described in 'skb_mpls_pop'
include/linux/netdevice.h:2053: warning: Function parameter or member 'gso_partial_features' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'name_assign_type' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'mpls_ptr' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'xdp_prog' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'qdisc_hash' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device'
include/linux/netdevice.h:2053: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device'
include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state' include/drm/drm_modeset_helper_vtables.h:1053: warning: Function parameter or member 'prepare_writeback_job' not described in 'drm_connector_helper_funcs' include/drm/drm_modeset_helper_vtables.h:1053: warning: Function parameter or member 'cleanup_writeback_job' not described in 'drm_connector_helper_funcs' include/drm/drm_atomic_state_helper.h:1: warning: no structured comments found
include/drm/drm_gem_shmem_helper.h:87: warning: Function parameter or member 'madv' not described in 'drm_gem_shmem_object' include/drm/drm_gem_shmem_helper.h:87: warning: Function parameter or member 'madv_list' not described in 'drm_gem_shmem_object' drivers/gpu/drm/i915/display/intel_dpll_mgr.h:158: warning: Enum value 'DPLL_ID_TGL_MGPLL5' not described in enum 'intel_dpll_id' drivers/gpu/drm/i915/display/intel_dpll_mgr.h:158: warning: Enum value 'DPLL_ID_TGL_MGPLL6' not described in enum 'intel_dpll_id' drivers/gpu/drm/i915/display/intel_dpll_mgr.h:158: warning: Excess enum value 'DPLL_ID_TGL_TCPLL6' description in 'intel_dpll_id' drivers/gpu/drm/i915/display/intel_dpll_mgr.h:158: warning: Excess enum value 'DPLL_ID_TGL_TCPLL5' description in 'intel_dpll_id' drivers/gpu/drm/i915/display/intel_dpll_mgr.h:342: warning: Function parameter or member 'wakeref' not described in 'intel_shared_dpll'
Error: Cannot open file drivers/gpu/drm/i915/i915_gem_batch_pool.c
Error: Cannot open file drivers/gpu/drm/i915/i915_gem_batch_pool.c
Error: Cannot open file drivers/gpu/drm/i915/i915_gem_batch_pool.c
drivers/gpu/drm/i915/i915_drv.h:1129: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source The OA context specific information. drivers/gpu/drm/i915/i915_drv.h:1143: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source State of the OA buffer. drivers/gpu/drm/i915/i915_drv.h:1154: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Locks reads and writes to all head/tail state drivers/gpu/drm/i915/i915_drv.h:1176: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source One 'aging' tail pointer and one 'aged' tail pointer ready to drivers/gpu/drm/i915/i915_drv.h:1188: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Index for the aged tail ready to read() data up to. drivers/gpu/drm/i915/i915_drv.h:1193: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source A monotonic timestamp for when the current aging tail pointer drivers/gpu/drm/i915/i915_drv.h:1199: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Although we can always read back the head pointer register, drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'pinned_ctx' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'specific_ctx_id' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'specific_ctx_id_mask' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'poll_check_timer' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'poll_wq' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'pollin' not described in 'i915_perf_stream'
drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'periodic' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'period_exponent' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1207: warning: Function parameter or member 'oa_buffer' not described in 'i915_perf_stream' drivers/gpu/drm/i915/i915_drv.h:1129: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source The OA context specific information. drivers/gpu/drm/i915/i915_drv.h:1143: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source State of the OA buffer. drivers/gpu/drm/i915/i915_drv.h:1154: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Locks reads and writes to all head/tail state drivers/gpu/drm/i915/i915_drv.h:1176: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source One 'aging' tail pointer and one 'aged' tail pointer ready to drivers/gpu/drm/i915/i915_drv.h:1188: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Index for the aged tail ready to read() data up to. drivers/gpu/drm/i915/i915_drv.h:1193: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source A monotonic timestamp for when the current aging tail pointer drivers/gpu/drm/i915/i915_drv.h:1199: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Although we can always read back the head pointer register, drivers/gpu/drm/i915/i915_drv.h:1129: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source The OA context specific information. drivers/gpu/drm/i915/i915_drv.h:1143: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source State of the OA buffer. drivers/gpu/drm/i915/i915_drv.h:1154: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Locks reads and writes to all head/tail state drivers/gpu/drm/i915/i915_drv.h:1176: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source One 'aging' tail pointer and one 'aged' tail pointer ready to drivers/gpu/drm/i915/i915_drv.h:1188: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Index for the aged tail ready to read() data up to. drivers/gpu/drm/i915/i915_drv.h:1193: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source A monotonic timestamp for when the current aging tail pointer drivers/gpu/drm/i915/i915_drv.h:1199: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source Although we can always read back the head pointer register, drivers/gpu/drm/mcde/mcde_drv.c:1: warning: 'ST-Ericsson MCDE DRM Driver' not found
include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'quotactl' not described in 'security_list_options'
include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'quota_on' not described in 'security_list_options'
include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options'
include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options' include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options' include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options'
include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'getprocattr' not described in 'security_list_options'
include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'setprocattr' not described in 'security_list_options'
include/linux/lsm_hooks.h:1822: warning: Function parameter or member 'locked_down' not described in 'security_list_options' Documentation/admin-guide/perf/imx-ddr.rst:21: WARNING: Unexpected indentation.
Documentation/admin-guide/perf/imx-ddr.rst:34: WARNING: Unexpected indentation.
Documentation/admin-guide/perf/imx-ddr.rst:40: WARNING: Unexpected indentation.
Documentation/admin-guide/perf/imx-ddr.rst:45: WARNING: Unexpected indentation.
Documentation/admin-guide/perf/imx-ddr.rst:52: WARNING: Unexpected indentation.
Documentation/admin-guide/xfs.rst:257: WARNING: Block quote ends without a blank line; unexpected unindent.
Documentation/arm64/memory.rst:158: WARNING: Unexpected indentation.
Documentation/arm64/memory.rst:162: WARNING: Unexpected indentation.
Documentation/hwmon/inspur-ipsps1.rst:2: WARNING: Title underline too short.
vim +5538 net/core/skbuff.c
8822e270d69701 John Hurley 2019-07-07 5525
ed246cee09b986 John Hurley 2019-07-07 5526 /**
ed246cee09b986 John Hurley 2019-07-07 5527 * skb_mpls_pop() - pop the outermost MPLS header
ed246cee09b986 John Hurley 2019-07-07 5528 *
ed246cee09b986 John Hurley 2019-07-07 5529 * @skb: buffer
ed246cee09b986 John Hurley 2019-07-07 5530 * @next_proto: ethertype of header after popped MPLS header
ed246cee09b986 John Hurley 2019-07-07 5531 *
ed246cee09b986 John Hurley 2019-07-07 5532 * Expects skb->data at mac header.
ed246cee09b986 John Hurley 2019-07-07 5533 *
ed246cee09b986 John Hurley 2019-07-07 5534 * Returns 0 on success, -errno otherwise.
ed246cee09b986 John Hurley 2019-07-07 5535 */
c3fa3a45784aab Davide Caratti 2019-10-10 5536 int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto, int mac_len)
ed246cee09b986 John Hurley 2019-07-07 5537 {
ed246cee09b986 John Hurley 2019-07-07 @5538 int err;
ed246cee09b986 John Hurley 2019-07-07 5539
ed246cee09b986 John Hurley 2019-07-07 5540 if (unlikely(!eth_p_mpls(skb->protocol)))
4fa3379002f6b6 Davide Caratti 2019-10-10 5541 return 0;
ed246cee09b986 John Hurley 2019-07-07 5542
c3fa3a45784aab Davide Caratti 2019-10-10 5543 err = skb_ensure_writable(skb, mac_len + MPLS_HLEN);
ed246cee09b986 John Hurley 2019-07-07 5544 if (unlikely(err))
ed246cee09b986 John Hurley 2019-07-07 5545 return err;
ed246cee09b986 John Hurley 2019-07-07 5546
ed246cee09b986 John Hurley 2019-07-07 5547 skb_postpull_rcsum(skb, mpls_hdr(skb), MPLS_HLEN);
ed246cee09b986 John Hurley 2019-07-07 5548 memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb),
c3fa3a45784aab Davide Caratti 2019-10-10 5549 mac_len);
ed246cee09b986 John Hurley 2019-07-07 5550
ed246cee09b986 John Hurley 2019-07-07 5551 __skb_pull(skb, MPLS_HLEN);
ed246cee09b986 John Hurley 2019-07-07 5552 skb_reset_mac_header(skb);
c3fa3a45784aab Davide Caratti 2019-10-10 5553 skb_set_network_header(skb, mac_len);
ed246cee09b986 John Hurley 2019-07-07 5554
ed246cee09b986 John Hurley 2019-07-07 5555 if (skb->dev && skb->dev->type == ARPHRD_ETHER) {
ed246cee09b986 John Hurley 2019-07-07 5556 struct ethhdr *hdr;
ed246cee09b986 John Hurley 2019-07-07 5557
ed246cee09b986 John Hurley 2019-07-07 5558 /* use mpls_hdr() to get ethertype to account for VLANs. */
ed246cee09b986 John Hurley 2019-07-07 5559 hdr = (struct ethhdr *)((void *)mpls_hdr(skb) - ETH_HLEN);
ed246cee09b986 John Hurley 2019-07-07 5560 skb_mod_eth_type(skb, hdr, next_proto);
ed246cee09b986 John Hurley 2019-07-07 5561 }
ed246cee09b986 John Hurley 2019-07-07 5562 skb->protocol = next_proto;
ed246cee09b986 John Hurley 2019-07-07 5563
ed246cee09b986 John Hurley 2019-07-07 5564 return 0;
ed246cee09b986 John Hurley 2019-07-07 5565 }
ed246cee09b986 John Hurley 2019-07-07 5566 EXPORT_SYMBOL_GPL(skb_mpls_pop);
ed246cee09b986 John Hurley 2019-07-07 5567 :::::: The code at line 5538 was first introduced by commit
:::::: ed246cee09b9865145a2e1e34f63ec0e31dd83a5 net: core: move pop MPLS functionality from OvS to core helper
:::::: TO: John Hurley <[email protected]> :::::: CC: David S. Miller <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation