[Bug 979] hash: invalid shift expression in rte_thash

bugzilla at dpdk.org bugzilla at dpdk.org
Thu Mar 24 16:08:29 CET 2022


https://bugs.dpdk.org/show_bug.cgi?id=979

            Bug ID: 979
           Summary: hash: invalid shift expression in rte_thash
           Product: DPDK
           Version: 21.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: vhost/virtio
          Assignee: vladimir.medvedkin at intel.com
          Reporter: david.marchand at redhat.com
                CC: dev at dpdk.org
  Target Milestone: ---

This has been reported by covscan in our internal CI for v21.11:

2. dpdk-21.11/lib/hash/rte_thash.c:116: assignment: Assigning: "j" = "0".
4. dpdk-21.11/lib/hash/rte_thash.c:118: large_shift: In expression
"(uint16_t)rss_key[(i + 1) % size] >> 8 - j", right shifting "rss_key[(i + 1) %
size]" by more than 7 bits always yields zero. The shift amount, "8 - j", is 8.
#   116|                for (j = 0; j < 8; j++) {
#   117|                        left_part = rss_key[i] << j;
#   118|->                      right_part = (uint16_t)(rss_key[(i + 1) %
size]) >>
#   119|                                (8 - j);
#   120|                        m[i * 8 + j] = left_part|right_part;

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the dev mailing list