Ran PVS studio against this patchset. The resulting warnings for
drivers/net/rnp were:
MESSAGES
LocationCodeMessage
Fails/Info
rnp_mac.c (251)
V610 Undefined behavior.
Check the shift operator '>>='. The right operand ('....' = [0..65535]) is
greater than or equal to the length in bits of the promoted left operand.
rnp_mac.c (198)
V525 The code contains the
collection of similar blocks. Check items 'flt_reg', 'vlan_reg', 'vlan_reg'
in lines 198, 199, 200.
rnp_mac.c (202)
V525 The code contains the
collection of similar blocks. Check items 'flt_reg', 'vlan_reg', 'vlan_reg'
in lines 202, 203, 204.
rnp_osdep.h (129)
V576 Incorrect format.
Consider checking the fourth actual argument of the 'snprintf' function.
The memsize type argument is expected.
rnp_osdep.h (33)
V677 Custom declaration of
a standard 'dma_addr_t' type. The declaration from system header files
should be used instead.
rnp_ethdev.c (106)
V1032 The pointer 'msgbuf'
is cast to a more strictly aligned pointer type.
rnp_ethdev.c (254)
V1051 Consider checking
for misprints. It's possible that the 'dma_ctrl' should be checked here.
rnp_ethdev.c (1325)
V525 The code contains the
collection of similar blocks. Check items 'eth_stats', 'mac_stats',
'mac_stats' in lines 1325, 1331, 1337.
rnp_ethdev.c (110)
V641 The size of the
'msgbuf' buffer is not a multiple of the element size of the type 'struct
rnp_mbx_fw_cmd_reply'.
rnp_ethdev.c (113)
V641 The size of the
'msgbuf' buffer is not a multiple of the element size of the type 'struct
rnp_mbx_fw_cmd_req'.
rnp_ethdev.c (725)
V1027 Pointer to an object
of the 'rte_device' class is cast to unrelated 'rte_pci_device' class.
rnp_ethdev.c (1646)
V1027 Pointer to an object
of the 'rte_device' class is cast to unrelated 'rte_pci_device' class.
rnp_ethdev.c (1777)
V1027 Pointer to an object
of the 'rte_device' class is cast to unrelated 'rte_pci_device' class.
rnp_link.c (192)
V519 The
'link.link_autoneg' variable is assigned values twice successively. Perhaps
this is a mistake. Check lines: 186, 192.
rnp_link.c (359)
V547 Expression
'!port->attr.link_ready' is always true.
rnp_link.c (113)
V1048 The 'lane' variable
was assigned the same value.
rnp_rxtx.c (1412)
V684 A value of the
variable 'txbd->d.cmd' is not modified. Consider inspecting the expression.
It is possible that '1' should be present instead of '0'.
rnp_rxtx.c (1226)
V1027 Pointer to an object
of the 'rte_ether_hdr' class is cast to unrelated 'rte_vlan_hdr' class.
On Tue, Feb 18, 2025 at 11:58 PM Wenbo Cao wrote:
> For This patchset just to support the basic chip init work
> and user can just found the eth_dev, but can't control more.
> For Now just support 2*10g nic,the chip can support
> 2*10g,4*10g,4*1g,8*1g,8*10g.
> The Feature rx side can support rx-cksum-offload,rss,vlan-filter
> flow_clow,uncast_filter,mcast_filter,1588,Jumbo-frame
> The Feature tx side can support tx-cksum-offload,tso,vxlan-tso
> flow director base on ntuple pattern of tcp/udp/ip/ eth_hdr->type
> for sriov is also support.
>
> Because of the chip design defect, for multiple-port mode
> one pci-bdf will have multiple-port (max can have four ports)
> so this code must be care of one bdf init multiple-port.
> v13:
> * Supplementary document about n10 network card characteristics.
> * update release_25_03.rst.
> * fixed the code style advisea Stephen Hemminger.
> * fixed the code issue check PVS-stdio for Static compilation error.
>
> v12:
> * fixed __rte_packed __deprecated__ compile issue.
>
> v11:
> * fixed array-bounds issue when used rte_memcpy src addr is
> * not enough to hold align dst.
> * improve efficient_code advised by Stephen
>
> v10:
> * fixed mingw windows meson issue
> * rnp not support windows for now.
>
> v9:
> * fixed commit log format check by devtools.
> * fixed code compile issue.
>
> v8:
> * fixed codespell issue.
> * fixed MAINTAINERS file
>
> v7:
> * add support nic basic feature such as rss vlan strip/filter,
> * mtu-change recv/send scater-recv/mutltiple-send.
> * fixed code rationality, advised by Ferruh Yigit.
> v6:
> * fixed the doc(rst) format problem advise by Thomas Monjalon
>
> v5:
> * fixed the symbol name require by the style documentation
>
> v4:
> * one patch has been forgot to upload :(
>
> v3:
> * fixed http://dpdk.org/patch/129830 FreeBSD 13 compile Issue
> * change iobar type to void suggest by Stephen Hemminger
> * add KMOD_DEP support for vfio-pci
> * change run-cmd argument parse check for invalid extra_args
>
> v2:
> * fixed MAINTAIN maillist fullname format
> * fixed driver/net/meson the order issue of new driver to driver list
> * improve virtual point function usage suggest by Stephen Hemminger
>
> Wenbo Cao (28):
> net/rnp: add skeleton
> net/rnp: add ethdev probe and remove
> net/rnp: add log
> net/rnp: support mailbox basic operate
> net/rnp: add device init and uninit
> net/rnp: add get device information operation
> net/rnp: add support MAC promisc mode
> net/rnp: add queue setup and release operations
> net/rnp: add queue stop and start operations
> net/rnp: add support device start stop operations
> net/rnp: add RSS support operations
> net/rnp: add support link update operations
> net/rnp: add support link setup operations
> net/rnp: add Rx burst simple support
> net/rnp: add Tx burst simple support
> net/rnp: add MTU set operation
> net/rnp: add Rx scatter segment version
> net/rnp: add Tx multiple segment version
> net/rnp: add support basic stats operation
> net/rnp: add support xstats operation
> net/rnp: add unicast MAC filter operation
> net/rnp: add supported packet types
> net/rnp: add support Rx checksum offload
> net/rnp: add support Tx TSO offload
> net/rnp: support VLAN offloads
> net/rnp: add support VLAN filters operations
> net/rnp: add queue info operation
> net/rnp: support Rx/Tx burst mode info
>
> .mailmap | 1 +
> MAINTAINERS | 6 +
> doc/guides/nics/features/rnp.ini | 33 +
> doc/guides/nics/img/mucse_nic_port.svg | 4023 ++++++++++++++++++++++++
> doc/guides/nics/index.rst | 1 +
> doc/guides/nics/rnp.rst | 124 +
> doc/guides/rel_notes/release_25_03.rst | 5 +
> drivers/net/meson.build | 1 +
> drivers/net/rnp/base/meson.build | 17 +
> drivers/net/rnp/base/rnp_bdq_if.c | 398 +++
> drivers/net/rnp/base/rnp_bdq_if.h | 154 +
> drivers/net/rnp/base/rnp_bitrev.h | 64 +
> drivers/net/rnp/base/rnp_common.c | 103 +
> drivers/net/rnp/base/rnp_common.h | 17 +
> drivers/net/rnp/base/rnp_crc32.c | 37 +
> drivers/net/rnp/base/rnp_crc32.h | 10 +
> drivers/net/rnp/base/rnp_dma_regs.h | 68 +
> drivers/net/rnp/base/rnp_eth_regs.h | 91 +
> drivers/net/rnp/base/rnp_fw_cmd.c | 162 +
> drivers/net/rnp/base/rnp_fw_cmd.h | 357 +++
> drivers/net/rnp/base/rnp_hw.h | 136 +
> drivers/net/rnp/base/rnp_mac.c | 358 +++
> drivers/net/rnp/base/rnp_mac.h | 34 +
> drivers/net/rnp/base/rnp_mac_regs.h | 208 ++
> drivers/net/rnp/base/rnp_mbx.c | 510 +++
> drivers/net/rnp/base/rnp_mbx.h | 58 +
> drivers/net/rnp/base/rnp_mbx_fw.c | 493 +++
> drivers/net/rnp/base/rnp_mbx_fw.h | 24 +
> drivers/net/rnp/base/rnp_osdep.h | 172 +
> drivers/net/rnp/meson.build | 27 +
> drivers/net/rnp/rnp.h | 258 ++
> drivers/net/rnp/rnp_ethdev.c | 1845 +++++++++++
> drivers/net/rnp/rnp_link.c | 439 +++
> drivers/net/rnp/rnp_link.h | 52 +
> drivers/net/rnp/rnp_logs.h | 36 +
> drivers/net/rnp/rnp_rss.c | 367 +++
> drivers/net/rnp/rnp_rss.h | 44 +
> drivers/net/rnp/rnp_rxtx.c | 1818 +++++++++++
> drivers/net/rnp/rnp_rxtx.h | 162 +
> 39 files changed, 12713 insertions(+)
> create mode 100644 doc/guides/nics/features/rnp.ini
> create mode 100644 doc/guides/nics/img/mucse_nic_port.svg
> create mode 100644 doc/guides/nics/rnp.rst
> create mode 100644 drivers/net/rnp/base/meson.build
> create mode 100644 drivers/net/rnp/base/rnp_bdq_if.c
> create mode 100644 drivers/net/rnp/base/rnp_bdq_if.h
> create mode 100644 drivers/net/rnp/base/rnp_bitrev.h
> create mode 100644 drivers/net/rnp/base/rnp_common.c
> create mode 100644 drivers/net/rnp/base/rnp_common.h
> create mode 100644 drivers/net/rnp/base/rnp_crc32.c
> create mode 100644 drivers/net/rnp/base/rnp_crc32.h
> create mode 100644 drivers/net/rnp/base/rnp_dma_regs.h
> create mode 100644 drivers/net/rnp/base/rnp_eth_regs.h
> create mode 100644 drivers/net/rnp/base/rnp_fw_cmd.c
> create mode 100644 drivers/net/rnp/base/rnp_fw_cmd.h
> create mode 100644 drivers/net/rnp/base/rnp_hw.h
> create mode 100644 drivers/net/rnp/base/rnp_mac.c
> create mode 100644 drivers/net/rnp/base/rnp_mac.h
> create mode 100644 drivers/net/rnp/base/rnp_mac_regs.h
> create mode 100644 drivers/net/rnp/base/rnp_mbx.c
> create mode 100644 drivers/net/rnp/base/rnp_mbx.h
> create mode 100644 drivers/net/rnp/base/rnp_mbx_fw.c
> create mode 100644 drivers/net/rnp/base/rnp_mbx_fw.h
> create mode 100644 drivers/net/rnp/base/rnp_osdep.h
> create mode 100644 drivers/net/rnp/meson.build
> create mode 100644 drivers/net/rnp/rnp.h
> create mode 100644 drivers/net/rnp/rnp_ethdev.c
> create mode 100644 drivers/net/rnp/rnp_link.c
> create mode 100644 drivers/net/rnp/rnp_link.h
> create mode 100644 drivers/net/rnp/rnp_logs.h
> create mode 100644 drivers/net/rnp/rnp_rss.c
> create mode 100644 drivers/net/rnp/rnp_rss.h
> create mode 100644 drivers/net/rnp/rnp_rxtx.c
> create mode 100644 drivers/net/rnp/rnp_rxtx.h
>
> --
> 2.25.1
>
>