Go to file
Wei Hu (Xavier) 5c471cb581 net/hns3: fix unintended sign extension in fd operation
Currently, there are coverity defects warning as below:

CID 349937 (#1 of 1): Unintended sign extension (SIGN_EXTENSION)
sign_extension: Suspicious implicit sign extension: port_number with
type uint16_t (16 bits, unsigned) is promoted in port_number << cur_pos
to type int (32 bits, signed), then sign-extended to type unsigned long
(64 bits, unsigned). If port_number << cur_pos is greater than
0x7FFFFFFF, the upper bits of the result will all be 1.

CID 349893 (#1 of 1): Unintended sign extension (SIGN_EXTENSION)
sign_extension: Suspicious implicit sign extension: vlan_tag with type
uint8_t (8 bits, unsigned) is promoted in vlan_tag << cur_pos to type
int (32 bits, signed), then sign-extended to type unsigned long (64
bits, unsigned). If vlan_tag << cur_pos is greater than 0x7FFFFFFF, the
upper bits of the result will all be 1.

This patch fixes them by replacing the data type of port_number and
vlan_tag with uint32_t in the inner static function named
hns3_fd_convert_meta_data of hns3 PMD driver.

Coverity issue: 349937, 349893
Fixes: fcba820d9b ("net/hns3: support flow director")
Cc: stable@dpdk.org

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-06-16 19:21:07 +02:00
.ci ci: reduce examples in static builds 2020-04-17 23:34:08 +02:00
app app/testpmd: fix error detection in MTU command 2020-06-16 19:21:07 +02:00
buildtools compat: provide experimental alias for matured ABI 2020-05-18 19:46:25 +02:00
config eal/windows: implement basic memory management 2020-06-15 19:30:54 +02:00
devtools doc: prefer https when pointing to dpdk.org 2020-05-24 23:42:36 +02:00
doc eal: introduce bit operations API 2020-06-16 14:16:56 +02:00
drivers net/hns3: fix unintended sign extension in fd operation 2020-06-16 19:21:07 +02:00
examples examples/ip_pipeline: remove check of null response 2020-05-24 18:24:28 +02:00
kernel kernel/linux: error out on module build failure 2020-05-19 17:59:57 +02:00
lib cfgfile: check flags on creation for future proofing 2020-06-16 17:46:39 +02:00
license eal: move OS-specific sub-directories 2020-03-31 13:08:55 +02:00
mk mk: add note about make system deprecation 2020-05-19 18:04:19 +02:00
usertools usertools: read PCI device name as UTF-8 2020-05-24 19:09:13 +02:00
.editorconfig devtools: add EditorConfig file 2020-02-22 21:05:22 +01:00
.gitattributes improve git diff 2016-11-13 15:25:12 +01:00
.gitignore doc: add feature matrix table for bbdev 2020-04-19 22:34:26 +02:00
.travis.yml version: 20.08-rc0 2020-05-27 11:37:33 +02:00
ABI_VERSION version: 20.08-rc0 2020-05-27 11:37:33 +02:00
GNUmakefile test: move to app directory 2019-02-26 15:29:27 +01:00
MAINTAINERS test/bitops: add bit operations test case 2020-06-16 14:34:39 +02:00
Makefile remove blank lines at end of file 2019-11-26 00:12:08 +01:00
meson_options.txt trace: introduce new subsystem 2020-04-23 15:39:06 +02:00
meson.build build: add arch-specific header path to global includes 2020-05-10 23:45:02 +02:00
README license: introduce SPDX identifiers 2018-01-04 22:41:38 +01:00
VERSION version: 20.08-rc0 2020-05-27 11:37:33 +02:00

DPDK is a set of libraries and drivers for fast packet processing.
It supports many processor architectures and both FreeBSD and Linux.

The DPDK uses the Open Source BSD-3-Clause license for the core libraries
and drivers. The kernel components are GPL-2.0 licensed.

Please check the doc directory for release notes,
API documentation, and sample application information.

For questions and usage discussions, subscribe to: users@dpdk.org
Report bugs and issues to the development mailing list: dev@dpdk.org