From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [jpirko-mlxsw:jiri_devel_counters 11/11] net/sched/cls_api.c:3501:9: warning: 'last_hw_stats_type' may be used uninitialized in this function
Date: Sat, 29 Feb 2020 00:10:47 +0800 [thread overview]
Message-ID: <202002290031.3QDRaDc2%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 7661 bytes --]
tree: https://github.com/jpirko/linux_mlxsw jiri_devel_counters
head: 16685c91fd428e68692046f3c1abffe2625e23df
commit: 16685c91fd428e68692046f3c1abffe2625e23df [11/11] sched: act: allow user to specify type of HW stats for a filter
config: x86_64-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.5.0-5) 7.5.0
reproduce:
git checkout 16685c91fd428e68692046f3c1abffe2625e23df
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
net/sched/cls_api.c: In function 'tc_setup_flow_action':
>> net/sched/cls_api.c:3501:9: warning: 'last_hw_stats_type' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (i && last_hw_stats_type != entry->hw_stats_type)
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/last_hw_stats_type +3501 net/sched/cls_api.c
3478
3479 int tc_setup_flow_action(struct flow_action *flow_action,
3480 const struct tcf_exts *exts)
3481 {
3482 enum flow_action_hw_stats_type last_hw_stats_type;
3483 struct tc_action *act;
3484 int i, j, k, err = 0;
3485
3486 if (!exts)
3487 return 0;
3488
3489 j = 0;
3490 tcf_exts_for_each_action(i, act, exts) {
3491 struct flow_action_entry *entry;
3492
3493 entry = &flow_action->entries[j];
3494 spin_lock_bh(&act->tcfa_lock);
3495 err = tcf_act_get_cookie(entry, act);
3496 if (err)
3497 goto err_out_locked;
3498
3499 entry->hw_stats_type =
3500 tcf_flow_action_hw_stats_type(act->hw_stats_type);
> 3501 if (i && last_hw_stats_type != entry->hw_stats_type)
3502 flow_action->mixed_hw_stats_types = true;
3503 last_hw_stats_type = entry->hw_stats_type;
3504
3505 if (is_tcf_gact_ok(act)) {
3506 entry->id = FLOW_ACTION_ACCEPT;
3507 } else if (is_tcf_gact_shot(act)) {
3508 entry->id = FLOW_ACTION_DROP;
3509 } else if (is_tcf_gact_trap(act)) {
3510 entry->id = FLOW_ACTION_TRAP;
3511 } else if (is_tcf_gact_goto_chain(act)) {
3512 entry->id = FLOW_ACTION_GOTO;
3513 entry->chain_index = tcf_gact_goto_chain_index(act);
3514 } else if (is_tcf_mirred_egress_redirect(act)) {
3515 entry->id = FLOW_ACTION_REDIRECT;
3516 tcf_mirred_get_dev(entry, act);
3517 } else if (is_tcf_mirred_egress_mirror(act)) {
3518 entry->id = FLOW_ACTION_MIRRED;
3519 tcf_mirred_get_dev(entry, act);
3520 } else if (is_tcf_mirred_ingress_redirect(act)) {
3521 entry->id = FLOW_ACTION_REDIRECT_INGRESS;
3522 tcf_mirred_get_dev(entry, act);
3523 } else if (is_tcf_mirred_ingress_mirror(act)) {
3524 entry->id = FLOW_ACTION_MIRRED_INGRESS;
3525 tcf_mirred_get_dev(entry, act);
3526 } else if (is_tcf_vlan(act)) {
3527 switch (tcf_vlan_action(act)) {
3528 case TCA_VLAN_ACT_PUSH:
3529 entry->id = FLOW_ACTION_VLAN_PUSH;
3530 entry->vlan.vid = tcf_vlan_push_vid(act);
3531 entry->vlan.proto = tcf_vlan_push_proto(act);
3532 entry->vlan.prio = tcf_vlan_push_prio(act);
3533 break;
3534 case TCA_VLAN_ACT_POP:
3535 entry->id = FLOW_ACTION_VLAN_POP;
3536 break;
3537 case TCA_VLAN_ACT_MODIFY:
3538 entry->id = FLOW_ACTION_VLAN_MANGLE;
3539 entry->vlan.vid = tcf_vlan_push_vid(act);
3540 entry->vlan.proto = tcf_vlan_push_proto(act);
3541 entry->vlan.prio = tcf_vlan_push_prio(act);
3542 break;
3543 default:
3544 err = -EOPNOTSUPP;
3545 goto err_out_locked;
3546 }
3547 } else if (is_tcf_tunnel_set(act)) {
3548 entry->id = FLOW_ACTION_TUNNEL_ENCAP;
3549 err = tcf_tunnel_encap_get_tunnel(entry, act);
3550 if (err)
3551 goto err_out_locked;
3552 } else if (is_tcf_tunnel_release(act)) {
3553 entry->id = FLOW_ACTION_TUNNEL_DECAP;
3554 } else if (is_tcf_pedit(act)) {
3555 for (k = 0; k < tcf_pedit_nkeys(act); k++) {
3556 switch (tcf_pedit_cmd(act, k)) {
3557 case TCA_PEDIT_KEY_EX_CMD_SET:
3558 entry->id = FLOW_ACTION_MANGLE;
3559 break;
3560 case TCA_PEDIT_KEY_EX_CMD_ADD:
3561 entry->id = FLOW_ACTION_ADD;
3562 break;
3563 default:
3564 err = -EOPNOTSUPP;
3565 goto err_out_locked;
3566 }
3567 entry->mangle.htype = tcf_pedit_htype(act, k);
3568 entry->mangle.mask = tcf_pedit_mask(act, k);
3569 entry->mangle.val = tcf_pedit_val(act, k);
3570 entry->mangle.offset = tcf_pedit_offset(act, k);
3571 entry = &flow_action->entries[++j];
3572 }
3573 } else if (is_tcf_csum(act)) {
3574 entry->id = FLOW_ACTION_CSUM;
3575 entry->csum_flags = tcf_csum_update_flags(act);
3576 } else if (is_tcf_skbedit_mark(act)) {
3577 entry->id = FLOW_ACTION_MARK;
3578 entry->mark = tcf_skbedit_mark(act);
3579 } else if (is_tcf_sample(act)) {
3580 entry->id = FLOW_ACTION_SAMPLE;
3581 entry->sample.trunc_size = tcf_sample_trunc_size(act);
3582 entry->sample.truncate = tcf_sample_truncate(act);
3583 entry->sample.rate = tcf_sample_rate(act);
3584 tcf_sample_get_group(entry, act);
3585 } else if (is_tcf_police(act)) {
3586 entry->id = FLOW_ACTION_POLICE;
3587 entry->police.burst = tcf_police_tcfp_burst(act);
3588 entry->police.rate_bytes_ps =
3589 tcf_police_rate_bytes_ps(act);
3590 } else if (is_tcf_ct(act)) {
3591 entry->id = FLOW_ACTION_CT;
3592 entry->ct.action = tcf_ct_action(act);
3593 entry->ct.zone = tcf_ct_zone(act);
3594 } else if (is_tcf_mpls(act)) {
3595 switch (tcf_mpls_action(act)) {
3596 case TCA_MPLS_ACT_PUSH:
3597 entry->id = FLOW_ACTION_MPLS_PUSH;
3598 entry->mpls_push.proto = tcf_mpls_proto(act);
3599 entry->mpls_push.label = tcf_mpls_label(act);
3600 entry->mpls_push.tc = tcf_mpls_tc(act);
3601 entry->mpls_push.bos = tcf_mpls_bos(act);
3602 entry->mpls_push.ttl = tcf_mpls_ttl(act);
3603 break;
3604 case TCA_MPLS_ACT_POP:
3605 entry->id = FLOW_ACTION_MPLS_POP;
3606 entry->mpls_pop.proto = tcf_mpls_proto(act);
3607 break;
3608 case TCA_MPLS_ACT_MODIFY:
3609 entry->id = FLOW_ACTION_MPLS_MANGLE;
3610 entry->mpls_mangle.label = tcf_mpls_label(act);
3611 entry->mpls_mangle.tc = tcf_mpls_tc(act);
3612 entry->mpls_mangle.bos = tcf_mpls_bos(act);
3613 entry->mpls_mangle.ttl = tcf_mpls_ttl(act);
3614 break;
3615 default:
3616 goto err_out_locked;
3617 }
3618 } else if (is_tcf_skbedit_ptype(act)) {
3619 entry->id = FLOW_ACTION_PTYPE;
3620 entry->ptype = tcf_skbedit_ptype(act);
3621 } else {
3622 err = -EOPNOTSUPP;
3623 goto err_out_locked;
3624 }
3625 spin_unlock_bh(&act->tcfa_lock);
3626
3627 if (!is_tcf_pedit(act))
3628 j++;
3629 }
3630
3631 err_out:
3632 if (err)
3633 tc_cleanup_flow_action(flow_action);
3634
3635 return err;
3636 err_out_locked:
3637 spin_unlock_bh(&act->tcfa_lock);
3638 goto err_out;
3639 }
3640 EXPORT_SYMBOL(tc_setup_flow_action);
3641
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29031 bytes --]
reply other threads:[~2020-02-28 16:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202002290031.3QDRaDc2%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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.