uuid: enhancements and tests
Subsystems (5)
cover uuid: enhancements and tests
The DPDK version of uuid was missing tests and a way to generate uuid's. Add both.
Stephen Hemminger (2):
eal: add functions to generate uuid values
test: add functional test for uuid
app/test/meson.build | 1 + app/test/test_uuid.c | 135 +++++++++++++++++++++++++++++++ lib/eal/common/eal_common_uuid.c | 56 +++++++++++++ lib/eal/include/rte_uuid.h | 22 ++++- lib/eal/version.map | 2 + 5 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 app/test/test_uuid.c
Signature · 1 line
2.43.0
PATCH 1/2 eal: add functions to generate uuid values
Useful to be able to generate uuid values for tests or for interaction with other subsystems as magic cookie. Naming and overall algorithm come from libuuid which is used by permission of original author.
--- lib/eal/common/eal_common_uuid.c | 56 ++++++++++++++++++++++++++++++++ lib/eal/include/rte_uuid.h | 22 ++++++++++++- lib/eal/version.map | 2 ++ 3 files changed, 79 insertions(+), 1 deletion(-)
lib/eal/common/eal_common_uuid.c +56 -0
@@ -7,7 +7,12 @@#include <stdint.h> #include <stdlib.h> #include <ctype.h> +#include <time.h> +#include <rte_atomic.h> +#include <rte_common.h> +#include <rte_random.h> +#include <rte_time.h> #include <rte_uuid.h> /* UUID packed form */
@@ -165,3 +170,54 @@ void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) uuid.node[0 ], uuid.node[1 ], uuid.node[2 ], uuid.node[3], uuid.node[4], uuid.node[5]); } + +void rte_uuid_generate_random (rte_uuid_t out) +{ +union { +uint64_t words[2 ]; +rte_uuid_t uuid; + } buf; +struct uuid uu; + +/* UUID is 128 bit */ + buf.words[0 ] =rte_rand (); + buf.words[1 ] =rte_rand (); + +/* Mark these random bytes a version 4 random uuid */ +uuid_unpack (buf.uuid, &uu); + uu.clock_seq = (uu.clock_seq &0x3FFF ) |0x8000 ; + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; +uuid_pack (&uu, out); +} + +void rte_uuid_generate_time (rte_uuid_t out) +{ +struct uuid uu; +struct timespec ts; +uint64_t ns, rnd; +static uint16_t sequence; + +/* The time value for UUID is 100ns since 15 October 1582 */ +clock_gettime (CLOCK_REALTIME , &ts); + + ns = ts.tv_nsec /100 ; + ns += (uint64_t ) ts.tv_sec * (NSEC_PER_SEC /100 ); + ns += (((uint64_t )0x01B21DD2 ) <<32 ) +0x13814000 ; + + uu.time_low = (uint32_t ) ns; + uu.time_mid = (uint16_t ) (ns >>32 ); + uu.time_hi_and_version = (uint16_t ) (ns >>48 ); + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; + uu.clock_seq =rte_atomic_fetch_add_explicit (&sequence,1 , + rte_memory_order_relaxed); + + rnd =rte_rand (); +memcpy (uu.node, &rnd,6 ); +/* +* What libuuid does set multicast bit. +* This avoids conflicts with network cards. +*/ + uu.node[0 ] |=0x1 ; + +uuid_pack (&uu, out); +}
lib/eal/include/rte_uuid.h +21 -1
@@ -18,6 +18,8 @@ extern "C" {#include <stddef.h> #include <string.h> +#include <rte_compat.h> +/** * Struct describing a Universal Unique Identifier */
@@ -94,12 +96,30 @@ int rte_uuid_parse(const char *in, rte_uuid_t uu);* @param uu * UUID to format * @param out -* Resulting string buffer +* Resulting string bufferm * @param len * Sizeof the available string buffer */ void rte_uuid_unparse (const rte_uuid_t uu,char *out,size_t len); +/** +* Generate a random uuid +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_random(rte_uuid_t uu); + +/** +* Generate a uuid based on time stamp. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_time(rte_uuid_t uu); + #ifdef __cplusplus }#endif
lib/eal/version.map +2 -0
@@ -396,6 +396,8 @@ EXPERIMENTAL { # added in 24.03 rte_vfio_get_device_info; # WINDOWS_NO_EXPORT + rte_uuid_generate_random; + rte_uuid_generate_time; }; INTERNAL {
Signature · 1 line
2.43.0
Re: [PATCH 1/2] eal: add functions to generate uuid values
Quoted 17 lines · Stephen Hemminger
Useful to be able to generate uuid values for tests or for interaction with other subsystems as magic cookie. Naming and overall algorithm come from libuuid which is used by permission of original author.
Signed-off-by Stephen Hemminger <[email protected]>--- lib/eal/common/eal_common_uuid.c | 56 ++++++++++++++++++++++++++++++++ lib/eal/include/rte_uuid.h | 22 ++++++++++++- lib/eal/version.map | 2 ++ 3 files changed, 79 insertions(+), 1 deletion(-)lib/eal/common/eal_common_uuid.c +0
-0
lib/eal/common/eal_common_uuid.c line 12
Quoted 6 lines
lib/eal/common/eal_common_uuid.c +2
-0@@ -7,7 +7,12 @@#include <stdint.h> #include <stdlib.h> #include <ctype.h> +#include <time.h> +#include <rte_atomic.h>
i guess this should be rte_stdatomic.h
Quoted 26 lines
lib/eal/common/eal_common_uuid.c +19
-0+#include <rte_common.h> +#include <rte_random.h> +#include <rte_time.h> #include <rte_uuid.h> /* UUID packed form */ @@ -165,3 +170,54 @@ void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) uuid.node[0 ], uuid.node[1 ], uuid.node[2 ], uuid.node[3], uuid.node[4], uuid.node[5]); } + +void rte_uuid_generate_random (rte_uuid_t out) +{ +union { +uint64_t words[2 ]; +rte_uuid_t uuid; + } buf; +struct uuid uu; + +/* UUID is 128 bit */ + buf.words[0 ] =rte_rand (); + buf.words[1 ] =rte_rand (); + +/* Mark these random bytes a version 4 random uuid */ +uuid_unpack (buf.uuid, &uu); + uu.clock_seq = (uu.clock_seq &0x3FFF ) |0x8000 ;
lib/eal/common/eal_common_uuid.c void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) · line 198
Quoted 10 lines
lib/eal/common/eal_common_uuid.c +10
-0+ uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; +uuid_pack (&uu, out); +} + +void rte_uuid_generate_time (rte_uuid_t out) +{ +struct uuid uu; +struct timespec ts; +uint64_t ns, rnd; +static uint16_t sequence;
sequence will need to be RTE_ATOMIC(uint16_t) if you build with clang and you -Denable_stdatomic=true clang enforces the use of atomic types and build would have failed at the rte_atomic_fetch_add_explicit below.
the CI probably already told you this.
Quoted 39 lines
lib/eal/common/eal_common_uuid.c +25
-0+ +/* The time value for UUID is 100ns since 15 October 1582 */ +clock_gettime (CLOCK_REALTIME , &ts); + + ns = ts.tv_nsec /100 ; + ns += (uint64_t ) ts.tv_sec * (NSEC_PER_SEC /100 ); + ns += (((uint64_t )0x01B21DD2 ) <<32 ) +0x13814000 ; + + uu.time_low = (uint32_t ) ns; + uu.time_mid = (uint16_t ) (ns >>32 ); + uu.time_hi_and_version = (uint16_t ) (ns >>48 ); + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; + uu.clock_seq =rte_atomic_fetch_add_explicit (&sequence,1 , + rte_memory_order_relaxed); + + rnd =rte_rand (); +memcpy (uu.node, &rnd,6 ); +/* +* What libuuid does set multicast bit. +* This avoids conflicts with network cards. +*/ + uu.node[0 ] |=0x1 ; + +uuid_pack (&uu, out); +}lib/eal/include/rte_uuid.h +2
-0@@ -18,6 +18,8 @@ extern "C" {#include <stddef.h> #include <string.h> +#include <rte_compat.h> +/** * Struct describing a Universal Unique Identifier */
lib/eal/include/rte_uuid.h int rte_uuid_parse(const char *in, rte_uuid_t uu); · line 99
Quoted 5 lines
lib/eal/include/rte_uuid.h +1
-1@@ -94,12 +96,30 @@ int rte_uuid_parse(const char *in, rte_uuid_t uu);* @param uu * UUID to format * @param out -* Resulting string buffer +* Resulting string bufferm
buffer -> bufferm intentional?
Quoted 31 lines
lib/eal/include/rte_uuid.h +18
-0* @param len * Sizeof the available string buffer */ void rte_uuid_unparse (const rte_uuid_t uu,char *out,size_t len); +/** +* Generate a random uuid +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_random(rte_uuid_t uu); + +/** +* Generate a uuid based on time stamp. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_time(rte_uuid_t uu); + #ifdef __cplusplus }#endif lib/eal/version.map +0
-0
lib/eal/version.map EXPERIMENTAL { · line 397
Quoted 2 lines
lib/eal/version.map +0
-0@@ -396,6 +396,8 @@ EXPERIMENTAL { # added in 24.03
i guess 24.07 now
Quoted 8 lines
lib/eal/version.map +2
-0rte_vfio_get_device_info; # WINDOWS_NO_EXPORT + rte_uuid_generate_random; + rte_uuid_generate_time; }; INTERNAL {Signature · 1 line
2.43.0
PATCH 2/2 test: add functional test for uuid
In reply to Stephen HemmingerThe uuid functions in EAL were not covered by any current functional tests.
--- app/test/meson.build | 1 + app/test/test_uuid.c | 135 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 app/test/test_uuid.c
app/test/meson.build +1 -0
@@ -198,6 +198,7 @@ source_file_deps = { 'test_trace.c': [], 'test_trace_perf.c': [], 'test_trace_register.c': [], + 'test_uuid.c' : [], 'test_vdev.c': ['kvargs', 'bus_vdev'], 'test_version.c': [], }
app/test/test_uuid.c new file +135 -0
135 lines not on this page · raw message
Signature · 1 line
2.43.0
v2 cover uuid: add generate functions and tests
In reply to Stephen HemmingerThe DPDK version of uuid was missing tests and a way to generate uuid's. Add both.
v2 - use RTE_ATOMIC to get _Atomic in clang
Stephen Hemminger (2):
eal: add functions to generate uuid values
test: add functional test for uuid
app/test/meson.build | 1 + app/test/test_uuid.c | 135 +++++++++++++++++++++++++++++++ lib/eal/common/eal_common_uuid.c | 56 +++++++++++++ lib/eal/include/rte_uuid.h | 22 ++++- lib/eal/version.map | 2 + 5 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 app/test/test_uuid.c
Signature · 1 line
2.43.0
PATCH v2 1/2 eal: add functions to generate uuid values
Useful to be able to generate uuid values for tests or for interaction with other subsystems as magic cookie. Naming and overall algorithm come from libuuid which is used by permission of original author.
--- lib/eal/common/eal_common_uuid.c | 56 ++++++++++++++++++++++++++++++++ lib/eal/include/rte_uuid.h | 22 ++++++++++++- lib/eal/version.map | 2 ++ 3 files changed, 79 insertions(+), 1 deletion(-)
lib/eal/common/eal_common_uuid.c +56 -0
@@ -7,7 +7,12 @@#include <stdint.h> #include <stdlib.h> #include <ctype.h> +#include <time.h> +#include <rte_atomic.h> +#include <rte_common.h> +#include <rte_random.h> +#include <rte_time.h> #include <rte_uuid.h> /* UUID packed form */
@@ -165,3 +170,54 @@ void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) uuid.node[0 ], uuid.node[1 ], uuid.node[2 ], uuid.node[3], uuid.node[4], uuid.node[5]); } + +void rte_uuid_generate_random (rte_uuid_t out) +{ +union { +uint64_t words[2 ]; +rte_uuid_t uuid; + } buf; +struct uuid uu; + +/* UUID is 128 bit */ + buf.words[0 ] =rte_rand (); + buf.words[1 ] =rte_rand (); + +/* Mark these random bytes a version 4 random uuid */ +uuid_unpack (buf.uuid, &uu); + uu.clock_seq = (uu.clock_seq &0x3FFF ) |0x8000 ; + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; +uuid_pack (&uu, out); +} + +void rte_uuid_generate_time (rte_uuid_t out) +{ +struct uuid uu; +struct timespec ts; +uint64_t ns, rnd; +static uint16_t sequence; + +/* The time value for UUID is 100ns since 15 October 1582 */ +clock_gettime (CLOCK_REALTIME , &ts); + + ns = ts.tv_nsec /100 ; + ns += (uint64_t ) ts.tv_sec * (NSEC_PER_SEC /100 ); + ns += (((uint64_t )0x01B21DD2 ) <<32 ) +0x13814000 ; + + uu.time_low = (uint32_t ) ns; + uu.time_mid = (uint16_t ) (ns >>32 ); + uu.time_hi_and_version = (uint16_t ) (ns >>48 ); + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; + uu.clock_seq =rte_atomic_fetch_add_explicit (&sequence,1 , + rte_memory_order_relaxed); + + rnd =rte_rand (); +memcpy (uu.node, &rnd,6 ); +/* +* What libuuid does set multicast bit. +* This avoids conflicts with network cards. +*/ + uu.node[0 ] |=0x1 ; + +uuid_pack (&uu, out); +}
lib/eal/include/rte_uuid.h +21 -1
@@ -18,6 +18,8 @@ extern "C" {#include <stddef.h> #include <string.h> +#include <rte_compat.h> +/** * Struct describing a Universal Unique Identifier */
@@ -94,12 +96,30 @@ int rte_uuid_parse(const char *in, rte_uuid_t uu);* @param uu * UUID to format * @param out -* Resulting string buffer +* Resulting string bufferm * @param len * Sizeof the available string buffer */ void rte_uuid_unparse (const rte_uuid_t uu,char *out,size_t len); +/** +* Generate a random uuid +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_random(rte_uuid_t uu); + +/** +* Generate a uuid based on time stamp. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_time(rte_uuid_t uu); + #ifdef __cplusplus }#endif
lib/eal/version.map +2 -0
@@ -396,6 +396,8 @@ EXPERIMENTAL { # added in 24.03 rte_vfio_get_device_info; # WINDOWS_NO_EXPORT + rte_uuid_generate_random; + rte_uuid_generate_time; }; INTERNAL {
Signature · 1 line
2.43.0
Re: [PATCH v2 1/2] eal: add functions to generate uuid values
Quoted 17 lines · Stephen Hemminger
Useful to be able to generate uuid values for tests or for interaction with other subsystems as magic cookie. Naming and overall algorithm come from libuuid which is used by permission of original author.
Signed-off-by Stephen Hemminger <[email protected]>--- lib/eal/common/eal_common_uuid.c | 56 ++++++++++++++++++++++++++++++++ lib/eal/include/rte_uuid.h | 22 ++++++++++++- lib/eal/version.map | 2 ++ 3 files changed, 79 insertions(+), 1 deletion(-)lib/eal/common/eal_common_uuid.c +0
-0
lib/eal/common/eal_common_uuid.c line 12
Quoted 6 lines
lib/eal/common/eal_common_uuid.c +2
-0@@ -7,7 +7,12 @@#include <stdint.h> #include <stdlib.h> #include <ctype.h> +#include <time.h> +#include <rte_atomic.h>
should be rte_stdatomic.h
Quoted 26 lines
lib/eal/common/eal_common_uuid.c +19
-0+#include <rte_common.h> +#include <rte_random.h> +#include <rte_time.h> #include <rte_uuid.h> /* UUID packed form */ @@ -165,3 +170,54 @@ void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) uuid.node[0 ], uuid.node[1 ], uuid.node[2 ], uuid.node[3], uuid.node[4], uuid.node[5]); } + +void rte_uuid_generate_random (rte_uuid_t out) +{ +union { +uint64_t words[2 ]; +rte_uuid_t uuid; + } buf; +struct uuid uu; + +/* UUID is 128 bit */ + buf.words[0 ] =rte_rand (); + buf.words[1 ] =rte_rand (); + +/* Mark these random bytes a version 4 random uuid */ +uuid_unpack (buf.uuid, &uu); + uu.clock_seq = (uu.clock_seq &0x3FFF ) |0x8000 ;
lib/eal/common/eal_common_uuid.c void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) · line 198
Quoted 10 lines
lib/eal/common/eal_common_uuid.c +10
-0+ uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; +uuid_pack (&uu, out); +} + +void rte_uuid_generate_time (rte_uuid_t out) +{ +struct uuid uu; +struct timespec ts; +uint64_t ns, rnd; +static uint16_t sequence;
should be ``static RTE_ATOMIC(uint16_t) sequence;``
Quoted 39 lines
lib/eal/common/eal_common_uuid.c +25
-0+ +/* The time value for UUID is 100ns since 15 October 1582 */ +clock_gettime (CLOCK_REALTIME , &ts); + + ns = ts.tv_nsec /100 ; + ns += (uint64_t ) ts.tv_sec * (NSEC_PER_SEC /100 ); + ns += (((uint64_t )0x01B21DD2 ) <<32 ) +0x13814000 ; + + uu.time_low = (uint32_t ) ns; + uu.time_mid = (uint16_t ) (ns >>32 ); + uu.time_hi_and_version = (uint16_t ) (ns >>48 ); + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; + uu.clock_seq =rte_atomic_fetch_add_explicit (&sequence,1 , + rte_memory_order_relaxed); + + rnd =rte_rand (); +memcpy (uu.node, &rnd,6 ); +/* +* What libuuid does set multicast bit. +* This avoids conflicts with network cards. +*/ + uu.node[0 ] |=0x1 ; + +uuid_pack (&uu, out); +}lib/eal/include/rte_uuid.h +2
-0@@ -18,6 +18,8 @@ extern "C" {#include <stddef.h> #include <string.h> +#include <rte_compat.h> +/** * Struct describing a Universal Unique Identifier */
lib/eal/include/rte_uuid.h int rte_uuid_parse(const char *in, rte_uuid_t uu); · line 99
Quoted 5 lines
lib/eal/include/rte_uuid.h +1
-1@@ -94,12 +96,30 @@ int rte_uuid_parse(const char *in, rte_uuid_t uu);* @param uu * UUID to format * @param out -* Resulting string buffer +* Resulting string bufferm
intentional change buffer -> bufferm?
Quoted 31 lines
lib/eal/include/rte_uuid.h +18
-0* @param len * Sizeof the available string buffer */ void rte_uuid_unparse (const rte_uuid_t uu,char *out,size_t len); +/** +* Generate a random uuid +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_random(rte_uuid_t uu); + +/** +* Generate a uuid based on time stamp. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_time(rte_uuid_t uu); + #ifdef __cplusplus }#endif lib/eal/version.map +0
-0
lib/eal/version.map EXPERIMENTAL { · line 398
Quoted 3 lines
lib/eal/version.map +0
-0@@ -396,6 +396,8 @@ EXPERIMENTAL { # added in 24.03 rte_vfio_get_device_info; # WINDOWS_NO_EXPORT
# added in 24.07
lib/eal/version.map EXPERIMENTAL { · line 403
Quoted 6 lines
lib/eal/version.map +2
-0+ rte_uuid_generate_random; + rte_uuid_generate_time; }; INTERNAL {
i actually didn't see the RTE_ATOMIC get added in v2 as per cover letter, so i'm thinking maybe the v1 series was re-submitted as v2?
Quoted 1 line
2.43.0
PATCH v2 2/2 test: add functional test for uuid
In reply to Stephen HemmingerThe uuid functions in EAL were not covered by existing functional tests.
--- app/test/meson.build | 1 + app/test/test_uuid.c | 135 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 app/test/test_uuid.c
app/test/meson.build +1 -0
@@ -198,6 +198,7 @@ source_file_deps = { 'test_trace.c': [], 'test_trace_perf.c': [], 'test_trace_register.c': [], + 'test_uuid.c' : [], 'test_vdev.c': ['kvargs', 'bus_vdev'], 'test_version.c': [], }
app/test/test_uuid.c new file +135 -0
135 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH v2 2/2] test: add functional test for uuid
Quoted 5 lines · Stephen Hemminger
The uuid functions in EAL were not covered by existing functional tests.
Signed-off-by Stephen Hemminger <[email protected]>---
v3 cover uuid: add generate functions and tests
In reply to Stephen HemmingerWhile looking at using uuid's in some logging cases, discovered that the existing uuid support in EAL was missing some functions add in later versions of libuuid.
Add functions to generate Uuid values, and add missing functional tests for uuid's.
Stephen Hemminger (2):
eal: add functions to generate uuid values
test: add functional test for uuid
app/test/meson.build | 1 + app/test/test_uuid.c | 138 +++++++++++++++++++++++++++++++ lib/eal/common/eal_common_uuid.c | 56 +++++++++++++ lib/eal/include/rte_uuid.h | 28 ++++++- lib/eal/version.map | 2 + 5 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 app/test/test_uuid.c
Signature · 1 line
2.43.0
PATCH v3 1/2 eal: add functions to generate uuid values
Useful to be able to generate uuid values for tests or for interaction with other subsystems as magic cookie. Naming and overall algorithm come from libuuid which is used by permission of original author.
--- lib/eal/common/eal_common_uuid.c | 56 ++++++++++++++++++++++++++++++++ lib/eal/include/rte_uuid.h | 28 +++++++++++++++- lib/eal/version.map | 2 ++ 3 files changed, 85 insertions(+), 1 deletion(-)
lib/eal/common/eal_common_uuid.c +56 -0
@@ -3,12 +3,18 @@*/ #include <stdio.h> +#include <stdbool.h> #include <string.h> #include <stdint.h> #include <stdlib.h> #include <ctype.h> +#include <time.h> +#include <rte_stdatomic.h> +#include <rte_random.h> +#include <rte_time.h> #include <rte_uuid.h> +#include <rte_os_shim.h> /* UUID packed form */ struct uuid {
@@ -165,3 +171,53 @@ void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) uuid.node[0 ], uuid.node[1 ], uuid.node[2 ], uuid.node[3], uuid.node[4], uuid.node[5]); } + +void rte_uuid_generate_random (rte_uuid_t out) +{ +union { +uint64_t words[2 ]; +rte_uuid_t uuid; + } buf; +struct uuid uu; + +/* UUID is 128 bit */ + buf.words[0 ] =rte_rand (); + buf.words[1 ] =rte_rand (); + +/* Mark these random bytes a version 4 random uuid */ +uuid_unpack (buf.uuid, &uu); + uu.clock_seq = (uu.clock_seq &0x3FFF ) |0x8000 ; + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; +uuid_pack (&uu, out); +} + +void rte_uuid_generate_time (rte_uuid_t out) +{ +struct uuid uu; +struct timespec ts; +uint64_t ns, rnd; +static RTE_ATOMIC (uint16_t ) sequence; + +/* The time value for UUID is 100ns since 15 October 1582 */ +clock_gettime (CLOCK_REALTIME , &ts); + + ns = ts.tv_nsec /100 ; + ns += (uint64_t ) ts.tv_sec * (NSEC_PER_SEC /100 ); + ns += (((uint64_t )0x01B21DD2 ) <<32 ) +0x13814000 ; + + uu.time_low = (uint32_t ) ns; + uu.time_mid = (uint16_t ) (ns >>32 ); + uu.time_hi_and_version = (uint16_t ) (ns >>48 ); + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; + uu.clock_seq =rte_atomic_fetch_add_explicit (&sequence,1 , rte_memory_order_relaxed); + + rnd =rte_rand (); +memcpy (uu.node, &rnd,6 ); +/* +* Follow the convention so that random node part will not +* not match a valid MAC address, +*/ + uu.node[0 ] |=0x1 ; + +uuid_pack (&uu, out); +}
lib/eal/include/rte_uuid.h +27 -1
@@ -18,6 +18,8 @@ extern "C" {#include <stddef.h> #include <string.h> +#include <rte_compat.h> +/** * Struct describing a Universal Unique Identifier */
@@ -94,12 +96,36 @@ int rte_uuid_parse(const char *in, rte_uuid_t uu);* @param uu * UUID to format * @param out -* Resulting string buffer +* Resulting string bufferm * @param len * Sizeof the available string buffer */ void rte_uuid_unparse (const rte_uuid_t uu,char *out,size_t len); +/** +* Generate a random uuid +* +* Uses high quality pseudo-random generator rte_rand() to generate a universal +* unique identifier. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_random(rte_uuid_t uu); + +/** +* Generate a uuid based on time stamp. +* +* Uses the current time and a random Ethernet MAC address to generate a +* universal unique identifier. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_time(rte_uuid_t uu); + #ifdef __cplusplus }#endif
lib/eal/version.map +2 -0
@@ -396,6 +396,8 @@ EXPERIMENTAL { # added in 24.03 rte_vfio_get_device_info; # WINDOWS_NO_EXPORT + rte_uuid_generate_random; + rte_uuid_generate_time; }; INTERNAL {
Signature · 1 line
2.43.0
PATCH v3 2/2 test: add functional test for uuid
In reply to Stephen HemmingerThe uuid functions in EAL were not covered by existing functional tests.
--- app/test/meson.build | 1 + app/test/test_uuid.c | 138 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 app/test/test_uuid.c
app/test/meson.build +1 -0
@@ -198,6 +198,7 @@ source_file_deps = { 'test_trace.c': [], 'test_trace_perf.c': [], 'test_trace_register.c': [], + 'test_uuid.c' : [], 'test_vdev.c': ['kvargs', 'bus_vdev'], 'test_version.c': [], }
app/test/test_uuid.c new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
2.43.0
v4 cover replace use of rte_memcpy with fixed sizes
In reply to Stephen HemmingerThe DPDK has a lot of unnecessary usage of rte_memcpy. This patch set replaces cases where rte_memcpy is used with a fixed size constant size.
Typical example is:
rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN); which can be replaced with: memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
This does not change the resulting binary on almost all architectures because x86 version of intrisics and glibc are the same, and other architectures were using __builtin_constant_p().
The main benefit is that analysis tools like fortify, Coverity, and ASAN analyzers can check these memcpy's.
The first patch is a simple coccinelle script to do the replacement and the rest are the results broken out by module. The script can be used again to make sure more bad usage doesn't creep in with new drivers.
v4 - replace other unnecessary rte_memcpy in ethdev.
replace memcpy with structure assignment where possible. fixup formatting in a couple places.
v3 - rebase and rerun coccinelle script on 24.03
- consolidate patches by subtree
- remove inclusion of rte_memcpy.h when no longer used.
Stephen Hemminger (30):
cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
eal: replace use of fixed size rte_memcpy
ethdev: replace uses of rte_memcpy
eventdev: replace use of fixed size rte_memcpy
cryptodev: replace use of fixed size rte_memcpy
ip_frag: replace use of fixed size rte_memcpy
net: replace use of fixed size rte_memcpy
lpm: replace use of fixed size rte_memcpy
node: replace use of fixed size rte_memcpy
pdcp: replace use of fixed size rte_memcpy
pipeline: replace use of fixed size rte_memcpy
rib: replace use of fixed size rte_memcpy
security: replace use of fixed size rte_memcpy
bus: remove unneeded rte_memcpy.h include
net: replace use of fixed size rte_memcpy
raw: replace use of fixed size rte_memcpy baseband: replace use of fixed size rte_memcpy common: replace use of fixed size rte_memcpy crypto: replace use of fixed size rte_memcpy crypto: replace use of fixed size rte_memcpy event: replace use of fixed size rte_memcpy mempool: replace use of fixed size rte_memcpy ml/cnxk: replace use of fixed size rte_memcpy app/test-pmd: replace use of fixed size rte_memcpy app/graph: replace use of fixed size rte_memcpy app/test-eventdev: replace use of fixed size rte_memcpy app/test: replace use of fixed size rte_memcpy app/test-pipeline: remove unused rte_memcpy.h include app/test-bbdev: remove unnecessary include of rte_memcpy.h examples: replace use of fixed size rte_memcpy
app/graph/neigh.c | 8 +- app/test-bbdev/test_bbdev.c | 1 - app/test-eventdev/test_pipeline_common.c | 19 ++- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - app/test-pmd/cmdline.c | 48 ++++---- app/test-pmd/cmdline_flow.c | 24 ++-- app/test-pmd/config.c | 8 +- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - app/test/commands.c | 1 - app/test/packet_burst_generator.c | 4 +- app/test/test_crc.c | 5 +- app/test/test_cryptodev.c | 18 ++- app/test/test_cryptodev_asym.c | 1 - app/test/test_cryptodev_security_pdcp.c | 1 - app/test/test_efd.c | 1 - app/test/test_efd_perf.c | 1 - app/test/test_event_crypto_adapter.c | 12 +- app/test/test_event_dma_adapter.c | 4 +- app/test/test_eventdev.c | 1 - app/test/test_ipsec.c | 6 +- app/test/test_link_bonding_mode4.c | 8 +- app/test/test_mbuf.c | 1 - app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - app/test/test_rawdev.c | 1 - app/test/test_security_inline_proto.c | 36 +++--- app/test/test_service_cores.c | 1 - app/test/virtual_pmd.c | 3 +- devtools/cocci/rte_memcpy.cocci | 11 ++ drivers/baseband/acc/rte_acc100_pmd.c | 16 ++- drivers/baseband/acc/rte_vrb_pmd.c | 21 ++-- drivers/baseband/la12xx/bbdev_la12xx.c | 4 +- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/common/idpf/idpf_common_device.c | 4 +- drivers/common/idpf/idpf_common_virtchnl.c | 10 +- drivers/common/qat/qat_qp.c | 10 +- drivers/compress/qat/qat_comp.c | 8 +- drivers/crypto/ccp/ccp_crypto.c | 14 +-- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +- drivers/crypto/qat/qat_sym_session.c | 52 ++++----- .../scheduler/rte_cryptodev_scheduler.c | 6 +- drivers/crypto/scheduler/scheduler_failover.c | 12 +- drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 - drivers/event/cnxk/cnxk_tim_evdev.c | 4 +- drivers/event/dlb2/dlb2.c | 4 +- drivers/event/dpaa/dpaa_eventdev.c | 1 - drivers/event/dpaa2/dpaa2_eventdev.c | 7 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 - drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 - drivers/event/octeontx/ssovf_evdev_selftest.c | 1 - drivers/event/octeontx/timvf_evdev.c | 4 +- drivers/mempool/dpaa/dpaa_mempool.c | 4 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 +- drivers/ml/cnxk/cn10k_ml_model.c | 8 +- drivers/ml/cnxk/cn10k_ml_ops.c | 11 +- drivers/ml/cnxk/cnxk_ml_ops.c | 2 +- drivers/ml/cnxk/mvtvm_ml_model.c | 8 +- drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/avp/avp_ethdev.c | 4 +- drivers/net/axgbe/axgbe_ethdev.c | 4 +- drivers/net/bnx2x/bnx2x.c | 32 +++-- drivers/net/bnxt/bnxt_flow.c | 34 +++--- drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +- drivers/net/bonding/rte_eth_bond_flow.c | 2 +- drivers/net/cnxk/cnxk_eswitch_devargs.c | 3 +- drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +- drivers/net/cnxk/cnxk_rep.c | 3 +- drivers/net/cnxk/cnxk_rep_flow.c | 6 +- drivers/net/cnxk/cnxk_rep_msg.c | 8 +- drivers/net/cnxk/cnxk_rep_ops.c | 2 +- drivers/net/cnxk/cnxk_tm.c | 5 +- drivers/net/cpfl/cpfl_ethdev.c | 3 +- drivers/net/cpfl/cpfl_vchnl.c | 4 +- drivers/net/cxgbe/clip_tbl.c | 2 +- drivers/net/cxgbe/cxgbe_filter.c | 8 +- drivers/net/cxgbe/l2t.c | 4 +- drivers/net/cxgbe/smt.c | 20 ++-- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 - drivers/net/dpaa2/dpaa2_ethdev.c | 1 - drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_rxtx.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 1 - drivers/net/dpaa2/dpaa2_tm.c | 2 +- drivers/net/e1000/em_rxtx.c | 1 - drivers/net/e1000/igb_flow.c | 22 ++-- drivers/net/e1000/igb_pf.c | 7 +- drivers/net/e1000/igb_rxtx.c | 1 - drivers/net/enic/enic_main.c | 8 +- drivers/net/failsafe/failsafe_ops.c | 6 +- drivers/net/gve/base/gve_adminq.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 1 - drivers/net/hinic/hinic_pmd_flow.c | 40 +++---- drivers/net/hns3/hns3_fdir.c | 2 +- drivers/net/hns3/hns3_flow.c | 4 +- drivers/net/i40e/i40e_ethdev.c | 109 ++++++++---------- drivers/net/i40e/i40e_fdir.c | 28 +++-- drivers/net/i40e/i40e_flow.c | 56 +++++---- drivers/net/i40e/i40e_pf.c | 3 +- drivers/net/i40e/i40e_tm.c | 11 +- drivers/net/i40e/rte_pmd_i40e.c | 34 +++--- drivers/net/iavf/iavf_fdir.c | 93 +++++++-------- drivers/net/iavf/iavf_fsub.c | 50 ++++---- drivers/net/iavf/iavf_generic_flow.c | 2 +- drivers/net/iavf/iavf_tm.c | 11 +- drivers/net/iavf/iavf_vchnl.c | 9 +- drivers/net/ice/ice_dcf.c | 5 +- drivers/net/ice/ice_dcf_parent.c | 2 +- drivers/net/ice/ice_dcf_sched.c | 11 +- drivers/net/ice/ice_diagnose.c | 4 +- drivers/net/ice/ice_ethdev.c | 14 +-- drivers/net/ice/ice_fdir_filter.c | 37 +++--- drivers/net/ice/ice_generic_flow.c | 2 +- drivers/net/ice/ice_hash.c | 2 +- drivers/net/ice/ice_tm.c | 11 +- drivers/net/idpf/idpf_ethdev.c | 7 +- drivers/net/idpf/idpf_rxtx.c | 10 +- drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++-- drivers/net/ipn3ke/ipn3ke_representor.c | 16 +-- drivers/net/ipn3ke/ipn3ke_tm.c | 6 +- drivers/net/ixgbe/ixgbe_ethdev.c | 9 +- drivers/net/ixgbe/ixgbe_fdir.c | 7 +- drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------ drivers/net/ixgbe/ixgbe_ipsec.c | 8 +- drivers/net/ixgbe/ixgbe_pf.c | 5 +- drivers/net/ixgbe/ixgbe_tm.c | 11 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +- drivers/net/memif/memif_socket.c | 4 +- drivers/net/mlx5/mlx5_devx.c | 4 +- drivers/net/mlx5/mlx5_flow.c | 38 +++--- drivers/net/mlx5/mlx5_flow_aso.c | 6 +- drivers/net/mlx5/mlx5_flow_hw.c | 27 ++--- drivers/net/mlx5/mlx5_rx.c | 6 +- drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +- drivers/net/mvpp2/mrvl_tm.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 1 - drivers/net/nfp/flower/nfp_conntrack.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 16 +-- .../net/nfp/flower/nfp_flower_representor.c | 2 +- drivers/net/nfp/nfp_mtr.c | 10 +- drivers/net/ngbe/ngbe_pf.c | 4 +- drivers/net/null/rte_eth_null.c | 6 +- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pcap/pcap_osdep_freebsd.c | 3 +- drivers/net/pcap/pcap_osdep_linux.c | 3 +- drivers/net/qede/qede_main.c | 2 +- drivers/net/ring/rte_eth_ring.c | 1 - drivers/net/sfc/sfc.c | 2 +- drivers/net/sfc/sfc_ef10_tx.c | 2 +- drivers/net/sfc/sfc_ethdev.c | 11 +- drivers/net/sfc/sfc_flow.c | 20 ++-- drivers/net/sfc/sfc_flow_rss.c | 2 +- drivers/net/sfc/sfc_mae.c | 2 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/sfc/sfc_tso.c | 2 +- drivers/net/sfc/sfc_tso.h | 9 +- drivers/net/tap/rte_eth_tap.c | 14 +-- drivers/net/txgbe/txgbe_ethdev.c | 9 +- drivers/net/txgbe/txgbe_fdir.c | 6 +- drivers/net/txgbe/txgbe_flow.c | 65 +++++------ drivers/net/txgbe/txgbe_ipsec.c | 8 +- drivers/net/txgbe/txgbe_pf.c | 5 +- drivers/net/txgbe/txgbe_tm.c | 11 +- drivers/net/vhost/rte_eth_vhost.c | 1 - drivers/net/virtio/virtio_ethdev.c | 1 - drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +- drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +- drivers/raw/ifpga/afu_pmd_n3000.c | 8 +- drivers/raw/ifpga/ifpga_rawdev.c | 11 +- drivers/raw/skeleton/skeleton_rawdev.c | 8 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 1 - examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 1 - examples/ip_fragmentation/main.c | 1 - examples/ip_reassembly/main.c | 1 - examples/ipv4_multicast/main.c | 1 - examples/l2fwd-cat/cat.c | 4 +- examples/l2fwd-jobstats/main.c | 1 - examples/l2fwd-keepalive/main.c | 1 - examples/l2fwd-macsec/main.c | 1 - examples/l2fwd/main.c | 1 - examples/l3fwd-power/main.c | 1 - examples/l3fwd/main.c | 1 - examples/link_status_interrupt/main.c | 1 - .../client_server_mp/mp_server/init.c | 1 - .../client_server_mp/mp_server/main.c | 1 - examples/multi_process/symmetric_mp/main.c | 1 - examples/ptpclient/ptpclient.c | 11 +- examples/qos_sched/app_thread.c | 1 - examples/qos_sched/main.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/vhost/main.c | 6 +- examples/vmdq/main.c | 7 +- examples/vmdq_dcb/main.c | 15 +-- lib/cryptodev/rte_cryptodev.c | 2 +- lib/eal/common/eal_common_options.c | 7 +- lib/ethdev/rte_ethdev.c | 12 +- lib/ethdev/rte_flow.c | 101 ++++++++-------- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_dma_adapter.c | 4 +- lib/eventdev/rte_event_timer_adapter.c | 2 +- lib/fib/trie.c | 2 +- lib/ip_frag/rte_ipv6_fragmentation.c | 4 +- lib/ip_frag/rte_ipv6_reassembly.c | 6 +- lib/lpm/rte_lpm6.c | 3 +- lib/net/rte_ether.c | 2 +- lib/node/ip6_lookup.c | 8 +- lib/pdcp/pdcp_process.c | 36 +++--- lib/pipeline/rte_table_action.c | 8 +- lib/rib/rte_rib6.h | 5 +- lib/security/rte_security.c | 4 +- 232 files changed, 936 insertions(+), 1100 deletions(-) create mode 100644 devtools/cocci/rte_memcpy.cocci
Signature · 1 line
2.43.0
PATCH v4 1/30 cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
Rte_memcpy should not be used for the simple case of copying a fix size structure because it is slower and will hide problems from code analysis tools. Coverity, fortify and other analyzers special case memcpy().
Gcc (and Clang) are smart enough to inline copies which will be faster.
--- devtools/cocci/rte_memcpy.cocci | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 devtools/cocci/rte_memcpy.cocci
devtools/cocci/rte_memcpy.cocci new file +11 -0
@@ -0,0 +1,11 @@ +// +// rte_memcpy should not be used for simple fixed size structure +// because compiler's are smart enough to inline these. +// +@@ +expression src, dst; constant size; +@@ +( +- rte_memcpy(dst, src, size) ++ memcpy(dst, src, size) +)
Signature · 1 line
2.43.0
RE: [PATCH v4 01/30] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
Quoted 5 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Friday, 5 April 2024 18.53
Rte_memcpyshould not be used for the simple case of copying a fix size structure because it is slower and will hide problems
"it is slower"... not always true.
Perhaps: "it is not faster than memcpy".
Quoted 5 lines
from code analysis tools. Coverity, fortify and other analyzers special case
memcpy().Gcc (and Clang) are smart enough to inline copies which will be faster.
"faster" -> "just as fast".
Quoted 3 lines
Signed-off-by Stephen Hemminger <[email protected]>---
With the updated description,
For the series,
PATCH v4 2/30 eal: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/eal/common/eal_common_options.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
lib/eal/common/eal_common_options.c +3 -4
@@ -30,7 +30,6 @@#include <rte_tailq.h> #include <rte_version.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #ifndef RTE_EXEC_ENV_WINDOWS #include <rte_telemetry.h> #endif
@@ -1253,7 +1252,7 @@ eal_parse_lcores(const char *lcores)/* without '@', by default using lcore_set as cpuset */ if (*lcores !='@' ) -rte_memcpy (&cpuset, &lcore_set,sizeof (cpuset)); +memcpy (&cpuset, &lcore_set,sizeof (cpuset)); set_count =CPU_COUNT (&lcore_set);/* start to update lcore_set */
@@ -1275,8 +1274,8 @@ eal_parse_lcores(const char *lcores)if (check_cpuset (&cpuset) <0 ) goto err; -rte_memcpy (&lcore_config[idx].cpuset, &cpuset, -sizeof (rte_cpuset_t)); +memcpy (&lcore_config[idx].cpuset, &cpuset, +sizeof (rte_cpuset_t)); }/* some cores from the lcore_set can't be handled by EAL */
Signature · 1 line
2.43.0
PATCH v4 3/30 ethdev: replace uses of rte_memcpy
In reply to Stephen HemmingerReplace use of rte_memcpy in ethdev. Most of these were fixed size, and the others were not in the fast path. Where possible replace memcpy() with structure assignment which has same effect is type safe.
ethdev: struct assign
--- lib/ethdev/rte_ethdev.c | 12 ++--- lib/ethdev/rte_flow.c | 101 +++++++++++++++++++--------------------- 2 files changed, 53 insertions(+), 60 deletions(-)
lib/ethdev/rte_ethdev.c +5 -7
@@ -15,7 +15,6 @@#include <rte_log.h> #include <rte_interrupts.h> #include <rte_kvargs.h> -#include <rte_memcpy.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_malloc.h>
@@ -618,7 +617,7 @@ rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)rte_spinlock_lock (rte_mcfg_ethdev_get_lock ());if (eth_dev_shared_data_prepare () !=NULL ) { -rte_memcpy (owner, ðdev->data->owner,sizeof (*owner)); + *owner = ethdev->data->owner; ret =0 ; }else { ret = -ENOMEM ;
@@ -1316,15 +1315,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, dev->data->dev_configured =0 ;/* Store original config, as rollback required on failure */ -memcpy (&orig_conf, &dev->data->dev_conf,sizeof (dev->data->dev_conf)); + orig_conf = dev->data->dev_conf;/* * Copy the dev_conf parameter into the dev structure. * rte_eth_dev_info_get() requires dev_conf, copy it before dev_info get */ if (dev_conf != &dev->data->dev_conf) -memcpy (&dev->data->dev_conf, dev_conf, -sizeof (dev->data->dev_conf)); + dev->data->dev_conf = *dev_conf;/* Backup mtu for rollback */ old_mtu = dev->data->mtu;
@@ -1601,7 +1599,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,eth_dev_rx_queue_config (dev,0 );eth_dev_tx_queue_config (dev,0 ); rollback: -memcpy (&dev->data->dev_conf, &orig_conf,sizeof (dev->data->dev_conf)); + dev->data->dev_conf = orig_conf;if (old_mtu != dev->data->mtu) dev->data->mtu = old_mtu;
@@ -3843,7 +3841,7 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf)return -EINVAL ; } -memcpy (dev_conf, &dev->data->dev_conf,sizeof (struct rte_eth_conf )); + *dev_conf = dev->data->dev_conf;rte_ethdev_trace_conf_get (port_id, dev_conf);
lib/ethdev/rte_flow.c +48 -53
164 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v4 4/30 eventdev: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_dma_adapter.c | 4 ++-- lib/eventdev/rte_event_timer_adapter.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
lib/eventdev/rte_event_crypto_adapter.c +1 -1
@@ -655,7 +655,7 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,continue ; } -rte_memcpy (ev, &m_data->response_info,sizeof (*ev)); +memcpy (ev, &m_data->response_info,sizeof (*ev)); ev->event_ptr = ops[i]; ev->event_type =RTE_EVENT_TYPE_CRYPTODEV ;if (adapter->implicit_release_disabled)
lib/eventdev/rte_event_dma_adapter.c +2 -2
@@ -447,7 +447,7 @@ rte_event_dma_adapter_create(uint8_t id, uint8_t evdev_id, struct rte_event_portif (pc ==NULL )return -ENOMEM ; -rte_memcpy (pc, port_config,sizeof (struct rte_event_port_conf )); +memcpy (pc, port_config,sizeof (struct rte_event_port_conf )); ret =rte_event_dma_adapter_create_ext (id, evdev_id, edma_default_config_cb, mode, pc);if (ret !=0 )rte_free (pc);
@@ -668,7 +668,7 @@ edma_ops_enqueue_burst(struct event_dma_adapter *adapter, struct rte_event_dma_acontinue ; } -rte_memcpy (ev, response_info,sizeof (struct rte_event )); +memcpy (ev, response_info,sizeof (struct rte_event )); ev->event_ptr = ops[i]; ev->event_type =RTE_EVENT_TYPE_DMADEV ;if (adapter->implicit_release_disabled)
lib/eventdev/rte_event_timer_adapter.c +1 -1
@@ -549,7 +549,7 @@ event_buffer_add(struct event_buffer *bufp, struct rte_event *eventp)/* Instead of modulus, bitwise AND with mask to get head_idx. */ head_idx = bufp->head &EVENT_BUFFER_MASK ; buf_eventp = &bufp->events[head_idx]; -rte_memcpy (buf_eventp, eventp,sizeof (struct rte_event )); +memcpy (buf_eventp, eventp,sizeof (struct rte_event ));/* Wrap automatically when overflow occurs. */ bufp->head++;
Signature · 1 line
2.43.0
PATCH v4 5/30 cryptodev: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/cryptodev/rte_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/cryptodev/rte_cryptodev.c +1 -1
@@ -2854,7 +2854,7 @@ crypto_caps_array(struct rte_tel_data *d,while ((dev_caps = &capabilities[i++])->op !=RTE_CRYPTO_OP_TYPE_UNDEFINED ) {memset (&caps_val,0 ,CRYPTO_CAPS_SZ *sizeof (caps_val[0 ])); -rte_memcpy (caps_val, dev_caps,sizeof (capabilities[0 ])); +memcpy (caps_val, dev_caps,sizeof (capabilities[0 ]));for (j =0 ; j <CRYPTO_CAPS_SZ ; j++)rte_tel_data_add_array_uint (d, caps_val[j]); }
Signature · 1 line
2.43.0
RE: [EXTERNAL] [PATCH v4 05/30] cryptodev: replace use of fixed size rte_memcpy
Quoted 7 lines
Automatically generated by
devtools/cocci/rte_memcpy.cocciSigned-off-by Stephen Hemminger <[email protected]>--- lib/cryptodev/rte_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v4 6/30 ip_frag: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/ip_frag/rte_ipv6_fragmentation.c | 4 +--- lib/ip_frag/rte_ipv6_reassembly.c | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-)
lib/ip_frag/rte_ipv6_fragmentation.c +1 -3
@@ -5,8 +5,6 @@#include <stddef.h> #include <errno.h> -#include <rte_memcpy.h> -#include "ip_frag_common.h" /**
@@ -23,7 +21,7 @@ __fill_ipv6hdr_frag(struct rte_ipv6_hdr *dst, {struct rte_ipv6_fragment_ext *fh; -rte_memcpy (dst, src,sizeof (*dst)); +memcpy (dst, src,sizeof (*dst)); dst->payload_len =rte_cpu_to_be_16 (len); dst->proto =IPPROTO_FRAGMENT ;
lib/ip_frag/rte_ipv6_reassembly.c +2 -4
@@ -4,8 +4,6 @@#include <stddef.h> -#include <rte_memcpy.h> -#include "ip_frag_common.h" /**
@@ -143,8 +141,8 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,int32_t ip_len;int32_t trim; -rte_memcpy (&key.src_dst[0 ], ip_hdr->src_addr,16 ); -rte_memcpy (&key.src_dst[2 ], ip_hdr->dst_addr,16 ); +memcpy (&key.src_dst[0 ], ip_hdr->src_addr,16 ); +memcpy (&key.src_dst[2 ], ip_hdr->dst_addr,16 ); key.id = frag_hdr->id; key.key_len =IPV6_KEYLEN ;
Signature · 1 line
2.43.0
PATCH v4 7/30 net: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/net/rte_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/net/rte_ether.c +1 -1
@@ -13,7 +13,7 @@ rte_eth_random_addr(uint8_t *addr)uint64_t rand =rte_rand ();uint8_t *p = (uint8_t *)&rand; -rte_memcpy (addr, p,RTE_ETHER_ADDR_LEN ); +memcpy (addr, p,RTE_ETHER_ADDR_LEN ); addr[0 ] &= (uint8_t )~RTE_ETHER_GROUP_ADDR ;/* clear multicast bit */ addr[0 ] |=RTE_ETHER_LOCAL_ADMIN_ADDR ;/* set local assignment bit */ }
Signature · 1 line
2.43.0
PATCH v4 8/30 lpm: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/lpm/rte_lpm6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/lpm/rte_lpm6.c +1 -2
@@ -11,7 +11,6 @@#include <rte_log.h> #include <rte_common.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_eal_memconfig.h> #include <rte_string_fns.h> #include <rte_errno.h>
@@ -139,7 +138,7 @@ ip6_mask_addr(uint8_t *ip, uint8_t depth)static inline void ip6_copy_addr (uint8_t *dst,const uint8_t *src) { -rte_memcpy (dst, src,RTE_LPM6_IPV6_ADDR_SIZE ); +memcpy (dst, src,RTE_LPM6_IPV6_ADDR_SIZE ); }/*
Signature · 1 line
2.43.0
PATCH v4 9/30 node: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/node/ip6_lookup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/node/ip6_lookup.c +4 -4
@@ -112,28 +112,28 @@ ip6_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node *node, sizeof(struct rte_ether_hdr));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf0, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[0 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[0 ], ipv6_hdr->dst_addr,16 );/* Extract DIP of mbuf1 */ ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf1, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr ));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf1, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[1 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[1 ], ipv6_hdr->dst_addr,16 );/* Extract DIP of mbuf2 */ ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf2, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr ));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf2, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[2 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[2 ], ipv6_hdr->dst_addr,16 );/* Extract DIP of mbuf3 */ ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf3, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr ));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf3, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[3 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[3 ], ipv6_hdr->dst_addr,16 );rte_lpm6_lookup_bulk_func (lpm6, ip_batch, next_hop,4 );
Signature · 1 line
2.43.0
PATCH v4 10/30 pdcp: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/pdcp/pdcp_process.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
lib/pdcp/pdcp_process.c +18 -18
@@ -60,7 +60,7 @@ pdcp_iv_gen_null_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *e m = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (m_ptr, &m,8 ); +memcpy (m_ptr, &m,8 ); } static void
@@ -72,10 +72,10 @@ pdcp_iv_gen_null_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET); iv_u64[0 ] = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); iv_u64[1 ] = iv_u64[0 ] ^ en_priv->auth_iv_part.u64[1 ]; -rte_memcpy (iv +8 , &iv_u64[1 ],8 ); +memcpy (iv +8 , &iv_u64[1 ],8 ); } static void
@@ -89,7 +89,7 @@ pdcp_iv_gen_aes_ctr_null(struct rte_crypto_op *cop, const struct entity_priv *en iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); iv_u64[1 ] =0 ; -rte_memcpy (iv, iv_u64,16 ); +memcpy (iv, iv_u64,16 ); } static void
@@ -101,8 +101,8 @@ pdcp_iv_gen_zs_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET); iv_u64 = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64,8 ); -rte_memcpy (iv +8 , &iv_u64,8 ); +memcpy (iv, &iv_u64,8 ); +memcpy (iv +8 , &iv_u64,8 ); } static void
@@ -115,17 +115,17 @@ pdcp_iv_gen_zs_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv,/* Generating cipher IV */ iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); -rte_memcpy (iv +8 , &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv +8 , &iv_u64[0 ],8 ); iv +=PDCP_IV_LEN ;/* Generating auth IV */ iv_u64[0 ] = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); iv_u64[1 ] = iv_u64[0 ] ^ en_priv->auth_iv_part.u64[1 ]; -rte_memcpy (iv +8 , &iv_u64[1 ],8 ); +memcpy (iv +8 , &iv_u64[1 ],8 ); } static void
@@ -140,12 +140,12 @@ pdcp_iv_gen_zs_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_ iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET); iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); -rte_memcpy (iv +8 , &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv +8 , &iv_u64[0 ],8 ); m_ptr = (uint8_t *)rte_pktmbuf_prepend (mb,8 ); m = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (m_ptr, &m,8 ); +memcpy (m_ptr, &m,8 ); } static void
@@ -162,11 +162,11 @@ pdcp_iv_gen_aes_ctr_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); iv_u64[1 ] =0 ; -rte_memcpy (iv, iv_u64,PDCP_IV_LEN ); +memcpy (iv, iv_u64,PDCP_IV_LEN ); m_ptr = (uint8_t *)rte_pktmbuf_prepend (mb,8 ); m = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (m_ptr, &m,8 ); +memcpy (m_ptr, &m,8 ); } static void
@@ -179,15 +179,15 @@ pdcp_iv_gen_aes_ctr_zs(struct rte_crypto_op *cop, const struct entity_priv *en_p iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); iv_u64[1 ] =0 ; -rte_memcpy (iv, iv_u64,PDCP_IV_LEN ); +memcpy (iv, iv_u64,PDCP_IV_LEN ); iv +=PDCP_IV_LEN ; iv_u64[0 ] = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); iv_u64[1 ] = iv_u64[0 ] ^ en_priv->auth_iv_part.u64[1 ]; -rte_memcpy (iv +8 , &iv_u64[1 ],8 ); +memcpy (iv +8 , &iv_u64[1 ],8 ); } static int
Signature · 1 line
2.43.0
PATCH v4 11/30 pipeline: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/pipeline/rte_table_action.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/pipeline/rte_table_action.c +4 -4
@@ -1441,7 +1441,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, tcp->src_port, data->port); -rte_memcpy (ip->src_addr, data->addr,16 ); +memcpy (ip->src_addr, data->addr,16 ); tcp->src_port = data->port; tcp->cksum = tcp_cksum; }else {
@@ -1454,7 +1454,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, udp->src_port, data->port); -rte_memcpy (ip->src_addr, data->addr,16 ); +memcpy (ip->src_addr, data->addr,16 ); udp->src_port = data->port; udp->dgram_cksum = udp_cksum; }
@@ -1469,7 +1469,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, tcp->dst_port, data->port); -rte_memcpy (ip->dst_addr, data->addr,16 ); +memcpy (ip->dst_addr, data->addr,16 ); tcp->dst_port = data->port; tcp->cksum = tcp_cksum; }else {
@@ -1482,7 +1482,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, udp->dst_port, data->port); -rte_memcpy (ip->dst_addr, data->addr,16 ); +memcpy (ip->dst_addr, data->addr,16 ); udp->dst_port = data->port; udp->dgram_cksum = udp_cksum; }
Signature · 1 line
2.43.0
PATCH v4 12/30 rib: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerMostly automatically generated by devtools/cocci/rte_memcpy.cocci The fib/trie.c was relying on headers
rte_rib6 -> rte_memcpy -> rte_vect
since rib6 is no longer using rte_memcpy need to get rte_vect.h
--- lib/fib/trie.c | 2 +- lib/rib/rte_rib6.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
lib/fib/trie.c +1 -1
@@ -9,7 +9,7 @@#include <rte_debug.h> #include <rte_malloc.h> #include <rte_errno.h> - +#include <rte_vect.h> #include <rte_rib6.h> #include <rte_fib6.h> #include "trie.h"
lib/rib/rte_rib6.h +3 -2
@@ -14,7 +14,8 @@* Level compressed tree implementation for IPv6 Longest Prefix Match */ -#include <rte_memcpy.h> +#include <string.h> +#include <rte_common.h> #ifdef __cplusplus
@@ -61,7 +62,7 @@ rte_rib6_copy_addr(uint8_t *dst, const uint8_t *src) {if ((dst ==NULL ) || (src ==NULL ))return ; -rte_memcpy (dst, src,RTE_RIB6_IPV6_ADDR_SIZE ); +memcpy (dst, src,RTE_RIB6_IPV6_ADDR_SIZE ); }/**
Signature · 1 line
2.43.0
PATCH v4 13/30 security: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/security/rte_security.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/security/rte_security.c +2 -2
@@ -384,7 +384,7 @@ crypto_caps_array(struct rte_tel_data *d,while ((dev_caps = &capabilities[i++])->op !=RTE_CRYPTO_OP_TYPE_UNDEFINED ) {memset (&caps_val,0 ,CRYPTO_CAPS_SZ *sizeof (caps_val[0 ])); -rte_memcpy (caps_val, dev_caps,sizeof (capabilities[0 ])); +memcpy (caps_val, dev_caps,sizeof (capabilities[0 ]));for (j =0 ; j <CRYPTO_CAPS_SZ ; j++)rte_tel_data_add_array_uint (d, caps_val[j]); }
@@ -409,7 +409,7 @@ sec_caps_array(struct rte_tel_data *d,while ((dev_caps = &capabilities[i++])->action !=RTE_SECURITY_ACTION_TYPE_NONE ) {memset (&caps_val,0 ,SEC_CAPS_SZ *sizeof (caps_val[0 ])); -rte_memcpy (caps_val, dev_caps,sizeof (capabilities[0 ])); +memcpy (caps_val, dev_caps,sizeof (capabilities[0 ]));for (j =0 ; j <SEC_CAPS_SZ ; j++)rte_tel_data_add_array_uint (d, caps_val[j]); }
Signature · 1 line
2.43.0
RE: [EXTERNAL] [PATCH v4 13/30] security: replace use of fixed size rte_memcpy
Quoted 4 lines
Automatically generated by
devtools/cocci/rte_memcpy.cocciSigned-off-by Stephen Hemminger <[email protected]>---
PATCH v4 14/30 bus: remove unneeded rte_memcpy.h include
In reply to Stephen HemmingerIncluded here but never used.
--- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 - drivers/bus/pci/linux/pci.c | 1 - 7 files changed, 7 deletions(-)
drivers/bus/auxiliary/linux/auxiliary.c +0 -1
@@ -8,7 +8,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <eal_filesystem.h> #include "../private.h"
drivers/bus/fslmc/fslmc_bus.c +0 -1
@@ -13,7 +13,6 @@#include <bus_driver.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <ethdev_driver.h> #include <rte_mbuf_dyn.h>
drivers/bus/fslmc/fslmc_vfio.c +0 -1
@@ -24,7 +24,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +0 -1
@@ -14,7 +14,6 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +0 -1
@@ -13,7 +13,6 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +0 -1
@@ -26,7 +26,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/pci/linux/pci.c +0 -1
@@ -10,7 +10,6 @@#include <rte_bus_pci.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <rte_vfio.h> #include "eal_filesystem.h"
Signature · 1 line
2.43.0
PATCH v4 15/30 net: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci Also remove unnecessary includes of rte_memcpy.h
--- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/avp/avp_ethdev.c | 4 +- drivers/net/axgbe/axgbe_ethdev.c | 4 +- drivers/net/bnx2x/bnx2x.c | 32 +++-- drivers/net/bnxt/bnxt_flow.c | 34 +++--- drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +- drivers/net/bonding/rte_eth_bond_flow.c | 2 +- drivers/net/cnxk/cnxk_eswitch_devargs.c | 3 +- drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +- drivers/net/cnxk/cnxk_rep.c | 3 +- drivers/net/cnxk/cnxk_rep_flow.c | 6 +- drivers/net/cnxk/cnxk_rep_msg.c | 8 +- drivers/net/cnxk/cnxk_rep_ops.c | 2 +- drivers/net/cnxk/cnxk_tm.c | 5 +- drivers/net/cpfl/cpfl_ethdev.c | 3 +- drivers/net/cpfl/cpfl_vchnl.c | 4 +- drivers/net/cxgbe/clip_tbl.c | 2 +- drivers/net/cxgbe/cxgbe_filter.c | 8 +- drivers/net/cxgbe/l2t.c | 4 +- drivers/net/cxgbe/smt.c | 20 ++-- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 - drivers/net/dpaa2/dpaa2_ethdev.c | 1 - drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_rxtx.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 1 - drivers/net/dpaa2/dpaa2_tm.c | 2 +- drivers/net/e1000/em_rxtx.c | 1 - drivers/net/e1000/igb_flow.c | 22 ++-- drivers/net/e1000/igb_pf.c | 7 +- drivers/net/e1000/igb_rxtx.c | 1 - drivers/net/enic/enic_main.c | 8 +- drivers/net/failsafe/failsafe_ops.c | 6 +- drivers/net/gve/base/gve_adminq.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 1 - drivers/net/hinic/hinic_pmd_flow.c | 40 +++---- drivers/net/hns3/hns3_fdir.c | 2 +- drivers/net/hns3/hns3_flow.c | 4 +- drivers/net/i40e/i40e_ethdev.c | 109 ++++++++---------- drivers/net/i40e/i40e_fdir.c | 28 +++-- drivers/net/i40e/i40e_flow.c | 56 +++++---- drivers/net/i40e/i40e_pf.c | 3 +- drivers/net/i40e/i40e_tm.c | 11 +- drivers/net/i40e/rte_pmd_i40e.c | 34 +++--- drivers/net/iavf/iavf_fdir.c | 93 +++++++-------- drivers/net/iavf/iavf_fsub.c | 50 ++++---- drivers/net/iavf/iavf_generic_flow.c | 2 +- drivers/net/iavf/iavf_tm.c | 11 +- drivers/net/iavf/iavf_vchnl.c | 9 +- drivers/net/ice/ice_dcf.c | 5 +- drivers/net/ice/ice_dcf_parent.c | 2 +- drivers/net/ice/ice_dcf_sched.c | 11 +- drivers/net/ice/ice_diagnose.c | 4 +- drivers/net/ice/ice_ethdev.c | 14 +-- drivers/net/ice/ice_fdir_filter.c | 37 +++--- drivers/net/ice/ice_generic_flow.c | 2 +- drivers/net/ice/ice_hash.c | 2 +- drivers/net/ice/ice_tm.c | 11 +- drivers/net/idpf/idpf_ethdev.c | 7 +- drivers/net/idpf/idpf_rxtx.c | 10 +- drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++-- drivers/net/ipn3ke/ipn3ke_representor.c | 16 +-- drivers/net/ipn3ke/ipn3ke_tm.c | 6 +- drivers/net/ixgbe/ixgbe_ethdev.c | 9 +- drivers/net/ixgbe/ixgbe_fdir.c | 7 +- drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------ drivers/net/ixgbe/ixgbe_ipsec.c | 8 +- drivers/net/ixgbe/ixgbe_pf.c | 5 +- drivers/net/ixgbe/ixgbe_tm.c | 11 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +- drivers/net/memif/memif_socket.c | 4 +- drivers/net/mlx5/mlx5_devx.c | 4 +- drivers/net/mlx5/mlx5_flow.c | 38 +++--- drivers/net/mlx5/mlx5_flow_aso.c | 6 +- drivers/net/mlx5/mlx5_flow_hw.c | 27 ++--- drivers/net/mlx5/mlx5_rx.c | 6 +- drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +- drivers/net/mvpp2/mrvl_tm.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 1 - drivers/net/nfp/flower/nfp_conntrack.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 16 +-- .../net/nfp/flower/nfp_flower_representor.c | 2 +- drivers/net/nfp/nfp_mtr.c | 10 +- drivers/net/ngbe/ngbe_pf.c | 4 +- drivers/net/null/rte_eth_null.c | 6 +- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pcap/pcap_osdep_freebsd.c | 3 +- drivers/net/pcap/pcap_osdep_linux.c | 3 +- drivers/net/qede/qede_main.c | 2 +- drivers/net/ring/rte_eth_ring.c | 1 - drivers/net/sfc/sfc.c | 2 +- drivers/net/sfc/sfc_ef10_tx.c | 2 +- drivers/net/sfc/sfc_ethdev.c | 11 +- drivers/net/sfc/sfc_flow.c | 20 ++-- drivers/net/sfc/sfc_flow_rss.c | 2 +- drivers/net/sfc/sfc_mae.c | 2 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/sfc/sfc_tso.c | 2 +- drivers/net/sfc/sfc_tso.h | 9 +- drivers/net/tap/rte_eth_tap.c | 14 +-- drivers/net/txgbe/txgbe_ethdev.c | 9 +- drivers/net/txgbe/txgbe_fdir.c | 6 +- drivers/net/txgbe/txgbe_flow.c | 65 +++++------ drivers/net/txgbe/txgbe_ipsec.c | 8 +- drivers/net/txgbe/txgbe_pf.c | 5 +- drivers/net/txgbe/txgbe_tm.c | 11 +- drivers/net/vhost/rte_eth_vhost.c | 1 - drivers/net/virtio/virtio_ethdev.c | 1 - 107 files changed, 582 insertions(+), 664 deletions(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
@@ -2094,7 +2094,7 @@ get_iface_info(const char *if_name,if (ioctl (sock,SIOCGIFHWADDR , &ifr)) goto error; -rte_memcpy (eth_addr, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN ); +memcpy (eth_addr, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN );close (sock);return 0 ;
drivers/net/avp/avp_ethdev.c +2 -2
@@ -248,7 +248,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)while (avp_fifo_get (avp->resp_q, (void **)&resp_addr,1 ))PMD_DRV_LOG (DEBUG ,"Discarding stale response\n" ); -rte_memcpy (avp->sync_addr, request,sizeof (*request)); +memcpy (avp->sync_addr, request,sizeof (*request)); count =avp_fifo_put (avp->req_q, &avp->host_sync_addr,1 );if (count <1 ) { PMD_DRV_LOG(ERR, "Cannot send request %u to host\n",
@@ -285,7 +285,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request) }/* copy to user buffer */ -rte_memcpy (request, avp->sync_addr,sizeof (*request)); +memcpy (request, avp->sync_addr,sizeof (*request)); ret =0 ; PMD_DRV_LOG(DEBUG, "Result %d received for request %u\n",
drivers/net/axgbe/axgbe_ethdev.c +2 -2
@@ -594,7 +594,7 @@ axgbe_dev_rss_hash_update(struct rte_eth_dev *dev,if (rss_conf->rss_key !=NULL && rss_conf->rss_key_len ==AXGBE_RSS_HASH_KEY_SIZE ) { -rte_memcpy (pdata->rss_key, rss_conf->rss_key, +memcpy (pdata->rss_key, rss_conf->rss_key,AXGBE_RSS_HASH_KEY_SIZE );/* Program the hash key */ ret =axgbe_write_rss_hash_key (pdata);
@@ -637,7 +637,7 @@ axgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,if (rss_conf->rss_key !=NULL && rss_conf->rss_key_len >=AXGBE_RSS_HASH_KEY_SIZE ) { -rte_memcpy (rss_conf->rss_key, pdata->rss_key, +memcpy (rss_conf->rss_key, pdata->rss_key,AXGBE_RSS_HASH_KEY_SIZE ); } rss_conf->rss_key_len =AXGBE_RSS_HASH_KEY_SIZE ;
drivers/net/bnx2x/bnx2x.c +15 -17
@@ -2242,18 +2242,18 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) tx_parse_bd->parsing_data = (mac_type <<ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT ); -rte_memcpy (&tx_parse_bd->data.mac_addr.dst_hi, - &eh->dst_addr.addr_bytes[0 ],2 ); -rte_memcpy (&tx_parse_bd->data.mac_addr.dst_mid, - &eh->dst_addr.addr_bytes[2 ],2 ); -rte_memcpy (&tx_parse_bd->data.mac_addr.dst_lo, - &eh->dst_addr.addr_bytes[4 ],2 ); -rte_memcpy (&tx_parse_bd->data.mac_addr.src_hi, - &eh->src_addr.addr_bytes[0 ],2 ); -rte_memcpy (&tx_parse_bd->data.mac_addr.src_mid, - &eh->src_addr.addr_bytes[2 ],2 ); -rte_memcpy (&tx_parse_bd->data.mac_addr.src_lo, - &eh->src_addr.addr_bytes[4 ],2 ); +memcpy (&tx_parse_bd->data.mac_addr.dst_hi, + &eh->dst_addr.addr_bytes[0 ],2 ); +memcpy (&tx_parse_bd->data.mac_addr.dst_mid, + &eh->dst_addr.addr_bytes[2 ],2 ); +memcpy (&tx_parse_bd->data.mac_addr.dst_lo, + &eh->dst_addr.addr_bytes[4 ],2 ); +memcpy (&tx_parse_bd->data.mac_addr.src_hi, + &eh->src_addr.addr_bytes[0 ],2 ); +memcpy (&tx_parse_bd->data.mac_addr.src_mid, + &eh->src_addr.addr_bytes[2 ],2 ); +memcpy (&tx_parse_bd->data.mac_addr.src_lo, + &eh->src_addr.addr_bytes[4 ],2 ); tx_parse_bd->data.mac_addr.dst_hi =rte_cpu_to_be_16 (tx_parse_bd->data.mac_addr.dst_hi);
@@ -6675,8 +6675,7 @@ bnx2x_config_rss_pf(struct bnx2x_softc *sc, struct ecore_rss_config_obj *rss_obj/* Hash bits */ params.rss_result_mask =MULTI_MASK ; -rte_memcpy (params.ind_table, rss_obj->ind_table, -sizeof (params.ind_table)); +memcpy (params.ind_table, rss_obj->ind_table,sizeof (params.ind_table));if (config_hash) {/* RSS keys */
@@ -6742,8 +6741,7 @@ bnx2x_set_mac_one(struct bnx2x_softc *sc, uint8_t * mac,/* fill a user request section if needed */ if (!rte_bit_relaxed_get32 (RAMROD_CONT , ramrod_flags)) { -rte_memcpy (ramrod_param.user_req.u.mac.mac, mac, -ETH_ALEN ); +memcpy (ramrod_param.user_req.u.mac.mac, mac,ETH_ALEN );rte_bit_relaxed_set32 (mac_type, &ramrod_param.user_req.vlan_mac_flags);
@@ -6958,7 +6956,7 @@ static void bnx2x_link_report_locked(struct bnx2x_softc *sc)ELINK_DEBUG_P1 (sc,"link status change count = %x" , sc->link_cnt);/* report new link params and remember the state for the next time */ -rte_memcpy (&sc->last_reported_link, &cur_data,sizeof (cur_data)); +memcpy (&sc->last_reported_link, &cur_data,sizeof (cur_data));if (rte_bit_relaxed_get32 (BNX2X_LINK_REPORT_LINK_DOWN , &cur_data.link_report_flags)) {
drivers/net/bnxt/bnxt_flow.c +18 -16
@@ -233,8 +233,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr, "DMAC is invalid!\n");return -rte_errno; } -rte_memcpy (filter->dst_macaddr, - ð_spec->hdr.dst_addr,RTE_ETHER_ADDR_LEN ); +memcpy (filter->dst_macaddr, + ð_spec->hdr.dst_addr, +RTE_ETHER_ADDR_LEN ); en |= use_ntuple ?NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR :EM_FLOW_ALLOC_INPUT_EN_DST_MACADDR ;
@@ -257,8 +258,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr, "SMAC is invalid!\n");return -rte_errno; } -rte_memcpy (filter->src_macaddr, - ð_spec->hdr.src_addr,RTE_ETHER_ADDR_LEN ); +memcpy (filter->src_macaddr, + ð_spec->hdr.src_addr, +RTE_ETHER_ADDR_LEN ); en |= use_ntuple ?NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_MACADDR :EM_FLOW_ALLOC_INPUT_EN_SRC_MACADDR ;
@@ -423,23 +425,23 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr, en |=EM_FLOW_ALLOC_INPUT_EN_SRC_IPADDR |EM_FLOW_ALLOC_INPUT_EN_DST_IPADDR ; -rte_memcpy (filter->src_ipaddr, - ipv6_spec->hdr.src_addr,16 ); -rte_memcpy (filter->dst_ipaddr, - ipv6_spec->hdr.dst_addr,16 ); +memcpy (filter->src_ipaddr, ipv6_spec->hdr.src_addr, +16 ); +memcpy (filter->dst_ipaddr, ipv6_spec->hdr.dst_addr, +16 );if (!bnxt_check_zero_bytes (ipv6_mask->hdr.src_addr,16 )) { -rte_memcpy (filter->src_ipaddr_mask, - ipv6_mask->hdr.src_addr,16 ); +memcpy (filter->src_ipaddr_mask, + ipv6_mask->hdr.src_addr,16 ); en |= !use_ntuple ?0 :NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; }if (!bnxt_check_zero_bytes (ipv6_mask->hdr.dst_addr,16 )) { -rte_memcpy (filter->dst_ipaddr_mask, - ipv6_mask->hdr.dst_addr,16 ); +memcpy (filter->dst_ipaddr_mask, + ipv6_mask->hdr.dst_addr,16 ); en |= !use_ntuple ?0 :NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; }
@@ -591,8 +593,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,return -rte_errno; } -rte_memcpy (((uint8_t *)&tenant_id_be +1 ), - vxlan_spec->hdr.vni,3 ); +memcpy (((uint8_t *)&tenant_id_be +1 ), + vxlan_spec->hdr.vni,3 ); filter->vni =rte_be_to_cpu_32 (tenant_id_be); filter->tunnel_type =
@@ -645,8 +647,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr, "Invalid TNI mask");return -rte_errno; } -rte_memcpy (((uint8_t *)&tenant_id_be +1 ), - nvgre_spec->tni,3 ); +memcpy (((uint8_t *)&tenant_id_be +1 ), + nvgre_spec->tni,3 ); filter->vni =rte_be_to_cpu_32 (tenant_id_be); filter->tunnel_type =
drivers/net/bonding/rte_eth_bond_8023ad.c +2 -2
@@ -1539,10 +1539,10 @@ rte_eth_bond_8023ad_member_info(uint16_t port_id, uint16_t member_id, info->selected = port->selected; info->actor_state = port->actor_state; -rte_memcpy (&info->actor, &port->actor,sizeof (port->actor)); +memcpy (&info->actor, &port->actor,sizeof (port->actor)); info->partner_state = port->partner_state; -rte_memcpy (&info->partner, &port->partner,sizeof (port->partner)); +memcpy (&info->partner, &port->partner,sizeof (port->partner)); info->agg_port_id = port->aggregator_port_id;return 0 ;
drivers/net/bonding/rte_eth_bond_flow.c +1 -1
@@ -182,7 +182,7 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow, count->hits =0 ; count->bytes_set =0 ; count->hits_set =0 ; -rte_memcpy (&member_count, count,sizeof (member_count)); +memcpy (&member_count, count,sizeof (member_count));for (i =0 ; i < internals->member_count; i++) { ret = rte_flow_query(internals->members[i].port_id, flow->flows[i], action,
drivers/net/cnxk/cnxk_eswitch_devargs.c +2 -1
@@ -112,7 +112,8 @@ cnxk_eswitch_repr_devargs(struct rte_pci_device *pci_dev, struct cnxk_eswitch_de goto fail; } -rte_memcpy (&eswitch_dev->esw_da[j].da, ð_da[i],sizeof (struct rte_eth_devargs )); +memcpy (&eswitch_dev->esw_da[j].da, ð_da[i], +sizeof (struct rte_eth_devargs ));/* No of representor ports to be created */ eswitch_dev->repr_cnt.nb_repr_created += eswitch_dev->esw_da[j].nb_repr_ports; j++;
drivers/net/cnxk/cnxk_ethdev_ops.c +1 -1
@@ -454,7 +454,7 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr) }/* Update mac address to cnxk ethernet device */ -rte_memcpy (dev->mac_addr, addr->addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (dev->mac_addr, addr->addr_bytes,RTE_ETHER_ADDR_LEN ); exit:return rc;
drivers/net/cnxk/cnxk_rep.c +2 -1
@@ -383,7 +383,8 @@ cnxk_representee_notification(void *roc_nix, struct roc_eswitch_repte_notify_msg goto done; } -rte_memcpy (msg->notify_msg, notify_msg,sizeof (struct roc_eswitch_repte_notify_msg )); +memcpy (msg->notify_msg, notify_msg, +sizeof (struct roc_eswitch_repte_notify_msg ));plt_rep_dbg ("Pushing new notification : msg type %d" , msg->notify_msg->type);pthread_mutex_lock (&eswitch_dev->repte_msg_proc.mutex);TAILQ_INSERT_TAIL (&repte_msg_proc->msg_list, msg, next);
drivers/net/cnxk/cnxk_rep_flow.c +4 -2
@@ -81,7 +81,8 @@ prepare_pattern_data(const struct rte_flow_item *pattern, uint16_t nb_pattern, hdr.mask_sz = term[pattern->type].item_size; } -rte_memcpy (RTE_PTR_ADD (pattern_data, len), &hdr,sizeof (cnxk_pattern_hdr_t)); +memcpy (RTE_PTR_ADD (pattern_data, len), &hdr, +sizeof (cnxk_pattern_hdr_t)); len +=sizeof (cnxk_pattern_hdr_t);/* Copy pattern spec data */
@@ -228,7 +229,8 @@ prepare_action_data(const struct rte_flow_action *action, uint16_t nb_action, ui hdr.type = action->type; hdr.conf_sz = sz; -rte_memcpy (RTE_PTR_ADD (action_data, len), &hdr,sizeof (cnxk_action_hdr_t)); +memcpy (RTE_PTR_ADD (action_data, len), &hdr, +sizeof (cnxk_action_hdr_t)); len +=sizeof (cnxk_action_hdr_t);/* Copy action conf data */
drivers/net/cnxk/cnxk_rep_msg.c +4 -4
@@ -58,7 +58,7 @@ receive_control_message(int socketfd, void *data, uint32_t len)if (cmsg->cmsg_type ==SCM_CREDENTIALS ) { cr = (struct ucred *)CMSG_DATA (cmsg); }else if (cmsg->cmsg_type ==SCM_RIGHTS ) { -rte_memcpy (&afd,CMSG_DATA (cmsg),sizeof (int )); +memcpy (&afd,CMSG_DATA (cmsg),sizeof (int ));plt_rep_dbg ("afd %d" , afd); } }
@@ -90,7 +90,7 @@ send_message_on_socket(int socketfd, void *data, uint32_t len, int afd) cmsg->cmsg_len =CMSG_LEN (sizeof (int )); cmsg->cmsg_level =SOL_SOCKET ; cmsg->cmsg_type =SCM_RIGHTS ; -rte_memcpy (CMSG_DATA (cmsg), &afd,sizeof (int )); +memcpy (CMSG_DATA (cmsg), &afd,sizeof (int )); } size =sendmsg (socketfd, &mh,MSG_DONTWAIT );
@@ -198,7 +198,7 @@ cnxk_rep_msg_populate_type(void *buffer, uint32_t *length, cnxk_type_t type, uin data.length = sz;/* Populate the type data */ -rte_memcpy (RTE_PTR_ADD (buffer, len), &data,sizeof (cnxk_type_data_t)); +memcpy (RTE_PTR_ADD (buffer, len), &data,sizeof (cnxk_type_data_t)); len +=sizeof (cnxk_type_data_t); *length = len;
@@ -218,7 +218,7 @@ cnxk_rep_msg_populate_header(void *buffer, uint32_t *length) hdr.signature =CTRL_MSG_SIGNATURE ;/* Populate header data */ -rte_memcpy (RTE_PTR_ADD (buffer, len), &hdr,sizeof (cnxk_header_t)); +memcpy (RTE_PTR_ADD (buffer, len), &hdr,sizeof (cnxk_header_t)); len +=sizeof (cnxk_header_t); *length = len;
drivers/net/cnxk/cnxk_rep_ops.c +1 -1
@@ -677,7 +677,7 @@ cnxk_rep_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)cnxk_rep_msg_populate_header (buffer, &len); msg_sm_meta.portid = rep_dev->rep_id; -rte_memcpy (&msg_sm_meta.addr_bytes, addr->addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (&msg_sm_meta.addr_bytes, addr->addr_bytes,RTE_ETHER_ADDR_LEN );cnxk_rep_msg_populate_command_meta (buffer, &len, &msg_sm_meta,sizeof (cnxk_rep_msg_eth_set_mac_meta_t),CNXK_REP_MSG_ETH_SET_MAC );
drivers/net/cnxk/cnxk_tm.c +2 -3
@@ -300,8 +300,7 @@ cnxk_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev, uint32_t id, profile->profile.pkt_len_adj = params->pkt_length_adjust; profile->profile.pkt_mode = params->packet_mode; profile->profile.free_fn = rte_free; -rte_memcpy (&profile->params, params, -sizeof (struct rte_tm_shaper_params )); +memcpy (&profile->params, params,sizeof (struct rte_tm_shaper_params )); rc =roc_nix_tm_shaper_profile_add (nix, &profile->profile);
@@ -373,7 +372,7 @@ cnxk_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,if (!node)return -ENOMEM ; -rte_memcpy (&node->params, params,sizeof (struct rte_tm_node_params )); +memcpy (&node->params, params,sizeof (struct rte_tm_node_params )); node->nix_node.id = node_id; node->nix_node.parent_id = parent_node_id;
drivers/net/cpfl/cpfl_ethdev.c +2 -1
@@ -2292,7 +2292,8 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *astrncpy (adapter->name, pci_dev->device.name,PCI_PRI_STR_SIZE ); -rte_memcpy (&base->caps, &req_caps,sizeof (struct virtchnl2_get_capabilities )); +memcpy (&base->caps, &req_caps, +sizeof (struct virtchnl2_get_capabilities )); ret =idpf_adapter_init (base);if (ret !=0 ) {
drivers/net/cpfl/cpfl_vchnl.c +2 -2
@@ -32,7 +32,7 @@ cpfl_cc_vport_list_get(struct cpfl_adapter_ext *adapter,return err; } -rte_memcpy (response, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (response, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE );return 0 ; }
@@ -66,7 +66,7 @@ cpfl_cc_vport_info_get(struct cpfl_adapter_ext *adapter,return err; } -rte_memcpy (response, args.out_buffer,sizeof (*response)); +memcpy (response, args.out_buffer,sizeof (*response));return 0 ; }
drivers/net/cxgbe/clip_tbl.c +1 -1
@@ -115,7 +115,7 @@ static struct clip_entry *t4_clip_alloc(struct rte_eth_dev *dev,if (ce) {t4_os_lock (&ce->lock);if (__atomic_load_n (&ce->refcnt, __ATOMIC_RELAXED) ==0 ) { -rte_memcpy (ce->addr, lip,sizeof (ce->addr)); +memcpy (ce->addr, lip,sizeof (ce->addr));if (v6) { ce->type =FILTER_TYPE_IPV6 ; __atomic_store_n(&ce->refcnt, 1,
drivers/net/cxgbe/cxgbe_filter.c +4 -4
@@ -851,10 +851,10 @@ static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx) fwr->ivlanm =cpu_to_be16 (f->fs.mask.ivlan); fwr->ovlan =cpu_to_be16 (f->fs.val.ovlan); fwr->ovlanm =cpu_to_be16 (f->fs.mask.ovlan); -rte_memcpy (fwr->lip, f->fs.val.lip,sizeof (fwr->lip)); -rte_memcpy (fwr->lipm, f->fs.mask.lip,sizeof (fwr->lipm)); -rte_memcpy (fwr->fip, f->fs.val.fip,sizeof (fwr->fip)); -rte_memcpy (fwr->fipm, f->fs.mask.fip,sizeof (fwr->fipm)); +memcpy (fwr->lip, f->fs.val.lip,sizeof (fwr->lip)); +memcpy (fwr->lipm, f->fs.mask.lip,sizeof (fwr->lipm)); +memcpy (fwr->fip, f->fs.val.fip,sizeof (fwr->fip)); +memcpy (fwr->fipm, f->fs.mask.fip,sizeof (fwr->fipm)); fwr->lp =cpu_to_be16 (f->fs.val.lport); fwr->lpm =cpu_to_be16 (f->fs.mask.lport); fwr->fp =cpu_to_be16 (f->fs.val.fport);
drivers/net/cxgbe/l2t.c +2 -2
@@ -82,7 +82,7 @@ static int write_l2e(struct rte_eth_dev *dev, struct l2t_entry *e, int sync, V_L2T_W_NOREPLY(!sync)); req->l2t_idx =cpu_to_be16 (l2t_idx); req->vlan =cpu_to_be16 (e->vlan); -rte_memcpy (req->dst_mac, e->dmac,RTE_ETHER_ADDR_LEN ); +memcpy (req->dst_mac, e->dmac,RTE_ETHER_ADDR_LEN );if (loopback)memset (req->dst_mac,0 ,RTE_ETHER_ADDR_LEN );
@@ -155,7 +155,7 @@ static struct l2t_entry *t4_l2t_alloc_switching(struct rte_eth_dev *dev, e->state =L2T_STATE_SWITCHING ; e->vlan = vlan; e->lport = port; -rte_memcpy (e->dmac, eth_addr,RTE_ETHER_ADDR_LEN ); +memcpy (e->dmac, eth_addr,RTE_ETHER_ADDR_LEN );__atomic_store_n (&e->refcnt,1 , __ATOMIC_RELAXED); ret =write_l2e (dev, e,0 , !L2T_LPBK , !L2T_ARPMISS );if (ret <0 )
drivers/net/cxgbe/smt.c +9 -11
@@ -55,26 +55,24 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)*/ if (e->idx &1 ) { req->pfvf1 =0x0 ; -rte_memcpy (req->src_mac1, e->src_mac, -RTE_ETHER_ADDR_LEN ); +memcpy (req->src_mac1, e->src_mac,RTE_ETHER_ADDR_LEN );/* fill pfvf0/src_mac0 with entry * at prev index from smt-tab. */ req->pfvf0 =0x0 ; -rte_memcpy (req->src_mac0, s->smtab[e->idx -1 ].src_mac, -RTE_ETHER_ADDR_LEN ); +memcpy (req->src_mac0, s->smtab[e->idx -1 ].src_mac, +RTE_ETHER_ADDR_LEN ); }else { req->pfvf0 =0x0 ; -rte_memcpy (req->src_mac0, e->src_mac, -RTE_ETHER_ADDR_LEN ); +memcpy (req->src_mac0, e->src_mac,RTE_ETHER_ADDR_LEN );/* fill pfvf1/src_mac1 with entry * at next index from smt-tab */ req->pfvf1 =0x0 ; -rte_memcpy (req->src_mac1, s->smtab[e->idx +1 ].src_mac, -RTE_ETHER_ADDR_LEN ); +memcpy (req->src_mac1, s->smtab[e->idx +1 ].src_mac, +RTE_ETHER_ADDR_LEN ); } row = (e->hw_idx >>1 ); }else {
@@ -87,8 +85,8 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)/* fill pfvf0/src_mac0 from smt-tab */ t6req->pfvf0 =0x0 ; -rte_memcpy (t6req->src_mac0, s->smtab[e->idx].src_mac, -RTE_ETHER_ADDR_LEN ); +memcpy (t6req->src_mac0, s->smtab[e->idx].src_mac, +RTE_ETHER_ADDR_LEN ); row = e->hw_idx; req = (struct cpl_smt_write_req *)t6req; }
@@ -158,7 +156,7 @@ static struct smt_entry *t4_smt_alloc_switching(struct rte_eth_dev *dev,t4_os_lock (&e->lock);if (__atomic_load_n (&e->refcnt, __ATOMIC_RELAXED) ==0 ) { e->pfvf = pfvf; -rte_memcpy (e->src_mac, smac,RTE_ETHER_ADDR_LEN ); +memcpy (e->src_mac, smac,RTE_ETHER_ADDR_LEN ); ret =write_smt_entry (dev, e);if (ret) { e->pfvf =0 ;
drivers/net/dpaa2/base/dpaa2_hw_dpni.c +0 -1
@@ -11,7 +11,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/net/dpaa2/dpaa2_ethdev.c +0 -1
@@ -11,7 +11,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -10,7 +10,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/net/dpaa2/dpaa2_rxtx.c +0 -1
@@ -11,7 +11,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <dev_driver.h> #include <rte_hexdump.h>
drivers/net/dpaa2/dpaa2_sparser.c +0 -1
@@ -5,7 +5,6 @@#include <rte_mbuf.h> #include <rte_ethdev.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <dev_driver.h>
drivers/net/dpaa2/dpaa2_tm.c +1 -1
@@ -324,7 +324,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id, NULL, NULL); profile->id = shaper_profile_id; -rte_memcpy (&profile->params, params,sizeof (profile->params)); +memcpy (&profile->params, params,sizeof (profile->params));LIST_INSERT_HEAD (&priv->shaper_profiles, profile, next);
drivers/net/e1000/em_rxtx.c +0 -1
@@ -20,7 +20,6 @@#include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_memzone.h> #include <rte_launch.h> #include <rte_eal.h>
drivers/net/e1000/igb_flow.c +10 -12
@@ -1484,9 +1484,9 @@ igb_flow_create(struct rte_eth_dev *dev, goto out; } -rte_memcpy (&ntuple_filter_ptr->filter_info, - &ntuple_filter, -sizeof (struct rte_eth_ntuple_filter )); +memcpy (&ntuple_filter_ptr->filter_info, + &ntuple_filter, +sizeof (struct rte_eth_ntuple_filter ));TAILQ_INSERT_TAIL (&igb_filter_ntuple_list, ntuple_filter_ptr, entries); flow->rule = ntuple_filter_ptr;
@@ -1511,9 +1511,9 @@ igb_flow_create(struct rte_eth_dev *dev, goto out; } -rte_memcpy (ðertype_filter_ptr->filter_info, - ðertype_filter, -sizeof (struct rte_eth_ethertype_filter )); +memcpy (ðertype_filter_ptr->filter_info, + ðertype_filter, +sizeof (struct rte_eth_ethertype_filter ));TAILQ_INSERT_TAIL (&igb_filter_ethertype_list, ethertype_filter_ptr, entries); flow->rule = ethertype_filter_ptr;
@@ -1536,9 +1536,8 @@ igb_flow_create(struct rte_eth_dev *dev, goto out; } -rte_memcpy (&syn_filter_ptr->filter_info, - &syn_filter, -sizeof (struct rte_eth_syn_filter )); +memcpy (&syn_filter_ptr->filter_info, &syn_filter, +sizeof (struct rte_eth_syn_filter ));TAILQ_INSERT_TAIL (&igb_filter_syn_list, syn_filter_ptr, entries);
@@ -1562,9 +1561,8 @@ igb_flow_create(struct rte_eth_dev *dev, goto out; } -rte_memcpy (&flex_filter_ptr->filter_info, - &flex_filter, -sizeof (struct igb_flex_filter )); +memcpy (&flex_filter_ptr->filter_info, &flex_filter, +sizeof (struct igb_flex_filter ));TAILQ_INSERT_TAIL (&igb_filter_flex_list, flex_filter_ptr, entries); flow->rule = flex_filter_ptr;
drivers/net/e1000/igb_pf.c +3 -4
@@ -17,7 +17,6 @@#include <rte_eal.h> #include <rte_ether.h> #include <ethdev_driver.h> -#include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h>
@@ -290,7 +289,7 @@ igb_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)/* reply to reset with ack and vf mac address */ msgbuf[0 ] =E1000_VF_RESET |E1000_VT_MSGTYPE_ACK ; -rte_memcpy (new_mac, vf_mac,RTE_ETHER_ADDR_LEN ); +memcpy (new_mac, vf_mac,RTE_ETHER_ADDR_LEN );e1000_write_mbx (hw, msgbuf,3 , vf);return 0 ;
@@ -308,8 +307,8 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)if (rte_is_unicast_ether_addr ((struct rte_ether_addr *)new_mac)) {if (!rte_is_zero_ether_addr ((struct rte_ether_addr *)new_mac)) -rte_memcpy (vfinfo[vf].vf_mac_addresses, new_mac, -sizeof (vfinfo[vf].vf_mac_addresses)); +memcpy (vfinfo[vf].vf_mac_addresses, new_mac, +sizeof (vfinfo[vf].vf_mac_addresses)); hw->mac.ops.rar_set (hw, new_mac, rar_entry); rah =E1000_READ_REG (hw,E1000_RAH (rar_entry)); rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + vf));
drivers/net/e1000/igb_rxtx.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_pci.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_memzone.h> #include <rte_launch.h> #include <rte_eal.h>
drivers/net/enic/enic_main.c +4 -4
@@ -1221,8 +1221,8 @@ static int enic_set_rsskey(struct enic *enic, uint8_t *user_key)/* Save for later queries */ if (!err) { -rte_memcpy (&enic->rss_key, rss_key_buf_va, -sizeof (union vnic_rss_key )); +memcpy (&enic->rss_key, rss_key_buf_va, +sizeof (union vnic_rss_key )); }enic_free_consistent (enic,sizeof (union vnic_rss_key ), rss_key_buf_va, rss_key_buf_pa);
@@ -1243,7 +1243,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)if (!rss_cpu_buf_va)return -ENOMEM ; -rte_memcpy (rss_cpu_buf_va, rss_cpu,sizeof (union vnic_rss_cpu )); +memcpy (rss_cpu_buf_va, rss_cpu,sizeof (union vnic_rss_cpu )); err = enic_set_rss_cpu(enic, rss_cpu_buf_pa,
@@ -1254,7 +1254,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)/* Save for later queries */ if (!err) -rte_memcpy (&enic->rss_cpu, rss_cpu,sizeof (union vnic_rss_cpu )); +memcpy (&enic->rss_cpu, rss_cpu,sizeof (union vnic_rss_cpu ));return err; }
drivers/net/failsafe/failsafe_ops.c +3 -3
@@ -902,16 +902,16 @@ fs_stats_get(struct rte_eth_dev *dev, ret =fs_lock (dev,0 );if (ret !=0 )return ret; -rte_memcpy (stats, &PRIV (dev)->stats_accumulator,sizeof (*stats)); +memcpy (stats, &PRIV (dev)->stats_accumulator,sizeof (*stats)); FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {struct rte_eth_stats *snapshot = &sdev->stats_snapshot.stats;uint64_t *timestamp = &sdev->stats_snapshot.timestamp; -rte_memcpy (&backup, snapshot,sizeof (backup)); +memcpy (&backup, snapshot,sizeof (backup)); ret =rte_eth_stats_get (PORT_ID (sdev), snapshot);if (ret) {if (!fs_err (sdev, ret)) { -rte_memcpy (snapshot, &backup,sizeof (backup)); +memcpy (snapshot, &backup,sizeof (backup)); goto inc; } ERROR("Operation rte_eth_stats_get failed for sub_device %d with error %d",
drivers/net/gve/base/gve_adminq.c +1 -1
@@ -785,7 +785,7 @@ int gve_adminq_describe_device(struct gve_priv *priv) } priv->max_mtu = mtu; priv->num_event_counters =be16_to_cpu (descriptor->counters); -rte_memcpy (priv->dev_addr.addr_bytes, descriptor->mac,ETH_ALEN ); +memcpy (priv->dev_addr.addr_bytes, descriptor->mac,ETH_ALEN );PMD_DRV_LOG (INFO ,"MAC addr: " RTE_ETHER_ADDR_PRT_FMT ,RTE_ETHER_ADDR_BYTES (&priv->dev_addr)); priv->tx_pages_per_qpl =be16_to_cpu (descriptor->tx_pages_per_qpl);
drivers/net/hinic/hinic_pmd_ethdev.c +0 -1
@@ -7,7 +7,6 @@#include <ethdev_pci.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_mempool.h> #include <rte_errno.h> #include <rte_ether.h>
drivers/net/hinic/hinic_pmd_flow.c +18 -22
@@ -983,8 +983,7 @@ static int hinic_normal_item_check_ip(const struct rte_flow_item **in_out_item, } ipv6_spec = (const struct rte_flow_item_ipv6 *)item->spec; -rte_memcpy (rule->hinic_fdir.dst_ipv6, - ipv6_spec->hdr.dst_addr,16 ); +memcpy (rule->hinic_fdir.dst_ipv6, ipv6_spec->hdr.dst_addr,16 );/* * Check if the next not void item is TCP or UDP or ICMP.
@@ -2193,8 +2192,8 @@ static int hinic_add_del_ntuple_filter(struct rte_eth_dev *dev, sizeof(struct hinic_5tuple_filter), 0);if (filter ==NULL )return -ENOMEM ; -rte_memcpy (&filter->filter_info, &filter_5tuple, -sizeof (struct hinic_5tuple_filter_info )); +memcpy (&filter->filter_info, &filter_5tuple, +sizeof (struct hinic_5tuple_filter_info )); filter->queue = ntuple_filter->queue; filter_info->qid = ntuple_filter->queue;
@@ -2912,8 +2911,7 @@ static int hinic_add_del_tcam_fdir_filter(struct rte_eth_dev *dev, sizeof(struct hinic_tcam_filter), 0);if (tcam_filter ==NULL )return -ENOMEM ; - (void )rte_memcpy (&tcam_filter->tcam_key, - &tcam_key,sizeof (struct tag_tcam_key )); +memcpy (&tcam_filter->tcam_key, &tcam_key,sizeof (struct tag_tcam_key )); tcam_filter->queue = fdir_tcam_rule.data.qid; ret =hinic_add_tcam_filter (dev, tcam_filter, &fdir_tcam_rule);
@@ -2990,9 +2988,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev, &ntuple_filter, FALSE); goto out; } -rte_memcpy (&ntuple_filter_ptr->filter_info, - &ntuple_filter, -sizeof (struct rte_eth_ntuple_filter )); +memcpy (&ntuple_filter_ptr->filter_info, + &ntuple_filter, +sizeof (struct rte_eth_ntuple_filter ));TAILQ_INSERT_TAIL (&nic_dev->filter_ntuple_list, ntuple_filter_ptr, entries); flow->rule = ntuple_filter_ptr;
@@ -3022,9 +3020,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev, ðertype_filter, FALSE); goto out; } -rte_memcpy (ðertype_filter_ptr->filter_info, - ðertype_filter, -sizeof (struct rte_eth_ethertype_filter )); +memcpy (ðertype_filter_ptr->filter_info, + ðertype_filter, +sizeof (struct rte_eth_ethertype_filter ));TAILQ_INSERT_TAIL (&nic_dev->filter_ethertype_list, ethertype_filter_ptr, entries); flow->rule = ethertype_filter_ptr;
@@ -3065,8 +3063,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev, goto out; } -rte_memcpy (&fdir_rule_ptr->filter_info, &fdir_rule, -sizeof (struct hinic_fdir_rule )); +memcpy (&fdir_rule_ptr->filter_info, &fdir_rule, +sizeof (struct hinic_fdir_rule ));TAILQ_INSERT_TAIL (&nic_dev->filter_fdir_rule_list, fdir_rule_ptr, entries); flow->rule = fdir_rule_ptr;
@@ -3109,8 +3107,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,case RTE_ETH_FILTER_NTUPLE : ntuple_filter_ptr = (struct hinic_ntuple_filter_ele *) pmd_flow->rule; -rte_memcpy (&ntuple_filter, &ntuple_filter_ptr->filter_info, -sizeof (struct rte_eth_ntuple_filter )); +memcpy (&ntuple_filter, &ntuple_filter_ptr->filter_info, +sizeof (struct rte_eth_ntuple_filter )); ret =hinic_add_del_ntuple_filter (dev, &ntuple_filter, FALSE);if (!ret) { TAILQ_REMOVE(&nic_dev->filter_ntuple_list,
@@ -3121,9 +3119,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,case RTE_ETH_FILTER_ETHERTYPE : ethertype_filter_ptr = (struct hinic_ethertype_filter_ele *) pmd_flow->rule; -rte_memcpy (ðertype_filter, - ðertype_filter_ptr->filter_info, -sizeof (struct rte_eth_ethertype_filter )); +memcpy (ðertype_filter, ðertype_filter_ptr->filter_info, +sizeof (struct rte_eth_ethertype_filter )); ret =hinic_add_del_ethertype_filter (dev, ðertype_filter, FALSE);if (!ret) {
@@ -3134,9 +3131,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,break ;case RTE_ETH_FILTER_FDIR : fdir_rule_ptr = (struct hinic_fdir_rule_ele *)pmd_flow->rule; -rte_memcpy (&fdir_rule, - &fdir_rule_ptr->filter_info, -sizeof (struct hinic_fdir_rule )); +memcpy (&fdir_rule, &fdir_rule_ptr->filter_info, +sizeof (struct hinic_fdir_rule ));if (fdir_rule.mode ==HINIC_FDIR_MODE_NORMAL ) { ret =hinic_add_del_fdir_filter (dev, &fdir_rule, FALSE); }else if (fdir_rule.mode ==HINIC_FDIR_MODE_TCAM ) {
drivers/net/hns3/hns3_fdir.c +1 -1
@@ -996,7 +996,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,return -ENOMEM ; } -rte_memcpy (&node->fdir_conf, rule,sizeof (struct hns3_fdir_rule )); +memcpy (&node->fdir_conf, rule,sizeof (struct hns3_fdir_rule )); ret =hns3_insert_fdir_filter (hw, fdir_info, node);if (ret <0 ) {rte_free (node);
drivers/net/hns3/hns3_flow.c +2 -2
@@ -2416,8 +2416,8 @@ hns3_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow, } rss_conf = (struct rte_flow_action_rss *)data; rss_rule = (struct hns3_rss_conf_ele *)flow->rule; -rte_memcpy (rss_conf, &rss_rule->filter_info.conf, -sizeof (struct rte_flow_action_rss )); +memcpy (rss_conf, &rss_rule->filter_info.conf, +sizeof (struct rte_flow_action_rss ));break ;default : return rte_flow_error_set(error, ENOTSUP,
drivers/net/i40e/i40e_ethdev.c +47 -62
280 lines not on this page · raw message
drivers/net/i40e/i40e_fdir.c +13 -15
@@ -464,10 +464,10 @@ fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,* need to be presented in a reversed order with respect * to the expected received packets. */ -rte_memcpy (&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip, -IPV6_ADDR_LEN ); -rte_memcpy (&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip, -IPV6_ADDR_LEN ); +memcpy (&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip, +IPV6_ADDR_LEN ); +memcpy (&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip, +IPV6_ADDR_LEN ); len +=sizeof (struct rte_ipv6_hdr );return len;
@@ -528,18 +528,16 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf, [I40E_FILTER_PCTYPE_NONF_IPV6_OTHER ] =IPPROTO_NONE , }; -rte_memcpy (raw_pkt, &fdir_input->flow.l2_flow.dst, -sizeof (struct rte_ether_addr )); -rte_memcpy (raw_pkt +sizeof (struct rte_ether_addr ), - &fdir_input->flow.l2_flow.src, -sizeof (struct rte_ether_addr )); +memcpy (raw_pkt, &fdir_input->flow.l2_flow.dst, +sizeof (struct rte_ether_addr )); +memcpy (raw_pkt +sizeof (struct rte_ether_addr ), + &fdir_input->flow.l2_flow.src,sizeof (struct rte_ether_addr )); raw_pkt +=2 *sizeof (struct rte_ether_addr );if (vlan && fdir_input->flow_ext.vlan_tci) { -rte_memcpy (raw_pkt, vlan_frame,sizeof (vlan_frame)); -rte_memcpy (raw_pkt +sizeof (uint16_t ), - &fdir_input->flow_ext.vlan_tci, -sizeof (uint16_t )); +memcpy (raw_pkt, vlan_frame,sizeof (vlan_frame)); +memcpy (raw_pkt +sizeof (uint16_t ), + &fdir_input->flow_ext.vlan_tci,sizeof (uint16_t )); raw_pkt +=sizeof (vlan_frame); len +=sizeof (vlan_frame); }
@@ -1003,7 +1001,7 @@ static int i40e_fdir_filter_convert(const struct i40e_fdir_filter_conf *input, struct i40e_fdir_filter *filter) { - rte_memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf)); + memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf));if (input->input.flow_ext.pkt_template) { filter->fdir.input.flow.raw_flow.packet =NULL ; filter->fdir.input.flow.raw_flow.length =
@@ -1060,7 +1058,7 @@ i40e_sw_fdir_filter_insert(struct i40e_pf *pf, struct i40e_fdir_filter *filter)return -1 ; hash_filter = &fdir_info->fdir_filter_array[ret]; -rte_memcpy (hash_filter, filter,sizeof (*filter)); +memcpy (hash_filter, filter,sizeof (*filter)); fdir_info->hash_map[ret] = hash_filter;TAILQ_INSERT_TAIL (&fdir_info->fdir_list, hash_filter, rules);
drivers/net/i40e/i40e_flow.c +27 -29
114 lines not on this page · raw message
drivers/net/i40e/i40e_pf.c +1 -2
@@ -16,7 +16,6 @@#include <rte_ether.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include "i40e_logs.h" #include "base/i40e_prototype.h"
@@ -869,7 +868,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,for (i =0 ; i < addr_list->num_elements; i++) { mac = (struct rte_ether_addr *)(addr_list->list[i].addr); -rte_memcpy (&filter.mac_addr, mac,RTE_ETHER_ADDR_LEN ); +memcpy (&filter.mac_addr, mac,RTE_ETHER_ADDR_LEN ); filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;if (rte_is_zero_ether_addr (mac) ||i40e_vsi_add_mac (vf->vsi, &filter)) {
drivers/net/i40e/i40e_tm.c +5 -6
@@ -279,8 +279,8 @@ i40e_shaper_profile_add(struct rte_eth_dev *dev,if (!shaper_profile)return -ENOMEM ; shaper_profile->shaper_profile_id = shaper_profile_id; -rte_memcpy (&shaper_profile->profile, profile, -sizeof (struct rte_tm_shaper_params )); +memcpy (&shaper_profile->profile, profile, +sizeof (struct rte_tm_shaper_params ));TAILQ_INSERT_TAIL (&pf->tm_conf.shaper_profile_list, shaper_profile, node);
@@ -526,8 +526,8 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->reference_count =0 ; tm_node->parent =NULL ; tm_node->shaper_profile = shaper_profile; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params, +sizeof (struct rte_tm_node_params )); pf->tm_conf.root = tm_node;/* increase the reference counter of the shaper profile */
@@ -600,8 +600,7 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->reference_count =0 ; tm_node->parent = parent_node; tm_node->shaper_profile = shaper_profile; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params,sizeof (struct rte_tm_node_params ));if (parent_node_type ==I40E_TM_NODE_TYPE_PORT ) {TAILQ_INSERT_TAIL (&pf->tm_conf.tc_list, tm_node, node);
drivers/net/i40e/rte_pmd_i40e.c +15 -19
@@ -90,7 +90,7 @@ rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK ;memset (&ctxt,0 ,sizeof (ctxt)); -rte_memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); +memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); ctxt.seid = vsi->seid; hw =I40E_VSI_TO_HW (vsi);
@@ -192,7 +192,7 @@ rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK ;memset (&ctxt,0 ,sizeof (ctxt)); -rte_memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); +memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); ctxt.seid = vsi->seid; hw =I40E_VSI_TO_HW (vsi);
@@ -237,9 +237,8 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)for (i =0 ; i < vlan_num; i++) { mv_f[i].filter_type = filter_type; -rte_memcpy (&mv_f[i].macaddr, - &f->mac_info.mac_addr, -ETH_ADDR_LEN ); +memcpy (&mv_f[i].macaddr, &f->mac_info.mac_addr, +ETH_ADDR_LEN ); }if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || filter_type ==I40E_MACVLAN_HASH_MATCH ) {
@@ -298,9 +297,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)for (i =0 ; i < vlan_num; i++) { mv_f[i].filter_type = f->mac_info.filter_type; -rte_memcpy (&mv_f[i].macaddr, - &f->mac_info.mac_addr, -ETH_ADDR_LEN ); +memcpy (&mv_f[i].macaddr, &f->mac_info.mac_addr, +ETH_ADDR_LEN ); } if (f->mac_info.filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -380,7 +378,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on) vsi->info.switch_id &= ~I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB ;memset (&ctxt,0 ,sizeof (ctxt)); -rte_memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); +memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); ctxt.seid = vsi->seid; ret =i40e_aq_update_vsi_params (hw, &ctxt,NULL );
@@ -705,7 +703,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, vsi->info.port_vlan_flags &= ~I40E_AQ_VSI_PVLAN_INSERT_PVID ;memset (&ctxt,0 ,sizeof (ctxt)); -rte_memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); +memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); ctxt.seid = vsi->seid; hw =I40E_VSI_TO_HW (vsi);
@@ -767,7 +765,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, }if (on) { -rte_memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); +memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ; ret =i40e_vsi_add_mac (vsi, &filter); }else {
@@ -839,7 +837,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on) }memset (&ctxt,0 ,sizeof (ctxt)); -rte_memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); +memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); ctxt.seid = vsi->seid; hw =I40E_VSI_TO_HW (vsi);
@@ -2586,11 +2584,10 @@ i40e_vsi_update_queue_region_mapping(struct i40e_hw *hw,return ret; }/* update the local VSI info with updated queue map */ -rte_memcpy (&vsi->info.tc_mapping, &ctxt.info.tc_mapping, -sizeof (vsi->info.tc_mapping)); -rte_memcpy (&vsi->info.queue_mapping, - &ctxt.info.queue_mapping, -sizeof (vsi->info.queue_mapping)); +memcpy (&vsi->info.tc_mapping, &ctxt.info.tc_mapping, +sizeof (vsi->info.tc_mapping)); +memcpy (&vsi->info.queue_mapping, &ctxt.info.queue_mapping, +sizeof (vsi->info.queue_mapping)); vsi->info.mapping_flags = ctxt.info.mapping_flags; vsi->info.valid_sections =0 ;
@@ -2961,8 +2958,7 @@ i40e_queue_region_get_all_info(struct i40e_pf *pf, {struct i40e_queue_regions *info = &pf->queue_region; -rte_memcpy (regions_ptr, info, -sizeof (struct i40e_queue_regions )); +memcpy (regions_ptr, info,sizeof (struct i40e_queue_regions ));return 0 ; }
drivers/net/iavf/iavf_fdir.c +42 -51
215 lines not on this page · raw message
drivers/net/iavf/iavf_fsub.c +25 -25
92 lines not on this page · raw message
drivers/net/iavf/iavf_generic_flow.c +1 -1
@@ -2019,7 +2019,7 @@ iavf_pattern_skip_void_item(struct rte_flow_item *items, pb = pe +1 ; }/* Copy the END item. */ -rte_memcpy (items, pe,sizeof (struct rte_flow_item )); +memcpy (items, pe,sizeof (struct rte_flow_item )); }/* Check if the pattern matches a supported item type array */
drivers/net/iavf/iavf_tm.c +5 -6
@@ -342,8 +342,8 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->id = node_id; tm_node->parent =NULL ; tm_node->reference_count =0 ; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params, +sizeof (struct rte_tm_node_params )); vf->tm_conf.root = tm_node;return 0 ; }
@@ -403,8 +403,7 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->reference_count =0 ; tm_node->parent = parent_node; tm_node->shaper_profile = shaper_profile; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params,sizeof (struct rte_tm_node_params ));if (parent_node_type ==IAVF_TM_NODE_TYPE_PORT ) {TAILQ_INSERT_TAIL (&vf->tm_conf.tc_list, tm_node, node);
@@ -543,8 +542,8 @@ iavf_shaper_profile_add(struct rte_eth_dev *dev,if (!shaper_profile)return -ENOMEM ; shaper_profile->shaper_profile_id = shaper_profile_id; -rte_memcpy (&shaper_profile->profile, profile, -sizeof (struct rte_tm_shaper_params )); +memcpy (&shaper_profile->profile, profile, +sizeof (struct rte_tm_shaper_params ));TAILQ_INSERT_TAIL (&vf->tm_conf.shaper_profile_list, shaper_profile, node);
drivers/net/iavf/iavf_vchnl.c +4 -5
@@ -920,7 +920,7 @@ iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter)return ret; } -rte_memcpy (&vf->vlan_v2_caps, vf->aq_resp,sizeof (vf->vlan_v2_caps)); +memcpy (&vf->vlan_v2_caps, vf->aq_resp,sizeof (vf->vlan_v2_caps));return 0 ; }
@@ -1427,8 +1427,8 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) addr = &adapter->dev_data->mac_addrs[i];if (rte_is_zero_ether_addr (addr))continue ; -rte_memcpy (list->list[j].addr, addr->addr_bytes, -sizeof (addr->addr_bytes)); +memcpy (list->list[j].addr, addr->addr_bytes, +sizeof (addr->addr_bytes)); list->list[j].type = (j ==0 ?VIRTCHNL_ETHER_ADDR_PRIMARY :VIRTCHNL_ETHER_ADDR_EXTRA );
@@ -1547,8 +1547,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr, list->vsi_id = vf->vsi_res->vsi_id; list->num_elements =1 ; list->list[0 ].type = type; -rte_memcpy (list->list[0 ].addr, addr->addr_bytes, -sizeof (addr->addr_bytes)); +memcpy (list->list[0 ].addr, addr->addr_bytes,sizeof (addr->addr_bytes)); args.ops = add ?VIRTCHNL_OP_ADD_ETH_ADDR :VIRTCHNL_OP_DEL_ETH_ADDR ; args.in_args = cmd_buffer;
drivers/net/ice/ice_dcf.c +2 -3
@@ -731,7 +731,7 @@ dcf_get_vlan_offload_caps_v2(struct ice_dcf_hw *hw)return ret; } -rte_memcpy (&hw->vlan_v2_caps, &vlan_v2_caps,sizeof (vlan_v2_caps)); +memcpy (&hw->vlan_v2_caps, &vlan_v2_caps,sizeof (vlan_v2_caps));return 0 ; }
@@ -1407,8 +1407,7 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,return -ENOMEM ; } -rte_memcpy (list->list[0 ].addr, addr->addr_bytes, -sizeof (addr->addr_bytes)); +memcpy (list->list[0 ].addr, addr->addr_bytes,sizeof (addr->addr_bytes));PMD_DRV_LOG (DEBUG ,"add/rm mac:" RTE_ETHER_ADDR_PRT_FMT ,RTE_ETHER_ADDR_BYTES (addr));
drivers/net/ice/ice_dcf_parent.c +1 -1
@@ -407,7 +407,7 @@ ice_dcf_load_pkg(struct ice_adapter *adapter) use_dsn =ice_dcf_execute_virtchnl_cmd (&dcf_adapter->real_hw, &vc_cmd) ==0 ;if (use_dsn) -rte_memcpy (&dsn, pkg_info.dsn,sizeof (dsn)); +memcpy (&dsn, pkg_info.dsn,sizeof (dsn));return ice_load_pkg (adapter, use_dsn, dsn); }
drivers/net/ice/ice_dcf_sched.c +5 -6
@@ -308,8 +308,8 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->id = node_id; tm_node->parent =NULL ; tm_node->reference_count =0 ; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params, +sizeof (struct rte_tm_node_params )); hw->tm_conf.root = tm_node;return 0 ;
@@ -373,8 +373,7 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->shaper_profile = shaper_profile; tm_node->reference_count =0 ; tm_node->parent = parent_node; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params,sizeof (struct rte_tm_node_params ));if (parent_node_type ==ICE_DCF_TM_NODE_TYPE_PORT ) {TAILQ_INSERT_TAIL (&hw->tm_conf.tc_list, tm_node, node);
@@ -520,8 +519,8 @@ ice_dcf_shaper_profile_add(struct rte_eth_dev *dev,if (!shaper_profile)return -ENOMEM ; shaper_profile->shaper_profile_id = shaper_profile_id; -rte_memcpy (&shaper_profile->profile, profile, -sizeof (struct rte_tm_shaper_params )); +memcpy (&shaper_profile->profile, profile, +sizeof (struct rte_tm_shaper_params ));TAILQ_INSERT_TAIL (&hw->tm_conf.shaper_profile_list, shaper_profile, node);
drivers/net/ice/ice_diagnose.c +2 -2
@@ -362,13 +362,13 @@ ice_dump_pkg(struct rte_eth_dev *dev, uint8_t **buff, uint32_t *size) count = *size /ICE_PKG_BUF_SIZE ;for (i =0 ; i < count; i++) { next_buff = (uint8_t *)(*buff) + i *ICE_PKG_BUF_SIZE ; -rte_memcpy (pkg_buff.buf, next_buff,ICE_PKG_BUF_SIZE ); +memcpy (pkg_buff.buf, next_buff,ICE_PKG_BUF_SIZE );if (ice_aq_upload_section (hw, (struct ice_buf_hdr *)&pkg_buff.buf[0 ],ICE_PKG_BUF_SIZE ,NULL ))return -EINVAL ; -rte_memcpy (next_buff, pkg_buff.buf,ICE_PKG_BUF_SIZE ); +memcpy (next_buff, pkg_buff.buf,ICE_PKG_BUF_SIZE ); } cache_size =sizeof (struct ice_package_header ) + *size;
drivers/net/ice/ice_ethdev.c +7 -7
@@ -3453,11 +3453,11 @@ static int ice_init_rss(struct ice_pf *pf)RTE_MIN (rss_conf->rss_key_len, vsi->rss_key_size)); -rte_memcpy (key.standard_rss_key, vsi->rss_key, -ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE ); -rte_memcpy (key.extended_hash_key, - &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE ], -ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE ); +memcpy (key.standard_rss_key, vsi->rss_key, +ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE ); +memcpy (key.extended_hash_key, + &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE ], +ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE ); ret =ice_aq_set_rss_key (hw, vsi->idx, &key);if (ret) goto out;
@@ -4549,7 +4549,7 @@ ice_vsi_config_vlan_filter(struct ice_vsi *vsi, bool on) vsi->info.sw_flags2 &= ~sw_flags2; vsi->info.sw_id = hw->port_info->sw_id; - (void )rte_memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); +memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); ctxt.info.valid_sections =rte_cpu_to_le_16 (ICE_AQ_VSI_PROP_SW_VALID |ICE_AQ_VSI_PROP_SECURITY_VALID );
@@ -5367,7 +5367,7 @@ ice_vsi_vlan_pvid_set(struct ice_vsi *vsi, struct ice_vsi_vlan_pvid_info *info) ICE_AQ_VSI_INNER_VLAN_EMODE_M); vsi->info.inner_vlan_flags |= vlan_flags;memset (&ctxt,0 ,sizeof (ctxt)); -rte_memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); +memcpy (&ctxt.info, &vsi->info,sizeof (vsi->info)); ctxt.info.valid_sections =rte_cpu_to_le_16 (ICE_AQ_VSI_PROP_VLAN_VALID ); ctxt.vsi_num = vsi->vsi_id;
drivers/net/ice/ice_fdir_filter.c +19 -18
@@ -1224,13 +1224,13 @@ ice_fdir_extract_fltr_key(struct ice_fdir_fltr_pattern *key,memset (key,0 ,sizeof (*key)); key->flow_type = input->flow_type; -rte_memcpy (&key->ip, &input->ip,sizeof (key->ip)); -rte_memcpy (&key->mask, &input->mask,sizeof (key->mask)); -rte_memcpy (&key->ext_data, &input->ext_data,sizeof (key->ext_data)); -rte_memcpy (&key->ext_mask, &input->ext_mask,sizeof (key->ext_mask)); +memcpy (&key->ip, &input->ip,sizeof (key->ip)); +memcpy (&key->mask, &input->mask,sizeof (key->mask)); +memcpy (&key->ext_data, &input->ext_data,sizeof (key->ext_data)); +memcpy (&key->ext_mask, &input->ext_mask,sizeof (key->ext_mask)); -rte_memcpy (&key->gtpu_data, &input->gtpu_data,sizeof (key->gtpu_data)); -rte_memcpy (&key->gtpu_mask, &input->gtpu_mask,sizeof (key->gtpu_mask)); +memcpy (&key->gtpu_data, &input->gtpu_data,sizeof (key->gtpu_data)); +memcpy (&key->gtpu_mask, &input->gtpu_mask,sizeof (key->gtpu_mask)); key->tunnel_type = filter->tunnel_type; }
@@ -1358,7 +1358,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,if (!entry) goto error; -rte_memcpy (entry, filter,sizeof (*filter)); +memcpy (entry, filter,sizeof (*filter)); flow->rule = entry;
@@ -1419,7 +1419,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,if (filter->mark_flag ==1 )ice_fdir_rx_parsing_enable (ad,1 ); -rte_memcpy (entry, filter,sizeof (*entry)); +memcpy (entry, filter,sizeof (*entry)); ret =ice_fdir_entry_insert (pf, entry, &key);if (ret) { rte_flow_error_set(error, -ret,
@@ -1720,8 +1720,8 @@ ice_fdir_parse_action(struct ice_adapter *ad, act_count = actions->conf; filter->input.cnt_ena =ICE_FXD_FLTR_QW0_STAT_ENA_PKTS ; -rte_memcpy (&filter->act_count, act_count, -sizeof (filter->act_count)); +memcpy (&filter->act_count, act_count, +sizeof (filter->act_count));break ;default :
@@ -1978,12 +1978,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, p_ext_data = (tunnel_type && is_outer) ? &filter->input.ext_data_outer : &filter->input.ext_data; -rte_memcpy (&p_ext_data->src_mac, - ð_spec->hdr.src_addr,RTE_ETHER_ADDR_LEN ); -rte_memcpy (&p_ext_data->dst_mac, - ð_spec->hdr.dst_addr,RTE_ETHER_ADDR_LEN ); -rte_memcpy (&p_ext_data->ether_type, - ð_spec->hdr.ether_type,sizeof (eth_spec->hdr.ether_type)); +memcpy (&p_ext_data->src_mac, ð_spec->hdr.src_addr, +RTE_ETHER_ADDR_LEN ); +memcpy (&p_ext_data->dst_mac, ð_spec->hdr.dst_addr, +RTE_ETHER_ADDR_LEN ); +memcpy (&p_ext_data->ether_type, + ð_spec->hdr.ether_type, +sizeof (eth_spec->hdr.ether_type));break ;case RTE_FLOW_ITEM_TYPE_IPV4 : flow_type =ICE_FLTR_PTYPE_NONF_IPV4_OTHER ;
@@ -2108,8 +2109,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,if (ipv6_mask->hdr.hop_limits ==UINT8_MAX ) *input_set |=ICE_INSET_IPV6_HOP_LIMIT ; -rte_memcpy (&p_v6->dst_ip, ipv6_spec->hdr.dst_addr,16 ); -rte_memcpy (&p_v6->src_ip, ipv6_spec->hdr.src_addr,16 ); +memcpy (&p_v6->dst_ip, ipv6_spec->hdr.dst_addr,16 ); +memcpy (&p_v6->src_ip, ipv6_spec->hdr.src_addr,16 ); vtc_flow_cpu =rte_be_to_cpu_32 (ipv6_spec->hdr.vtc_flow); p_v6->tc = (uint8_t )(vtc_flow_cpu >>ICE_FDIR_IPV6_TC_OFFSET ); p_v6->proto = ipv6_spec->hdr.proto;
drivers/net/ice/ice_generic_flow.c +1 -1
@@ -1969,7 +1969,7 @@ ice_pattern_skip_void_item(struct rte_flow_item *items, pb = pe +1 ; }/* Copy the END item. */ -rte_memcpy (items, pe,sizeof (struct rte_flow_item )); +memcpy (items, pe,sizeof (struct rte_flow_item )); }/* Check if the pattern matches a supported item type array */
drivers/net/ice/ice_hash.c +1 -1
@@ -715,7 +715,7 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad, pkt_len, ICE_BLK_RSS, true, &prof))return -rte_errno; -rte_memcpy (&meta->raw.prof, &prof,sizeof (prof)); +memcpy (&meta->raw.prof, &prof,sizeof (prof));rte_free (pkt_buf);rte_free (msk_buf);
drivers/net/ice/ice_tm.c +5 -6
@@ -293,8 +293,8 @@ ice_shaper_profile_add(struct rte_eth_dev *dev,if (!shaper_profile)return -ENOMEM ; shaper_profile->shaper_profile_id = shaper_profile_id; -rte_memcpy (&shaper_profile->profile, profile, -sizeof (struct rte_tm_shaper_params )); +memcpy (&shaper_profile->profile, profile, +sizeof (struct rte_tm_shaper_params ));TAILQ_INSERT_TAIL (&pf->tm_conf.shaper_profile_list, shaper_profile, node);
@@ -403,8 +403,8 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->shaper_profile = shaper_profile; tm_node->children = (void *)((uint8_t *)tm_node +sizeof (struct ice_tm_node )); -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params, +sizeof (struct rte_tm_node_params )); pf->tm_conf.root = tm_node;return 0 ; }
@@ -480,8 +480,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,PMD_DRV_LOG (WARNING ,"weight != 1 not supported in level %d" , level_id); -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params,sizeof (struct rte_tm_node_params )); tm_node->parent->reference_count++;return 0 ;
drivers/net/idpf/idpf_ethdev.c +4 -3
@@ -1088,8 +1088,8 @@ idpf_handle_virtchnl_msg(struct idpf_adapter_ext *adapter_ex)return ; } -rte_memcpy (adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va, -IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va, +IDPF_DFLT_MBX_BUF_SIZE ); mbx_op =rte_le_to_cpu_16 (ctlq_msg.opcode); vc_op =rte_le_to_cpu_32 (ctlq_msg.cookie.mbx.chnl_opcode);
@@ -1202,7 +1202,8 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *astrncpy (adapter->name, pci_dev->device.name,PCI_PRI_STR_SIZE ); -rte_memcpy (&base->caps, &req_caps,sizeof (struct virtchnl2_get_capabilities )); +memcpy (&base->caps, &req_caps, +sizeof (struct virtchnl2_get_capabilities )); ret =idpf_adapter_init (base);if (ret !=0 ) {
drivers/net/idpf/idpf_rxtx.c +6 -4
@@ -76,7 +76,7 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,else ring_size =RTE_ALIGN (len *sizeof (struct idpf_base_tx_desc ),IDPF_DMA_MEM_ALIGN ); -rte_memcpy (ring_name,"idpf Tx ring" ,sizeof ("idpf Tx ring" )); +memcpy (ring_name,"idpf Tx ring" ,sizeof ("idpf Tx ring" ));break ;case VIRTCHNL2_QUEUE_TYPE_RX :if (splitq)
@@ -85,17 +85,19 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,else ring_size =RTE_ALIGN (len *sizeof (struct virtchnl2_singleq_rx_buf_desc ),IDPF_DMA_MEM_ALIGN ); -rte_memcpy (ring_name,"idpf Rx ring" ,sizeof ("idpf Rx ring" )); +memcpy (ring_name,"idpf Rx ring" ,sizeof ("idpf Rx ring" ));break ;case VIRTCHNL2_QUEUE_TYPE_TX_COMPLETION : ring_size =RTE_ALIGN (len *sizeof (struct idpf_splitq_tx_compl_desc ),IDPF_DMA_MEM_ALIGN ); -rte_memcpy (ring_name,"idpf Tx compl ring" ,sizeof ("idpf Tx compl ring" )); +memcpy (ring_name,"idpf Tx compl ring" , +sizeof ("idpf Tx compl ring" ));break ;case VIRTCHNL2_QUEUE_TYPE_RX_BUFFER : ring_size =RTE_ALIGN (len *sizeof (struct virtchnl2_splitq_rx_buf_desc ),IDPF_DMA_MEM_ALIGN ); -rte_memcpy (ring_name,"idpf Rx buf ring" ,sizeof ("idpf Rx buf ring" )); +memcpy (ring_name,"idpf Rx buf ring" , +sizeof ("idpf Rx buf ring" ));break ;default :PMD_INIT_LOG (ERR ,"Invalid queue type" );
drivers/net/ipn3ke/ipn3ke_flow.c +15 -17
@@ -100,15 +100,14 @@ ipn3ke_pattern_vxlan(const struct rte_flow_item patterns[],case RTE_FLOW_ITEM_TYPE_ETH : eth = item->spec; -rte_memcpy (&parser->key[0 ], - eth->hdr.src_addr.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (&parser->key[0 ], eth->hdr.src_addr.addr_bytes, +RTE_ETHER_ADDR_LEN );break ;case RTE_FLOW_ITEM_TYPE_VXLAN : vxlan = item->spec; -rte_memcpy (&parser->key[6 ], vxlan->hdr.vni,3 ); +memcpy (&parser->key[6 ], vxlan->hdr.vni,3 );break ;default :
@@ -164,9 +163,8 @@ ipn3ke_pattern_mac(const struct rte_flow_item patterns[],case RTE_FLOW_ITEM_TYPE_ETH : eth = item->spec; -rte_memcpy (parser->key, - eth->hdr.src_addr.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (parser->key, eth->hdr.src_addr.addr_bytes, +RTE_ETHER_ADDR_LEN );break ;default :
@@ -369,13 +367,13 @@ ipn3ke_pattern_ip_tcp(const struct rte_flow_item patterns[],case RTE_FLOW_ITEM_TYPE_IPV4 : ipv4 = item->spec; -rte_memcpy (&parser->key[0 ], &ipv4->hdr.src_addr,4 ); +memcpy (&parser->key[0 ], &ipv4->hdr.src_addr,4 );break ;case RTE_FLOW_ITEM_TYPE_TCP : tcp = item->spec; -rte_memcpy (&parser->key[4 ], &tcp->hdr.src_port,2 ); +memcpy (&parser->key[4 ], &tcp->hdr.src_port,2 );break ;default :
@@ -434,13 +432,13 @@ ipn3ke_pattern_ip_udp(const struct rte_flow_item patterns[],case RTE_FLOW_ITEM_TYPE_IPV4 : ipv4 = item->spec; -rte_memcpy (&parser->key[0 ], &ipv4->hdr.src_addr,4 ); +memcpy (&parser->key[0 ], &ipv4->hdr.src_addr,4 );break ;case RTE_FLOW_ITEM_TYPE_UDP : udp = item->spec; -rte_memcpy (&parser->key[4 ], &udp->hdr.src_port,2 ); +memcpy (&parser->key[4 ], &udp->hdr.src_port,2 );break ;default :
@@ -502,19 +500,19 @@ ipn3ke_pattern_ip_nvgre(const struct rte_flow_item patterns[],case RTE_FLOW_ITEM_TYPE_IPV4 : ipv4 = item->spec; -rte_memcpy (&parser->key[0 ], &ipv4->hdr.src_addr,4 ); +memcpy (&parser->key[0 ], &ipv4->hdr.src_addr,4 );break ;case RTE_FLOW_ITEM_TYPE_UDP : udp = item->spec; -rte_memcpy (&parser->key[4 ], &udp->hdr.src_port,2 ); +memcpy (&parser->key[4 ], &udp->hdr.src_port,2 );break ;case RTE_FLOW_ITEM_TYPE_NVGRE : nvgre = item->spec; -rte_memcpy (&parser->key[6 ], nvgre->tni,3 ); +memcpy (&parser->key[6 ], nvgre->tni,3 );break ;default :
@@ -576,19 +574,19 @@ ipn3ke_pattern_vxlan_ip_udp(const struct rte_flow_item patterns[],case RTE_FLOW_ITEM_TYPE_VXLAN : vxlan = item->spec; -rte_memcpy (&parser->key[0 ], vxlan->hdr.vni,3 ); +memcpy (&parser->key[0 ], vxlan->hdr.vni,3 );break ;case RTE_FLOW_ITEM_TYPE_IPV4 : ipv4 = item->spec; -rte_memcpy (&parser->key[3 ], &ipv4->hdr.src_addr,4 ); +memcpy (&parser->key[3 ], &ipv4->hdr.src_addr,4 );break ;case RTE_FLOW_ITEM_TYPE_UDP : udp = item->spec; -rte_memcpy (&parser->key[7 ], &udp->hdr.src_port,2 ); +memcpy (&parser->key[7 ], &udp->hdr.src_port,2 );break ;default :
drivers/net/ipn3ke/ipn3ke_representor.c +8 -8
@@ -137,17 +137,17 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev)if (hw->retimer.mac_type ==IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI ) {/* Set mac address */ -rte_memcpy (((char *)(&val)), - (char *)&dev->data->mac_addrs->addr_bytes[0 ], -sizeof (uint32_t )); +memcpy (((char *)(&val)), + (char *)&dev->data->mac_addrs->addr_bytes[0 ], +sizeof (uint32_t )); (*hw->f_mac_write)(hw, val,IPN3KE_MAC_PRIMARY_MAC_ADDR0 , rpst->port_id,0 ); -rte_memcpy (((char *)(&val)), - (char *)&dev->data->mac_addrs->addr_bytes[4 ], -sizeof (uint16_t )); +memcpy (((char *)(&val)), + (char *)&dev->data->mac_addrs->addr_bytes[4 ], +sizeof (uint16_t )); (*hw->f_mac_write)(hw, val, IPN3KE_MAC_PRIMARY_MAC_ADDR1,
@@ -2753,13 +2753,13 @@ ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev,rte_ether_addr_copy (&mac_addr[0 ], &rpst->mac_addr);/* Set mac address */ -rte_memcpy (((char *)(&val)), &mac_addr[0 ],sizeof (uint32_t )); +memcpy (((char *)(&val)), &mac_addr[0 ],sizeof (uint32_t )); (*hw->f_mac_write)(hw, val,IPN3KE_MAC_PRIMARY_MAC_ADDR0 , rpst->port_id,0 ); -rte_memcpy (((char *)(&val)), &mac_addr[4 ],sizeof (uint16_t )); +memcpy (((char *)(&val)), &mac_addr[4 ],sizeof (uint16_t )); (*hw->f_mac_write)(hw, val, IPN3KE_MAC_PRIMARY_MAC_ADDR0,
drivers/net/ipn3ke/ipn3ke_tm.c +3 -3
@@ -814,7 +814,7 @@ ipn3ke_tm_shaper_profile_add(struct rte_eth_dev *dev, rte_strerror(EINVAL)); }else { sp->valid =1 ; -rte_memcpy (&sp->params, profile,sizeof (sp->params)); +memcpy (&sp->params, profile,sizeof (sp->params)); } tm->h.n_shaper_profiles++;
@@ -960,7 +960,7 @@ ipn3ke_tm_tdrop_profile_add(struct rte_eth_dev *dev, IPN3KE_TDROP_TH2_MASK); tp->th1 = th1; tp->th2 = th2; -rte_memcpy (&tp->params, profile,sizeof (tp->params)); +memcpy (&tp->params, profile,sizeof (tp->params));/* Add to list */ tm->h.n_tdrop_profiles++;
@@ -1308,7 +1308,7 @@ ipn3ke_tm_node_add(struct rte_eth_dev *dev, n->tdrop_profile =ipn3ke_hw_tm_tdrop_profile_search (hw, params->leaf.wred.wred_profile_id); -rte_memcpy (&n->params, params,sizeof (n->params)); +memcpy (&n->params, params,sizeof (n->params));return 0 ; }
drivers/net/ixgbe/ixgbe_ethdev.c +3 -6
@@ -6597,9 +6597,8 @@ ixgbe_add_del_ntuple_filter(struct rte_eth_dev *dev, sizeof(struct ixgbe_5tuple_filter), 0);if (filter ==NULL )return -ENOMEM ; -rte_memcpy (&filter->filter_info, - &filter_5tuple, -sizeof (struct ixgbe_5tuple_filter_info )); +memcpy (&filter->filter_info, &filter_5tuple, +sizeof (struct ixgbe_5tuple_filter_info )); filter->queue = ntuple_filter->queue; ret =ixgbe_add_5tuple_filter (dev, filter);if (ret <0 ) {
@@ -7596,9 +7595,7 @@ ixgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,if (!node)return -ENOMEM ; -rte_memcpy (&node->key, - &key, -sizeof (struct ixgbe_l2_tn_key )); +memcpy (&node->key, &key,sizeof (struct ixgbe_l2_tn_key )); node->pool = l2_tunnel->pool; ret =ixgbe_insert_l2_tn_filter (l2_tn_info, node);if (ret <0 ) {
drivers/net/ixgbe/ixgbe_fdir.c +3 -4
@@ -74,7 +74,7 @@else \ ipv6_addr[i] =0 ; \ } \ -rte_memcpy ((ipaddr), ipv6_addr,sizeof (ipv6_addr));\ +memcpy ((ipaddr), ipv6_addr,sizeof (ipv6_addr));\ } while (0)#define IXGBE_FDIRIP6M_INNER_MAC_SHIFT 4
@@ -1217,9 +1217,8 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev, 0);if (!node)return -ENOMEM ; -rte_memcpy (&node->ixgbe_fdir, - &rule->ixgbe_fdir, -sizeof (union ixgbe_atr_input )); +memcpy (&node->ixgbe_fdir, &rule->ixgbe_fdir, +sizeof (union ixgbe_atr_input )); node->fdirflags = fdircmd_flags; node->fdirhash = fdirhash; node->queue = queue;
drivers/net/ixgbe/ixgbe_flow.c +29 -36
137 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ipsec.c +4 -4
@@ -680,10 +680,10 @@ ixgbe_crypto_add_ingress_sa_from_flow(const void *sess,const struct rte_flow_item_ipv6 *ipv6 = ip_spec; ic_session->src_ip.type = IPv6; ic_session->dst_ip.type = IPv6; -rte_memcpy (ic_session->src_ip.ipv6, - ipv6->hdr.src_addr,16 ); -rte_memcpy (ic_session->dst_ip.ipv6, - ipv6->hdr.dst_addr,16 ); +memcpy (ic_session->src_ip.ipv6, ipv6->hdr.src_addr, +16 ); +memcpy (ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr, +16 ); }else {const struct rte_flow_item_ipv4 *ipv4 = ip_spec; ic_session->src_ip.type = IPv4;
drivers/net/ixgbe/ixgbe_pf.c +2 -3
@@ -16,7 +16,6 @@#include <rte_eal.h> #include <rte_ether.h> #include <ethdev_driver.h> -#include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h>
@@ -450,7 +449,7 @@ ixgbe_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)/* reply to reset with ack and vf mac address */ msgbuf[0 ] =IXGBE_VF_RESET |IXGBE_VT_MSGTYPE_ACK ; -rte_memcpy (new_mac, vf_mac,RTE_ETHER_ADDR_LEN ); +memcpy (new_mac, vf_mac,RTE_ETHER_ADDR_LEN );/* * Piggyback the multicast filter type so VF can compute the * correct vectors
@@ -472,7 +471,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)if (rte_is_valid_assigned_ether_addr ( (struct rte_ether_addr *)new_mac)) { -rte_memcpy (vfinfo[vf].vf_mac_addresses, new_mac,6 ); +memcpy (vfinfo[vf].vf_mac_addresses, new_mac,6 );return hw->mac.ops.set_rar (hw, rar_entry, new_mac, vf,IXGBE_RAH_AV ); }return -1 ;
drivers/net/ixgbe/ixgbe_tm.c +5 -6
@@ -289,8 +289,8 @@ ixgbe_shaper_profile_add(struct rte_eth_dev *dev,if (!shaper_profile)return -ENOMEM ; shaper_profile->shaper_profile_id = shaper_profile_id; -rte_memcpy (&shaper_profile->profile, profile, -sizeof (struct rte_tm_shaper_params )); +memcpy (&shaper_profile->profile, profile, +sizeof (struct rte_tm_shaper_params ));TAILQ_INSERT_TAIL (&tm_conf->shaper_profile_list, shaper_profile, node);
@@ -637,8 +637,8 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->no =0 ; tm_node->parent =NULL ; tm_node->shaper_profile = shaper_profile; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params, +sizeof (struct rte_tm_node_params )); tm_conf->root = tm_node;/* increase the reference counter of the shaper profile */
@@ -718,8 +718,7 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->reference_count =0 ; tm_node->parent = parent_node; tm_node->shaper_profile = shaper_profile; -rte_memcpy (&tm_node->params, params, -sizeof (struct rte_tm_node_params )); +memcpy (&tm_node->params, params,sizeof (struct rte_tm_node_params ));if (parent_node_type ==IXGBE_TM_NODE_TYPE_PORT ) { tm_node->no = parent_node->reference_count; TAILQ_INSERT_TAIL(&tm_conf->tc_list,
drivers/net/ixgbe/rte_pmd_ixgbe.c +2 -2
@@ -37,8 +37,8 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf,if (rte_is_valid_assigned_ether_addr ( (struct rte_ether_addr *)new_mac)) { -rte_memcpy (vfinfo[vf].vf_mac_addresses, new_mac, -RTE_ETHER_ADDR_LEN ); +memcpy (vfinfo[vf].vf_mac_addresses, new_mac, +RTE_ETHER_ADDR_LEN );return hw->mac.ops.set_rar (hw, rar_entry, new_mac, vf,IXGBE_RAH_AV ); }
drivers/net/memif/memif_socket.c +2 -2
@@ -48,7 +48,7 @@ memif_msg_send(int fd, memif_msg_t *msg, int afd) cmsg->cmsg_len =CMSG_LEN (sizeof (int )); cmsg->cmsg_level =SOL_SOCKET ; cmsg->cmsg_type =SCM_RIGHTS ; -rte_memcpy (CMSG_DATA (cmsg), &afd,sizeof (int )); +memcpy (CMSG_DATA (cmsg), &afd,sizeof (int )); }return sendmsg (fd, &mh,0 );
@@ -675,7 +675,7 @@ memif_msg_receive(struct memif_control_channel *cc)if (cmsg->cmsg_type ==SCM_CREDENTIALS ) cr = (struct ucred *)CMSG_DATA (cmsg);else if (cmsg->cmsg_type ==SCM_RIGHTS ) -rte_memcpy (&afd,CMSG_DATA (cmsg),sizeof (int )); +memcpy (&afd,CMSG_DATA (cmsg),sizeof (int )); } cmsg =CMSG_NXTHDR (&mh, cmsg); }
drivers/net/mlx5/mlx5_devx.c +2 -2
@@ -512,7 +512,7 @@ mlx5_rxq_obj_hairpin_new(struct mlx5_rxq_priv *rxq)* during queue setup. */ MLX5_ASSERT (hca_attr->hairpin_data_buffer_locked); -rte_memcpy (&locked_attr, &unlocked_attr,sizeof (locked_attr)); +memcpy (&locked_attr, &unlocked_attr,sizeof (locked_attr)); locked_attr.hairpin_data_buffer_type =MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_LOCKED_INTERNAL_BUFFER ; tmpl->rq = mlx5_devx_cmd_create_rq(priv->sh->cdev->ctx, &locked_attr,
@@ -1289,7 +1289,7 @@ mlx5_txq_obj_hairpin_new(struct rte_eth_dev *dev, uint16_t idx)*/ MLX5_ASSERT (hca_attr->hairpin_sq_wq_in_host_mem);MLX5_ASSERT (hca_attr->hairpin_sq_wqe_bb_size >0 ); -rte_memcpy (&host_mem_attr, &dev_mem_attr,sizeof (host_mem_attr)); +memcpy (&host_mem_attr, &dev_mem_attr,sizeof (host_mem_attr)); umem_size =MLX5_WQE_SIZE *RTE_BIT32 (host_mem_attr.wq_attr.log_hairpin_num_packets); umem_dbrec =RTE_ALIGN (umem_size,MLX5_DBR_SIZE );
drivers/net/mlx5/mlx5_flow.c +19 -19
@@ -4516,8 +4516,8 @@ flow_action_handles_translate(struct rte_eth_dev *dev, (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ACTION_NUM ,NULL ,"too many shared actions" ); } -rte_memcpy (&handle[copied_n].action, &actions[n].conf, -sizeof (actions[n].conf)); +memcpy (&handle[copied_n].action, &actions[n].conf, +sizeof (actions[n].conf)); handle[copied_n].index = n; copied_n++; }
@@ -5383,30 +5383,30 @@ flow_hairpin_split(struct rte_eth_dev *dev,case RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP :case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN :case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP : -rte_memcpy (actions_tx, actions, +memcpy (actions_tx, actions,sizeof (struct rte_flow_action )); actions_tx++;break ;case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID :if (push_vlan) { -rte_memcpy (actions_tx, actions, -sizeof (struct rte_flow_action )); +memcpy (actions_tx, actions, +sizeof (struct rte_flow_action )); actions_tx++; }else { -rte_memcpy (actions_rx, actions, -sizeof (struct rte_flow_action )); +memcpy (actions_rx, actions, +sizeof (struct rte_flow_action )); actions_rx++; }break ;case RTE_FLOW_ACTION_TYPE_COUNT :case RTE_FLOW_ACTION_TYPE_AGE :if (encap) { -rte_memcpy (actions_tx, actions, -sizeof (struct rte_flow_action )); +memcpy (actions_tx, actions, +sizeof (struct rte_flow_action )); actions_tx++; }else { -rte_memcpy (actions_rx, actions, -sizeof (struct rte_flow_action )); +memcpy (actions_rx, actions, +sizeof (struct rte_flow_action )); actions_rx++; }break ;
@@ -5418,8 +5418,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, actions_tx++; encap =1 ; }else { -rte_memcpy (actions_rx, actions, -sizeof (struct rte_flow_action )); +memcpy (actions_rx, actions, +sizeof (struct rte_flow_action )); actions_rx++; }break ;
@@ -5430,14 +5430,14 @@ flow_hairpin_split(struct rte_eth_dev *dev, sizeof(struct rte_flow_action)); actions_tx++; }else { -rte_memcpy (actions_rx, actions, -sizeof (struct rte_flow_action )); +memcpy (actions_rx, actions, +sizeof (struct rte_flow_action )); actions_rx++; }break ;default : -rte_memcpy (actions_rx, actions, -sizeof (struct rte_flow_action )); +memcpy (actions_rx, actions, +sizeof (struct rte_flow_action )); actions_rx++;break ; }
@@ -5447,7 +5447,7 @@ flow_hairpin_split(struct rte_eth_dev *dev, tag_action->type = (enum rte_flow_action_type )MLX5_RTE_FLOW_ACTION_TYPE_TAG ; actions_rx++; -rte_memcpy (actions_rx, actions,sizeof (struct rte_flow_action )); +memcpy (actions_rx, actions,sizeof (struct rte_flow_action )); actions_rx++; set_tag = (void *)actions_rx; *set_tag = (struct mlx5_rte_flow_action_set_tag ) {
@@ -5457,7 +5457,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,MLX5_ASSERT (set_tag->id >REG_NON ); tag_action->conf = set_tag;/* Create Tx item list. */ -rte_memcpy (actions_tx, actions,sizeof (struct rte_flow_action )); +memcpy (actions_tx, actions,sizeof (struct rte_flow_action )); addr = (void *)&pattern_tx[2 ]; item = pattern_tx; item->type = (enum rte_flow_item_type)
drivers/net/mlx5/mlx5_flow_aso.c +3 -3
@@ -1377,9 +1377,9 @@ mlx5_aso_ct_status_update(struct mlx5_aso_sq *sq, uint16_t num)MLX5_ASSERT (ct);MLX5_ASO_CT_UPDATE_STATE (ct,ASO_CONNTRACK_READY );if (sq->elts[idx].query_data) -rte_memcpy (sq->elts[idx].query_data, - (char *)((uintptr_t )sq->mr.addr + idx *64 ), -64 ); +memcpy (sq->elts[idx].query_data, + (char *)((uintptr_t )sq->mr.addr + idx *64 ), +64 ); } }
drivers/net/mlx5/mlx5_flow_hw.c +14 -13
@@ -2072,7 +2072,7 @@ mlx5_tbl_translate_modify_header(struct rte_eth_dev *dev,return rte_flow_error_set (error,ENOMEM ,RTE_FLOW_ERROR_TYPE_UNSPECIFIED ,NULL ,"translate modify_header: no memory for modify header context" ); -rte_memcpy (acts->mhdr, mhdr,sizeof (*mhdr)); +memcpy (acts->mhdr, mhdr,sizeof (*mhdr)); pattern.data = (__be64 *)acts->mhdr->mhdr_cmds;if (mhdr->shared) { uint32_t flags = mlx5_hw_act_flag[!!attr->group][tbl_type] |
@@ -2669,8 +2669,8 @@ flow_hw_populate_rule_acts_caches(struct rte_eth_dev *dev,struct mlx5dr_rule_action *rule_acts =flow_hw_get_dr_action_buffer (priv, table, at_idx, q); -rte_memcpy (rule_acts, table->ats[at_idx].acts.rule_acts, -sizeof (table->ats[at_idx].acts.rule_acts)); +memcpy (rule_acts, table->ats[at_idx].acts.rule_acts, +sizeof (table->ats[at_idx].acts.rule_acts)); } }
@@ -2972,9 +2972,9 @@ flow_hw_modify_field_construct(struct mlx5_modification_cmd *mhdr_cmd, mhdr_action->src.field != RTE_FLOW_FIELD_POINTER)return 0 ;if (mhdr_action->src.field ==RTE_FLOW_FIELD_VALUE ) -rte_memcpy (values, &mhdr_action->src.value,sizeof (values)); +memcpy (values, &mhdr_action->src.value,sizeof (values));else -rte_memcpy (values, mhdr_action->src.pvalue,sizeof (values)); +memcpy (values, mhdr_action->src.pvalue,sizeof (values)); if (mhdr_action->dst.field == RTE_FLOW_FIELD_META || mhdr_action->dst.field == RTE_FLOW_FIELD_TAG || mhdr_action->dst.field == RTE_FLOW_FIELD_METER_COLOR ||
@@ -4825,7 +4825,7 @@ flow_hw_table_create(struct rte_eth_dev *dev,rte_flow_error_set (error, err,RTE_FLOW_ERROR_TYPE_UNSPECIFIED ,NULL ,"Failed to create template table" ); else - rte_memcpy(error, &sub_error, sizeof(sub_error)); + memcpy(error, &sub_error, sizeof(sub_error)); }return NULL ; }
@@ -6917,8 +6917,9 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,if (masked) {uint32_t mask_val =0xffffffff ; -rte_memcpy (spec->src.value, &conf->vlan_vid,sizeof (conf->vlan_vid)); -rte_memcpy (mask->src.value, &mask_val,sizeof (mask_val)); +memcpy (spec->src.value, &conf->vlan_vid, +sizeof (conf->vlan_vid)); +memcpy (mask->src.value, &mask_val,sizeof (mask_val)); } ra[set_vlan_vid_ix].type =RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ; ra[set_vlan_vid_ix].conf = spec;
@@ -6954,7 +6955,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev, .conf = &conf }; -rte_memcpy (conf.src.value, &vid,sizeof (vid)); +memcpy (conf.src.value, &vid,sizeof (vid));return flow_hw_modify_field_construct (mhdr_cmd, act_data, hw_acts, &modify_action); }
@@ -8577,8 +8578,8 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev,struct rte_flow_action actions_m[4 ] = { {0 } };unsigned int idx =0 ; -rte_memcpy (set_tag_v.src.value, &tag_value,sizeof (tag_value)); -rte_memcpy (set_tag_m.src.value, &tag_mask,sizeof (tag_mask)); +memcpy (set_tag_v.src.value, &tag_value,sizeof (tag_value)); +memcpy (set_tag_m.src.value, &tag_mask,sizeof (tag_mask));flow_hw_update_action_mask (&actions_v[idx], &actions_m[idx],RTE_FLOW_ACTION_TYPE_MODIFY_FIELD , &set_tag_v, &set_tag_m);
@@ -8985,8 +8986,8 @@ flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev, }; set_reg_v.dst.offset =rte_bsf32 (marker_mask); -rte_memcpy (set_reg_v.src.value, &marker_bits,sizeof (marker_bits)); -rte_memcpy (set_reg_m.src.value, &marker_mask,sizeof (marker_mask)); +memcpy (set_reg_v.src.value, &marker_bits,sizeof (marker_bits)); +memcpy (set_reg_m.src.value, &marker_mask,sizeof (marker_mask));return flow_hw_actions_template_create (dev, &attr, actions_v, actions_m, error); }
drivers/net/mlx5/mlx5_rx.c +3 -3
@@ -767,9 +767,9 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe, ret =check_cqe_iteration (next, rxq->cqe_n, rxq->cq_ci);if (ret !=MLX5_CQE_STATUS_SW_OWN ||MLX5_CQE_FORMAT (next->op_own) ==MLX5_COMPRESSED ) -rte_memcpy (&rxq->title_cqe, - (const void *)(uintptr_t )cqe, -sizeof (struct mlx5_cqe )); +memcpy (&rxq->title_cqe, + (const void *)(uintptr_t )cqe, +sizeof (struct mlx5_cqe )); } } }
drivers/net/mlx5/mlx5_rxtx_vec.c +4 -4
@@ -349,8 +349,8 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, ret =check_cqe_iteration (next, rxq->cqe_n, rxq->cq_ci);if (ret !=MLX5_CQE_STATUS_SW_OWN ||MLX5_CQE_FORMAT (next->op_own) ==MLX5_COMPRESSED ) -rte_memcpy (&rxq->title_pkt, elts[nocmp_n -1 ], -sizeof (struct rte_mbuf )); +memcpy (&rxq->title_pkt, elts[nocmp_n -1 ], +sizeof (struct rte_mbuf )); }/* Decompress the last CQE if compressed. */ if (comp_idx <MLX5_VPMD_DESCS_PER_LOOP ) {
@@ -499,8 +499,8 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, ret =check_cqe_iteration (next, rxq->cqe_n, rxq->cq_ci);if (ret !=MLX5_CQE_STATUS_SW_OWN ||MLX5_CQE_FORMAT (next->op_own) ==MLX5_COMPRESSED ) -rte_memcpy (&rxq->title_pkt, elts[nocmp_n -1 ], -sizeof (struct rte_mbuf )); +memcpy (&rxq->title_pkt, elts[nocmp_n -1 ], +sizeof (struct rte_mbuf )); }/* Decompress the last CQE if compressed. */ if (comp_idx <MLX5_VPMD_DESCS_PER_LOOP ) {
drivers/net/mvpp2/mrvl_tm.c +1 -1
@@ -437,7 +437,7 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id, NULL, NULL); profile->id = shaper_profile_id; -rte_memcpy (&profile->params, params,sizeof (profile->params)); +memcpy (&profile->params, params,sizeof (profile->params));LIST_INSERT_HEAD (&priv->shaper_profiles, profile, next);
drivers/net/netvsc/hn_ethdev.c +0 -1
@@ -16,7 +16,6 @@#include <sys/ioctl.h> #include <rte_ethdev.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_memzone.h> #include <rte_devargs.h>
drivers/net/nfp/flower/nfp_conntrack.c +1 -1
@@ -1470,7 +1470,7 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze, merge_entry->ze = ze; merge_entry->pre_ct_parent = pre_ct_entry; merge_entry->post_ct_parent = post_ct_entry; -rte_memcpy (merge_entry->cookie, new_cookie,sizeof (new_cookie)); +memcpy (merge_entry->cookie, new_cookie,sizeof (new_cookie)); merge_entry->rule.items_cnt = pre_ct_entry->rule.items_cnt + post_ct_entry->rule.items_cnt - cnt_same_item -1 ; merge_entry->rule.actions_cnt = pre_ct_entry->rule.actions_cnt +
drivers/net/nfp/flower/nfp_flower_flow.c +8 -8
@@ -179,10 +179,10 @@ nfp_mask_id_alloc(struct nfp_flow_priv *priv,return -ENOENT ; } -rte_memcpy (&temp_id, &ring->buf[ring->tail],NFP_FLOWER_MASK_ELEMENT_RS ); +memcpy (&temp_id, &ring->buf[ring->tail],NFP_FLOWER_MASK_ELEMENT_RS ); *mask_id = temp_id; -rte_memcpy (&ring->buf[ring->tail], &freed_id,NFP_FLOWER_MASK_ELEMENT_RS ); +memcpy (&ring->buf[ring->tail], &freed_id,NFP_FLOWER_MASK_ELEMENT_RS ); ring->tail = (ring->tail +NFP_FLOWER_MASK_ELEMENT_RS ) % (NFP_FLOWER_MASK_ENTRY_RS *NFP_FLOWER_MASK_ELEMENT_RS );
@@ -201,7 +201,7 @@ nfp_mask_id_free(struct nfp_flow_priv *priv,if (CIRC_SPACE (ring->head, ring->tail,NFP_FLOWER_MASK_ENTRY_RS ) ==0 )return -ENOBUFS ; -rte_memcpy (&ring->buf[ring->head], &mask_id,NFP_FLOWER_MASK_ELEMENT_RS ); +memcpy (&ring->buf[ring->head], &mask_id,NFP_FLOWER_MASK_ELEMENT_RS ); ring->head = (ring->head +NFP_FLOWER_MASK_ELEMENT_RS ) % (NFP_FLOWER_MASK_ENTRY_RS *NFP_FLOWER_MASK_ELEMENT_RS );
@@ -2255,13 +2255,13 @@ nfp_flow_action_set_mac(char *act_data, set_mac = action->conf;if (mac_src_flag) { -rte_memcpy (&set_eth->eth_addr[RTE_ETHER_ADDR_LEN ], - set_mac->mac_addr,RTE_ETHER_ADDR_LEN ); +memcpy (&set_eth->eth_addr[RTE_ETHER_ADDR_LEN ], + set_mac->mac_addr,RTE_ETHER_ADDR_LEN );for (i =0 ; i <RTE_ETHER_ADDR_LEN ; i++) set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] =0xff ; }else { -rte_memcpy (&set_eth->eth_addr[0 ], - set_mac->mac_addr,RTE_ETHER_ADDR_LEN ); +memcpy (&set_eth->eth_addr[0 ], set_mac->mac_addr, +RTE_ETHER_ADDR_LEN );for (i =0 ; i <RTE_ETHER_ADDR_LEN ; i++) set_eth->eth_addr_mask[i] =0xff ; }
@@ -2337,7 +2337,7 @@ nfp_flow_action_set_ipv6(char *act_data, set_ip->reserved =0 ;for (i =0 ; i <4 ; i++) { -rte_memcpy (&tmp, &set_ipv6->ipv6_addr[i *4 ],4 ); +memcpy (&tmp, &set_ipv6->ipv6_addr[i *4 ],4 ); set_ip->ipv6[i].exact = tmp; set_ip->ipv6[i].mask =RTE_BE32 (0xffffffff ); }
drivers/net/nfp/flower/nfp_flower_representor.c +1 -1
@@ -194,7 +194,7 @@ nfp_flower_repr_stats_get(struct rte_eth_dev *ethdev,struct nfp_flower_representor *repr; repr = ethdev->data->dev_private; -rte_memcpy (stats, &repr->repr_stats,sizeof (struct rte_eth_stats )); +memcpy (stats, &repr->repr_stats,sizeof (struct rte_eth_stats ));return 0 ; }
drivers/net/nfp/nfp_mtr.c +5 -5
@@ -243,7 +243,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,struct nfp_profile_conf old_conf;/* Get the old profile config */ -rte_memcpy (&old_conf, &mtr_profile->conf,sizeof (old_conf)); +memcpy (&old_conf, &mtr_profile->conf,sizeof (old_conf));memset (&mtr_profile->conf,0 ,sizeof (struct nfp_profile_conf ));
@@ -267,7 +267,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,return 0 ; rollback: -rte_memcpy (&mtr_profile->conf, &old_conf,sizeof (old_conf)); +memcpy (&mtr_profile->conf, &old_conf,sizeof (old_conf));return ret; }
@@ -492,8 +492,8 @@ nfp_mtr_policy_add(struct rte_eth_dev *dev, } mtr_policy->policy_id = mtr_policy_id; -rte_memcpy (&mtr_policy->policy, policy, -sizeof (struct rte_mtr_meter_policy_params )); +memcpy (&mtr_policy->policy, policy, +sizeof (struct rte_mtr_meter_policy_params ));/* Insert policy into policy list */ LIST_INSERT_HEAD (&priv->policies, mtr_policy, next);
@@ -1028,7 +1028,7 @@ nfp_mtr_stats_read(struct rte_eth_dev *dev, *stats_mask = mtr->stats_mask;rte_spinlock_lock (&priv->mtr_stats_lock); -rte_memcpy (&curr, &mtr->mtr_stats.curr,sizeof (curr)); +memcpy (&curr, &mtr->mtr_stats.curr,sizeof (curr));rte_spinlock_unlock (&priv->mtr_stats_lock); prev = &mtr->mtr_stats.prev;
drivers/net/ngbe/ngbe_pf.c +2 -2
@@ -347,7 +347,7 @@ ngbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf)/* reply to reset with ack and vf mac address */ msgbuf[0 ] =NGBE_VF_RESET |NGBE_VT_MSGTYPE_ACK ; -rte_memcpy (new_mac, vf_mac,RTE_ETHER_ADDR_LEN ); +memcpy (new_mac, vf_mac,RTE_ETHER_ADDR_LEN );/* * Piggyback the multicast filter type so VF can compute the * correct vectors
@@ -369,7 +369,7 @@ ngbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac;if (rte_is_valid_assigned_ether_addr (ea)) { -rte_memcpy (vfinfo[vf].vf_mac_addresses, new_mac,6 ); +memcpy (vfinfo[vf].vf_mac_addresses, new_mac,6 );return hw->mac.set_rar (hw, rar_entry, new_mac, vf, true); }return -1 ;
drivers/net/null/rte_eth_null.c +3 -3
@@ -465,7 +465,7 @@ eth_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf) rss_conf->rss_hf & internal->flow_type_rss_offloads;if (rss_conf->rss_key) -rte_memcpy (internal->rss_key, rss_conf->rss_key,40 ); +memcpy (internal->rss_key, rss_conf->rss_key,40 );rte_spinlock_unlock (&internal->rss_lock);
@@ -482,7 +482,7 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev, rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;if (rss_conf->rss_key) -rte_memcpy (rss_conf->rss_key, internal->rss_key,40 ); +memcpy (rss_conf->rss_key, internal->rss_key,40 );rte_spinlock_unlock (&internal->rss_lock);
@@ -577,7 +577,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, struct pmd_options *args) internals->flow_type_rss_offloads =RTE_ETH_RSS_PROTO_MASK ; internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_ETH_RETA_GROUP_SIZE ; -rte_memcpy (internals->rss_key, default_rss_key,40 ); +memcpy (internals->rss_key, default_rss_key,40 ); data = eth_dev->data; data->nb_rx_queues = (uint16_t )nb_rx_queues;
drivers/net/pcap/pcap_ethdev.c +1 -1
@@ -1270,7 +1270,7 @@ eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,return -1 ;PMD_LOG (INFO ,"Setting phy MAC for %s" , if_name); -rte_memcpy (mac_addrs, mac.addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (mac_addrs, mac.addr_bytes,RTE_ETHER_ADDR_LEN ); eth_dev->data->mac_addrs = mac_addrs;return 0 ; }
drivers/net/pcap/pcap_osdep_freebsd.c +1 -2
@@ -9,7 +9,6 @@#include <sys/sysctl.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include "pcap_osdep.h"
@@ -52,7 +51,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac) ifm = (struct if_msghdr *)buf; sdl = (struct sockaddr_dl *)(ifm +1 ); -rte_memcpy (mac->addr_bytes,LLADDR (sdl),RTE_ETHER_ADDR_LEN ); +memcpy (mac->addr_bytes,LLADDR (sdl),RTE_ETHER_ADDR_LEN );rte_free (buf);return 0 ;
drivers/net/pcap/pcap_osdep_linux.c +1 -2
@@ -9,7 +9,6 @@#include <sys/socket.h> #include <unistd.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include "pcap_osdep.h"
@@ -35,7 +34,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)return -1 ; } -rte_memcpy (mac->addr_bytes, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN ); +memcpy (mac->addr_bytes, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN );close (if_fd);return 0 ;
drivers/net/qede/qede_main.c +1 -1
@@ -180,7 +180,7 @@ static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn) is_mac_exist =ecore_vf_bulletin_get_forced_mac (hwfn, mac, &is_mac_forced);if (is_mac_exist && is_mac_forced) -rte_memcpy (hwfn->hw_info.hw_mac_addr, mac,ETH_ALEN ); +memcpy (hwfn->hw_info.hw_mac_addr, mac,ETH_ALEN );/* Always update link configuration according to bulletin */ qed_link_update (hwfn);
drivers/net/ring/rte_eth_ring.c +0 -1
@@ -8,7 +8,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_os_shim.h> #include <rte_string_fns.h> #include <bus_vdev_driver.h>
drivers/net/sfc/sfc.c +1 -1
@@ -850,7 +850,7 @@ sfc_rss_attach(struct sfc_adapter *sa)efx_ev_fini (sa->nic);efx_intr_fini (sa->nic); -rte_memcpy (rss->key, default_rss_key,sizeof (rss->key)); +memcpy (rss->key, default_rss_key,sizeof (rss->key));memset (&rss->dummy_ctx,0 ,sizeof (rss->dummy_ctx)); rss->dummy_ctx.conf.qid_span =1 ; rss->dummy_ctx.dummy = true;
drivers/net/sfc/sfc_ef10_tx.c +1 -1
@@ -514,7 +514,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg, first_m_seg->outer_l2_len); th = (const struct rte_tcp_hdr *)(hdr_addr + tcph_off); -rte_memcpy (&sent_seq, &th->sent_seq,sizeof (uint32_t )); +memcpy (&sent_seq, &th->sent_seq,sizeof (uint32_t )); sent_seq =rte_be_to_cpu_32 (sent_seq); sfc_ef10_tx_qdesc_tso2_create(txq, *added, packet_id, outer_packet_id,
drivers/net/sfc/sfc_ethdev.c +5 -6
@@ -1287,8 +1287,7 @@ sfc_set_mc_addr_list(struct rte_eth_dev *dev, }for (i =0 ; i < nb_mc_addr; ++i) { -rte_memcpy (mc_addrs, mc_addr_set[i].addr_bytes, -EFX_MAC_ADDR_LEN ); +memcpy (mc_addrs, mc_addr_set[i].addr_bytes,EFX_MAC_ADDR_LEN ); mc_addrs +=EFX_MAC_ADDR_LEN ; }
@@ -1672,7 +1671,7 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev, rss_conf->rss_hf =sfc_rx_hf_efx_to_rte (rss, rss->hash_types); rss_conf->rss_key_len =EFX_RSS_KEY_SIZE ;if (rss_conf->rss_key !=NULL ) -rte_memcpy (rss_conf->rss_key, rss->key,EFX_RSS_KEY_SIZE ); +memcpy (rss_conf->rss_key, rss->key,EFX_RSS_KEY_SIZE );return 0 ; }
@@ -1741,7 +1740,7 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev, } } -rte_memcpy (rss->key, rss_conf->rss_key,sizeof (rss->key)); +memcpy (rss->key, rss_conf->rss_key,sizeof (rss->key)); } rss->hash_types = efx_hash_types;
@@ -1840,7 +1839,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,sfc_adapter_lock (sa); -rte_memcpy (rss_tbl_new, rss->tbl,sizeof (rss->tbl)); +memcpy (rss_tbl_new, rss->tbl,sizeof (rss->tbl));for (entry =0 ; entry < reta_size; entry++) {int grp_idx = entry %RTE_ETH_RETA_GROUP_SIZE ;
@@ -1864,7 +1863,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev, goto fail_scale_tbl_set; } -rte_memcpy (rss->tbl, rss_tbl_new,sizeof (rss->tbl)); +memcpy (rss->tbl, rss_tbl_new,sizeof (rss->tbl)); fail_scale_tbl_set: bad_reta_entry:
drivers/net/sfc/sfc_flow.c +10 -10
@@ -325,8 +325,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, efx_spec->efs_match_flags |= is_ifrm ?EFX_FILTER_MATCH_IFRM_LOC_MAC :EFX_FILTER_MATCH_LOC_MAC ; -rte_memcpy (loc_mac, spec->hdr.dst_addr.addr_bytes, -EFX_MAC_ADDR_LEN ); +memcpy (loc_mac, spec->hdr.dst_addr.addr_bytes, +EFX_MAC_ADDR_LEN ); }else if (memcmp (mask->hdr.dst_addr.addr_bytes, ig_mask,EFX_MAC_ADDR_LEN ) ==0 ) {if (rte_is_unicast_ether_addr (&spec->hdr.dst_addr))
@@ -348,8 +348,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,*/ if (rte_is_same_ether_addr (&mask->hdr.src_addr, &supp_mask.hdr.src_addr)) { efx_spec->efs_match_flags |=EFX_FILTER_MATCH_REM_MAC ; -rte_memcpy (efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes, -EFX_MAC_ADDR_LEN ); +memcpy (efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes, +EFX_MAC_ADDR_LEN ); }else if (!rte_is_zero_ether_addr (&mask->hdr.src_addr)) { goto fail_bad_mask; }
@@ -624,8 +624,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,RTE_BUILD_BUG_ON (sizeof (efx_spec->efs_rem_host) !=sizeof (spec->hdr.src_addr)); -rte_memcpy (&efx_spec->efs_rem_host, spec->hdr.src_addr, -sizeof (efx_spec->efs_rem_host)); +memcpy (&efx_spec->efs_rem_host, spec->hdr.src_addr, +sizeof (efx_spec->efs_rem_host)); }else if (!sfc_flow_is_zero (mask->hdr.src_addr,sizeof (mask->hdr.src_addr))) { goto fail_bad_mask;
@@ -637,8 +637,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,RTE_BUILD_BUG_ON (sizeof (efx_spec->efs_loc_host) !=sizeof (spec->hdr.dst_addr)); -rte_memcpy (&efx_spec->efs_loc_host, spec->hdr.dst_addr, -sizeof (efx_spec->efs_loc_host)); +memcpy (&efx_spec->efs_loc_host, spec->hdr.dst_addr, +sizeof (efx_spec->efs_loc_host)); }else if (!sfc_flow_is_zero (mask->hdr.dst_addr,sizeof (mask->hdr.dst_addr))) { goto fail_bad_mask;
@@ -889,8 +889,8 @@ sfc_flow_set_efx_spec_vni_or_vsid(efx_filter_spec_t *efx_spec,if (memcmp (vni_or_vsid_mask, vni_or_vsid_full_mask,EFX_VNI_OR_VSID_LEN ) ==0 ) { efx_spec->efs_match_flags |=EFX_FILTER_MATCH_VNI_OR_VSID ; -rte_memcpy (efx_spec->efs_vni_or_vsid, vni_or_vsid_val, -EFX_VNI_OR_VSID_LEN ); +memcpy (efx_spec->efs_vni_or_vsid, vni_or_vsid_val, +EFX_VNI_OR_VSID_LEN ); }else if (!sfc_flow_is_zero (vni_or_vsid_mask,EFX_VNI_OR_VSID_LEN )) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item,
drivers/net/sfc/sfc_flow_rss.c +1 -1
@@ -119,7 +119,7 @@ sfc_flow_rss_parse_conf(struct sfc_adapter *sa, key = ethdev_rss->key; } -rte_memcpy (out->key, key,sizeof (out->key)); +memcpy (out->key, key,sizeof (out->key));switch (in->func) {case RTE_ETH_HASH_FUNCTION_DEFAULT :
drivers/net/sfc/sfc_mae.c +1 -1
@@ -547,7 +547,7 @@ sfc_mae_mac_addr_add(struct sfc_adapter *sa,if (mac_addr ==NULL )return ENOMEM ; -rte_memcpy (mac_addr->addr_bytes, addr_bytes,EFX_MAC_ADDR_LEN ); +memcpy (mac_addr->addr_bytes, addr_bytes,EFX_MAC_ADDR_LEN ); mac_addr->refcnt =1 ; mac_addr->fw_rsrc.mac_id.id =EFX_MAE_RSRC_ID_INVALID ;
drivers/net/sfc/sfc_rx.c +1 -1
@@ -1526,7 +1526,7 @@ sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa, sizeof(rss->key));return EINVAL ; } -rte_memcpy (rss->key, conf->rss_key,sizeof (rss->key)); +memcpy (rss->key, conf->rss_key,sizeof (rss->key)); } rss->hash_types = efx_hash_types;
drivers/net/sfc/sfc_tso.c +1 -1
@@ -159,7 +159,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,/* Handle TCP header */ th = (const struct rte_tcp_hdr *)(tsoh + tcph_off); -rte_memcpy (&sent_seq, &th->sent_seq,sizeof (uint32_t )); +memcpy (&sent_seq, &th->sent_seq,sizeof (uint32_t )); sent_seq =rte_be_to_cpu_32 (sent_seq); efx_tx_qdesc_tso2_create(txq->common, packet_id, 0, sent_seq,
drivers/net/sfc/sfc_tso.h +4 -5
@@ -35,7 +35,7 @@ sfc_tso_ip4_get_ipid(const uint8_t *pkt_hdrp, size_t ip_hdr_off)uint16_t ipid; ip_hdrp = (const struct rte_ipv4_hdr *)(pkt_hdrp + ip_hdr_off); -rte_memcpy (&ipid, &ip_hdrp->packet_id,sizeof (ipid)); +memcpy (&ipid, &ip_hdrp->packet_id,sizeof (ipid));return rte_be_to_cpu_16 (ipid); }
@@ -46,9 +46,8 @@ sfc_tso_outer_udp_fix_len(const struct rte_mbuf *m, uint8_t *tsoh)rte_be16_t len =rte_cpu_to_be_16 (m->l2_len + m->l3_len + m->l4_len + m->tso_segsz); -rte_memcpy (tsoh + m->outer_l2_len + m->outer_l3_len + - offsetof(struct rte_udp_hdr , dgram_len), - &len,sizeof (len)); +memcpy (tsoh + m->outer_l2_len + m->outer_l3_len + offsetof(struct rte_udp_hdr , dgram_len), + &len,sizeof (len)); } static inline void
@@ -67,7 +66,7 @@ sfc_tso_innermost_ip_fix_len(const struct rte_mbuf *m, uint8_t *tsoh, len =rte_cpu_to_be_16 (ip_payload_len); } -rte_memcpy (tsoh + iph_ofst + field_ofst, &len,sizeof (len)); +memcpy (tsoh + iph_ofst + field_ofst, &len,sizeof (len)); } unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,
drivers/net/tap/rte_eth_tap.c +7 -7
@@ -1404,11 +1404,11 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) mac_addr)) mode =LOCAL_AND_REMOTE ; ifr.ifr_hwaddr.sa_family =AF_LOCAL ; -rte_memcpy (ifr.ifr_hwaddr.sa_data, mac_addr,RTE_ETHER_ADDR_LEN ); +memcpy (ifr.ifr_hwaddr.sa_data, mac_addr,RTE_ETHER_ADDR_LEN ); ret =tap_ioctl (pmd,SIOCSIFHWADDR , &ifr,1 , mode);if (ret <0 )return ret; -rte_memcpy (&pmd->eth_addr, mac_addr,RTE_ETHER_ADDR_LEN ); +memcpy (&pmd->eth_addr, mac_addr,RTE_ETHER_ADDR_LEN );if (pmd->remote_if_index && !pmd->flow_isolate) {/* Replace MAC redirection rule after a MAC change */ ret =tap_flow_implicit_destroy (pmd,TAP_REMOTE_LOCAL_MAC );
@@ -2010,7 +2010,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,if (rte_is_zero_ether_addr (mac_addr))rte_eth_random_addr ((uint8_t *)&pmd->eth_addr);else -rte_memcpy (&pmd->eth_addr, mac_addr,sizeof (*mac_addr)); +memcpy (&pmd->eth_addr, mac_addr,sizeof (*mac_addr)); }/*
@@ -2033,8 +2033,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,if (pmd->type ==ETH_TUNTAP_TYPE_TAP ) {memset (&ifr,0 ,sizeof (struct ifreq )); ifr.ifr_hwaddr.sa_family =AF_LOCAL ; -rte_memcpy (ifr.ifr_hwaddr.sa_data, &pmd->eth_addr, -RTE_ETHER_ADDR_LEN ); +memcpy (ifr.ifr_hwaddr.sa_data, &pmd->eth_addr, +RTE_ETHER_ADDR_LEN );if (tap_ioctl (pmd,SIOCSIFHWADDR , &ifr,0 ,LOCAL_ONLY ) <0 ) goto error_exit; }
@@ -2091,8 +2091,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name, pmd->name, pmd->remote_iface); goto error_remote; } -rte_memcpy (&pmd->eth_addr, ifr.ifr_hwaddr.sa_data, -RTE_ETHER_ADDR_LEN ); +memcpy (&pmd->eth_addr, ifr.ifr_hwaddr.sa_data, +RTE_ETHER_ADDR_LEN );
Lines of this file are not shown. View the raw message.
drivers/net/txgbe/txgbe_flow.c +29 -36
65 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.0
Part of the diff is not shown here. View the raw message.
PATCH v4 16/30 raw: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-- drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-- drivers/raw/ifpga/afu_pmd_n3000.c | 8 ++++---- drivers/raw/ifpga/ifpga_rawdev.c | 11 +++++------ drivers/raw/skeleton/skeleton_rawdev.c | 8 +++----- drivers/raw/skeleton/skeleton_rawdev_test.c | 1 - 7 files changed, 15 insertions(+), 22 deletions(-)
drivers/raw/ifpga/afu_pmd_he_hssi.c +1 -2
@@ -15,7 +15,6 @@#include <rte_eal.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> #include <bus_pci_driver.h>
@@ -314,7 +313,7 @@ static int he_hssi_config(struct afu_rawdev *dev, void *config,if (cfg->port >=NUM_HE_HSSI_PORTS )return -EINVAL ; -rte_memcpy (&priv->he_hssi_cfg, cfg,sizeof (priv->he_hssi_cfg)); +memcpy (&priv->he_hssi_cfg, cfg,sizeof (priv->he_hssi_cfg));return 0 ; }
drivers/raw/ifpga/afu_pmd_he_lpbk.c +1 -2
@@ -15,7 +15,6 @@#include <rte_eal.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> #include <bus_pci_driver.h>
@@ -363,7 +362,7 @@ static int he_lpbk_config(struct afu_rawdev *dev, void *config,if ((cfg->end < cfg->begin) || (cfg->end >MAX_CACHE_LINES ))return -EINVAL ; -rte_memcpy (&priv->he_lpbk_cfg, cfg,sizeof (priv->he_lpbk_cfg)); +memcpy (&priv->he_lpbk_cfg, cfg,sizeof (priv->he_lpbk_cfg));return 0 ; }
drivers/raw/ifpga/afu_pmd_he_mem.c +1 -2
@@ -14,7 +14,6 @@#include <rte_eal.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> #include <bus_pci_driver.h>
@@ -126,7 +125,7 @@ static int he_mem_tg_config(struct afu_rawdev *dev, void *config,if (config_size !=sizeof (struct rte_pmd_afu_he_mem_tg_cfg ))return -EINVAL ; -rte_memcpy (&priv->he_mem_tg_cfg, config,sizeof (priv->he_mem_tg_cfg)); +memcpy (&priv->he_mem_tg_cfg, config,sizeof (priv->he_mem_tg_cfg));return 0 ; }
drivers/raw/ifpga/afu_pmd_n3000.c +4 -4
@@ -1867,8 +1867,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,if ((cfg->nlb_cfg.end < cfg->nlb_cfg.begin) || (cfg->nlb_cfg.end >MAX_CACHE_LINES ))return -EINVAL ; -rte_memcpy (&priv->nlb_cfg, &cfg->nlb_cfg, -sizeof (struct rte_pmd_afu_nlb_cfg )); +memcpy (&priv->nlb_cfg, &cfg->nlb_cfg, +sizeof (struct rte_pmd_afu_nlb_cfg )); }else if (cfg->type ==RTE_PMD_AFU_N3000_DMA ) {if (cfg->dma_cfg.index >=NUM_N3000_DMA )return -EINVAL ;
@@ -1887,8 +1887,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config, cfg->dma_cfg.length); } } -rte_memcpy (&priv->dma_cfg, &cfg->dma_cfg, -sizeof (struct rte_pmd_afu_dma_cfg )); +memcpy (&priv->dma_cfg, &cfg->dma_cfg, +sizeof (struct rte_pmd_afu_dma_cfg )); }else {IFPGA_RAWDEV_PMD_ERR ("Invalid type of N3000 AFU" );return -EINVAL ;
drivers/raw/ifpga/ifpga_rawdev.c +5 -6
@@ -14,7 +14,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_kvargs.h>
@@ -258,7 +257,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev *ifpga_dev)if (point <12 )return -1 ; point -=12 ; -rte_memcpy (ifpga_dev->parent_bdf, &link[point],12 ); +memcpy (ifpga_dev->parent_bdf, &link[point],12 ); point =strlen (link1);if (point <26 )
@@ -948,10 +947,10 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,if (ret)return ret; -rte_memcpy (&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b, -sizeof (u64)); -rte_memcpy (&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b +8 , -sizeof (u64)); +memcpy (&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b, +sizeof (u64)); +memcpy (&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b +8 , +sizeof (u64)); IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n", __func__,
drivers/raw/skeleton/skeleton_rawdev.c +3 -5
@@ -20,7 +20,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_lcore.h> #include <bus_vdev_driver.h>
@@ -245,8 +244,8 @@ static int skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev, skelq = &skeldev->queues[queue_id];if (queue_id <SKELETON_MAX_QUEUES ) -rte_memcpy (queue_conf, skelq, -sizeof (struct skeleton_rawdev_queue )); +memcpy (queue_conf, skelq, +sizeof (struct skeleton_rawdev_queue ));return 0 ; }
@@ -281,8 +280,7 @@ static int skeleton_rawdev_queue_setup(struct rte_rawdev *dev,if (skeldev->num_queues > queue_id && q->depth <SKELETON_QUEUE_MAX_DEPTH ) { -rte_memcpy (q, queue_conf, -sizeof (struct skeleton_rawdev_queue )); +memcpy (q, queue_conf,sizeof (struct skeleton_rawdev_queue ));clear_queue_bufs (queue_id); }else {SKELETON_PMD_ERR ("Invalid queue configuration" );
drivers/raw/skeleton/skeleton_rawdev_test.c +0 -1
@@ -7,7 +7,6 @@#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <dev_driver.h> #include <rte_rawdev.h> #include <bus_vdev_driver.h>
Signature · 1 line
2.43.0
PATCH v4 17/30 baseband: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/baseband/acc/rte_acc100_pmd.c | 16 +++++++--------- drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++----------- drivers/baseband/la12xx/bbdev_la12xx.c | 4 ++-- 3 files changed, 19 insertions(+), 22 deletions(-)
drivers/baseband/acc/rte_acc100_pmd.c +7 -9
@@ -2975,15 +2975,13 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,uint8_t *prev_ptr = (uint8_t *) prev_desc;uint8_t *new_ptr = (uint8_t *) desc;/* Copy first 4 words and BDESCs */ -rte_memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); -rte_memcpy (new_ptr +ACC_5GUL_OFFSET_0 , - prev_ptr +ACC_5GUL_OFFSET_0 , -ACC_5GUL_SIZE_1 ); +memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); +memcpy (new_ptr +ACC_5GUL_OFFSET_0 , + prev_ptr +ACC_5GUL_OFFSET_0 ,ACC_5GUL_SIZE_1 ); desc->req.op_addr = prev_desc->req.op_addr;/* Copy FCW */ -rte_memcpy (new_ptr +ACC_DESC_FCW_OFFSET , - prev_ptr +ACC_DESC_FCW_OFFSET , -ACC_FCW_LD_BLEN ); +memcpy (new_ptr +ACC_DESC_FCW_OFFSET , + prev_ptr +ACC_DESC_FCW_OFFSET ,ACC_FCW_LD_BLEN );acc100_dma_desc_ld_update (op, &desc->req, input, h_output, &in_offset, &h_out_offset, &h_out_length, harq_layout);
@@ -3130,7 +3128,7 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc =acc_desc (q, total_enqueued_cbs); desc->req.data_ptrs[0 ].address = q->ring_addr_iova + fcw_offset; desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ; -rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); +memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); ret = acc100_dma_desc_ld_fill(op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length,
@@ -4430,7 +4428,7 @@ acc100_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); value =acc_reg_read (d, HwPfPcieGpexBridgeControl);bool firstCfg = (value !=ACC100_CFG_PCI_BRIDGE );
drivers/baseband/acc/rte_vrb_pmd.c +10 -11
@@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,uint8_t *prev_ptr = (uint8_t *) prev_desc;uint8_t *new_ptr = (uint8_t *) desc;/* Copy first 4 words and BDESCs. */ -rte_memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); -rte_memcpy (new_ptr +ACC_5GUL_OFFSET_0 , - prev_ptr +ACC_5GUL_OFFSET_0 , -ACC_5GUL_SIZE_1 ); +memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); +memcpy (new_ptr +ACC_5GUL_OFFSET_0 , + prev_ptr +ACC_5GUL_OFFSET_0 ,ACC_5GUL_SIZE_1 ); desc->req.op_addr = prev_desc->req.op_addr;/* Copy FCW. */ -rte_memcpy (new_ptr +ACC_DESC_FCW_OFFSET , - prev_ptr +ACC_DESC_FCW_OFFSET , -ACC_FCW_LD_BLEN ); +memcpy (new_ptr +ACC_DESC_FCW_OFFSET , + prev_ptr +ACC_DESC_FCW_OFFSET ,ACC_FCW_LD_BLEN );vrb_dma_desc_ld_update (op, &desc->req, input, h_output, &in_offset, &h_out_offset, &h_out_length, harq_layout);
@@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, fcw_offset = (desc_idx <<8 ) +ACC_DESC_FCW_OFFSET ; desc->req.data_ptrs[0 ].address = q->ring_addr_iova + fcw_offset; desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ; -rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); +memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld, +ACC_FCW_LD_BLEN ); desc->req.fcw_ld.tb_trailer_size = (c - r -1 ) * trail_len; ret = vrb_dma_desc_ld_fill(op, &desc->req, &input, h_output, &in_offset, &h_out_offset,
@@ -3991,7 +3990,7 @@ enqueue_mldts_split_op(struct acc_queue *q, struct rte_bbdev_mldts_op *op,if (symb ==0 ) desc->req.cbs_in_tb = num_syms;else -rte_memcpy (&desc->req.fcw_mldts, fcw,ACC_FCW_MLDTS_BLEN ); +memcpy (&desc->req.fcw_mldts, fcw,ACC_FCW_MLDTS_BLEN ); desc->req.data_ptrs[1 ].address =rte_pktmbuf_iova_offset (input_q, in_offset); desc->req.data_ptrs[1 ].blen = q_size; in_offset += q_size;
@@ -4337,7 +4336,7 @@ vrb1_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration. */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf));/* Check we are already out of PG. */ status =acc_reg_read (d, VRB1_PfHiSectionPowerGatingAck);
@@ -4744,7 +4743,7 @@ vrb2_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration. */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf));/* Explicitly releasing AXI as this may be stopped after PF FLR/BME. */ address = VRB2_PfDmaAxiControl;
drivers/baseband/la12xx/bbdev_la12xx.c +2 -2
@@ -597,8 +597,8 @@ dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst) op = q_priv->bbdev_op[ci]; -rte_memcpy (dst, q_priv->msg_ch_vaddr[ci], -sizeof (struct bbdev_ipc_enqueue_op )); +memcpy (dst, q_priv->msg_ch_vaddr[ci], +sizeof (struct bbdev_ipc_enqueue_op ));/* Move Consumer Index forward */ ci++;
Signature · 1 line
2.43.0
PATCH v4 18/30 common: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci Also, remove unnecessary includes of rte_memcpy.h
--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_virtchnl.c | 10 ++++++---- drivers/common/qat/qat_qp.c | 10 ++++------ drivers/compress/qat/qat_comp.c | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-)
drivers/common/idpf/idpf_common_device.c +2 -2
@@ -477,8 +477,8 @@ idpf_vport_init(struct idpf_vport *vport, vport->num_rx_q = vport_info->num_rx_q; vport->num_rx_bufq = vport_info->num_rx_bufq; vport->max_mtu = vport_info->max_mtu; -rte_memcpy (vport->default_mac_addr, - vport_info->default_mac_addr,ETH_ALEN ); +memcpy (vport->default_mac_addr, vport_info->default_mac_addr, +ETH_ALEN ); vport->rss_algorithm = vport_info->rss_algorithm; vport->rss_key_size =RTE_MIN (IDPF_RSS_KEY_LEN , vport_info->rss_key_size);
drivers/common/idpf/idpf_common_virtchnl.c +6 -4
@@ -290,7 +290,8 @@ idpf_vc_caps_get(struct idpf_adapter *adapter)return err; } -rte_memcpy (&adapter->caps, args.out_buffer,sizeof (struct virtchnl2_get_capabilities )); +memcpy (&adapter->caps, args.out_buffer, +sizeof (struct virtchnl2_get_capabilities ));return 0 ; }
@@ -327,7 +328,8 @@ idpf_vc_vport_create(struct idpf_vport *vport,return err; } -rte_memcpy (&(vport->vport_info.info), args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (&(vport->vport_info.info), args.out_buffer, +IDPF_DFLT_MBX_BUF_SIZE );return 0 ; }
@@ -383,7 +385,7 @@ idpf_vc_queue_grps_add(struct idpf_vport *vport,return err; } -rte_memcpy (p2p_queue_grps_out, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (p2p_queue_grps_out, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE );return 0 ; }
@@ -922,7 +924,7 @@ idpf_vc_ptype_info_query(struct idpf_adapter *adapter,if (err !=0 )DRV_LOG (ERR ,"Failed to execute command of VIRTCHNL2_OP_GET_PTYPE_INFO" ); -rte_memcpy (recv_ptype_info, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (recv_ptype_info, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE );return err; }
drivers/common/qat/qat_qp.c +4 -6
@@ -871,9 +871,8 @@ qat_cq_get_fw_cipher_crc_cap(struct qat_qp *qp)return -EINVAL ; } -rte_memcpy (src_data_addr, - cipher_crc_cap_check_plaintext, -sizeof (cipher_crc_cap_check_plaintext)); +memcpy (src_data_addr, cipher_crc_cap_check_plaintext, +sizeof (cipher_crc_cap_check_plaintext)); phy_src_addr =rte_mem_virt2iova (src_data_addr);if (phy_src_addr ==0 || phy_src_addr ==RTE_BAD_IOVA ) {
@@ -892,9 +891,8 @@ qat_cq_get_fw_cipher_crc_cap(struct qat_qp *qp) auth_param = (void *)((uint8_t *)cipher_param +ICP_QAT_FW_HASH_REQUEST_PARAMETERS_OFFSET ); -rte_memcpy (cipher_param->u.cipher_IV_array, - cipher_crc_cap_check_iv, -sizeof (cipher_crc_cap_check_iv)); +memcpy (cipher_param->u.cipher_IV_array, cipher_crc_cap_check_iv, +sizeof (cipher_crc_cap_check_iv)); cipher_param->cipher_offset = cipher_crc_cap_check_cipher_offset; cipher_param->cipher_length =
drivers/compress/qat/qat_comp.c +4 -4
@@ -375,7 +375,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,QAT_DP_LOG (DEBUG ,"op %p, parent_cookie %p" , op, parent_cookie);/* copy original op to the local variable for restoring later */ -rte_memcpy (&op_backup, op,sizeof (op_backup)); +memcpy (&op_backup, op,sizeof (op_backup)); parent_cookie->nb_child_responses =0 ; parent_cookie->nb_children =0 ;
@@ -401,7 +401,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp, }/* prepare local dst mbuf */ -rte_memcpy (&dst_mbuf, op->m_dst,sizeof (dst_mbuf)); +memcpy (&dst_mbuf, op->m_dst,sizeof (dst_mbuf));rte_pktmbuf_reset (&dst_mbuf); dst_mbuf.buf_len = dst_data_size; dst_mbuf.data_len = dst_data_size;
@@ -457,7 +457,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,if (ret <0 ) {QAT_DP_LOG (WARNING ,"Failed to build child descriptor" );/* restore op and clear cookie */ -rte_memcpy (op, &op_backup,sizeof (op_backup)); +memcpy (op, &op_backup,sizeof (op_backup)); parent_cookie->split_op =0 ; parent_cookie->nb_children =0 ;return ret;
@@ -468,7 +468,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp, }/* restore backed up original op */ -rte_memcpy (op, &op_backup,sizeof (op_backup)); +memcpy (op, &op_backup,sizeof (op_backup));if (nb_descr != num_descriptors_built) QAT_DP_LOG(ERR, "split op. expected %d, built %d",
Signature · 1 line
2.43.0
PATCH v4 19/30 crypto: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/crypto/ccp/ccp_crypto.c | 14 +++++--------- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-)
drivers/crypto/ccp/ccp_crypto.c +5 -9
@@ -168,7 +168,7 @@ static int partial_hash_sha1(uint8_t *data_in, uint8_t *data_out)if (!SHA1_Init (&ctx))return -EFAULT ;SHA1_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx,SHA_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA_DIGEST_LENGTH );return 0 ; }
@@ -179,8 +179,7 @@ static int partial_hash_sha224(uint8_t *data_in, uint8_t *data_out)if (!SHA224_Init (&ctx))return -EFAULT ;SHA256_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA256_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA256_DIGEST_LENGTH );return 0 ; }
@@ -191,8 +190,7 @@ static int partial_hash_sha256(uint8_t *data_in, uint8_t *data_out)if (!SHA256_Init (&ctx))return -EFAULT ;SHA256_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA256_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA256_DIGEST_LENGTH );return 0 ; }
@@ -203,8 +201,7 @@ static int partial_hash_sha384(uint8_t *data_in, uint8_t *data_out)if (!SHA384_Init (&ctx))return -EFAULT ;SHA512_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA512_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA512_DIGEST_LENGTH );return 0 ; }
@@ -215,8 +212,7 @@ static int partial_hash_sha512(uint8_t *data_in, uint8_t *data_out)if (!SHA512_Init (&ctx))return -EFAULT ;SHA512_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA512_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA512_DIGEST_LENGTH );return 0 ; }
drivers/crypto/cnxk/cnxk_cryptodev_ops.c +1 -1
@@ -959,7 +959,7 @@ cnxk_crypto_cn10k_submit(void *qptr, void *inst, uint16_t nb_inst) lmt_dst =PLT_PTR_CAST (lmt_base);for (j =0 ; j < i; j++) { -rte_memcpy (lmt_dst, inst,sizeof (struct cpt_inst_s )); +memcpy (lmt_dst, inst,sizeof (struct cpt_inst_s )); inst =RTE_PTR_ADD (inst,sizeof (struct cpt_inst_s )); lmt_dst =RTE_PTR_ADD (lmt_dst,2 *sizeof (struct cpt_inst_s )); }
drivers/crypto/cnxk/cnxk_se.h +1 -1
@@ -1161,7 +1161,7 @@ cpt_sm_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens, struct roc_se_fc_pvoid *dst =PLT_PTR_ADD (offset_vaddr,ROC_SE_OFF_CTRL_LEN );const uint64_t *src = fc_params->iv_buf; -rte_memcpy (dst, src,16 ); +memcpy (dst, src,16 ); } inst->w4.u64 = cpt_inst_w4.u64; }else {
Signature · 1 line
2.43.0
PATCH v4 20/30 crypto: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +- drivers/crypto/qat/qat_sym_session.c | 52 +++++++++---------- .../scheduler/rte_cryptodev_scheduler.c | 6 +-- drivers/crypto/scheduler/scheduler_failover.c | 12 ++--- 5 files changed, 37 insertions(+), 39 deletions(-)
drivers/crypto/dpaa_sec/dpaa_sec.c +1 -1
@@ -676,7 +676,7 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp) } cdb = &sess->cdb; -rte_memcpy (&c_cdb, cdb,sizeof (struct sec_cdb )); +memcpy (&c_cdb, cdb,sizeof (struct sec_cdb ));#ifdef RTE_LIB_SECURITY printf ("\nsession protocol type = %d\n" , sess->proto_alg);#endif
drivers/crypto/ipsec_mb/pmd_snow3g.c +2 -2
@@ -291,8 +291,8 @@ process_snow3g_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,/* Copy back digest from src to auth.digest.data */ if (digest_appended) -rte_memcpy (ops[i]->sym->auth.digest.data, - dst,SNOW3G_DIGEST_LENGTH ); +memcpy (ops[i]->sym->auth.digest.data, dst, +SNOW3G_DIGEST_LENGTH ); } processed_ops++; }
drivers/crypto/qat/qat_sym_session.c +25 -27
148 lines not on this page · raw message
drivers/crypto/scheduler/rte_cryptodev_scheduler.c +3 -3
@@ -79,7 +79,7 @@ sync_caps(struct rte_cryptodev_capabilities *caps,/* remove a uncommon cap from the array */ for (j = i; j < sync_nb_caps -1 ; j++) -rte_memcpy (&caps[j], &caps[j+1 ],sizeof (*cap)); +memcpy (&caps[j], &caps[j +1 ],sizeof (*cap));memset (&caps[sync_nb_caps -1 ],0 ,sizeof (*cap)); sync_nb_caps--;
@@ -216,8 +216,8 @@ sync_sec_caps(uint32_t worker_idx,* caps, from the arrays */ for (j = i; j < nb_sec_caps -1 ; j++) { -rte_memcpy (&sec_caps[j], &sec_caps[j+1 ], -sizeof (*sec_cap)); +memcpy (&sec_caps[j], &sec_caps[j +1 ], +sizeof (*sec_cap)); rte_memcpy(&sec_crypto_caps[j][0], &sec_crypto_caps[j+1][0],
drivers/crypto/scheduler/scheduler_failover.c +6 -6
@@ -171,12 +171,12 @@ scheduler_start(struct rte_cryptodev *dev) sched_ctx->workers[PRIMARY_WORKER_IDX ].qp_id = i; sched_ctx->workers[SECONDARY_WORKER_IDX ].qp_id = i; -rte_memcpy (&qp_ctx->primary_worker, - &sched_ctx->workers[PRIMARY_WORKER_IDX ], -sizeof (struct scheduler_worker )); -rte_memcpy (&qp_ctx->secondary_worker, - &sched_ctx->workers[SECONDARY_WORKER_IDX ], -sizeof (struct scheduler_worker )); +memcpy (&qp_ctx->primary_worker, + &sched_ctx->workers[PRIMARY_WORKER_IDX ], +sizeof (struct scheduler_worker )); +memcpy (&qp_ctx->secondary_worker, + &sched_ctx->workers[SECONDARY_WORKER_IDX ], +sizeof (struct scheduler_worker )); }return 0 ;
Signature · 1 line
2.43.0
PATCH v4 21/30 event: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci Also, remove unnecessary includes of rte_memcpy.h
--- drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 - drivers/event/cnxk/cnxk_tim_evdev.c | 4 ++-- drivers/event/dlb2/dlb2.c | 4 ++-- drivers/event/dpaa/dpaa_eventdev.c | 1 - drivers/event/dpaa2/dpaa2_eventdev.c | 7 +++---- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 - drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 - drivers/event/octeontx/ssovf_evdev_selftest.c | 1 - drivers/event/octeontx/timvf_evdev.c | 4 ++-- 9 files changed, 9 insertions(+), 15 deletions(-)
drivers/event/cnxk/cnxk_eventdev_selftest.c +0 -1
@@ -13,7 +13,6 @@#include <rte_lcore.h> #include <rte_malloc.h> #include <rte_mbuf.h> -#include <rte_memcpy.h> #include <rte_per_lcore.h> #include <rte_random.h> #include <rte_test.h>
drivers/event/cnxk/cnxk_tim_evdev.c +2 -2
@@ -115,8 +115,8 @@ cnxk_tim_ring_info_get(const struct rte_event_timer_adapter *adptr, adptr_info->min_resolution_ns = tim_ring->ena_periodic ? tim_ring->max_tout : tim_ring->tck_nsec; -rte_memcpy (&adptr_info->conf, &adptr->data->conf, -sizeof (struct rte_event_timer_adapter_conf )); +memcpy (&adptr_info->conf, &adptr->data->conf, +sizeof (struct rte_event_timer_adapter_conf )); } static int
drivers/event/dlb2/dlb2.c +2 -2
@@ -1668,7 +1668,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->issued_releases =0 ;/* Save config message too. */ -rte_memcpy (&qm_port->cfg.ldb, &cfg,sizeof (qm_port->cfg.ldb)); +memcpy (&qm_port->cfg.ldb, &cfg,sizeof (qm_port->cfg.ldb));/* update state */ qm_port->state =PORT_STARTED ;/* enabled at create time */
@@ -1869,7 +1869,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->issued_releases =0 ;/* Save config message too. */ -rte_memcpy (&qm_port->cfg.dir, &cfg,sizeof (qm_port->cfg.dir)); +memcpy (&qm_port->cfg.dir, &cfg,sizeof (qm_port->cfg.dir));/* update state */ qm_port->state =PORT_STARTED ;/* enabled at create time */
drivers/event/dpaa/dpaa_eventdev.c +0 -1
@@ -19,7 +19,6 @@#include <rte_lcore.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_memory.h> #include <rte_memzone.h> #include <rte_pci.h>
drivers/event/dpaa2/dpaa2_eventdev.c +3 -4
@@ -20,7 +20,6 @@#include <rte_lcore.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_memory.h> #include <rte_pci.h> #include <bus_vdev_driver.h>
@@ -159,7 +158,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], "Unable to allocate event object"); goto send_partial; } -rte_memcpy (ev_temp, event,sizeof (struct rte_event )); +memcpy (ev_temp, event,sizeof (struct rte_event ));DPAA2_SET_FD_ADDR ((&fd_arr[loop]), (size_t )ev_temp);DPAA2_SET_FD_LEN ((&fd_arr[loop]),sizeof (struct rte_event ));
@@ -230,7 +229,7 @@ static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp,RTE_SET_USED (rxq); -rte_memcpy (ev, ev_temp,sizeof (struct rte_event )); +memcpy (ev, ev_temp,sizeof (struct rte_event ));rte_free (ev_temp);qbman_swp_dqrr_consume (swp, dq);
@@ -249,7 +248,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,RTE_SET_USED (swp);RTE_SET_USED (rxq); -rte_memcpy (ev, ev_temp,sizeof (struct rte_event )); +memcpy (ev, ev_temp,sizeof (struct rte_event ));rte_free (ev_temp); *dpaa2_seqn (ev->mbuf) = dqrr_index +1 ;DPAA2_PER_LCORE_DQRR_SIZE ++;
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +0 -1
@@ -12,7 +12,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_lcore.h> #include <rte_per_lcore.h>
drivers/event/dpaa2/dpaa2_hw_dpcon.c +0 -1
@@ -13,7 +13,6 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/event/octeontx/ssovf_evdev_selftest.c +0 -1
@@ -14,7 +14,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_lcore.h> #include <rte_per_lcore.h>
drivers/event/octeontx/timvf_evdev.c +2 -2
@@ -42,8 +42,8 @@ timvf_ring_info_get(const struct rte_event_timer_adapter *adptr,struct timvf_ring *timr = adptr->data->adapter_priv; adptr_info->max_tmo_ns = timr->max_tout; adptr_info->min_resolution_ns = timr->tck_nsec; -rte_memcpy (&adptr_info->conf, &adptr->data->conf, -sizeof (struct rte_event_timer_adapter_conf )); +memcpy (&adptr_info->conf, &adptr->data->conf, +sizeof (struct rte_event_timer_adapter_conf )); } static int
Signature · 1 line
2.43.0
PATCH v4 22/30 mempool: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/mempool/dpaa/dpaa_mempool.c | 4 ++-- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/mempool/dpaa/dpaa_mempool.c +2 -2
@@ -115,8 +115,8 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp)return -ENOMEM ; } -rte_memcpy (bp_info, (void *)&rte_dpaa_bpid_info[bpid], -sizeof (struct dpaa_bp_info )); +memcpy (bp_info, (void *)&rte_dpaa_bpid_info[bpid], +sizeof (struct dpaa_bp_info )); mp->pool_data = (void *)bp_info;DPAA_MEMPOOL_INFO ("BMAN pool created for bpid =%d" , bpid);
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -3
@@ -16,7 +16,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
@@ -125,8 +124,8 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp) rte_dpaa2_bpid_info[bpid].bp_list = bp_list; rte_dpaa2_bpid_info[bpid].bpid = bpid; -rte_memcpy (bp_info, (void *)&rte_dpaa2_bpid_info[bpid], -sizeof (struct dpaa2_bp_info )); +memcpy (bp_info, (void *)&rte_dpaa2_bpid_info[bpid], +sizeof (struct dpaa2_bp_info )); mp->pool_data = (void *)bp_info;DPAA2_MEMPOOL_DEBUG ("BP List created for bpid =%d" , dpbp_attr.bpid);
Signature · 1 line
2.43.0
PATCH v4 23/30 ml/cnxk: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/ml/cnxk/cn10k_ml_model.c | 8 +++++--- drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++---- drivers/ml/cnxk/cnxk_ml_ops.c | 2 +- drivers/ml/cnxk/mvtvm_ml_model.c | 8 +++++--- drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +++++--- 5 files changed, 23 insertions(+), 14 deletions(-)
drivers/ml/cnxk/cn10k_ml_model.c +5 -3
@@ -560,7 +560,7 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set model info */ memset (info,0 ,sizeof (struct rte_ml_model_info )); -rte_memcpy (info->name, metadata->model.name,MRVL_ML_MODEL_NAME_LEN ); +memcpy (info->name, metadata->model.name,MRVL_ML_MODEL_NAME_LEN );snprintf (info->version,RTE_ML_STR_MAX ,"%u.%u.%u.%u" , metadata->model.version[0 ], metadata->model.version[1 ], metadata->model.version[2 ], metadata->model.version[3 ]);
@@ -579,7 +579,8 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set input info */ for (i =0 ; i < info->nb_inputs; i++) { -rte_memcpy (input[i].name, io_info->input[i].name,MRVL_ML_INPUT_NAME_LEN ); +memcpy (input[i].name, io_info->input[i].name, +MRVL_ML_INPUT_NAME_LEN ); input[i].nb_dims = io_info->input[i].nb_dims; input[i].shape = &io_info->input[i].shape[0 ]; input[i].type = io_info->input[i].qtype;
@@ -590,7 +591,8 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set output info */ for (i =0 ; i < info->nb_outputs; i++) { -rte_memcpy (output[i].name, io_info->output[i].name,MRVL_ML_INPUT_NAME_LEN ); +memcpy (output[i].name, io_info->output[i].name, +MRVL_ML_INPUT_NAME_LEN ); output[i].nb_dims = io_info->output[i].nb_dims; output[i].shape = &io_info->output[i].shape[0 ]; output[i].type = io_info->output[i].qtype;
drivers/ml/cnxk/cn10k_ml_ops.c +7 -4
@@ -668,11 +668,13 @@ cn10k_ml_layer_load(void *device, uint16_t model_id, const char *layer_name, uin }/* Copy metadata to internal buffer */ -rte_memcpy (&layer->glow.metadata, buffer,sizeof (struct cn10k_ml_model_metadata )); +memcpy (&layer->glow.metadata, buffer, +sizeof (struct cn10k_ml_model_metadata ));cn10k_ml_model_metadata_update (&layer->glow.metadata);/* Set layer name */ -rte_memcpy (layer->name, layer->glow.metadata.model.name,MRVL_ML_MODEL_NAME_LEN ); +memcpy (layer->name, layer->glow.metadata.model.name, +MRVL_ML_MODEL_NAME_LEN );/* Enable support for batch_size of 256 */ if (layer->glow.metadata.model.batch_size ==0 )
@@ -748,11 +750,12 @@ cn10k_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params * model->subtype =ML_CNXK_MODEL_SUBTYPE_GLOW_MRVL ;/* Copy metadata to internal buffer */ -rte_memcpy (&model->glow.metadata, params->addr,sizeof (struct cn10k_ml_model_metadata )); +memcpy (&model->glow.metadata, params->addr, +sizeof (struct cn10k_ml_model_metadata ));cn10k_ml_model_metadata_update (&model->glow.metadata);/* Set model name */ -rte_memcpy (model->name, (char *)model->glow.metadata.model.name,64 ); +memcpy (model->name, (char *)model->glow.metadata.model.name,64 );/* Enable support for batch_size of 256 */ if (model->glow.metadata.model.batch_size ==0 )
drivers/ml/cnxk/cnxk_ml_ops.c +1 -1
@@ -1400,7 +1400,7 @@ cnxk_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id, } info = (struct rte_ml_model_info *)model->info; -rte_memcpy (model_info, info,sizeof (struct rte_ml_model_info )); +memcpy (model_info, info,sizeof (struct rte_ml_model_info )); model_info->input_info = info->input_info; model_info->output_info = info->output_info;
drivers/ml/cnxk/mvtvm_ml_model.c +5 -3
@@ -310,7 +310,7 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo goto tvm_mrvl_model; metadata = &model->mvtvm.metadata; -rte_memcpy (info->name, metadata->model.name,TVMDP_NAME_STRLEN ); +memcpy (info->name, metadata->model.name,TVMDP_NAME_STRLEN );snprintf (info->version,RTE_ML_STR_MAX ,"%u.%u.%u.%u" , metadata->model.version[0 ], metadata->model.version[1 ], metadata->model.version[2 ], metadata->model.version[3 ]);
@@ -327,7 +327,8 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set input info */ for (i =0 ; i < info->nb_inputs; i++) { -rte_memcpy (input[i].name, metadata->input[i].name,MRVL_ML_INPUT_NAME_LEN ); +memcpy (input[i].name, metadata->input[i].name, +MRVL_ML_INPUT_NAME_LEN ); input[i].nb_dims = metadata->input[i].ndim; input[i].shape = &model->mvtvm.info.input[i].shape[0 ]; input[i].type = model->mvtvm.info.input[i].qtype;
@@ -338,7 +339,8 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set output info */ for (i =0 ; i < info->nb_outputs; i++) { -rte_memcpy (output[i].name, metadata->output[i].name,MRVL_ML_OUTPUT_NAME_LEN ); +memcpy (output[i].name, metadata->output[i].name, +MRVL_ML_OUTPUT_NAME_LEN ); output[i].nb_dims = metadata->output[i].ndim; output[i].shape = &model->mvtvm.info.output[i].shape[0 ]; output[i].type = model->mvtvm.info.output[i].qtype;
drivers/ml/cnxk/mvtvm_ml_ops.c +5 -3
@@ -194,7 +194,7 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params */* Copy mod.so */ model->mvtvm.object.so.addr = mz->addr; model->mvtvm.object.so.size = object[0 ].size; -rte_memcpy (model->mvtvm.object.so.name, object[0 ].name,TVMDP_NAME_STRLEN ); +memcpy (model->mvtvm.object.so.name, object[0 ].name,TVMDP_NAME_STRLEN );rte_memcpy (model->mvtvm.object.so.addr, object[0 ].buffer, object[0 ].size);rte_free (object[0 ].buffer);
@@ -203,7 +203,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *RTE_PTR_ADD (model->mvtvm.object.so.addr,RTE_ALIGN_CEIL (model->mvtvm.object.so.size,RTE_CACHE_LINE_MIN_SIZE )); model->mvtvm.object.json.size = object[1 ].size; -rte_memcpy (model->mvtvm.object.json.name, object[1 ].name,TVMDP_NAME_STRLEN ); +memcpy (model->mvtvm.object.json.name, object[1 ].name, +TVMDP_NAME_STRLEN );rte_memcpy (model->mvtvm.object.json.addr, object[1 ].buffer, object[1 ].size);rte_free (object[1 ].buffer);
@@ -212,7 +213,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *RTE_PTR_ADD (model->mvtvm.object.json.addr,RTE_ALIGN_CEIL (model->mvtvm.object.json.size,RTE_CACHE_LINE_MIN_SIZE )); model->mvtvm.object.params.size = object[2 ].size; -rte_memcpy (model->mvtvm.object.params.name, object[2 ].name,TVMDP_NAME_STRLEN ); +memcpy (model->mvtvm.object.params.name, object[2 ].name, +TVMDP_NAME_STRLEN );rte_memcpy (model->mvtvm.object.params.addr, object[2 ].buffer, object[2 ].size);rte_free (object[2 ].buffer);
Signature · 1 line
2.43.0
PATCH v4 24/30 app/test-pmd: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/test-pmd/cmdline.c | 48 ++++++++++++++++++------------------- app/test-pmd/cmdline_flow.c | 24 +++++++++---------- app/test-pmd/config.c | 8 +++---- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - 11 files changed, 40 insertions(+), 48 deletions(-)
app/test-pmd/cmdline.c +24 -24
@@ -9534,7 +9534,7 @@ static void cmd_set_vxlan_parsed(void *parsed_result, vxlan_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (vxlan_encap_conf.vni, &id.vni[1 ],3 ); +memcpy (vxlan_encap_conf.vni, &id.vni[1 ],3 ); vxlan_encap_conf.udp_src =rte_cpu_to_be_16 (res->udp_src); vxlan_encap_conf.udp_dst =rte_cpu_to_be_16 (res->udp_dst); vxlan_encap_conf.ip_tos = res->tos;
@@ -9548,10 +9548,10 @@ static void cmd_set_vxlan_parsed(void *parsed_result, }if (vxlan_encap_conf.select_vlan) vxlan_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_vxlan = {
@@ -9729,7 +9729,7 @@ static void cmd_set_nvgre_parsed(void *parsed_result, nvgre_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (nvgre_encap_conf.tni, &id.tni[1 ],3 ); +memcpy (nvgre_encap_conf.tni, &id.tni[1 ],3 );if (nvgre_encap_conf.select_ipv4) {IPV4_ADDR_TO_UINT (res->ip_src, nvgre_encap_conf.ipv4_src);IPV4_ADDR_TO_UINT (res->ip_dst, nvgre_encap_conf.ipv4_dst);
@@ -9739,10 +9739,10 @@ static void cmd_set_nvgre_parsed(void *parsed_result, }if (nvgre_encap_conf.select_vlan) nvgre_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_nvgre = {
@@ -9856,10 +9856,10 @@ static void cmd_set_l2_encap_parsed(void *parsed_result,return ;if (l2_encap_conf.select_vlan) l2_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (l2_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (l2_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (l2_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (l2_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_l2_encap = {
@@ -10038,7 +10038,7 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result, mplsogre_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (mplsogre_encap_conf.label, &id.label,3 ); +memcpy (mplsogre_encap_conf.label, &id.label,3 );if (mplsogre_encap_conf.select_ipv4) {IPV4_ADDR_TO_UINT (res->ip_src, mplsogre_encap_conf.ipv4_src);IPV4_ADDR_TO_UINT (res->ip_dst, mplsogre_encap_conf.ipv4_dst);
@@ -10048,10 +10048,10 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result, }if (mplsogre_encap_conf.select_vlan) mplsogre_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_mplsogre_encap = {
@@ -10274,7 +10274,7 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result, mplsoudp_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (mplsoudp_encap_conf.label, &id.label,3 ); +memcpy (mplsoudp_encap_conf.label, &id.label,3 ); mplsoudp_encap_conf.udp_src =rte_cpu_to_be_16 (res->udp_src); mplsoudp_encap_conf.udp_dst =rte_cpu_to_be_16 (res->udp_dst);if (mplsoudp_encap_conf.select_ipv4) {
@@ -10286,10 +10286,10 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result, }if (mplsoudp_encap_conf.select_vlan) mplsoudp_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
app/test-pmd/cmdline_flow.c +12 -12
@@ -13768,7 +13768,7 @@ cmd_set_raw_parsed_sample(const struct buffer *in)fprintf (stderr,"Error - Not supported action\n" );return ; } -rte_memcpy (data, action,sizeof (struct rte_flow_action )); +memcpy (data, action,sizeof (struct rte_flow_action )); data++; } }
@@ -13929,8 +13929,8 @@ cmd_set_raw_parsed(const struct buffer *in)/* We have to add GTP header extra word. */ *total_size +=sizeof (ext_word); -rte_memcpy (data_tail - (*total_size), - &ext_word,sizeof (ext_word)); +memcpy (data_tail - (*total_size), &ext_word, +sizeof (ext_word)); } size =sizeof (struct rte_gtp_hdr );break ;
@@ -13975,21 +13975,21 @@ cmd_set_raw_parsed(const struct buffer *in)if (opt->checksum_rsvd.checksum) { *total_size +=sizeof (opt->checksum_rsvd); -rte_memcpy (data_tail - (*total_size), - &opt->checksum_rsvd, -sizeof (opt->checksum_rsvd)); +memcpy (data_tail - (*total_size), + &opt->checksum_rsvd, +sizeof (opt->checksum_rsvd)); }if (opt->key.key) { *total_size +=sizeof (opt->key.key); -rte_memcpy (data_tail - (*total_size), - &opt->key.key, -sizeof (opt->key.key)); +memcpy (data_tail - (*total_size), + &opt->key.key, +sizeof (opt->key.key)); }if (opt->sequence.sequence) { *total_size +=sizeof (opt->sequence.sequence); -rte_memcpy (data_tail - (*total_size), - &opt->sequence.sequence, -sizeof (opt->sequence.sequence)); +memcpy (data_tail - (*total_size), + &opt->sequence.sequence, +sizeof (opt->sequence.sequence)); } } proto =0x2F ;
app/test-pmd/config.c +4 -4
@@ -2639,8 +2639,8 @@ port_flow_template_table_create(portid_t port_id, uint32_t id, } pt->nb_pattern_templates = nb_pattern_templates; pt->nb_actions_templates = nb_actions_templates; -rte_memcpy (&pt->flow_attr, &table_attr->flow_attr, -sizeof (struct rte_flow_attr )); +memcpy (&pt->flow_attr, &table_attr->flow_attr, +sizeof (struct rte_flow_attr ));printf ("Template table #%u created\n" , pt->id);return 0 ; }
@@ -3259,8 +3259,8 @@ port_queue_action_handle_update(portid_t port_id, update = action->conf;break ;case RTE_FLOW_ACTION_TYPE_METER_MARK : -rte_memcpy (&mtr_update.meter_mark, action->conf, -sizeof (struct rte_flow_action_meter_mark )); +memcpy (&mtr_update.meter_mark, action->conf, +sizeof (struct rte_flow_action_meter_mark ));if (mtr_update.meter_mark.profile) mtr_update.profile_valid =1 ;if (mtr_update.meter_mark.policy)
app/test-pmd/csumonly.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/flowgen.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/iofwd.c +0 -1
@@ -24,7 +24,6 @@#include <rte_per_lcore.h> #include <rte_lcore.h> #include <rte_branch_prediction.h> -#include <rte_memcpy.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_interrupts.h>
app/test-pmd/macfwd.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/macswap.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/noisy_vnf.c +0 -1
@@ -24,7 +24,6 @@#include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_lcore.h> -#include <rte_memcpy.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_ethdev.h>
app/test-pmd/rxonly.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/testpmd.c +0 -1
@@ -30,7 +30,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_bus.h> #include <rte_eal.h>
Signature · 1 line
2.43.0
PATCH v4 25/30 app/graph: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/graph/neigh.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
app/graph/neigh.c +4 -4
@@ -91,14 +91,14 @@ ip6_rewrite_node_add(struct neigh_ipv6_config *v6_config)memset (data,0 , len);/* Copy dst mac */ -rte_memcpy ((void *)&data[0 ], (void *)&v6_config->mac,RTE_ETHER_ADDR_LEN ); +memcpy ((void *)&data[0 ], (void *)&v6_config->mac,RTE_ETHER_ADDR_LEN );/* Copy src mac */ rc =rte_eth_macaddr_get (portid, &smac);if (rc <0 )return rc; -rte_memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN );return rte_node_ip6_rewrite_add (portid, data, len, portid); }
@@ -121,7 +121,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)memset (data,0 , len);/* Copy dst mac */ -rte_memcpy ((void *)&data[0 ], (void *)&v4_config->mac,RTE_ETHER_ADDR_LEN ); +memcpy ((void *)&data[0 ], (void *)&v4_config->mac,RTE_ETHER_ADDR_LEN );/* Copy src mac */ rc =rte_eth_macaddr_get (portid, &smac);
@@ -130,7 +130,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)return rc; } -rte_memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN );return rte_node_ip4_rewrite_add (portid, data, len, portid); }
Signature · 1 line
2.43.0
PATCH v4 26/30 app/test-eventdev: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/test-eventdev/test_pipeline_common.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
app/test-eventdev/test_pipeline_common.c +7 -12
@@ -177,22 +177,17 @@ pipeline_tx_first(struct test_pipeline *t, struct evt_options *opt) mbuf->pkt_len = pkt_sz;/* Copy Ethernet header */ - rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0), - ð_hdr, sizeof(struct rte_ether_hdr)); + memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0), + ð_hdr, sizeof(struct rte_ether_hdr));/* Copy Ipv4 header */ - rte_memcpy(rte_pktmbuf_mtod_offset( - mbuf, char *, - sizeof(struct rte_ether_hdr)), - &ip_hdr, sizeof(struct rte_ipv4_hdr)); + memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ether_hdr)), + &ip_hdr, sizeof(struct rte_ipv4_hdr));/* Copy UDP header */ -rte_memcpy ( -rte_pktmbuf_mtod_offset ( -mbuf ,char *, - sizeof(struct rte_ipv4_hdr) + - sizeof(struct rte_ether_hdr)), - &udp_hdr, sizeof(struct rte_udp_hdr)); + memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ipv4_hdr) + + sizeof(struct rte_ether_hdr)), + &udp_hdr, sizeof(struct rte_udp_hdr)); pkt_udp_hdr = rte_pktmbuf_mtod_offset( mbuf, struct rte_udp_hdr *, sizeof(struct rte_ipv4_hdr) +
Signature · 1 line
2.43.0
PATCH v4 27/30 app/test: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/test/commands.c | 1 - app/test/packet_burst_generator.c | 4 +-- app/test/test_crc.c | 5 ++-- app/test/test_cryptodev.c | 18 ++++++------- app/test/test_cryptodev_asym.c | 1 - app/test/test_cryptodev_security_pdcp.c | 1 - app/test/test_efd.c | 1 - app/test/test_efd_perf.c | 1 - app/test/test_event_crypto_adapter.c | 12 ++++----- app/test/test_event_dma_adapter.c | 4 +-- app/test/test_eventdev.c | 1 - app/test/test_ipsec.c | 6 ++--- app/test/test_link_bonding_mode4.c | 8 +++--- app/test/test_mbuf.c | 1 - app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - app/test/test_rawdev.c | 1 - app/test/test_security_inline_proto.c | 36 ++++++++++++------------- app/test/test_service_cores.c | 1 - app/test/virtual_pmd.c | 3 +-- 20 files changed, 46 insertions(+), 61 deletions(-)
app/test/commands.c +0 -1
@@ -16,7 +16,6 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_memzone.h> #include <rte_launch.h> #include <rte_cycles.h>
app/test/packet_burst_generator.c +2 -2
@@ -148,8 +148,8 @@ initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr, ip_hdr->proto =IPPROTO_UDP ; ip_hdr->hop_limits =IP_DEFTTL ; -rte_memcpy (ip_hdr->src_addr, src_addr,sizeof (ip_hdr->src_addr)); -rte_memcpy (ip_hdr->dst_addr, dst_addr,sizeof (ip_hdr->dst_addr)); +memcpy (ip_hdr->src_addr, src_addr,sizeof (ip_hdr->src_addr)); +memcpy (ip_hdr->dst_addr, dst_addr,sizeof (ip_hdr->dst_addr));return (uint16_t ) (pkt_data_len +sizeof (struct rte_ipv6_hdr )); }
app/test/test_crc.c +2 -3
@@ -6,7 +6,6 @@#include <rte_hexdump.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_net_crc.h> #define CRC_VEC_LEN 32
@@ -83,7 +82,7 @@ test_crc_calc(void)return -7 ;for (i =0 ; i <CRC32_VEC_LEN1 ; i +=12 ) -rte_memcpy (&test_data[i], crc32_vec1,12 ); +memcpy (&test_data[i], crc32_vec1,12 ); result =crc_calc (test_data,CRC32_VEC_LEN1 , type);if (result != crc32_vec1_res) {
@@ -93,7 +92,7 @@ test_crc_calc(void)/* 32-bit ethernet CRC: Test 3 */ for (i =0 ; i <CRC32_VEC_LEN2 ; i +=12 ) -rte_memcpy (&test_data[i], crc32_vec1,12 ); +memcpy (&test_data[i], crc32_vec1,12 ); result =crc_calc (test_data,CRC32_VEC_LEN2 , type);if (result != crc32_vec2_res) {
app/test/test_cryptodev.c +8 -10
@@ -2479,8 +2479,8 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) sym_op->auth.data.length =QUOTE_512_BYTES ;/* Copy IV at the end of the crypto operation */ - rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), - aes_cbc_iv,CIPHER_IV_LENGTH_AES_CBC ); + memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), + aes_cbc_iv,CIPHER_IV_LENGTH_AES_CBC );/* Set crypto operation cipher parameters */ sym_op->cipher.data.offset =0 ;
@@ -2614,9 +2614,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess, DIGEST_BYTE_LENGTH_SHA512);TEST_ASSERT_NOT_NULL (ut_params->digest,"no room to append digest" ); -rte_memcpy (ut_params->digest, - digest, -DIGEST_BYTE_LENGTH_SHA512 ); +memcpy (ut_params->digest, digest,DIGEST_BYTE_LENGTH_SHA512 );/* Generate Crypto op data structure */ ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
@@ -2639,8 +2637,8 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess, sym_op->auth.data.length =QUOTE_512_BYTES ;/* Copy IV at the end of the crypto operation */ - rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), - iv,CIPHER_IV_LENGTH_AES_CBC ); + memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), + iv,CIPHER_IV_LENGTH_AES_CBC ); sym_op->cipher.data.offset =0 ; sym_op->cipher.data.length =QUOTE_512_BYTES ;
@@ -8997,7 +8995,7 @@ create_aead_operation(enum rte_crypto_aead_operation op, uint8_t *, IV_OFFSET);if (tdata->iv.len ==0 ) { -rte_memcpy (iv_ptr, tdata->iv.data,AES_GCM_J0_LENGTH ); +memcpy (iv_ptr, tdata->iv.data,AES_GCM_J0_LENGTH );debug_hexdump (stdout,"iv:" , iv_ptr,AES_GCM_J0_LENGTH ); }else {
@@ -14337,8 +14335,8 @@ test_multi_session_random_usage(void)for (i =0 ; i <MB_SESSION_NUMBER ; i++) { -rte_memcpy (&ut_paramz[i].ut_params, &unittest_params, -sizeof (struct crypto_unittest_params )); +memcpy (&ut_paramz[i].ut_params, &unittest_params, +sizeof (struct crypto_unittest_params )); test_AES_CBC_HMAC_SHA512_decrypt_create_session_params( &ut_paramz[i].ut_params,
app/test/test_cryptodev_asym.c +0 -1
@@ -8,7 +8,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_pause.h> #include <rte_cryptodev.h>
app/test/test_cryptodev_security_pdcp.c +0 -1
@@ -10,7 +10,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_pause.h> #include <rte_bus_vdev.h> #include <rte_byteorder.h>
app/test/test_efd.c +0 -1
@@ -13,7 +13,6 @@ test_efd(void)#else -#include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_efd.h> #include <rte_byteorder.h>
app/test/test_efd_perf.c +0 -1
@@ -22,7 +22,6 @@ test_efd_perf(void)#include <rte_malloc.h> #include <rte_random.h> #include <rte_efd.h> -#include <rte_memcpy.h> #include <rte_thash.h> #define NUM_KEYSIZES 10
app/test/test_event_crypto_adapter.c +6 -6
@@ -454,7 +454,7 @@ test_op_forward_mode(uint8_t session_less) m_data.request_info.cdev_id = request_info.cdev_id; m_data.request_info.queue_pair_id = request_info.queue_pair_id; m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); } sym_op->m_src = m;
@@ -653,8 +653,8 @@ test_asym_op_forward_mode(uint8_t session_less) m_data.request_info.cdev_id = request_info.cdev_id; m_data.request_info.queue_pair_id = request_info.queue_pair_id; m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + op->private_data_offset, - &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + op->private_data_offset, &m_data, +sizeof (m_data)); }/* Fill in event info and update event_ptr with rte_crypto_op */ memset (&ev,0 ,sizeof (ev));
@@ -820,7 +820,7 @@ test_op_new_mode(uint8_t session_less) op->private_data_offset = len;/* Fill in private data information */ m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); } sym_op->m_src = m;
@@ -977,8 +977,8 @@ test_asym_op_new_mode(uint8_t session_less) sizeof(struct rte_crypto_asym_xform));/* Fill in private data information */ m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + op->private_data_offset, - &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + op->private_data_offset, &m_data, +sizeof (m_data)); } ret =send_op_recv_ev (op);
app/test/test_event_dma_adapter.c +2 -2
@@ -269,8 +269,8 @@ test_op_forward_mode(void) op->vchan =TEST_DMA_VCHAN_ID ; response_info.event = dma_response_info.event; -rte_memcpy ((uint8_t *)op +sizeof (struct rte_event_dma_adapter_op ), &response_info, -sizeof (struct rte_event )); +memcpy ((uint8_t *)op +sizeof (struct rte_event_dma_adapter_op ), + &response_info,sizeof (struct rte_event ));/* Fill in event info and update event_ptr with rte_event_dma_adapter_op */ memset (&ev[i],0 ,sizeof (struct rte_event ));
app/test/test_eventdev.c +0 -1
@@ -8,7 +8,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #ifdef RTE_EXEC_ENV_WINDOWS static int
app/test/test_ipsec.c +3 -3
@@ -601,10 +601,10 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,/* copy outer IP and ESP header */ ipv4_outer.total_length =rte_cpu_to_be_16 (t_len); ipv4_outer.packet_id =rte_cpu_to_be_16 (seq); -rte_memcpy (dst, &ipv4_outer,sizeof (ipv4_outer)); +memcpy (dst, &ipv4_outer,sizeof (ipv4_outer)); dst +=sizeof (ipv4_outer); m->l3_len =sizeof (ipv4_outer); -rte_memcpy (dst, &esph,sizeof (esph)); +memcpy (dst, &esph,sizeof (esph)); dst +=sizeof (esph);if (string !=NULL ) {
@@ -616,7 +616,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string, sizeof(esp_pad_bytes))); dst += padlen;/* copy ESP tail header */ -rte_memcpy (dst, &espt,sizeof (espt)); +memcpy (dst, &espt,sizeof (espt)); }else memset (dst,0 , t_len);
app/test/test_link_bonding_mode4.c +4 -4
@@ -1399,8 +1399,8 @@ test_mode4_ext_ctrl(void)for (i =0 ; i <MEMBER_COUNT ; i++) { lacp_tx_buf[i] =rte_pktmbuf_alloc (test_params.mbuf_pool); - rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), - &lacpdu, sizeof(lacpdu)); + memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu, + sizeof(lacpdu));rte_pktmbuf_pkt_len (lacp_tx_buf[i]) =sizeof (lacpdu); }
@@ -1453,8 +1453,8 @@ test_mode4_ext_lacp(void)for (i =0 ; i <MEMBER_COUNT ; i++) { lacp_tx_buf[i] =rte_pktmbuf_alloc (test_params.mbuf_pool); - rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), - &lacpdu, sizeof(lacpdu)); + memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu, + sizeof(lacpdu));rte_pktmbuf_pkt_len (lacp_tx_buf[i]) =sizeof (lacpdu); }
app/test/test_mbuf.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test/test_member.c +0 -1
@@ -7,7 +7,6 @@#include <math.h> #include "test.h" -#include <rte_memcpy.h> #include <rte_malloc.h> #ifdef RTE_EXEC_ENV_WINDOWS
app/test/test_member_perf.c +0 -1
@@ -11,7 +11,6 @@#include <rte_cycles.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_memcpy.h> #include <rte_thash.h> #include <math.h>
app/test/test_rawdev.c +0 -1
@@ -7,7 +7,6 @@#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_dev.h> #ifdef RTE_EXEC_ENV_WINDOWS
app/test/test_security_inline_proto.c +18 -18
@@ -245,8 +245,8 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,/* Copy cipher session parameters */ if (sa->aead) { -rte_memcpy (sess_conf->crypto_xform, &sa->xform.aead, -sizeof (struct rte_crypto_sym_xform )); +memcpy (sess_conf->crypto_xform, &sa->xform.aead, +sizeof (struct rte_crypto_sym_xform )); sess_conf->crypto_xform->aead.key.data = sa->key.data;/* Verify crypto capabilities */ if (test_sec_crypto_caps_aead_verify (sec_cap, sess_conf->crypto_xform) !=0 ) {
@@ -256,13 +256,13 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid, } }else {if (dir ==RTE_SECURITY_IPSEC_SA_DIR_EGRESS ) { -rte_memcpy (&sess_conf->crypto_xform->cipher, - &sa->xform.chain.cipher.cipher, -sizeof (struct rte_crypto_cipher_xform )); +memcpy (&sess_conf->crypto_xform->cipher, + &sa->xform.chain.cipher.cipher, +sizeof (struct rte_crypto_cipher_xform )); -rte_memcpy (&sess_conf->crypto_xform->next->auth, - &sa->xform.chain.auth.auth, -sizeof (struct rte_crypto_auth_xform )); +memcpy (&sess_conf->crypto_xform->next->auth, + &sa->xform.chain.auth.auth, +sizeof (struct rte_crypto_auth_xform )); sess_conf->crypto_xform->cipher.key.data = sa->key.data; sess_conf->crypto_xform->next->auth.key.data =
@@ -282,12 +282,12 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,return TEST_SKIPPED ; } }else { -rte_memcpy (&sess_conf->crypto_xform->next->cipher, - &sa->xform.chain.cipher.cipher, -sizeof (struct rte_crypto_cipher_xform )); -rte_memcpy (&sess_conf->crypto_xform->auth, - &sa->xform.chain.auth.auth, -sizeof (struct rte_crypto_auth_xform )); +memcpy (&sess_conf->crypto_xform->next->cipher, + &sa->xform.chain.cipher.cipher, +sizeof (struct rte_crypto_cipher_xform )); +memcpy (&sess_conf->crypto_xform->auth, + &sa->xform.chain.auth.auth, +sizeof (struct rte_crypto_auth_xform )); sess_conf->crypto_xform->auth.key.data = sa->auth_key.data; sess_conf->crypto_xform->next->cipher.key.data =
@@ -463,12 +463,12 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len, boolreturn NULL ;if (outer_ipv4) { -rte_memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), - &dummy_ipv4_eth_hdr,RTE_ETHER_HDR_LEN ); +memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), + &dummy_ipv4_eth_hdr,RTE_ETHER_HDR_LEN ); pkt->l3_len =sizeof (struct rte_ipv4_hdr ); }else { -rte_memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), - &dummy_ipv6_eth_hdr,RTE_ETHER_HDR_LEN ); +memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), + &dummy_ipv6_eth_hdr,RTE_ETHER_HDR_LEN ); pkt->l3_len =sizeof (struct rte_ipv6_hdr ); } pkt->l2_len =RTE_ETHER_HDR_LEN ;
app/test/test_service_cores.c +0 -1
@@ -6,7 +6,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_cycles.h> #include <rte_service.h>
app/test/virtual_pmd.c +1 -2
@@ -8,7 +8,6 @@#include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_memory.h> #include <rte_ring.h>
@@ -186,7 +185,7 @@ virtual_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)struct virtual_ethdev_private *dev_private = dev->data->dev_private;if (stats) -rte_memcpy (stats, &dev_private->eth_stats,sizeof (*stats)); +memcpy (stats, &dev_private->eth_stats,sizeof (*stats));return 0 ; }
Signature · 1 line
2.43.0
RE: [EXTERNAL] [PATCH v4 27/30] app/test: replace use of fixed size rte_memcpy
Quoted 11 lines
Automatically generated by
devtools/cocci/rte_memcpy.cocciSigned-off-by Stephen Hemminger <[email protected]>--- app/test/commands.c | 1 - app/test/packet_burst_generator.c | 4 +-- app/test/test_crc.c | 5 ++-- app/test/test_cryptodev.c | 18 ++++++------- app/test/test_cryptodev_asym.c | 1 - app/test/test_cryptodev_security_pdcp.c | 1 -
Quoted 3 lines
app/test/test_ipsec.c | 6 ++---app/test/test_security_inline_proto.c | 36 ++++++++++++-------------
For above changes
PATCH v4 28/30 app/test-pipeline: remove unused rte_memcpy.h include
In reply to Stephen HemmingerThis included but never used here.
--- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - 4 files changed, 4 deletions(-)
app/test-pipeline/config.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
app/test-pipeline/init.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
app/test-pipeline/main.c +0 -1
@@ -19,7 +19,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
app/test-pipeline/runtime.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
Signature · 1 line
2.43.0
PATCH v4 29/30 app/test-bbdev: remove unnecessary include of rte_memcpy.h
In reply to Stephen HemmingerIncludes rte_memcpy.h but no rte_memcpy used.
--- app/test-bbdev/test_bbdev.c | 1 - 1 file changed, 1 deletion(-)
app/test-bbdev/test_bbdev.c +0 -1
@@ -6,7 +6,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_cycles.h> #include <rte_bus_vdev.h>
Signature · 1 line
2.43.0
PATCH v4 30/30 examples: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci Use structure assignment where possible.
--- examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 1 - examples/ip_fragmentation/main.c | 1 - examples/ip_reassembly/main.c | 1 - examples/ipv4_multicast/main.c | 1 - examples/l2fwd-cat/cat.c | 4 +--- examples/l2fwd-jobstats/main.c | 1 - examples/l2fwd-keepalive/main.c | 1 - examples/l2fwd-macsec/main.c | 1 - examples/l2fwd/main.c | 1 - examples/l3fwd-power/main.c | 1 - examples/l3fwd/main.c | 1 - examples/link_status_interrupt/main.c | 1 - .../client_server_mp/mp_server/init.c | 1 - .../client_server_mp/mp_server/main.c | 1 - examples/multi_process/symmetric_mp/main.c | 1 - examples/ptpclient/ptpclient.c | 11 +++++------ examples/qos_sched/app_thread.c | 1 - examples/qos_sched/main.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/vhost/main.c | 6 +++--- examples/vmdq/main.c | 7 +++---- examples/vmdq_dcb/main.c | 15 +++++---------- 24 files changed, 18 insertions(+), 45 deletions(-)
examples/bbdev_app/main.c +1 -1
@@ -359,7 +359,7 @@ add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst) eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *);/* copy header */ -rte_memcpy (eth_to, eth_from,sizeof (struct rte_ether_hdr )); +memcpy (eth_to, eth_from,sizeof (struct rte_ether_hdr )); } static inline void
examples/bond/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_common.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/ip_fragmentation/main.c +0 -1
@@ -18,7 +18,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/ip_reassembly/main.c +0 -1
@@ -19,7 +19,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/ipv4_multicast/main.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd-cat/cat.c +1 -3
@@ -12,7 +12,6 @@#include <stdio.h> #include <rte_common.h> -#include <rte_memcpy.h> #include <pqos.h>
@@ -314,8 +313,7 @@ parse_l3ca(const char *l3ca)if (cmask !=0 &&is_contiguous (cmask) ==0 ) goto err; -rte_memcpy (&m_config[idx].cpumask, - &cpuset,sizeof (rte_cpuset_t)); +memcpy (&m_config[idx].cpumask, &cpuset,sizeof (rte_cpuset_t));if (cmask !=0 ) { m_config[idx].cdp =1 ;
examples/l2fwd-jobstats/main.c +0 -1
@@ -13,7 +13,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd-keepalive/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd-macsec/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l3fwd-power/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l3fwd/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/link_status_interrupt/main.c +0 -1
@@ -19,7 +19,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/multi_process/client_server_mp/mp_server/init.c +0 -1
@@ -24,7 +24,6 @@#include <rte_ring.h> #include <rte_log.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_interrupts.h> #include <rte_ether.h>
examples/multi_process/client_server_mp/mp_server/main.c +0 -1
@@ -24,7 +24,6 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_ether.h> #include <rte_interrupts.h>
examples/multi_process/symmetric_mp/main.c +0 -1
@@ -37,7 +37,6 @@#include <rte_ether.h> #include <rte_ethdev.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_string_fns.h> #include <rte_cycles.h>
examples/ptpclient/ptpclient.c +5 -6
@@ -362,9 +362,9 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx) ptp_data->seqID_SYNC =rte_be_to_cpu_16 (ptp_hdr->seq_id);if (ptp_data->ptpset ==0 ) { -rte_memcpy (&ptp_data->master_clock_id, - &ptp_hdr->source_port_id.clock_id, -sizeof (struct clock_id )); +memcpy (&ptp_data->master_clock_id, + &ptp_hdr->source_port_id.clock_id, +sizeof (struct clock_id )); ptp_data->ptpset =1 ; }
@@ -469,9 +469,8 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data) client_clkid->id[6 ] = eth_hdr->src_addr.addr_bytes[4 ]; client_clkid->id[7 ] = eth_hdr->src_addr.addr_bytes[5 ]; -rte_memcpy (&ptp_data->client_clock_id, - client_clkid, -sizeof (struct clock_id )); +memcpy (&ptp_data->client_clock_id, client_clkid, +sizeof (struct clock_id ));/* Enable flag for hardware timestamping. */ created_pkt->ol_flags |=RTE_MBUF_F_TX_IEEE1588_TMST ;
examples/qos_sched/app_thread.c +0 -1
@@ -9,7 +9,6 @@#include <rte_malloc.h> #include <rte_cycles.h> #include <rte_ethdev.h> -#include <rte_memcpy.h> #include <rte_byteorder.h> #include <rte_branch_prediction.h> #include <rte_sched.h>
examples/qos_sched/main.c +0 -1
@@ -10,7 +10,6 @@#include <rte_malloc.h> #include <rte_cycles.h> #include <rte_ethdev.h> -#include <rte_memcpy.h> #include <rte_byteorder.h> #include <rte_branch_prediction.h>
examples/server_node_efd/efd_server/init.c +0 -1
@@ -24,7 +24,6 @@#include <rte_ring.h> #include <rte_log.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_interrupts.h> #include <rte_ether.h>
examples/server_node_efd/efd_server/main.c +0 -1
@@ -26,7 +26,6 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_ether.h> #include <rte_interrupts.h>
examples/vhost/main.c +3 -3
@@ -405,9 +405,9 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices) conf.pool_map[i].pools = (1UL << i); } - (void )(rte_memcpy (eth_conf, &vmdq_conf_default,sizeof (*eth_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, -sizeof (eth_conf->rx_adv_conf.vmdq_rx_conf))); +memcpy (eth_conf, &vmdq_conf_default,sizeof (*eth_conf)); +memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, +sizeof (eth_conf->rx_adv_conf.vmdq_rx_conf));return 0 ; }
examples/vmdq/main.c +3 -4
@@ -17,7 +17,6 @@#include <rte_common.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
@@ -151,9 +150,9 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools) conf.pool_map[i].pools = (1UL << (i % num_pools)); } - (void )(rte_memcpy (eth_conf, &vmdq_conf_default,sizeof (*eth_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, -sizeof (eth_conf->rx_adv_conf.vmdq_rx_conf))); + *eth_conf = vmdq_conf_default; + eth_conf->rx_adv_conf.vmdq_rx_conf = conf; +if (rss_enable) { eth_conf->rxmode.mq_mode =RTE_ETH_MQ_RX_VMDQ_RSS ; eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
examples/vmdq_dcb/main.c +5 -10
@@ -17,7 +17,6 @@#include <rte_common.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
@@ -161,15 +160,11 @@ get_eth_conf(struct rte_eth_conf *eth_conf) tx_conf.dcb_tc[i] = i % num_tcs; } dcb_conf.nb_tcs = (enum rte_eth_nb_tcs )num_tcs; - (void )(rte_memcpy (eth_conf, &vmdq_dcb_conf_default,sizeof (*eth_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, -sizeof (conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf, -sizeof (dcb_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf, -sizeof (vmdq_conf))); - (void )(rte_memcpy (ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf, -sizeof (tx_conf))); + (void )(memcpy (eth_conf, &vmdq_dcb_conf_default,sizeof (*eth_conf))); + (void )(memcpy (ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf,sizeof (conf))); + (void )(memcpy (ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf,sizeof (dcb_conf))); + (void )(memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf,sizeof (vmdq_conf))); + (void )(memcpy (ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf,sizeof (tx_conf)));if (rss_enable) { eth_conf->rxmode.mq_mode =RTE_ETH_MQ_RX_VMDQ_DCB_RSS ; eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
Signature · 1 line
2.43.0
v4 cover uuid: generator functions and unit test
In reply to Stephen HemmingerWhile looking at using uuid's in some logging cases, discovered that the existing uuid support in EAL was missing some functions add in later versions of libuuid.
Add functions to generate Uuid values, and add missing functional tests for uuid's.
v4 - review comments and use stdatomic
Stephen Hemminger (2):
eal: add functions to generate uuid values
test: add functional test for uuid
app/test/meson.build | 1 + app/test/test_uuid.c | 138 +++++++++++++++++++++++++++++++ lib/eal/common/eal_common_uuid.c | 56 +++++++++++++ lib/eal/include/rte_uuid.h | 26 ++++++ lib/eal/version.map | 4 + 5 files changed, 225 insertions(+) create mode 100644 app/test/test_uuid.c
Signature · 1 line
2.43.0
PATCH v4 1/2 eal: add functions to generate uuid values
Useful to be able to generate uuid values for tests or for interaction with other subsystems as magic cookie. Naming and overall algorithm come from libuuid which is used by permission of original author.
--- lib/eal/common/eal_common_uuid.c | 56 ++++++++++++++++++++++++++++++++ lib/eal/include/rte_uuid.h | 26 +++++++++++++++ lib/eal/version.map | 4 +++ 3 files changed, 86 insertions(+)
lib/eal/common/eal_common_uuid.c +56 -0
@@ -3,12 +3,18 @@*/ #include <stdio.h> +#include <stdbool.h> #include <string.h> #include <stdint.h> #include <stdlib.h> #include <ctype.h> +#include <time.h> +#include <rte_stdatomic.h> +#include <rte_random.h> +#include <rte_time.h> #include <rte_uuid.h> +#include <rte_os_shim.h> /* UUID packed form */ struct uuid {
@@ -165,3 +171,53 @@ void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len) uuid.node[0 ], uuid.node[1 ], uuid.node[2 ], uuid.node[3], uuid.node[4], uuid.node[5]); } + +void rte_uuid_generate_random (rte_uuid_t out) +{ +union { +uint64_t words[2 ]; +rte_uuid_t uuid; + } buf; +struct uuid uu; + +/* UUID is 128 bit */ + buf.words[0 ] =rte_rand (); + buf.words[1 ] =rte_rand (); + +/* Mark these random bytes a version 4 random uuid */ +uuid_unpack (buf.uuid, &uu); + uu.clock_seq = (uu.clock_seq &0x3FFF ) |0x8000 ; + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; +uuid_pack (&uu, out); +} + +void rte_uuid_generate_time (rte_uuid_t out) +{ +struct uuid uu; +struct timespec ts; +uint64_t ns, rnd; +static RTE_ATOMIC (uint16_t ) sequence; + +/* The time value for UUID is 100ns since 15 October 1582 */ +clock_gettime (CLOCK_REALTIME , &ts); + + ns = ts.tv_nsec /100 ; + ns += (uint64_t ) ts.tv_sec * (NSEC_PER_SEC /100 ); + ns += (((uint64_t )0x01B21DD2 ) <<32 ) +0x13814000 ; + + uu.time_low = (uint32_t ) ns; + uu.time_mid = (uint16_t ) (ns >>32 ); + uu.time_hi_and_version = (uint16_t ) (ns >>48 ); + uu.time_hi_and_version = (uu.time_hi_and_version &0x0FFF ) |0x4000 ; + uu.clock_seq =rte_atomic_fetch_add_explicit (&sequence,1 , rte_memory_order_relaxed); + + rnd =rte_rand (); +memcpy (uu.node, &rnd,6 ); +/* +* Follow the convention so that random node part +* will not match a valid MAC address, +*/ + uu.node[0 ] |=0x1 ; + +uuid_pack (&uu, out); +}
lib/eal/include/rte_uuid.h +26 -0
@@ -18,6 +18,8 @@ extern "C" {#include <stddef.h> #include <string.h> +#include <rte_compat.h> +/** * Struct describing a Universal Unique Identifier */
@@ -100,6 +102,30 @@ int rte_uuid_parse(const char *in, rte_uuid_t uu);*/ void rte_uuid_unparse (const rte_uuid_t uu,char *out,size_t len); +/** +* Generate a random uuid +* +* Uses high quality pseudo-random generator rte_rand() to generate a universal +* unique identifier. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_random(rte_uuid_t uu); + +/** +* Generate a uuid based on time stamp. +* +* Uses the current time and a random Ethernet MAC address to generate a +* universal unique identifier. +* +* @param uu +* Resulting UUID +*/ +__rte_experimental +void rte_uuid_generate_time(rte_uuid_t uu); + #ifdef __cplusplus }#endif
lib/eal/version.map +4 -0
@@ -396,6 +396,10 @@ EXPERIMENTAL { # added in 24.03 rte_vfio_get_device_info; # WINDOWS_NO_EXPORT + + # added in 24.07 + rte_uuid_generate_random; + rte_uuid_generate_time; }; INTERNAL {
Signature · 1 line
2.43.0
PATCH v4 2/2 test: add functional test for uuid
In reply to Stephen HemmingerThe uuid functions in EAL were not covered by existing functional tests.
--- app/test/meson.build | 1 + app/test/test_uuid.c | 138 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 app/test/test_uuid.c
app/test/meson.build +1 -0
@@ -198,6 +198,7 @@ source_file_deps = { 'test_trace.c': [], 'test_trace_perf.c': [], 'test_trace_register.c': [], + 'test_uuid.c' : [], 'test_vdev.c': ['kvargs', 'bus_vdev'], 'test_version.c': [], }
app/test/test_uuid.c new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
2.43.0
v5 cover replace use of rte_memcpy() with fixed size
In reply to Stephen HemmingerThe DPDK has a lot of unnecessary usage of rte_memcpy. This patch set replaces cases where rte_memcpy is used with a fixed size constant size.
Typical example is:
rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN); which can be replaced with: memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
This does not change the resulting binary on almost all architectures because x86 version of intrisics and glibc are the same, and other architectures were using __builtin_constant_p().
The main benefit is that analysis tools like fortify, Coverity, and ASAN analyzers can check these memcpy's. A recent example is that on Ubuntu 22.04 detected undefined use of memcpy such as:
memcpy(dst, NULL, 0)
The first patch is a simple coccinelle script to do the replacement and the rest are the results broken out by module. The script can be used again to make sure more bad usage doesn't creep in with new drivers.
v5 - rebase and fix a couple of the SW drivers.
rewording of commit messages
v4 - replace other unnecessary rte_memcpy in ethdev.
replace memcpy with structure assignment where possible. fixup formatting in a couple places.
v3 - rebase and rerun coccinelle script on 24.03
- consolidate patches by subtree
- remove inclusion of rte_memcpy.h when no longer used.
Stephen Hemminger (32):
cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
eal: replace use of fixed size rte_memcpy
ethdev: replace uses of rte_memcpy
eventdev: replace use of fixed size rte_memcpy
cryptodev: replace use of fixed size rte_memcpy
ip_frag: replace use of fixed size rte_memcpy
net: replace use of fixed size rte_memcpy
lpm: replace use of fixed size rte_memcpy
node: replace use of fixed size rte_memcpy
pdcp: replace use of fixed size rte_memcpy
pipeline: replace use of fixed size rte_memcpy
rib: replace use of fixed size rte_memcpy
security: replace use of fixed size rte_memcpy
bus: remove unneeded rte_memcpy.h include
raw: replace use of fixed size rte_memcpy baseband: replace use of fixed size rte_memcpy common: replace use of fixed size rte_memcpy crypto: replace use of fixed size rte_memcpy event: replace use of fixed size rte_memcpy mempool: replace use of fixed size rte_memcpy ml/cnxk: replace use of fixed size rte_memcpy app/test-pmd: replace use of fixed size rte_memcpy app/graph: replace use of fixed size rte_memcpy app/test-eventdev: replace use of fixed size rte_memcpy app/test: replace use of fixed size rte_memcpy app/test-pipeline: remove unused rte_memcpy.h include app/test-bbdev: remove unnecessary include of rte_memcpy.h examples: replace use of fixed size rte_memcpy net/null: replace use of fixed size memcpy net/tap: replace use of fixed size rte_memcpy net/pcap: replace use of fixed size rte_memcpy net/af_xdp:: replace use of fixed size rte_memcpy
app/graph/neigh.c | 8 +- app/test-bbdev/test_bbdev.c | 1 - app/test-eventdev/test_pipeline_common.c | 19 ++-- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - app/test-pmd/cmdline.c | 48 ++++----- app/test-pmd/cmdline_flow.c | 24 ++--- app/test-pmd/config.c | 8 +- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - app/test/commands.c | 1 - app/test/packet_burst_generator.c | 4 +- app/test/test_crc.c | 5 +- app/test/test_cryptodev.c | 18 ++-- app/test/test_cryptodev_asym.c | 1 - app/test/test_cryptodev_security_pdcp.c | 1 - app/test/test_efd.c | 1 - app/test/test_efd_perf.c | 1 - app/test/test_event_crypto_adapter.c | 12 +-- app/test/test_event_dma_adapter.c | 4 +- app/test/test_eventdev.c | 1 - app/test/test_ipsec.c | 6 +- app/test/test_link_bonding_mode4.c | 8 +- app/test/test_mbuf.c | 1 - app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - app/test/test_rawdev.c | 1 - app/test/test_security_inline_proto.c | 36 +++---- app/test/test_service_cores.c | 1 - app/test/virtual_pmd.c | 3 +- devtools/cocci/rte_memcpy.cocci | 11 ++ drivers/baseband/acc/rte_acc100_pmd.c | 16 ++- drivers/baseband/acc/rte_vrb_pmd.c | 21 ++-- drivers/baseband/la12xx/bbdev_la12xx.c | 4 +- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/common/idpf/idpf_common_device.c | 4 +- drivers/common/idpf/idpf_common_virtchnl.c | 10 +- drivers/common/qat/qat_qp.c | 10 +- drivers/compress/qat/qat_comp.c | 8 +- drivers/crypto/ccp/ccp_crypto.c | 14 +-- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +- drivers/crypto/qat/qat_sym_session.c | 52 +++++---- .../scheduler/rte_cryptodev_scheduler.c | 6 +- drivers/crypto/scheduler/scheduler_failover.c | 12 +-- drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 - drivers/event/cnxk/cnxk_tim_evdev.c | 4 +- drivers/event/dlb2/dlb2.c | 4 +- drivers/event/dpaa/dpaa_eventdev.c | 1 - drivers/event/dpaa2/dpaa2_eventdev.c | 7 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 - drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 - drivers/event/octeontx/ssovf_evdev_selftest.c | 1 - drivers/event/octeontx/timvf_evdev.c | 4 +- drivers/mempool/dpaa/dpaa_mempool.c | 4 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 +- drivers/ml/cnxk/cn10k_ml_model.c | 8 +- drivers/ml/cnxk/cn10k_ml_ops.c | 11 +- drivers/ml/cnxk/cnxk_ml_ops.c | 2 +- drivers/ml/cnxk/mvtvm_ml_model.c | 8 +- drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/null/rte_eth_null.c | 6 +- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pcap/pcap_osdep_freebsd.c | 2 +- drivers/net/pcap/pcap_osdep_linux.c | 2 +- drivers/net/tap/rte_eth_tap.c | 14 +-- drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +- drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +- drivers/raw/ifpga/afu_pmd_n3000.c | 8 +- drivers/raw/ifpga/ifpga_rawdev.c | 11 +- drivers/raw/skeleton/skeleton_rawdev.c | 8 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 1 - examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 1 - examples/ip_fragmentation/main.c | 1 - examples/ip_reassembly/main.c | 1 - examples/ipv4_multicast/main.c | 1 - examples/l2fwd-cat/cat.c | 4 +- examples/l2fwd-jobstats/main.c | 1 - examples/l2fwd-keepalive/main.c | 1 - examples/l2fwd-macsec/main.c | 1 - examples/l2fwd/main.c | 1 - examples/l3fwd-power/main.c | 1 - examples/l3fwd/main.c | 1 - examples/link_status_interrupt/main.c | 1 - .../client_server_mp/mp_server/init.c | 1 - .../client_server_mp/mp_server/main.c | 1 - examples/multi_process/symmetric_mp/main.c | 1 - examples/ptpclient/ptpclient.c | 11 +- examples/qos_sched/app_thread.c | 1 - examples/qos_sched/main.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/vhost/main.c | 6 +- examples/vmdq/main.c | 7 +- examples/vmdq_dcb/main.c | 15 +-- lib/cryptodev/rte_cryptodev.c | 2 +- lib/eal/common/eal_common_options.c | 7 +- lib/ethdev/rte_ethdev.c | 12 +-- lib/ethdev/rte_flow.c | 101 +++++++++--------- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_dma_adapter.c | 4 +- lib/eventdev/rte_event_timer_adapter.c | 2 +- lib/fib/trie.c | 2 +- lib/ip_frag/rte_ipv6_fragmentation.c | 4 +- lib/ip_frag/rte_ipv6_reassembly.c | 6 +- lib/lpm/rte_lpm6.c | 3 +- lib/net/rte_ether.c | 2 +- lib/node/ip6_lookup.c | 8 +- lib/pdcp/pdcp_process.c | 36 +++---- lib/pipeline/rte_table_action.c | 8 +- lib/rib/rte_rib6.h | 5 +- lib/security/rte_security.c | 4 +- 131 files changed, 368 insertions(+), 450 deletions(-) create mode 100644 devtools/cocci/rte_memcpy.cocci
Signature · 1 line
2.43.0
PATCH v5 1/32 cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
Rte_memcpy need not be used for the simple case of copying a fix size structure because it is not faster and will hide problems from code analysis tools. Coverity, Fortify and other analyzers special case memcpy() and can find issues that rte_memcpy() will hide.
Many platforms use memcpy instead of rte_memcpy already. The only reason rte_memcpy() was added in original DPDK was that the older Gcc was doing slower on x86 than the special rte_memcpy() when handling larger size copies.
--- devtools/cocci/rte_memcpy.cocci | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 devtools/cocci/rte_memcpy.cocci
devtools/cocci/rte_memcpy.cocci new file +11 -0
@@ -0,0 +1,11 @@ +// +// rte_memcpy should not be used for simple fixed size structure +// because compiler's are smart enough to inline these. +// +@@ +expression src, dst; constant size; +@@ +( +- rte_memcpy(dst, src, size) ++ memcpy(dst, src, size) +)
Signature · 1 line
2.43.0
PATCH v5 2/32 eal: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/eal/common/eal_common_options.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
lib/eal/common/eal_common_options.c +3 -4
@@ -30,7 +30,6 @@#include <rte_tailq.h> #include <rte_version.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #ifndef RTE_EXEC_ENV_WINDOWS #include <rte_telemetry.h> #endif
@@ -1253,7 +1252,7 @@ eal_parse_lcores(const char *lcores)/* without '@', by default using lcore_set as cpuset */ if (*lcores !='@' ) -rte_memcpy (&cpuset, &lcore_set,sizeof (cpuset)); +memcpy (&cpuset, &lcore_set,sizeof (cpuset)); set_count =CPU_COUNT (&lcore_set);/* start to update lcore_set */
@@ -1275,8 +1274,8 @@ eal_parse_lcores(const char *lcores)if (check_cpuset (&cpuset) <0 ) goto err; -rte_memcpy (&lcore_config[idx].cpuset, &cpuset, -sizeof (rte_cpuset_t)); +memcpy (&lcore_config[idx].cpuset, &cpuset, +sizeof (rte_cpuset_t)); }/* some cores from the lcore_set can't be handled by EAL */
Signature · 1 line
2.43.0
PATCH v5 3/32 ethdev: replace uses of rte_memcpy
In reply to Stephen HemmingerReplace use of rte_memcpy in ethdev. Most of these were fixed size, and the others were not in the fast path. Where possible replace memcpy() with structure assignment which has same effect is type safe.
ethdev: struct assign
--- lib/ethdev/rte_ethdev.c | 12 ++--- lib/ethdev/rte_flow.c | 101 +++++++++++++++++++--------------------- 2 files changed, 53 insertions(+), 60 deletions(-)
lib/ethdev/rte_ethdev.c +5 -7
@@ -15,7 +15,6 @@#include <rte_log.h> #include <rte_interrupts.h> #include <rte_kvargs.h> -#include <rte_memcpy.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_malloc.h>
@@ -618,7 +617,7 @@ rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)rte_spinlock_lock (rte_mcfg_ethdev_get_lock ());if (eth_dev_shared_data_prepare () !=NULL ) { -rte_memcpy (owner, ðdev->data->owner,sizeof (*owner)); + *owner = ethdev->data->owner; ret =0 ; }else { ret = -ENOMEM ;
@@ -1316,15 +1315,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, dev->data->dev_configured =0 ;/* Store original config, as rollback required on failure */ -memcpy (&orig_conf, &dev->data->dev_conf,sizeof (dev->data->dev_conf)); + orig_conf = dev->data->dev_conf;/* * Copy the dev_conf parameter into the dev structure. * rte_eth_dev_info_get() requires dev_conf, copy it before dev_info get */ if (dev_conf != &dev->data->dev_conf) -memcpy (&dev->data->dev_conf, dev_conf, -sizeof (dev->data->dev_conf)); + dev->data->dev_conf = *dev_conf;/* Backup mtu for rollback */ old_mtu = dev->data->mtu;
@@ -1601,7 +1599,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,eth_dev_rx_queue_config (dev,0 );eth_dev_tx_queue_config (dev,0 ); rollback: -memcpy (&dev->data->dev_conf, &orig_conf,sizeof (dev->data->dev_conf)); + dev->data->dev_conf = orig_conf;if (old_mtu != dev->data->mtu) dev->data->mtu = old_mtu;
@@ -3843,7 +3841,7 @@ rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf)return -EINVAL ; } -memcpy (dev_conf, &dev->data->dev_conf,sizeof (struct rte_eth_conf )); + *dev_conf = dev->data->dev_conf;rte_ethdev_trace_conf_get (port_id, dev_conf);
lib/ethdev/rte_flow.c +48 -53
164 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v5 4/32 eventdev: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_dma_adapter.c | 4 ++-- lib/eventdev/rte_event_timer_adapter.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
lib/eventdev/rte_event_crypto_adapter.c +1 -1
@@ -655,7 +655,7 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,continue ; } -rte_memcpy (ev, &m_data->response_info,sizeof (*ev)); +memcpy (ev, &m_data->response_info,sizeof (*ev)); ev->event_ptr = ops[i]; ev->event_type =RTE_EVENT_TYPE_CRYPTODEV ;if (adapter->implicit_release_disabled)
lib/eventdev/rte_event_dma_adapter.c +2 -2
@@ -447,7 +447,7 @@ rte_event_dma_adapter_create(uint8_t id, uint8_t evdev_id, struct rte_event_portif (pc ==NULL )return -ENOMEM ; -rte_memcpy (pc, port_config,sizeof (struct rte_event_port_conf )); +memcpy (pc, port_config,sizeof (struct rte_event_port_conf )); ret =rte_event_dma_adapter_create_ext (id, evdev_id, edma_default_config_cb, mode, pc);if (ret !=0 )rte_free (pc);
@@ -668,7 +668,7 @@ edma_ops_enqueue_burst(struct event_dma_adapter *adapter, struct rte_event_dma_acontinue ; } -rte_memcpy (ev, response_info,sizeof (struct rte_event )); +memcpy (ev, response_info,sizeof (struct rte_event )); ev->event_ptr = ops[i]; ev->event_type =RTE_EVENT_TYPE_DMADEV ;if (adapter->implicit_release_disabled)
lib/eventdev/rte_event_timer_adapter.c +1 -1
@@ -549,7 +549,7 @@ event_buffer_add(struct event_buffer *bufp, struct rte_event *eventp)/* Instead of modulus, bitwise AND with mask to get head_idx. */ head_idx = bufp->head &EVENT_BUFFER_MASK ; buf_eventp = &bufp->events[head_idx]; -rte_memcpy (buf_eventp, eventp,sizeof (struct rte_event )); +memcpy (buf_eventp, eventp,sizeof (struct rte_event ));/* Wrap automatically when overflow occurs. */ bufp->head++;
Signature · 1 line
2.43.0
PATCH v5 5/32 cryptodev: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/cryptodev/rte_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/cryptodev/rte_cryptodev.c +1 -1
@@ -2854,7 +2854,7 @@ crypto_caps_array(struct rte_tel_data *d,while ((dev_caps = &capabilities[i++])->op !=RTE_CRYPTO_OP_TYPE_UNDEFINED ) {memset (&caps_val,0 ,CRYPTO_CAPS_SZ *sizeof (caps_val[0 ])); -rte_memcpy (caps_val, dev_caps,sizeof (capabilities[0 ])); +memcpy (caps_val, dev_caps,sizeof (capabilities[0 ]));for (j =0 ; j <CRYPTO_CAPS_SZ ; j++)rte_tel_data_add_array_uint (d, caps_val[j]); }
Signature · 1 line
2.43.0
PATCH v5 6/32 ip_frag: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/ip_frag/rte_ipv6_fragmentation.c | 4 +--- lib/ip_frag/rte_ipv6_reassembly.c | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-)
lib/ip_frag/rte_ipv6_fragmentation.c +1 -3
@@ -5,8 +5,6 @@#include <stddef.h> #include <errno.h> -#include <rte_memcpy.h> -#include "ip_frag_common.h" /**
@@ -23,7 +21,7 @@ __fill_ipv6hdr_frag(struct rte_ipv6_hdr *dst, {struct rte_ipv6_fragment_ext *fh; -rte_memcpy (dst, src,sizeof (*dst)); +memcpy (dst, src,sizeof (*dst)); dst->payload_len =rte_cpu_to_be_16 (len); dst->proto =IPPROTO_FRAGMENT ;
lib/ip_frag/rte_ipv6_reassembly.c +2 -4
@@ -4,8 +4,6 @@#include <stddef.h> -#include <rte_memcpy.h> -#include "ip_frag_common.h" /**
@@ -143,8 +141,8 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,int32_t ip_len;int32_t trim; -rte_memcpy (&key.src_dst[0 ], ip_hdr->src_addr,16 ); -rte_memcpy (&key.src_dst[2 ], ip_hdr->dst_addr,16 ); +memcpy (&key.src_dst[0 ], ip_hdr->src_addr,16 ); +memcpy (&key.src_dst[2 ], ip_hdr->dst_addr,16 ); key.id = frag_hdr->id; key.key_len =IPV6_KEYLEN ;
Signature · 1 line
2.43.0
PATCH v5 7/32 net: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/net/rte_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/net/rte_ether.c +1 -1
@@ -13,7 +13,7 @@ rte_eth_random_addr(uint8_t *addr)uint64_t rand =rte_rand ();uint8_t *p = (uint8_t *)&rand; -rte_memcpy (addr, p,RTE_ETHER_ADDR_LEN ); +memcpy (addr, p,RTE_ETHER_ADDR_LEN ); addr[0 ] &= (uint8_t )~RTE_ETHER_GROUP_ADDR ;/* clear multicast bit */ addr[0 ] |=RTE_ETHER_LOCAL_ADMIN_ADDR ;/* set local assignment bit */ }
Signature · 1 line
2.43.0
PATCH v5 8/32 lpm: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/lpm/rte_lpm6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/lpm/rte_lpm6.c +1 -2
@@ -11,7 +11,6 @@#include <rte_log.h> #include <rte_common.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_eal_memconfig.h> #include <rte_string_fns.h> #include <rte_errno.h>
@@ -139,7 +138,7 @@ ip6_mask_addr(uint8_t *ip, uint8_t depth)static inline void ip6_copy_addr (uint8_t *dst,const uint8_t *src) { -rte_memcpy (dst, src,RTE_LPM6_IPV6_ADDR_SIZE ); +memcpy (dst, src,RTE_LPM6_IPV6_ADDR_SIZE ); }/*
Signature · 1 line
2.43.0
PATCH v5 9/32 node: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/node/ip6_lookup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/node/ip6_lookup.c +4 -4
@@ -112,28 +112,28 @@ ip6_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node *node, sizeof(struct rte_ether_hdr));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf0, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[0 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[0 ], ipv6_hdr->dst_addr,16 );/* Extract DIP of mbuf1 */ ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf1, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr ));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf1, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[1 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[1 ], ipv6_hdr->dst_addr,16 );/* Extract DIP of mbuf2 */ ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf2, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr ));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf2, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[2 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[2 ], ipv6_hdr->dst_addr,16 );/* Extract DIP of mbuf3 */ ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf3, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr ));/* Extract hop_limits as ipv6 hdr is in cache */ node_mbuf_priv1 (mbuf3, dyn)->ttl = ipv6_hdr->hop_limits; -rte_memcpy (ip_batch[3 ], ipv6_hdr->dst_addr,16 ); +memcpy (ip_batch[3 ], ipv6_hdr->dst_addr,16 );rte_lpm6_lookup_bulk_func (lpm6, ip_batch, next_hop,4 );
Signature · 1 line
2.43.0
PATCH v5 10/32 pdcp: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/pdcp/pdcp_process.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
lib/pdcp/pdcp_process.c +18 -18
@@ -60,7 +60,7 @@ pdcp_iv_gen_null_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *e m = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (m_ptr, &m,8 ); +memcpy (m_ptr, &m,8 ); } static void
@@ -72,10 +72,10 @@ pdcp_iv_gen_null_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET); iv_u64[0 ] = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); iv_u64[1 ] = iv_u64[0 ] ^ en_priv->auth_iv_part.u64[1 ]; -rte_memcpy (iv +8 , &iv_u64[1 ],8 ); +memcpy (iv +8 , &iv_u64[1 ],8 ); } static void
@@ -89,7 +89,7 @@ pdcp_iv_gen_aes_ctr_null(struct rte_crypto_op *cop, const struct entity_priv *en iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); iv_u64[1 ] =0 ; -rte_memcpy (iv, iv_u64,16 ); +memcpy (iv, iv_u64,16 ); } static void
@@ -101,8 +101,8 @@ pdcp_iv_gen_zs_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET); iv_u64 = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64,8 ); -rte_memcpy (iv +8 , &iv_u64,8 ); +memcpy (iv, &iv_u64,8 ); +memcpy (iv +8 , &iv_u64,8 ); } static void
@@ -115,17 +115,17 @@ pdcp_iv_gen_zs_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv,/* Generating cipher IV */ iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); -rte_memcpy (iv +8 , &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv +8 , &iv_u64[0 ],8 ); iv +=PDCP_IV_LEN ;/* Generating auth IV */ iv_u64[0 ] = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); iv_u64[1 ] = iv_u64[0 ] ^ en_priv->auth_iv_part.u64[1 ]; -rte_memcpy (iv +8 , &iv_u64[1 ],8 ); +memcpy (iv +8 , &iv_u64[1 ],8 ); } static void
@@ -140,12 +140,12 @@ pdcp_iv_gen_zs_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_ iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET); iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); -rte_memcpy (iv +8 , &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv +8 , &iv_u64[0 ],8 ); m_ptr = (uint8_t *)rte_pktmbuf_prepend (mb,8 ); m = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (m_ptr, &m,8 ); +memcpy (m_ptr, &m,8 ); } static void
@@ -162,11 +162,11 @@ pdcp_iv_gen_aes_ctr_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); iv_u64[1 ] =0 ; -rte_memcpy (iv, iv_u64,PDCP_IV_LEN ); +memcpy (iv, iv_u64,PDCP_IV_LEN ); m_ptr = (uint8_t *)rte_pktmbuf_prepend (mb,8 ); m = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (m_ptr, &m,8 ); +memcpy (m_ptr, &m,8 ); } static void
@@ -179,15 +179,15 @@ pdcp_iv_gen_aes_ctr_zs(struct rte_crypto_op *cop, const struct entity_priv *en_p iv_u64[0 ] = en_priv->cipher_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); iv_u64[1 ] =0 ; -rte_memcpy (iv, iv_u64,PDCP_IV_LEN ); +memcpy (iv, iv_u64,PDCP_IV_LEN ); iv +=PDCP_IV_LEN ; iv_u64[0 ] = en_priv->auth_iv_part.u64[0 ] | ((uint64_t )(rte_cpu_to_be_32 (count))); -rte_memcpy (iv, &iv_u64[0 ],8 ); +memcpy (iv, &iv_u64[0 ],8 ); iv_u64[1 ] = iv_u64[0 ] ^ en_priv->auth_iv_part.u64[1 ]; -rte_memcpy (iv +8 , &iv_u64[1 ],8 ); +memcpy (iv +8 , &iv_u64[1 ],8 ); } static int
Signature · 1 line
2.43.0
PATCH v5 11/32 pipeline: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/pipeline/rte_table_action.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/pipeline/rte_table_action.c +4 -4
@@ -1441,7 +1441,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, tcp->src_port, data->port); -rte_memcpy (ip->src_addr, data->addr,16 ); +memcpy (ip->src_addr, data->addr,16 ); tcp->src_port = data->port; tcp->cksum = tcp_cksum; }else {
@@ -1454,7 +1454,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, udp->src_port, data->port); -rte_memcpy (ip->src_addr, data->addr,16 ); +memcpy (ip->src_addr, data->addr,16 ); udp->src_port = data->port; udp->dgram_cksum = udp_cksum; }
@@ -1469,7 +1469,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, tcp->dst_port, data->port); -rte_memcpy (ip->dst_addr, data->addr,16 ); +memcpy (ip->dst_addr, data->addr,16 ); tcp->dst_port = data->port; tcp->cksum = tcp_cksum; }else {
@@ -1482,7 +1482,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, udp->dst_port, data->port); -rte_memcpy (ip->dst_addr, data->addr,16 ); +memcpy (ip->dst_addr, data->addr,16 ); udp->dst_port = data->port; udp->dgram_cksum = udp_cksum; }
Signature · 1 line
2.43.0
PATCH v5 12/32 rib: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerMostly automatically generated by devtools/cocci/rte_memcpy.cocci The fib/trie.c was relying on headers
rte_rib6 -> rte_memcpy -> rte_vect
since rib6 is no longer using rte_memcpy need to get rte_vect.h
--- lib/fib/trie.c | 2 +- lib/rib/rte_rib6.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
lib/fib/trie.c +1 -1
@@ -9,7 +9,7 @@#include <rte_debug.h> #include <rte_malloc.h> #include <rte_errno.h> - +#include <rte_vect.h> #include <rte_rib6.h> #include <rte_fib6.h> #include "trie.h"
lib/rib/rte_rib6.h +3 -2
@@ -14,7 +14,8 @@* Level compressed tree implementation for IPv6 Longest Prefix Match */ -#include <rte_memcpy.h> +#include <string.h> +#include <rte_common.h> #ifdef __cplusplus
@@ -61,7 +62,7 @@ rte_rib6_copy_addr(uint8_t *dst, const uint8_t *src) {if ((dst ==NULL ) || (src ==NULL ))return ; -rte_memcpy (dst, src,RTE_RIB6_IPV6_ADDR_SIZE ); +memcpy (dst, src,RTE_RIB6_IPV6_ADDR_SIZE ); }/**
Signature · 1 line
2.43.0
PATCH v5 13/32 security: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- lib/security/rte_security.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/security/rte_security.c +2 -2
@@ -384,7 +384,7 @@ crypto_caps_array(struct rte_tel_data *d,while ((dev_caps = &capabilities[i++])->op !=RTE_CRYPTO_OP_TYPE_UNDEFINED ) {memset (&caps_val,0 ,CRYPTO_CAPS_SZ *sizeof (caps_val[0 ])); -rte_memcpy (caps_val, dev_caps,sizeof (capabilities[0 ])); +memcpy (caps_val, dev_caps,sizeof (capabilities[0 ]));for (j =0 ; j <CRYPTO_CAPS_SZ ; j++)rte_tel_data_add_array_uint (d, caps_val[j]); }
@@ -409,7 +409,7 @@ sec_caps_array(struct rte_tel_data *d,while ((dev_caps = &capabilities[i++])->action !=RTE_SECURITY_ACTION_TYPE_NONE ) {memset (&caps_val,0 ,SEC_CAPS_SZ *sizeof (caps_val[0 ])); -rte_memcpy (caps_val, dev_caps,sizeof (capabilities[0 ])); +memcpy (caps_val, dev_caps,sizeof (capabilities[0 ]));for (j =0 ; j <SEC_CAPS_SZ ; j++)rte_tel_data_add_array_uint (d, caps_val[j]); }
Signature · 1 line
2.43.0
PATCH v5 14/32 bus: remove unneeded rte_memcpy.h include
In reply to Stephen HemmingerIncluded here but never used.
--- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 - drivers/bus/pci/linux/pci.c | 1 - 7 files changed, 7 deletions(-)
drivers/bus/auxiliary/linux/auxiliary.c +0 -1
@@ -8,7 +8,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <eal_filesystem.h> #include "../private.h"
drivers/bus/fslmc/fslmc_bus.c +0 -1
@@ -13,7 +13,6 @@#include <bus_driver.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <ethdev_driver.h> #include <rte_mbuf_dyn.h>
drivers/bus/fslmc/fslmc_vfio.c +0 -1
@@ -24,7 +24,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +0 -1
@@ -14,7 +14,6 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +0 -1
@@ -13,7 +13,6 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +0 -1
@@ -26,7 +26,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/bus/pci/linux/pci.c +0 -1
@@ -10,7 +10,6 @@#include <rte_bus_pci.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <rte_vfio.h> #include "eal_filesystem.h"
Signature · 1 line
2.43.0
PATCH v5 15/32 raw: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-- drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-- drivers/raw/ifpga/afu_pmd_n3000.c | 8 ++++---- drivers/raw/ifpga/ifpga_rawdev.c | 11 +++++------ drivers/raw/skeleton/skeleton_rawdev.c | 8 +++----- drivers/raw/skeleton/skeleton_rawdev_test.c | 1 - 7 files changed, 15 insertions(+), 22 deletions(-)
drivers/raw/ifpga/afu_pmd_he_hssi.c +1 -2
@@ -15,7 +15,6 @@#include <rte_eal.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> #include <bus_pci_driver.h>
@@ -314,7 +313,7 @@ static int he_hssi_config(struct afu_rawdev *dev, void *config,if (cfg->port >=NUM_HE_HSSI_PORTS )return -EINVAL ; -rte_memcpy (&priv->he_hssi_cfg, cfg,sizeof (priv->he_hssi_cfg)); +memcpy (&priv->he_hssi_cfg, cfg,sizeof (priv->he_hssi_cfg));return 0 ; }
drivers/raw/ifpga/afu_pmd_he_lpbk.c +1 -2
@@ -15,7 +15,6 @@#include <rte_eal.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> #include <bus_pci_driver.h>
@@ -363,7 +362,7 @@ static int he_lpbk_config(struct afu_rawdev *dev, void *config,if ((cfg->end < cfg->begin) || (cfg->end >MAX_CACHE_LINES ))return -EINVAL ; -rte_memcpy (&priv->he_lpbk_cfg, cfg,sizeof (priv->he_lpbk_cfg)); +memcpy (&priv->he_lpbk_cfg, cfg,sizeof (priv->he_lpbk_cfg));return 0 ; }
drivers/raw/ifpga/afu_pmd_he_mem.c +1 -2
@@ -14,7 +14,6 @@#include <rte_eal.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> #include <bus_pci_driver.h>
@@ -126,7 +125,7 @@ static int he_mem_tg_config(struct afu_rawdev *dev, void *config,if (config_size !=sizeof (struct rte_pmd_afu_he_mem_tg_cfg ))return -EINVAL ; -rte_memcpy (&priv->he_mem_tg_cfg, config,sizeof (priv->he_mem_tg_cfg)); +memcpy (&priv->he_mem_tg_cfg, config,sizeof (priv->he_mem_tg_cfg));return 0 ; }
drivers/raw/ifpga/afu_pmd_n3000.c +4 -4
@@ -1867,8 +1867,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,if ((cfg->nlb_cfg.end < cfg->nlb_cfg.begin) || (cfg->nlb_cfg.end >MAX_CACHE_LINES ))return -EINVAL ; -rte_memcpy (&priv->nlb_cfg, &cfg->nlb_cfg, -sizeof (struct rte_pmd_afu_nlb_cfg )); +memcpy (&priv->nlb_cfg, &cfg->nlb_cfg, +sizeof (struct rte_pmd_afu_nlb_cfg )); }else if (cfg->type ==RTE_PMD_AFU_N3000_DMA ) {if (cfg->dma_cfg.index >=NUM_N3000_DMA )return -EINVAL ;
@@ -1887,8 +1887,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config, cfg->dma_cfg.length); } } -rte_memcpy (&priv->dma_cfg, &cfg->dma_cfg, -sizeof (struct rte_pmd_afu_dma_cfg )); +memcpy (&priv->dma_cfg, &cfg->dma_cfg, +sizeof (struct rte_pmd_afu_dma_cfg )); }else {IFPGA_RAWDEV_PMD_ERR ("Invalid type of N3000 AFU" );return -EINVAL ;
drivers/raw/ifpga/ifpga_rawdev.c +5 -6
@@ -14,7 +14,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_devargs.h> -#include <rte_memcpy.h> #include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_kvargs.h>
@@ -258,7 +257,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev *ifpga_dev)if (point <12 )return -1 ; point -=12 ; -rte_memcpy (ifpga_dev->parent_bdf, &link[point],12 ); +memcpy (ifpga_dev->parent_bdf, &link[point],12 ); point =strlen (link1);if (point <26 )
@@ -949,10 +948,10 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,if (ret)return ret; -rte_memcpy (&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b, -sizeof (u64)); -rte_memcpy (&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b +8 , -sizeof (u64)); +memcpy (&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b, +sizeof (u64)); +memcpy (&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b +8 , +sizeof (u64)); IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n", __func__,
drivers/raw/skeleton/skeleton_rawdev.c +3 -5
@@ -20,7 +20,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_lcore.h> #include <bus_vdev_driver.h>
@@ -245,8 +244,8 @@ static int skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev, skelq = &skeldev->queues[queue_id];if (queue_id <SKELETON_MAX_QUEUES ) -rte_memcpy (queue_conf, skelq, -sizeof (struct skeleton_rawdev_queue )); +memcpy (queue_conf, skelq, +sizeof (struct skeleton_rawdev_queue ));return 0 ; }
@@ -281,8 +280,7 @@ static int skeleton_rawdev_queue_setup(struct rte_rawdev *dev,if (skeldev->num_queues > queue_id && q->depth <SKELETON_QUEUE_MAX_DEPTH ) { -rte_memcpy (q, queue_conf, -sizeof (struct skeleton_rawdev_queue )); +memcpy (q, queue_conf,sizeof (struct skeleton_rawdev_queue ));clear_queue_bufs (queue_id); }else {SKELETON_PMD_ERR ("Invalid queue configuration" );
drivers/raw/skeleton/skeleton_rawdev_test.c +0 -1
@@ -7,7 +7,6 @@#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <dev_driver.h> #include <rte_rawdev.h> #include <bus_vdev_driver.h>
Signature · 1 line
2.43.0
PATCH v5 16/32 baseband: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/baseband/acc/rte_acc100_pmd.c | 16 +++++++--------- drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++----------- drivers/baseband/la12xx/bbdev_la12xx.c | 4 ++-- 3 files changed, 19 insertions(+), 22 deletions(-)
drivers/baseband/acc/rte_acc100_pmd.c +7 -9
@@ -2975,15 +2975,13 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,uint8_t *prev_ptr = (uint8_t *) prev_desc;uint8_t *new_ptr = (uint8_t *) desc;/* Copy first 4 words and BDESCs */ -rte_memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); -rte_memcpy (new_ptr +ACC_5GUL_OFFSET_0 , - prev_ptr +ACC_5GUL_OFFSET_0 , -ACC_5GUL_SIZE_1 ); +memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); +memcpy (new_ptr +ACC_5GUL_OFFSET_0 , + prev_ptr +ACC_5GUL_OFFSET_0 ,ACC_5GUL_SIZE_1 ); desc->req.op_addr = prev_desc->req.op_addr;/* Copy FCW */ -rte_memcpy (new_ptr +ACC_DESC_FCW_OFFSET , - prev_ptr +ACC_DESC_FCW_OFFSET , -ACC_FCW_LD_BLEN ); +memcpy (new_ptr +ACC_DESC_FCW_OFFSET , + prev_ptr +ACC_DESC_FCW_OFFSET ,ACC_FCW_LD_BLEN );acc100_dma_desc_ld_update (op, &desc->req, input, h_output, &in_offset, &h_out_offset, &h_out_length, harq_layout);
@@ -3130,7 +3128,7 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc =acc_desc (q, total_enqueued_cbs); desc->req.data_ptrs[0 ].address = q->ring_addr_iova + fcw_offset; desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ; -rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); +memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); ret = acc100_dma_desc_ld_fill(op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length,
@@ -4430,7 +4428,7 @@ acc100_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); value =acc_reg_read (d, HwPfPcieGpexBridgeControl);bool firstCfg = (value !=ACC100_CFG_PCI_BRIDGE );
drivers/baseband/acc/rte_vrb_pmd.c +10 -11
@@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,uint8_t *prev_ptr = (uint8_t *) prev_desc;uint8_t *new_ptr = (uint8_t *) desc;/* Copy first 4 words and BDESCs. */ -rte_memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); -rte_memcpy (new_ptr +ACC_5GUL_OFFSET_0 , - prev_ptr +ACC_5GUL_OFFSET_0 , -ACC_5GUL_SIZE_1 ); +memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); +memcpy (new_ptr +ACC_5GUL_OFFSET_0 , + prev_ptr +ACC_5GUL_OFFSET_0 ,ACC_5GUL_SIZE_1 ); desc->req.op_addr = prev_desc->req.op_addr;/* Copy FCW. */ -rte_memcpy (new_ptr +ACC_DESC_FCW_OFFSET , - prev_ptr +ACC_DESC_FCW_OFFSET , -ACC_FCW_LD_BLEN ); +memcpy (new_ptr +ACC_DESC_FCW_OFFSET , + prev_ptr +ACC_DESC_FCW_OFFSET ,ACC_FCW_LD_BLEN );vrb_dma_desc_ld_update (op, &desc->req, input, h_output, &in_offset, &h_out_offset, &h_out_length, harq_layout);
@@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, fcw_offset = (desc_idx <<8 ) +ACC_DESC_FCW_OFFSET ; desc->req.data_ptrs[0 ].address = q->ring_addr_iova + fcw_offset; desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ; -rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); +memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld, +ACC_FCW_LD_BLEN ); desc->req.fcw_ld.tb_trailer_size = (c - r -1 ) * trail_len; ret = vrb_dma_desc_ld_fill(op, &desc->req, &input, h_output, &in_offset, &h_out_offset,
@@ -4002,7 +4001,7 @@ enqueue_mldts_split_op(struct acc_queue *q, struct rte_bbdev_mldts_op *op,if (symb ==0 ) desc->req.cbs_in_tb = num_syms;else -rte_memcpy (&desc->req.fcw_mldts, fcw,ACC_FCW_MLDTS_BLEN ); +memcpy (&desc->req.fcw_mldts, fcw,ACC_FCW_MLDTS_BLEN ); desc->req.data_ptrs[1 ].address =rte_pktmbuf_iova_offset (input_q, in_offset); desc->req.data_ptrs[1 ].blen = q_size; in_offset += q_size;
@@ -4352,7 +4351,7 @@ vrb1_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration. */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf));/* Check we are already out of PG. */ status =acc_reg_read (d, VRB1_PfHiSectionPowerGatingAck);
@@ -4759,7 +4758,7 @@ vrb2_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration. */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf));/* Explicitly releasing AXI as this may be stopped after PF FLR/BME. */ address = VRB2_PfDmaAxiControl;
drivers/baseband/la12xx/bbdev_la12xx.c +2 -2
@@ -597,8 +597,8 @@ dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst) op = q_priv->bbdev_op[ci]; -rte_memcpy (dst, q_priv->msg_ch_vaddr[ci], -sizeof (struct bbdev_ipc_enqueue_op )); +memcpy (dst, q_priv->msg_ch_vaddr[ci], +sizeof (struct bbdev_ipc_enqueue_op ));/* Move Consumer Index forward */ ci++;
Signature · 1 line
2.43.0
RE: [PATCH v5 16/32] baseband: replace use of fixed size rte_memcpy
Hi Stephen,
Still issue with indentation inconsistencies below.
Thanks
Nic
Quoted 164 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Tuesday, May 21, 2024 8:28 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Chautru, Nicolas <[email protected]>; Gagandeep Singh <[email protected]>; Hemant Agrawal <[email protected]>
Subject: [PATCH v5 16/32] baseband: replace use of fixed sizerte_memcpyAutomatically generated by
devtools/cocci/rte_memcpy.cocciSigned-off-by Stephen Hemminger <[email protected]>--- drivers/baseband/acc/rte_acc100_pmd.c | 16 +++++++--------- drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++----------- drivers/baseband/la12xx/bbdev_la12xx.c | 4 ++-- 3 files changed, 19 insertions(+), 22 deletions(-)drivers/baseband/acc/rte_acc100_pmd.c +5
-7@@ -2975,15 +2975,13 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op, uint8_t *prev_ptr = (uint8_t *) prev_desc;uint8_t *new_ptr = (uint8_t *) desc;/* Copy first 4 words and BDESCs */ -rte_memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); -rte_memcpy (new_ptr +ACC_5GUL_OFFSET_0 , - prev_ptr +ACC_5GUL_OFFSET_0 , -ACC_5GUL_SIZE_1 ); +memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); +memcpy (new_ptr +ACC_5GUL_OFFSET_0 , + prev_ptr +ACC_5GUL_OFFSET_0 ,ACC_5GUL_SIZE_1 ); desc->req.op_addr = prev_desc->req.op_addr;/* Copy FCW */ -rte_memcpy (new_ptr +ACC_DESC_FCW_OFFSET , - prev_ptr +ACC_DESC_FCW_OFFSET , -ACC_FCW_LD_BLEN ); +memcpy (new_ptr +ACC_DESC_FCW_OFFSET , + prev_ptr +ACC_DESC_FCW_OFFSET ,ACC_FCW_LD_BLEN ); acc100_dma_desc_ld_update(op, &desc->req, input,
h_output,drivers/baseband/acc/rte_acc100_pmd.c +1
-1&in_offset, &h_out_offset, &h_out_length, harq_layout);@@ -3130,7 +3128,7 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc =acc_desc (q, total_enqueued_cbs); desc->req.data_ptrs[0 ].address = q->ring_addr_iova + fcw_offset; desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ; -rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN); + memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
ACC_FCW_LD_BLEN);drivers/baseband/acc/rte_acc100_pmd.c +1
-1ret = acc100_dma_desc_ld_fill(op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length,@@ -4430,7 +4428,7 @@ acc100_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); value =acc_reg_read (d, HwPfPcieGpexBridgeControl);bool firstCfg = (value !=
ACC100_CFG_PCI_BRIDGE); diff --gita/drivers/baseband/acc/rte_vrb_pmd.cb/drivers/baseband/acc/rte_vrb_pmd.c
index585dc49bd6..bb11ff887a100644drivers/baseband/acc/rte_vrb_pmd.c +5
-7@@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op, uint8_t *prev_ptr = (uint8_t *) prev_desc;uint8_t *new_ptr = (uint8_t *) desc;/* Copy first 4 words and BDESCs. */ -rte_memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); -rte_memcpy (new_ptr +ACC_5GUL_OFFSET_0 , - prev_ptr +ACC_5GUL_OFFSET_0 , -ACC_5GUL_SIZE_1 ); +memcpy (new_ptr, prev_ptr,ACC_5GUL_SIZE_0 ); +memcpy (new_ptr +ACC_5GUL_OFFSET_0 , + prev_ptr +ACC_5GUL_OFFSET_0 ,ACC_5GUL_SIZE_1 ); desc->req.op_addr = prev_desc->req.op_addr;/* Copy FCW. */ -rte_memcpy (new_ptr +ACC_DESC_FCW_OFFSET , - prev_ptr +ACC_DESC_FCW_OFFSET , -ACC_FCW_LD_BLEN ); +memcpy (new_ptr +ACC_DESC_FCW_OFFSET , + prev_ptr +ACC_DESC_FCW_OFFSET ,ACC_FCW_LD_BLEN ); vrb_dma_desc_ld_update(op, &desc->req, input, h_output,drivers/baseband/acc/rte_vrb_pmd.c +2
-1&in_offset, &h_out_offset, &h_out_length, harq_layout);@@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, fcw_offset = (desc_idx <<8 ) +ACC_DESC_FCW_OFFSET ; desc->req.data_ptrs[0 ].address = q->ring_addr_iova + fcw_offset; desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ; -rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN); +memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld, +ACC_FCW_LD_BLEN );drivers/baseband/acc/rte_vrb_pmd.c +0
-0desc->req.fcw_ld.tb_trailer_size = (c - r -1 ) * trail_len; ret = vrb_dma_desc_ld_fill(op, &desc->req, &input, h_output, &in_offset, &h_out_offset, @@ -4002,7 +4001,7 @@ enqueue_mldts_split_op(struct
acc_queue*q, structrte_bbdev_mldts_op*op,drivers/baseband/acc/rte_vrb_pmd.c +0
-1if (symb ==0 ) desc->req.cbs_in_tb = num_syms;else - rte_memcpy(&desc->req.fcw_mldts, fcw,
ACC_FCW_MLDTS_BLEN);drivers/baseband/acc/rte_vrb_pmd.c +1
-0+ memcpy(&desc->req.fcw_mldts, fcw,
ACC_FCW_MLDTS_BLEN);
desc->req.data_ptrs[1].address =rte_pktmbuf_iova_offset(input_q, in_offset);drivers/baseband/acc/rte_vrb_pmd.c +1
-1desc->req.data_ptrs[1 ].blen = q_size; in_offset += q_size;@@ -4352,7 +4351,7 @@ vrb1_configure(const char *dev_name, struct rte_acc_conf *conf)struct acc_device *d = bbdev->data->dev_private;/* Store configuration. */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf));/* Check we are already out of PG. */ status =
acc_reg_read(d, VRB1_PfHiSectionPowerGatingAck); @@ -
4759,7 +4758,7 @@vrb2_configure(const char *dev_name, struct rte_acc_conf *conf)drivers/baseband/acc/rte_vrb_pmd.c +1
-1struct acc_device *d = bbdev->data->dev_private;/* Store configuration. */ -rte_memcpy (&d->acc_conf, conf,sizeof (d->acc_conf)); +memcpy (&d->acc_conf, conf,sizeof (d->acc_conf));/* Explicitly releasing AXI as this may be stopped after PF FLR/BME. */
drivers/baseband/acc/rte_vrb_pmd.c +0
-0address = VRB2_PfDmaAxiControl;drivers/baseband/la12xx/bbdev_la12xx.c +2
-2@@ -597,8 +597,8 @@ dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst) op = q_priv->bbdev_op[ci]; -rte_memcpy (dst, q_priv->msg_ch_vaddr[ci], -sizeof (struct bbdev_ipc_enqueue_op )); +memcpy (dst, q_priv->msg_ch_vaddr[ci], +sizeof (struct bbdev_ipc_enqueue_op ));/* Move Consumer Index forward */ ci++;
--
2.43.0
PATCH v5 17/32 common: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci Also, remove unnecessary includes of rte_memcpy.h
--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_virtchnl.c | 10 ++++++---- drivers/common/qat/qat_qp.c | 10 ++++------ drivers/compress/qat/qat_comp.c | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-)
drivers/common/idpf/idpf_common_device.c +2 -2
@@ -477,8 +477,8 @@ idpf_vport_init(struct idpf_vport *vport, vport->num_rx_q = vport_info->num_rx_q; vport->num_rx_bufq = vport_info->num_rx_bufq; vport->max_mtu = vport_info->max_mtu; -rte_memcpy (vport->default_mac_addr, - vport_info->default_mac_addr,ETH_ALEN ); +memcpy (vport->default_mac_addr, vport_info->default_mac_addr, +ETH_ALEN ); vport->rss_algorithm = vport_info->rss_algorithm; vport->rss_key_size =RTE_MIN (IDPF_RSS_KEY_LEN , vport_info->rss_key_size);
drivers/common/idpf/idpf_common_virtchnl.c +6 -4
@@ -290,7 +290,8 @@ idpf_vc_caps_get(struct idpf_adapter *adapter)return err; } -rte_memcpy (&adapter->caps, args.out_buffer,sizeof (struct virtchnl2_get_capabilities )); +memcpy (&adapter->caps, args.out_buffer, +sizeof (struct virtchnl2_get_capabilities ));return 0 ; }
@@ -327,7 +328,8 @@ idpf_vc_vport_create(struct idpf_vport *vport,return err; } -rte_memcpy (&(vport->vport_info.info), args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (&(vport->vport_info.info), args.out_buffer, +IDPF_DFLT_MBX_BUF_SIZE );return 0 ; }
@@ -383,7 +385,7 @@ idpf_vc_queue_grps_add(struct idpf_vport *vport,return err; } -rte_memcpy (p2p_queue_grps_out, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (p2p_queue_grps_out, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE );return 0 ; }
@@ -922,7 +924,7 @@ idpf_vc_ptype_info_query(struct idpf_adapter *adapter,if (err !=0 )DRV_LOG (ERR ,"Failed to execute command of VIRTCHNL2_OP_GET_PTYPE_INFO" ); -rte_memcpy (recv_ptype_info, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE ); +memcpy (recv_ptype_info, args.out_buffer,IDPF_DFLT_MBX_BUF_SIZE );return err; }
drivers/common/qat/qat_qp.c +4 -6
@@ -871,9 +871,8 @@ qat_cq_get_fw_cipher_crc_cap(struct qat_qp *qp)return -EINVAL ; } -rte_memcpy (src_data_addr, - cipher_crc_cap_check_plaintext, -sizeof (cipher_crc_cap_check_plaintext)); +memcpy (src_data_addr, cipher_crc_cap_check_plaintext, +sizeof (cipher_crc_cap_check_plaintext)); phy_src_addr =rte_mem_virt2iova (src_data_addr);if (phy_src_addr ==0 || phy_src_addr ==RTE_BAD_IOVA ) {
@@ -892,9 +891,8 @@ qat_cq_get_fw_cipher_crc_cap(struct qat_qp *qp) auth_param = (void *)((uint8_t *)cipher_param +ICP_QAT_FW_HASH_REQUEST_PARAMETERS_OFFSET ); -rte_memcpy (cipher_param->u.cipher_IV_array, - cipher_crc_cap_check_iv, -sizeof (cipher_crc_cap_check_iv)); +memcpy (cipher_param->u.cipher_IV_array, cipher_crc_cap_check_iv, +sizeof (cipher_crc_cap_check_iv)); cipher_param->cipher_offset = cipher_crc_cap_check_cipher_offset; cipher_param->cipher_length =
drivers/compress/qat/qat_comp.c +4 -4
@@ -375,7 +375,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,QAT_DP_LOG (DEBUG ,"op %p, parent_cookie %p" , op, parent_cookie);/* copy original op to the local variable for restoring later */ -rte_memcpy (&op_backup, op,sizeof (op_backup)); +memcpy (&op_backup, op,sizeof (op_backup)); parent_cookie->nb_child_responses =0 ; parent_cookie->nb_children =0 ;
@@ -401,7 +401,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp, }/* prepare local dst mbuf */ -rte_memcpy (&dst_mbuf, op->m_dst,sizeof (dst_mbuf)); +memcpy (&dst_mbuf, op->m_dst,sizeof (dst_mbuf));rte_pktmbuf_reset (&dst_mbuf); dst_mbuf.buf_len = dst_data_size; dst_mbuf.data_len = dst_data_size;
@@ -457,7 +457,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,if (ret <0 ) {QAT_DP_LOG (WARNING ,"Failed to build child descriptor" );/* restore op and clear cookie */ -rte_memcpy (op, &op_backup,sizeof (op_backup)); +memcpy (op, &op_backup,sizeof (op_backup)); parent_cookie->split_op =0 ; parent_cookie->nb_children =0 ;return ret;
@@ -468,7 +468,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp, }/* restore backed up original op */ -rte_memcpy (op, &op_backup,sizeof (op_backup)); +memcpy (op, &op_backup,sizeof (op_backup));if (nb_descr != num_descriptors_built) QAT_DP_LOG(ERR, "split op. expected %d, built %d",
Signature · 1 line
2.43.0
PATCH v5 18/32 crypto: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/crypto/ccp/ccp_crypto.c | 14 ++--- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +- drivers/crypto/qat/qat_sym_session.c | 52 +++++++++---------- .../scheduler/rte_cryptodev_scheduler.c | 6 +-- drivers/crypto/scheduler/scheduler_failover.c | 12 ++--- 8 files changed, 44 insertions(+), 50 deletions(-)
drivers/crypto/ccp/ccp_crypto.c +5 -9
@@ -168,7 +168,7 @@ static int partial_hash_sha1(uint8_t *data_in, uint8_t *data_out)if (!SHA1_Init (&ctx))return -EFAULT ;SHA1_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx,SHA_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA_DIGEST_LENGTH );return 0 ; }
@@ -179,8 +179,7 @@ static int partial_hash_sha224(uint8_t *data_in, uint8_t *data_out)if (!SHA224_Init (&ctx))return -EFAULT ;SHA256_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA256_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA256_DIGEST_LENGTH );return 0 ; }
@@ -191,8 +190,7 @@ static int partial_hash_sha256(uint8_t *data_in, uint8_t *data_out)if (!SHA256_Init (&ctx))return -EFAULT ;SHA256_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA256_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA256_DIGEST_LENGTH );return 0 ; }
@@ -203,8 +201,7 @@ static int partial_hash_sha384(uint8_t *data_in, uint8_t *data_out)if (!SHA384_Init (&ctx))return -EFAULT ;SHA512_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA512_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA512_DIGEST_LENGTH );return 0 ; }
@@ -215,8 +212,7 @@ static int partial_hash_sha512(uint8_t *data_in, uint8_t *data_out)if (!SHA512_Init (&ctx))return -EFAULT ;SHA512_Transform (&ctx, data_in); -rte_memcpy (data_out, &ctx, -SHA512_DIGEST_LENGTH ); +memcpy (data_out, &ctx,SHA512_DIGEST_LENGTH );return 0 ; }
drivers/crypto/cnxk/cnxk_cryptodev_ops.c +1 -1
@@ -959,7 +959,7 @@ cnxk_crypto_cn10k_submit(void *qptr, void *inst, uint16_t nb_inst) lmt_dst =PLT_PTR_CAST (lmt_base);for (j =0 ; j < i; j++) { -rte_memcpy (lmt_dst, inst,sizeof (struct cpt_inst_s )); +memcpy (lmt_dst, inst,sizeof (struct cpt_inst_s )); inst =RTE_PTR_ADD (inst,sizeof (struct cpt_inst_s )); lmt_dst =RTE_PTR_ADD (lmt_dst,2 *sizeof (struct cpt_inst_s )); }
drivers/crypto/cnxk/cnxk_se.h +1 -1
@@ -1161,7 +1161,7 @@ cpt_sm_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens, struct roc_se_fc_pvoid *dst =PLT_PTR_ADD (offset_vaddr,ROC_SE_OFF_CTRL_LEN );const uint64_t *src = fc_params->iv_buf; -rte_memcpy (dst, src,16 ); +memcpy (dst, src,16 ); } inst->w4.u64 = cpt_inst_w4.u64; }else {
drivers/crypto/dpaa_sec/dpaa_sec.c +1 -1
@@ -676,7 +676,7 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp) } cdb = &sess->cdb; -rte_memcpy (&c_cdb, cdb,sizeof (struct sec_cdb )); +memcpy (&c_cdb, cdb,sizeof (struct sec_cdb ));#ifdef RTE_LIB_SECURITY printf ("\nsession protocol type = %d\n" , sess->proto_alg);#endif
drivers/crypto/ipsec_mb/pmd_snow3g.c +2 -2
@@ -291,8 +291,8 @@ process_snow3g_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,/* Copy back digest from src to auth.digest.data */ if (digest_appended) -rte_memcpy (ops[i]->sym->auth.digest.data, - dst,SNOW3G_DIGEST_LENGTH ); +memcpy (ops[i]->sym->auth.digest.data, dst, +SNOW3G_DIGEST_LENGTH ); } processed_ops++; }
drivers/crypto/qat/qat_sym_session.c +25 -27
148 lines not on this page · raw message
drivers/crypto/scheduler/rte_cryptodev_scheduler.c +3 -3
@@ -79,7 +79,7 @@ sync_caps(struct rte_cryptodev_capabilities *caps,/* remove a uncommon cap from the array */ for (j = i; j < sync_nb_caps -1 ; j++) -rte_memcpy (&caps[j], &caps[j+1 ],sizeof (*cap)); +memcpy (&caps[j], &caps[j +1 ],sizeof (*cap));memset (&caps[sync_nb_caps -1 ],0 ,sizeof (*cap)); sync_nb_caps--;
@@ -216,8 +216,8 @@ sync_sec_caps(uint32_t worker_idx,* caps, from the arrays */ for (j = i; j < nb_sec_caps -1 ; j++) { -rte_memcpy (&sec_caps[j], &sec_caps[j+1 ], -sizeof (*sec_cap)); +memcpy (&sec_caps[j], &sec_caps[j +1 ], +sizeof (*sec_cap)); rte_memcpy(&sec_crypto_caps[j][0], &sec_crypto_caps[j+1][0],
drivers/crypto/scheduler/scheduler_failover.c +6 -6
@@ -171,12 +171,12 @@ scheduler_start(struct rte_cryptodev *dev) sched_ctx->workers[PRIMARY_WORKER_IDX ].qp_id = i; sched_ctx->workers[SECONDARY_WORKER_IDX ].qp_id = i; -rte_memcpy (&qp_ctx->primary_worker, - &sched_ctx->workers[PRIMARY_WORKER_IDX ], -sizeof (struct scheduler_worker )); -rte_memcpy (&qp_ctx->secondary_worker, - &sched_ctx->workers[SECONDARY_WORKER_IDX ], -sizeof (struct scheduler_worker )); +memcpy (&qp_ctx->primary_worker, + &sched_ctx->workers[PRIMARY_WORKER_IDX ], +sizeof (struct scheduler_worker )); +memcpy (&qp_ctx->secondary_worker, + &sched_ctx->workers[SECONDARY_WORKER_IDX ], +sizeof (struct scheduler_worker )); }return 0 ;
Signature · 1 line
2.43.0
PATCH v5 19/32 event: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci Also, remove unnecessary includes of rte_memcpy.h
--- drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 - drivers/event/cnxk/cnxk_tim_evdev.c | 4 ++-- drivers/event/dlb2/dlb2.c | 4 ++-- drivers/event/dpaa/dpaa_eventdev.c | 1 - drivers/event/dpaa2/dpaa2_eventdev.c | 7 +++---- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 - drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 - drivers/event/octeontx/ssovf_evdev_selftest.c | 1 - drivers/event/octeontx/timvf_evdev.c | 4 ++-- 9 files changed, 9 insertions(+), 15 deletions(-)
drivers/event/cnxk/cnxk_eventdev_selftest.c +0 -1
@@ -13,7 +13,6 @@#include <rte_lcore.h> #include <rte_malloc.h> #include <rte_mbuf.h> -#include <rte_memcpy.h> #include <rte_per_lcore.h> #include <rte_random.h> #include <rte_test.h>
drivers/event/cnxk/cnxk_tim_evdev.c +2 -2
@@ -115,8 +115,8 @@ cnxk_tim_ring_info_get(const struct rte_event_timer_adapter *adptr, adptr_info->min_resolution_ns = tim_ring->ena_periodic ? tim_ring->max_tout : tim_ring->tck_nsec; -rte_memcpy (&adptr_info->conf, &adptr->data->conf, -sizeof (struct rte_event_timer_adapter_conf )); +memcpy (&adptr_info->conf, &adptr->data->conf, +sizeof (struct rte_event_timer_adapter_conf )); } static int
drivers/event/dlb2/dlb2.c +2 -2
@@ -1668,7 +1668,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2, qm_port->issued_releases =0 ;/* Save config message too. */ -rte_memcpy (&qm_port->cfg.ldb, &cfg,sizeof (qm_port->cfg.ldb)); +memcpy (&qm_port->cfg.ldb, &cfg,sizeof (qm_port->cfg.ldb));/* update state */ qm_port->state =PORT_STARTED ;/* enabled at create time */
@@ -1869,7 +1869,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2, qm_port->issued_releases =0 ;/* Save config message too. */ -rte_memcpy (&qm_port->cfg.dir, &cfg,sizeof (qm_port->cfg.dir)); +memcpy (&qm_port->cfg.dir, &cfg,sizeof (qm_port->cfg.dir));/* update state */ qm_port->state =PORT_STARTED ;/* enabled at create time */
drivers/event/dpaa/dpaa_eventdev.c +0 -1
@@ -19,7 +19,6 @@#include <rte_lcore.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_memory.h> #include <rte_memzone.h> #include <rte_pci.h>
drivers/event/dpaa2/dpaa2_eventdev.c +3 -4
@@ -20,7 +20,6 @@#include <rte_lcore.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_memory.h> #include <rte_pci.h> #include <bus_vdev_driver.h>
@@ -159,7 +158,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], "Unable to allocate event object"); goto send_partial; } -rte_memcpy (ev_temp, event,sizeof (struct rte_event )); +memcpy (ev_temp, event,sizeof (struct rte_event ));DPAA2_SET_FD_ADDR ((&fd_arr[loop]), (size_t )ev_temp);DPAA2_SET_FD_LEN ((&fd_arr[loop]),sizeof (struct rte_event ));
@@ -230,7 +229,7 @@ static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp,RTE_SET_USED (rxq); -rte_memcpy (ev, ev_temp,sizeof (struct rte_event )); +memcpy (ev, ev_temp,sizeof (struct rte_event ));rte_free (ev_temp);qbman_swp_dqrr_consume (swp, dq);
@@ -249,7 +248,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,RTE_SET_USED (swp);RTE_SET_USED (rxq); -rte_memcpy (ev, ev_temp,sizeof (struct rte_event )); +memcpy (ev, ev_temp,sizeof (struct rte_event ));rte_free (ev_temp); *dpaa2_seqn (ev->mbuf) = dqrr_index +1 ;DPAA2_PER_LCORE_DQRR_SIZE ++;
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +0 -1
@@ -12,7 +12,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_lcore.h> #include <rte_per_lcore.h>
drivers/event/dpaa2/dpaa2_hw_dpcon.c +0 -1
@@ -13,7 +13,6 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/event/octeontx/ssovf_evdev_selftest.c +0 -1
@@ -14,7 +14,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_lcore.h> #include <rte_per_lcore.h>
drivers/event/octeontx/timvf_evdev.c +2 -2
@@ -42,8 +42,8 @@ timvf_ring_info_get(const struct rte_event_timer_adapter *adptr,struct timvf_ring *timr = adptr->data->adapter_priv; adptr_info->max_tmo_ns = timr->max_tout; adptr_info->min_resolution_ns = timr->tck_nsec; -rte_memcpy (&adptr_info->conf, &adptr->data->conf, -sizeof (struct rte_event_timer_adapter_conf )); +memcpy (&adptr_info->conf, &adptr->data->conf, +sizeof (struct rte_event_timer_adapter_conf )); } static int
Signature · 1 line
2.43.0
PATCH v5 20/32 mempool: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/mempool/dpaa/dpaa_mempool.c | 4 ++-- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/mempool/dpaa/dpaa_mempool.c +2 -2
@@ -115,8 +115,8 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp)return -ENOMEM ; } -rte_memcpy (bp_info, (void *)&rte_dpaa_bpid_info[bpid], -sizeof (struct dpaa_bp_info )); +memcpy (bp_info, (void *)&rte_dpaa_bpid_info[bpid], +sizeof (struct dpaa_bp_info )); mp->pool_data = (void *)bp_info;DPAA_MEMPOOL_INFO ("BMAN pool created for bpid =%d" , bpid);
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -3
@@ -16,7 +16,6 @@#include <rte_mbuf.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h>
@@ -125,8 +124,8 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp) rte_dpaa2_bpid_info[bpid].bp_list = bp_list; rte_dpaa2_bpid_info[bpid].bpid = bpid; -rte_memcpy (bp_info, (void *)&rte_dpaa2_bpid_info[bpid], -sizeof (struct dpaa2_bp_info )); +memcpy (bp_info, (void *)&rte_dpaa2_bpid_info[bpid], +sizeof (struct dpaa2_bp_info )); mp->pool_data = (void *)bp_info;DPAA2_MEMPOOL_DEBUG ("BP List created for bpid =%d" , dpbp_attr.bpid);
Signature · 1 line
2.43.0
PATCH v5 21/32 ml/cnxk: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/ml/cnxk/cn10k_ml_model.c | 8 +++++--- drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++---- drivers/ml/cnxk/cnxk_ml_ops.c | 2 +- drivers/ml/cnxk/mvtvm_ml_model.c | 8 +++++--- drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +++++--- 5 files changed, 23 insertions(+), 14 deletions(-)
drivers/ml/cnxk/cn10k_ml_model.c +5 -3
@@ -560,7 +560,7 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set model info */ memset (info,0 ,sizeof (struct rte_ml_model_info )); -rte_memcpy (info->name, metadata->model.name,MRVL_ML_MODEL_NAME_LEN ); +memcpy (info->name, metadata->model.name,MRVL_ML_MODEL_NAME_LEN );snprintf (info->version,RTE_ML_STR_MAX ,"%u.%u.%u.%u" , metadata->model.version[0 ], metadata->model.version[1 ], metadata->model.version[2 ], metadata->model.version[3 ]);
@@ -579,7 +579,8 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set input info */ for (i =0 ; i < info->nb_inputs; i++) { -rte_memcpy (input[i].name, io_info->input[i].name,MRVL_ML_INPUT_NAME_LEN ); +memcpy (input[i].name, io_info->input[i].name, +MRVL_ML_INPUT_NAME_LEN ); input[i].nb_dims = io_info->input[i].nb_dims; input[i].shape = &io_info->input[i].shape[0 ]; input[i].type = io_info->input[i].qtype;
@@ -590,7 +591,8 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set output info */ for (i =0 ; i < info->nb_outputs; i++) { -rte_memcpy (output[i].name, io_info->output[i].name,MRVL_ML_INPUT_NAME_LEN ); +memcpy (output[i].name, io_info->output[i].name, +MRVL_ML_INPUT_NAME_LEN ); output[i].nb_dims = io_info->output[i].nb_dims; output[i].shape = &io_info->output[i].shape[0 ]; output[i].type = io_info->output[i].qtype;
drivers/ml/cnxk/cn10k_ml_ops.c +7 -4
@@ -668,11 +668,13 @@ cn10k_ml_layer_load(void *device, uint16_t model_id, const char *layer_name, uin }/* Copy metadata to internal buffer */ -rte_memcpy (&layer->glow.metadata, buffer,sizeof (struct cn10k_ml_model_metadata )); +memcpy (&layer->glow.metadata, buffer, +sizeof (struct cn10k_ml_model_metadata ));cn10k_ml_model_metadata_update (&layer->glow.metadata);/* Set layer name */ -rte_memcpy (layer->name, layer->glow.metadata.model.name,MRVL_ML_MODEL_NAME_LEN ); +memcpy (layer->name, layer->glow.metadata.model.name, +MRVL_ML_MODEL_NAME_LEN );/* Enable support for batch_size of 256 */ if (layer->glow.metadata.model.batch_size ==0 )
@@ -748,11 +750,12 @@ cn10k_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params * model->subtype =ML_CNXK_MODEL_SUBTYPE_GLOW_MRVL ;/* Copy metadata to internal buffer */ -rte_memcpy (&model->glow.metadata, params->addr,sizeof (struct cn10k_ml_model_metadata )); +memcpy (&model->glow.metadata, params->addr, +sizeof (struct cn10k_ml_model_metadata ));cn10k_ml_model_metadata_update (&model->glow.metadata);/* Set model name */ -rte_memcpy (model->name, (char *)model->glow.metadata.model.name,64 ); +memcpy (model->name, (char *)model->glow.metadata.model.name,64 );/* Enable support for batch_size of 256 */ if (model->glow.metadata.model.batch_size ==0 )
drivers/ml/cnxk/cnxk_ml_ops.c +1 -1
@@ -1400,7 +1400,7 @@ cnxk_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id, } info = (struct rte_ml_model_info *)model->info; -rte_memcpy (model_info, info,sizeof (struct rte_ml_model_info )); +memcpy (model_info, info,sizeof (struct rte_ml_model_info )); model_info->input_info = info->input_info; model_info->output_info = info->output_info;
drivers/ml/cnxk/mvtvm_ml_model.c +5 -3
@@ -310,7 +310,7 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo goto tvm_mrvl_model; metadata = &model->mvtvm.metadata; -rte_memcpy (info->name, metadata->model.name,TVMDP_NAME_STRLEN ); +memcpy (info->name, metadata->model.name,TVMDP_NAME_STRLEN );snprintf (info->version,RTE_ML_STR_MAX ,"%u.%u.%u.%u" , metadata->model.version[0 ], metadata->model.version[1 ], metadata->model.version[2 ], metadata->model.version[3 ]);
@@ -327,7 +327,8 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set input info */ for (i =0 ; i < info->nb_inputs; i++) { -rte_memcpy (input[i].name, metadata->input[i].name,MRVL_ML_INPUT_NAME_LEN ); +memcpy (input[i].name, metadata->input[i].name, +MRVL_ML_INPUT_NAME_LEN ); input[i].nb_dims = metadata->input[i].ndim; input[i].shape = &model->mvtvm.info.input[i].shape[0 ]; input[i].type = model->mvtvm.info.input[i].qtype;
@@ -338,7 +339,8 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo/* Set output info */ for (i =0 ; i < info->nb_outputs; i++) { -rte_memcpy (output[i].name, metadata->output[i].name,MRVL_ML_OUTPUT_NAME_LEN ); +memcpy (output[i].name, metadata->output[i].name, +MRVL_ML_OUTPUT_NAME_LEN ); output[i].nb_dims = metadata->output[i].ndim; output[i].shape = &model->mvtvm.info.output[i].shape[0 ]; output[i].type = model->mvtvm.info.output[i].qtype;
drivers/ml/cnxk/mvtvm_ml_ops.c +5 -3
@@ -194,7 +194,7 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params */* Copy mod.so */ model->mvtvm.object.so.addr = mz->addr; model->mvtvm.object.so.size = object[0 ].size; -rte_memcpy (model->mvtvm.object.so.name, object[0 ].name,TVMDP_NAME_STRLEN ); +memcpy (model->mvtvm.object.so.name, object[0 ].name,TVMDP_NAME_STRLEN );rte_memcpy (model->mvtvm.object.so.addr, object[0 ].buffer, object[0 ].size);rte_free (object[0 ].buffer);
@@ -203,7 +203,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *RTE_PTR_ADD (model->mvtvm.object.so.addr,RTE_ALIGN_CEIL (model->mvtvm.object.so.size,RTE_CACHE_LINE_MIN_SIZE )); model->mvtvm.object.json.size = object[1 ].size; -rte_memcpy (model->mvtvm.object.json.name, object[1 ].name,TVMDP_NAME_STRLEN ); +memcpy (model->mvtvm.object.json.name, object[1 ].name, +TVMDP_NAME_STRLEN );rte_memcpy (model->mvtvm.object.json.addr, object[1 ].buffer, object[1 ].size);rte_free (object[1 ].buffer);
@@ -212,7 +213,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *RTE_PTR_ADD (model->mvtvm.object.json.addr,RTE_ALIGN_CEIL (model->mvtvm.object.json.size,RTE_CACHE_LINE_MIN_SIZE )); model->mvtvm.object.params.size = object[2 ].size; -rte_memcpy (model->mvtvm.object.params.name, object[2 ].name,TVMDP_NAME_STRLEN ); +memcpy (model->mvtvm.object.params.name, object[2 ].name, +TVMDP_NAME_STRLEN );rte_memcpy (model->mvtvm.object.params.addr, object[2 ].buffer, object[2 ].size);rte_free (object[2 ].buffer);
Signature · 1 line
2.43.0
PATCH v5 22/32 app/test-pmd: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/test-pmd/cmdline.c | 48 ++++++++++++++++++------------------- app/test-pmd/cmdline_flow.c | 24 +++++++++---------- app/test-pmd/config.c | 8 +++---- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - 11 files changed, 40 insertions(+), 48 deletions(-)
app/test-pmd/cmdline.c +24 -24
@@ -9534,7 +9534,7 @@ static void cmd_set_vxlan_parsed(void *parsed_result, vxlan_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (vxlan_encap_conf.vni, &id.vni[1 ],3 ); +memcpy (vxlan_encap_conf.vni, &id.vni[1 ],3 ); vxlan_encap_conf.udp_src =rte_cpu_to_be_16 (res->udp_src); vxlan_encap_conf.udp_dst =rte_cpu_to_be_16 (res->udp_dst); vxlan_encap_conf.ip_tos = res->tos;
@@ -9548,10 +9548,10 @@ static void cmd_set_vxlan_parsed(void *parsed_result, }if (vxlan_encap_conf.select_vlan) vxlan_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_vxlan = {
@@ -9729,7 +9729,7 @@ static void cmd_set_nvgre_parsed(void *parsed_result, nvgre_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (nvgre_encap_conf.tni, &id.tni[1 ],3 ); +memcpy (nvgre_encap_conf.tni, &id.tni[1 ],3 );if (nvgre_encap_conf.select_ipv4) {IPV4_ADDR_TO_UINT (res->ip_src, nvgre_encap_conf.ipv4_src);IPV4_ADDR_TO_UINT (res->ip_dst, nvgre_encap_conf.ipv4_dst);
@@ -9739,10 +9739,10 @@ static void cmd_set_nvgre_parsed(void *parsed_result, }if (nvgre_encap_conf.select_vlan) nvgre_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_nvgre = {
@@ -9856,10 +9856,10 @@ static void cmd_set_l2_encap_parsed(void *parsed_result,return ;if (l2_encap_conf.select_vlan) l2_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (l2_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (l2_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (l2_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (l2_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_l2_encap = {
@@ -10038,7 +10038,7 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result, mplsogre_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (mplsogre_encap_conf.label, &id.label,3 ); +memcpy (mplsogre_encap_conf.label, &id.label,3 );if (mplsogre_encap_conf.select_ipv4) {IPV4_ADDR_TO_UINT (res->ip_src, mplsogre_encap_conf.ipv4_src);IPV4_ADDR_TO_UINT (res->ip_dst, mplsogre_encap_conf.ipv4_dst);
@@ -10048,10 +10048,10 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result, }if (mplsogre_encap_conf.select_vlan) mplsogre_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_mplsogre_encap = {
@@ -10274,7 +10274,7 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result, mplsoudp_encap_conf.select_ipv4 =0 ; else return; -rte_memcpy (mplsoudp_encap_conf.label, &id.label,3 ); +memcpy (mplsoudp_encap_conf.label, &id.label,3 ); mplsoudp_encap_conf.udp_src =rte_cpu_to_be_16 (res->udp_src); mplsoudp_encap_conf.udp_dst =rte_cpu_to_be_16 (res->udp_dst);if (mplsoudp_encap_conf.select_ipv4) {
@@ -10286,10 +10286,10 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result, }if (mplsoudp_encap_conf.select_vlan) mplsoudp_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci); -rte_memcpy (mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes, -RTE_ETHER_ADDR_LEN ); +memcpy (mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes, +RTE_ETHER_ADDR_LEN ); +memcpy (mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes, +RTE_ETHER_ADDR_LEN ); }static cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
app/test-pmd/cmdline_flow.c +12 -12
@@ -13768,7 +13768,7 @@ cmd_set_raw_parsed_sample(const struct buffer *in)fprintf (stderr,"Error - Not supported action\n" );return ; } -rte_memcpy (data, action,sizeof (struct rte_flow_action )); +memcpy (data, action,sizeof (struct rte_flow_action )); data++; } }
@@ -13929,8 +13929,8 @@ cmd_set_raw_parsed(const struct buffer *in)/* We have to add GTP header extra word. */ *total_size +=sizeof (ext_word); -rte_memcpy (data_tail - (*total_size), - &ext_word,sizeof (ext_word)); +memcpy (data_tail - (*total_size), &ext_word, +sizeof (ext_word)); } size =sizeof (struct rte_gtp_hdr );break ;
@@ -13975,21 +13975,21 @@ cmd_set_raw_parsed(const struct buffer *in)if (opt->checksum_rsvd.checksum) { *total_size +=sizeof (opt->checksum_rsvd); -rte_memcpy (data_tail - (*total_size), - &opt->checksum_rsvd, -sizeof (opt->checksum_rsvd)); +memcpy (data_tail - (*total_size), + &opt->checksum_rsvd, +sizeof (opt->checksum_rsvd)); }if (opt->key.key) { *total_size +=sizeof (opt->key.key); -rte_memcpy (data_tail - (*total_size), - &opt->key.key, -sizeof (opt->key.key)); +memcpy (data_tail - (*total_size), + &opt->key.key, +sizeof (opt->key.key)); }if (opt->sequence.sequence) { *total_size +=sizeof (opt->sequence.sequence); -rte_memcpy (data_tail - (*total_size), - &opt->sequence.sequence, -sizeof (opt->sequence.sequence)); +memcpy (data_tail - (*total_size), + &opt->sequence.sequence, +sizeof (opt->sequence.sequence)); } } proto =0x2F ;
app/test-pmd/config.c +4 -4
@@ -2639,8 +2639,8 @@ port_flow_template_table_create(portid_t port_id, uint32_t id, } pt->nb_pattern_templates = nb_pattern_templates; pt->nb_actions_templates = nb_actions_templates; -rte_memcpy (&pt->flow_attr, &table_attr->flow_attr, -sizeof (struct rte_flow_attr )); +memcpy (&pt->flow_attr, &table_attr->flow_attr, +sizeof (struct rte_flow_attr ));printf ("Template table #%u created\n" , pt->id);return 0 ; }
@@ -3259,8 +3259,8 @@ port_queue_action_handle_update(portid_t port_id, update = action->conf;break ;case RTE_FLOW_ACTION_TYPE_METER_MARK : -rte_memcpy (&mtr_update.meter_mark, action->conf, -sizeof (struct rte_flow_action_meter_mark )); +memcpy (&mtr_update.meter_mark, action->conf, +sizeof (struct rte_flow_action_meter_mark ));if (mtr_update.meter_mark.profile) mtr_update.profile_valid =1 ;if (mtr_update.meter_mark.policy)
app/test-pmd/csumonly.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/flowgen.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/iofwd.c +0 -1
@@ -24,7 +24,6 @@#include <rte_per_lcore.h> #include <rte_lcore.h> #include <rte_branch_prediction.h> -#include <rte_memcpy.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_interrupts.h>
app/test-pmd/macfwd.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/macswap.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/noisy_vnf.c +0 -1
@@ -24,7 +24,6 @@#include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_lcore.h> -#include <rte_memcpy.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_ethdev.h>
app/test-pmd/rxonly.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test-pmd/testpmd.c +0 -1
@@ -30,7 +30,6 @@#include <rte_debug.h> #include <rte_cycles.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_bus.h> #include <rte_eal.h>
Signature · 1 line
2.43.0
PATCH v5 23/32 app/graph: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/graph/neigh.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
app/graph/neigh.c +4 -4
@@ -91,14 +91,14 @@ ip6_rewrite_node_add(struct neigh_ipv6_config *v6_config)memset (data,0 , len);/* Copy dst mac */ -rte_memcpy ((void *)&data[0 ], (void *)&v6_config->mac,RTE_ETHER_ADDR_LEN ); +memcpy ((void *)&data[0 ], (void *)&v6_config->mac,RTE_ETHER_ADDR_LEN );/* Copy src mac */ rc =rte_eth_macaddr_get (portid, &smac);if (rc <0 )return rc; -rte_memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN );return rte_node_ip6_rewrite_add (portid, data, len, portid); }
@@ -121,7 +121,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)memset (data,0 , len);/* Copy dst mac */ -rte_memcpy ((void *)&data[0 ], (void *)&v4_config->mac,RTE_ETHER_ADDR_LEN ); +memcpy ((void *)&data[0 ], (void *)&v4_config->mac,RTE_ETHER_ADDR_LEN );/* Copy src mac */ rc =rte_eth_macaddr_get (portid, &smac);
@@ -130,7 +130,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)return rc; } -rte_memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (&data[RTE_ETHER_ADDR_LEN ], smac.addr_bytes,RTE_ETHER_ADDR_LEN );return rte_node_ip4_rewrite_add (portid, data, len, portid); }
Signature · 1 line
2.43.0
PATCH v5 24/32 app/test-eventdev: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/test-eventdev/test_pipeline_common.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
app/test-eventdev/test_pipeline_common.c +7 -12
@@ -177,22 +177,17 @@ pipeline_tx_first(struct test_pipeline *t, struct evt_options *opt) mbuf->pkt_len = pkt_sz;/* Copy Ethernet header */ - rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0), - ð_hdr, sizeof(struct rte_ether_hdr)); + memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0), + ð_hdr, sizeof(struct rte_ether_hdr));/* Copy Ipv4 header */ - rte_memcpy(rte_pktmbuf_mtod_offset( - mbuf, char *, - sizeof(struct rte_ether_hdr)), - &ip_hdr, sizeof(struct rte_ipv4_hdr)); + memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ether_hdr)), + &ip_hdr, sizeof(struct rte_ipv4_hdr));/* Copy UDP header */ -rte_memcpy ( -rte_pktmbuf_mtod_offset ( -mbuf ,char *, - sizeof(struct rte_ipv4_hdr) + - sizeof(struct rte_ether_hdr)), - &udp_hdr, sizeof(struct rte_udp_hdr)); + memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ipv4_hdr) + + sizeof(struct rte_ether_hdr)), + &udp_hdr, sizeof(struct rte_udp_hdr)); pkt_udp_hdr = rte_pktmbuf_mtod_offset( mbuf, struct rte_udp_hdr *, sizeof(struct rte_ipv4_hdr) +
Signature · 1 line
2.43.0
PATCH v5 25/32 app/test: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- app/test/commands.c | 1 - app/test/packet_burst_generator.c | 4 +-- app/test/test_crc.c | 5 ++-- app/test/test_cryptodev.c | 18 ++++++------- app/test/test_cryptodev_asym.c | 1 - app/test/test_cryptodev_security_pdcp.c | 1 - app/test/test_efd.c | 1 - app/test/test_efd_perf.c | 1 - app/test/test_event_crypto_adapter.c | 12 ++++----- app/test/test_event_dma_adapter.c | 4 +-- app/test/test_eventdev.c | 1 - app/test/test_ipsec.c | 6 ++--- app/test/test_link_bonding_mode4.c | 8 +++--- app/test/test_mbuf.c | 1 - app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - app/test/test_rawdev.c | 1 - app/test/test_security_inline_proto.c | 36 ++++++++++++------------- app/test/test_service_cores.c | 1 - app/test/virtual_pmd.c | 3 +-- 20 files changed, 46 insertions(+), 61 deletions(-)
app/test/commands.c +0 -1
@@ -16,7 +16,6 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_memzone.h> #include <rte_launch.h> #include <rte_cycles.h>
app/test/packet_burst_generator.c +2 -2
@@ -148,8 +148,8 @@ initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr, ip_hdr->proto =IPPROTO_UDP ; ip_hdr->hop_limits =IP_DEFTTL ; -rte_memcpy (ip_hdr->src_addr, src_addr,sizeof (ip_hdr->src_addr)); -rte_memcpy (ip_hdr->dst_addr, dst_addr,sizeof (ip_hdr->dst_addr)); +memcpy (ip_hdr->src_addr, src_addr,sizeof (ip_hdr->src_addr)); +memcpy (ip_hdr->dst_addr, dst_addr,sizeof (ip_hdr->dst_addr));return (uint16_t ) (pkt_data_len +sizeof (struct rte_ipv6_hdr )); }
app/test/test_crc.c +2 -3
@@ -6,7 +6,6 @@#include <rte_hexdump.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_net_crc.h> #define CRC_VEC_LEN 32
@@ -83,7 +82,7 @@ test_crc_calc(void)return -7 ;for (i =0 ; i <CRC32_VEC_LEN1 ; i +=12 ) -rte_memcpy (&test_data[i], crc32_vec1,12 ); +memcpy (&test_data[i], crc32_vec1,12 ); result =crc_calc (test_data,CRC32_VEC_LEN1 , type);if (result != crc32_vec1_res) {
@@ -93,7 +92,7 @@ test_crc_calc(void)/* 32-bit ethernet CRC: Test 3 */ for (i =0 ; i <CRC32_VEC_LEN2 ; i +=12 ) -rte_memcpy (&test_data[i], crc32_vec1,12 ); +memcpy (&test_data[i], crc32_vec1,12 ); result =crc_calc (test_data,CRC32_VEC_LEN2 , type);if (result != crc32_vec2_res) {
app/test/test_cryptodev.c +8 -10
@@ -2479,8 +2479,8 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) sym_op->auth.data.length =QUOTE_512_BYTES ;/* Copy IV at the end of the crypto operation */ - rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), - aes_cbc_iv,CIPHER_IV_LENGTH_AES_CBC ); + memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), + aes_cbc_iv,CIPHER_IV_LENGTH_AES_CBC );/* Set crypto operation cipher parameters */ sym_op->cipher.data.offset =0 ;
@@ -2614,9 +2614,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess, DIGEST_BYTE_LENGTH_SHA512);TEST_ASSERT_NOT_NULL (ut_params->digest,"no room to append digest" ); -rte_memcpy (ut_params->digest, - digest, -DIGEST_BYTE_LENGTH_SHA512 ); +memcpy (ut_params->digest, digest,DIGEST_BYTE_LENGTH_SHA512 );/* Generate Crypto op data structure */ ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
@@ -2639,8 +2637,8 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess, sym_op->auth.data.length =QUOTE_512_BYTES ;/* Copy IV at the end of the crypto operation */ - rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), - iv,CIPHER_IV_LENGTH_AES_CBC ); + memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), + iv,CIPHER_IV_LENGTH_AES_CBC ); sym_op->cipher.data.offset =0 ; sym_op->cipher.data.length =QUOTE_512_BYTES ;
@@ -8997,7 +8995,7 @@ create_aead_operation(enum rte_crypto_aead_operation op, uint8_t *, IV_OFFSET);if (tdata->iv.len ==0 ) { -rte_memcpy (iv_ptr, tdata->iv.data,AES_GCM_J0_LENGTH ); +memcpy (iv_ptr, tdata->iv.data,AES_GCM_J0_LENGTH );debug_hexdump (stdout,"iv:" , iv_ptr,AES_GCM_J0_LENGTH ); }else {
@@ -14337,8 +14335,8 @@ test_multi_session_random_usage(void)for (i =0 ; i <MB_SESSION_NUMBER ; i++) { -rte_memcpy (&ut_paramz[i].ut_params, &unittest_params, -sizeof (struct crypto_unittest_params )); +memcpy (&ut_paramz[i].ut_params, &unittest_params, +sizeof (struct crypto_unittest_params )); test_AES_CBC_HMAC_SHA512_decrypt_create_session_params( &ut_paramz[i].ut_params,
app/test/test_cryptodev_asym.c +0 -1
@@ -8,7 +8,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_pause.h> #include <rte_cryptodev.h>
app/test/test_cryptodev_security_pdcp.c +0 -1
@@ -10,7 +10,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_pause.h> #include <rte_bus_vdev.h> #include <rte_byteorder.h>
app/test/test_efd.c +0 -1
@@ -13,7 +13,6 @@ test_efd(void)#else -#include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_efd.h> #include <rte_byteorder.h>
app/test/test_efd_perf.c +0 -1
@@ -22,7 +22,6 @@ test_efd_perf(void)#include <rte_malloc.h> #include <rte_random.h> #include <rte_efd.h> -#include <rte_memcpy.h> #include <rte_thash.h> #define NUM_KEYSIZES 10
app/test/test_event_crypto_adapter.c +6 -6
@@ -454,7 +454,7 @@ test_op_forward_mode(uint8_t session_less) m_data.request_info.cdev_id = request_info.cdev_id; m_data.request_info.queue_pair_id = request_info.queue_pair_id; m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); } sym_op->m_src = m;
@@ -653,8 +653,8 @@ test_asym_op_forward_mode(uint8_t session_less) m_data.request_info.cdev_id = request_info.cdev_id; m_data.request_info.queue_pair_id = request_info.queue_pair_id; m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + op->private_data_offset, - &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + op->private_data_offset, &m_data, +sizeof (m_data)); }/* Fill in event info and update event_ptr with rte_crypto_op */ memset (&ev,0 ,sizeof (ev));
@@ -820,7 +820,7 @@ test_op_new_mode(uint8_t session_less) op->private_data_offset = len;/* Fill in private data information */ m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + len, &m_data,sizeof (m_data)); } sym_op->m_src = m;
@@ -977,8 +977,8 @@ test_asym_op_new_mode(uint8_t session_less) sizeof(struct rte_crypto_asym_xform));/* Fill in private data information */ m_data.response_info.event = response_info.event; -rte_memcpy ((uint8_t *)op + op->private_data_offset, - &m_data,sizeof (m_data)); +memcpy ((uint8_t *)op + op->private_data_offset, &m_data, +sizeof (m_data)); } ret =send_op_recv_ev (op);
app/test/test_event_dma_adapter.c +2 -2
@@ -269,8 +269,8 @@ test_op_forward_mode(void) op->vchan =TEST_DMA_VCHAN_ID ; response_info.event = dma_response_info.event; -rte_memcpy ((uint8_t *)op +sizeof (struct rte_event_dma_adapter_op ), &response_info, -sizeof (struct rte_event )); +memcpy ((uint8_t *)op +sizeof (struct rte_event_dma_adapter_op ), + &response_info,sizeof (struct rte_event ));/* Fill in event info and update event_ptr with rte_event_dma_adapter_op */ memset (&ev[i],0 ,sizeof (struct rte_event ));
app/test/test_eventdev.c +0 -1
@@ -8,7 +8,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #ifdef RTE_EXEC_ENV_WINDOWS static int
app/test/test_ipsec.c +3 -3
@@ -601,10 +601,10 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,/* copy outer IP and ESP header */ ipv4_outer.total_length =rte_cpu_to_be_16 (t_len); ipv4_outer.packet_id =rte_cpu_to_be_16 (seq); -rte_memcpy (dst, &ipv4_outer,sizeof (ipv4_outer)); +memcpy (dst, &ipv4_outer,sizeof (ipv4_outer)); dst +=sizeof (ipv4_outer); m->l3_len =sizeof (ipv4_outer); -rte_memcpy (dst, &esph,sizeof (esph)); +memcpy (dst, &esph,sizeof (esph)); dst +=sizeof (esph);if (string !=NULL ) {
@@ -616,7 +616,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string, sizeof(esp_pad_bytes))); dst += padlen;/* copy ESP tail header */ -rte_memcpy (dst, &espt,sizeof (espt)); +memcpy (dst, &espt,sizeof (espt)); }else memset (dst,0 , t_len);
app/test/test_link_bonding_mode4.c +4 -4
@@ -1399,8 +1399,8 @@ test_mode4_ext_ctrl(void)for (i =0 ; i <MEMBER_COUNT ; i++) { lacp_tx_buf[i] =rte_pktmbuf_alloc (test_params.mbuf_pool); - rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), - &lacpdu, sizeof(lacpdu)); + memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu, + sizeof(lacpdu));rte_pktmbuf_pkt_len (lacp_tx_buf[i]) =sizeof (lacpdu); }
@@ -1453,8 +1453,8 @@ test_mode4_ext_lacp(void)for (i =0 ; i <MEMBER_COUNT ; i++) { lacp_tx_buf[i] =rte_pktmbuf_alloc (test_params.mbuf_pool); - rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), - &lacpdu, sizeof(lacpdu)); + memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu, + sizeof(lacpdu));rte_pktmbuf_pkt_len (lacp_tx_buf[i]) =sizeof (lacpdu); }
app/test/test_mbuf.c +0 -1
@@ -19,7 +19,6 @@#include <rte_debug.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_launch.h> #include <rte_eal.h> #include <rte_per_lcore.h>
app/test/test_member.c +0 -1
@@ -7,7 +7,6 @@#include <math.h> #include "test.h" -#include <rte_memcpy.h> #include <rte_malloc.h> #ifdef RTE_EXEC_ENV_WINDOWS
app/test/test_member_perf.c +0 -1
@@ -11,7 +11,6 @@#include <rte_cycles.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_memcpy.h> #include <rte_thash.h> #include <math.h>
app/test/test_rawdev.c +0 -1
@@ -7,7 +7,6 @@#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_dev.h> #ifdef RTE_EXEC_ENV_WINDOWS
app/test/test_security_inline_proto.c +18 -18
@@ -245,8 +245,8 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,/* Copy cipher session parameters */ if (sa->aead) { -rte_memcpy (sess_conf->crypto_xform, &sa->xform.aead, -sizeof (struct rte_crypto_sym_xform )); +memcpy (sess_conf->crypto_xform, &sa->xform.aead, +sizeof (struct rte_crypto_sym_xform )); sess_conf->crypto_xform->aead.key.data = sa->key.data;/* Verify crypto capabilities */ if (test_sec_crypto_caps_aead_verify (sec_cap, sess_conf->crypto_xform) !=0 ) {
@@ -256,13 +256,13 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid, } }else {if (dir ==RTE_SECURITY_IPSEC_SA_DIR_EGRESS ) { -rte_memcpy (&sess_conf->crypto_xform->cipher, - &sa->xform.chain.cipher.cipher, -sizeof (struct rte_crypto_cipher_xform )); +memcpy (&sess_conf->crypto_xform->cipher, + &sa->xform.chain.cipher.cipher, +sizeof (struct rte_crypto_cipher_xform )); -rte_memcpy (&sess_conf->crypto_xform->next->auth, - &sa->xform.chain.auth.auth, -sizeof (struct rte_crypto_auth_xform )); +memcpy (&sess_conf->crypto_xform->next->auth, + &sa->xform.chain.auth.auth, +sizeof (struct rte_crypto_auth_xform )); sess_conf->crypto_xform->cipher.key.data = sa->key.data; sess_conf->crypto_xform->next->auth.key.data =
@@ -282,12 +282,12 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,return TEST_SKIPPED ; } }else { -rte_memcpy (&sess_conf->crypto_xform->next->cipher, - &sa->xform.chain.cipher.cipher, -sizeof (struct rte_crypto_cipher_xform )); -rte_memcpy (&sess_conf->crypto_xform->auth, - &sa->xform.chain.auth.auth, -sizeof (struct rte_crypto_auth_xform )); +memcpy (&sess_conf->crypto_xform->next->cipher, + &sa->xform.chain.cipher.cipher, +sizeof (struct rte_crypto_cipher_xform )); +memcpy (&sess_conf->crypto_xform->auth, + &sa->xform.chain.auth.auth, +sizeof (struct rte_crypto_auth_xform )); sess_conf->crypto_xform->auth.key.data = sa->auth_key.data; sess_conf->crypto_xform->next->cipher.key.data =
@@ -463,12 +463,12 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len, boolreturn NULL ;if (outer_ipv4) { -rte_memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), - &dummy_ipv4_eth_hdr,RTE_ETHER_HDR_LEN ); +memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), + &dummy_ipv4_eth_hdr,RTE_ETHER_HDR_LEN ); pkt->l3_len =sizeof (struct rte_ipv4_hdr ); }else { -rte_memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), - &dummy_ipv6_eth_hdr,RTE_ETHER_HDR_LEN ); +memcpy (rte_pktmbuf_append (pkt,RTE_ETHER_HDR_LEN ), + &dummy_ipv6_eth_hdr,RTE_ETHER_HDR_LEN ); pkt->l3_len =sizeof (struct rte_ipv6_hdr ); } pkt->l2_len =RTE_ETHER_HDR_LEN ;
app/test/test_service_cores.c +0 -1
@@ -6,7 +6,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_cycles.h> #include <rte_service.h>
app/test/virtual_pmd.c +1 -2
@@ -8,7 +8,6 @@#include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_memory.h> #include <rte_ring.h>
@@ -186,7 +185,7 @@ virtual_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)struct virtual_ethdev_private *dev_private = dev->data->dev_private;if (stats) -rte_memcpy (stats, &dev_private->eth_stats,sizeof (*stats)); +memcpy (stats, &dev_private->eth_stats,sizeof (*stats));return 0 ; }
Signature · 1 line
2.43.0
PATCH v5 26/32 app/test-pipeline: remove unused rte_memcpy.h include
In reply to Stephen HemmingerThis included but never used here.
--- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - 4 files changed, 4 deletions(-)
app/test-pipeline/config.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
app/test-pipeline/init.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
app/test-pipeline/main.c +0 -1
@@ -19,7 +19,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
app/test-pipeline/runtime.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_per_lcore.h> #include <rte_launch.h>
Signature · 1 line
2.43.0
PATCH v5 27/32 app/test-bbdev: remove unnecessary include of rte_memcpy.h
In reply to Stephen HemmingerIncludes rte_memcpy.h but no rte_memcpy used.
--- app/test-bbdev/test_bbdev.c | 1 - 1 file changed, 1 deletion(-)
app/test-bbdev/test_bbdev.c +0 -1
@@ -6,7 +6,6 @@#include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_memcpy.h> #include <rte_cycles.h> #include <rte_bus_vdev.h>
Signature · 1 line
2.43.0
PATCH v5 28/32 examples: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci Use structure assignment where possible.
--- examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 1 - examples/ip_fragmentation/main.c | 1 - examples/ip_reassembly/main.c | 1 - examples/ipv4_multicast/main.c | 1 - examples/l2fwd-cat/cat.c | 4 +--- examples/l2fwd-jobstats/main.c | 1 - examples/l2fwd-keepalive/main.c | 1 - examples/l2fwd-macsec/main.c | 1 - examples/l2fwd/main.c | 1 - examples/l3fwd-power/main.c | 1 - examples/l3fwd/main.c | 1 - examples/link_status_interrupt/main.c | 1 - .../client_server_mp/mp_server/init.c | 1 - .../client_server_mp/mp_server/main.c | 1 - examples/multi_process/symmetric_mp/main.c | 1 - examples/ptpclient/ptpclient.c | 11 +++++------ examples/qos_sched/app_thread.c | 1 - examples/qos_sched/main.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/vhost/main.c | 6 +++--- examples/vmdq/main.c | 7 +++---- examples/vmdq_dcb/main.c | 15 +++++---------- 24 files changed, 18 insertions(+), 45 deletions(-)
examples/bbdev_app/main.c +1 -1
@@ -360,7 +360,7 @@ add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst) eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *);/* copy header */ -rte_memcpy (eth_to, eth_from,sizeof (struct rte_ether_hdr )); +memcpy (eth_to, eth_from,sizeof (struct rte_ether_hdr )); } static inline void
examples/bond/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_common.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/ip_fragmentation/main.c +0 -1
@@ -18,7 +18,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/ip_reassembly/main.c +0 -1
@@ -19,7 +19,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/ipv4_multicast/main.c +0 -1
@@ -17,7 +17,6 @@#include <rte_byteorder.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd-cat/cat.c +1 -3
@@ -12,7 +12,6 @@#include <stdio.h> #include <rte_common.h> -#include <rte_memcpy.h> #include <pqos.h>
@@ -314,8 +313,7 @@ parse_l3ca(const char *l3ca)if (cmask !=0 &&is_contiguous (cmask) ==0 ) goto err; -rte_memcpy (&m_config[idx].cpumask, - &cpuset,sizeof (rte_cpuset_t)); +memcpy (&m_config[idx].cpumask, &cpuset,sizeof (rte_cpuset_t));if (cmask !=0 ) { m_config[idx].cdp =1 ;
examples/l2fwd-jobstats/main.c +0 -1
@@ -13,7 +13,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd-keepalive/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd-macsec/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l2fwd/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l3fwd-power/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/l3fwd/main.c +0 -1
@@ -21,7 +21,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/link_status_interrupt/main.c +0 -1
@@ -19,7 +19,6 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
examples/multi_process/client_server_mp/mp_server/init.c +0 -1
@@ -24,7 +24,6 @@#include <rte_ring.h> #include <rte_log.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_interrupts.h> #include <rte_ether.h>
examples/multi_process/client_server_mp/mp_server/main.c +0 -1
@@ -24,7 +24,6 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_ether.h> #include <rte_interrupts.h>
examples/multi_process/symmetric_mp/main.c +0 -1
@@ -37,7 +37,6 @@#include <rte_ether.h> #include <rte_ethdev.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_string_fns.h> #include <rte_cycles.h>
examples/ptpclient/ptpclient.c +5 -6
@@ -362,9 +362,9 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx) ptp_data->seqID_SYNC =rte_be_to_cpu_16 (ptp_hdr->seq_id);if (ptp_data->ptpset ==0 ) { -rte_memcpy (&ptp_data->master_clock_id, - &ptp_hdr->source_port_id.clock_id, -sizeof (struct clock_id )); +memcpy (&ptp_data->master_clock_id, + &ptp_hdr->source_port_id.clock_id, +sizeof (struct clock_id )); ptp_data->ptpset =1 ; }
@@ -469,9 +469,8 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data) client_clkid->id[6 ] = eth_hdr->src_addr.addr_bytes[4 ]; client_clkid->id[7 ] = eth_hdr->src_addr.addr_bytes[5 ]; -rte_memcpy (&ptp_data->client_clock_id, - client_clkid, -sizeof (struct clock_id )); +memcpy (&ptp_data->client_clock_id, client_clkid, +sizeof (struct clock_id ));/* Enable flag for hardware timestamping. */ created_pkt->ol_flags |=RTE_MBUF_F_TX_IEEE1588_TMST ;
examples/qos_sched/app_thread.c +0 -1
@@ -9,7 +9,6 @@#include <rte_malloc.h> #include <rte_cycles.h> #include <rte_ethdev.h> -#include <rte_memcpy.h> #include <rte_byteorder.h> #include <rte_branch_prediction.h> #include <rte_sched.h>
examples/qos_sched/main.c +0 -1
@@ -10,7 +10,6 @@#include <rte_malloc.h> #include <rte_cycles.h> #include <rte_ethdev.h> -#include <rte_memcpy.h> #include <rte_byteorder.h> #include <rte_branch_prediction.h>
examples/server_node_efd/efd_server/init.c +0 -1
@@ -24,7 +24,6 @@#include <rte_ring.h> #include <rte_log.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_interrupts.h> #include <rte_ether.h>
examples/server_node_efd/efd_server/main.c +0 -1
@@ -26,7 +26,6 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_mempool.h> -#include <rte_memcpy.h> #include <rte_mbuf.h> #include <rte_ether.h> #include <rte_interrupts.h>
examples/vhost/main.c +3 -3
@@ -405,9 +405,9 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices) conf.pool_map[i].pools = (1UL << i); } - (void )(rte_memcpy (eth_conf, &vmdq_conf_default,sizeof (*eth_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, -sizeof (eth_conf->rx_adv_conf.vmdq_rx_conf))); +memcpy (eth_conf, &vmdq_conf_default,sizeof (*eth_conf)); +memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, +sizeof (eth_conf->rx_adv_conf.vmdq_rx_conf));return 0 ; }
examples/vmdq/main.c +3 -4
@@ -17,7 +17,6 @@#include <rte_common.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
@@ -151,9 +150,9 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools) conf.pool_map[i].pools = (1UL << (i % num_pools)); } - (void )(rte_memcpy (eth_conf, &vmdq_conf_default,sizeof (*eth_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, -sizeof (eth_conf->rx_adv_conf.vmdq_rx_conf))); + *eth_conf = vmdq_conf_default; + eth_conf->rx_adv_conf.vmdq_rx_conf = conf; +if (rss_enable) { eth_conf->rxmode.mq_mode =RTE_ETH_MQ_RX_VMDQ_RSS ; eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
examples/vmdq_dcb/main.c +5 -10
@@ -17,7 +17,6 @@#include <rte_common.h> #include <rte_log.h> #include <rte_memory.h> -#include <rte_memcpy.h> #include <rte_eal.h> #include <rte_launch.h> #include <rte_cycles.h>
@@ -161,15 +160,11 @@ get_eth_conf(struct rte_eth_conf *eth_conf) tx_conf.dcb_tc[i] = i % num_tcs; } dcb_conf.nb_tcs = (enum rte_eth_nb_tcs )num_tcs; - (void )(rte_memcpy (eth_conf, &vmdq_dcb_conf_default,sizeof (*eth_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, -sizeof (conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf, -sizeof (dcb_conf))); - (void )(rte_memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf, -sizeof (vmdq_conf))); - (void )(rte_memcpy (ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf, -sizeof (tx_conf))); + (void )(memcpy (eth_conf, &vmdq_dcb_conf_default,sizeof (*eth_conf))); + (void )(memcpy (ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf,sizeof (conf))); + (void )(memcpy (ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf,sizeof (dcb_conf))); + (void )(memcpy (ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf,sizeof (vmdq_conf))); + (void )(memcpy (ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf,sizeof (tx_conf)));if (rss_enable) { eth_conf->rxmode.mq_mode =RTE_ETH_MQ_RX_VMDQ_DCB_RSS ; eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
Signature · 1 line
2.43.0
PATCH v5 29/32 net/null: replace use of fixed size memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/net/null/rte_eth_null.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/null/rte_eth_null.c +3 -3
@@ -465,7 +465,7 @@ eth_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf) rss_conf->rss_hf & internal->flow_type_rss_offloads;if (rss_conf->rss_key) -rte_memcpy (internal->rss_key, rss_conf->rss_key,40 ); +memcpy (internal->rss_key, rss_conf->rss_key,40 );rte_spinlock_unlock (&internal->rss_lock);
@@ -482,7 +482,7 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev, rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;if (rss_conf->rss_key) -rte_memcpy (rss_conf->rss_key, internal->rss_key,40 ); +memcpy (rss_conf->rss_key, internal->rss_key,40 );rte_spinlock_unlock (&internal->rss_lock);
@@ -577,7 +577,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, struct pmd_options *args) internals->flow_type_rss_offloads =RTE_ETH_RSS_PROTO_MASK ; internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_ETH_RETA_GROUP_SIZE ; -rte_memcpy (internals->rss_key, default_rss_key,40 ); +memcpy (internals->rss_key, default_rss_key,40 ); data = eth_dev->data; data->nb_rx_queues = (uint16_t )nb_rx_queues;
Signature · 1 line
2.43.0
PATCH v5 30/32 net/tap: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/net/tap/rte_eth_tap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/tap/rte_eth_tap.c +7 -7
@@ -1404,11 +1404,11 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) mac_addr)) mode =LOCAL_AND_REMOTE ; ifr.ifr_hwaddr.sa_family =AF_LOCAL ; -rte_memcpy (ifr.ifr_hwaddr.sa_data, mac_addr,RTE_ETHER_ADDR_LEN ); +memcpy (ifr.ifr_hwaddr.sa_data, mac_addr,RTE_ETHER_ADDR_LEN ); ret =tap_ioctl (pmd,SIOCSIFHWADDR , &ifr,1 , mode);if (ret <0 )return ret; -rte_memcpy (&pmd->eth_addr, mac_addr,RTE_ETHER_ADDR_LEN ); +memcpy (&pmd->eth_addr, mac_addr,RTE_ETHER_ADDR_LEN );if (pmd->remote_if_index && !pmd->flow_isolate) {/* Replace MAC redirection rule after a MAC change */ ret =tap_flow_implicit_destroy (pmd,TAP_REMOTE_LOCAL_MAC );
@@ -2010,7 +2010,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,if (rte_is_zero_ether_addr (mac_addr))rte_eth_random_addr ((uint8_t *)&pmd->eth_addr);else -rte_memcpy (&pmd->eth_addr, mac_addr,sizeof (*mac_addr)); +memcpy (&pmd->eth_addr, mac_addr,sizeof (*mac_addr)); }/*
@@ -2033,8 +2033,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,if (pmd->type ==ETH_TUNTAP_TYPE_TAP ) {memset (&ifr,0 ,sizeof (struct ifreq )); ifr.ifr_hwaddr.sa_family =AF_LOCAL ; -rte_memcpy (ifr.ifr_hwaddr.sa_data, &pmd->eth_addr, -RTE_ETHER_ADDR_LEN ); +memcpy (ifr.ifr_hwaddr.sa_data, &pmd->eth_addr, +RTE_ETHER_ADDR_LEN );if (tap_ioctl (pmd,SIOCSIFHWADDR , &ifr,0 ,LOCAL_ONLY ) <0 ) goto error_exit; }
@@ -2091,8 +2091,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name, pmd->name, pmd->remote_iface); goto error_remote; } -rte_memcpy (&pmd->eth_addr, ifr.ifr_hwaddr.sa_data, -RTE_ETHER_ADDR_LEN ); +memcpy (&pmd->eth_addr, ifr.ifr_hwaddr.sa_data, +RTE_ETHER_ADDR_LEN );/* The desired MAC is already in ifreq after SIOCGIFHWADDR. */ if (tap_ioctl (pmd,SIOCSIFHWADDR , &ifr,0 ,LOCAL_ONLY ) <0 ) { TAP_LOG(ERR, "%s: failed to get %s MAC address.",
Signature · 1 line
2.43.0
PATCH v5 31/32 net/pcap: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pcap/pcap_osdep_freebsd.c | 2 +- drivers/net/pcap/pcap_osdep_linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/pcap/pcap_ethdev.c +1 -1
@@ -1270,7 +1270,7 @@ eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,return -1 ;PMD_LOG (INFO ,"Setting phy MAC for %s" , if_name); -rte_memcpy (mac_addrs, mac.addr_bytes,RTE_ETHER_ADDR_LEN ); +memcpy (mac_addrs, mac.addr_bytes,RTE_ETHER_ADDR_LEN ); eth_dev->data->mac_addrs = mac_addrs;return 0 ; }
drivers/net/pcap/pcap_osdep_freebsd.c +1 -1
@@ -52,7 +52,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac) ifm = (struct if_msghdr *)buf; sdl = (struct sockaddr_dl *)(ifm +1 ); -rte_memcpy (mac->addr_bytes,LLADDR (sdl),RTE_ETHER_ADDR_LEN ); +memcpy (mac->addr_bytes,LLADDR (sdl),RTE_ETHER_ADDR_LEN );rte_free (buf);return 0 ;
drivers/net/pcap/pcap_osdep_linux.c +1 -1
@@ -35,7 +35,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)return -1 ; } -rte_memcpy (mac->addr_bytes, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN ); +memcpy (mac->addr_bytes, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN );close (if_fd);return 0 ;
Signature · 1 line
2.43.0
PATCH v5 32/32 net/af_xdp:: replace use of fixed size rte_memcpy
In reply to Stephen HemmingerAutomatically generated by devtools/cocci/rte_memcpy.cocci
--- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
@@ -2096,7 +2096,7 @@ get_iface_info(const char *if_name,if (ioctl (sock,SIOCGIFHWADDR , &ifr)) goto error; -rte_memcpy (eth_addr, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN ); +memcpy (eth_addr, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN );close (sock);return 0 ;
Signature · 1 line
2.43.0
Re: [PATCH v5 00/32] replace use of rte_memcpy() with fixed size
In reply to Stephen HemmingerQuoted 9 lines · Stephen Hemminger
The DPDK has a lot of unnecessary usage of
rte_memcpy. This patch set replaces cases whererte_memcpyis used with a fixed size constant size.Typical example is:
rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN); which can be replaced with: memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
Quoted 9 lines
This does not change the resulting binary on almost all architectures because x86 version of intrisics and glibc are the same, and other architectures were using
__builtin_constant_p().The main benefit is that analysis tools like fortify, Coverity, and ASAN analyzers can check these memcpy's. A recent example is that on Ubuntu 22.04 detected undefined use of memcpy such as:
memcpy(dst, NULL, 0)
Would it be possible to instead have a build mode where rte_memcpy() is *always* delegating to memcpy(), and run these tools on that configuration?
It seems easier to just always using rte_memcpy() in DPDK code, then let the platform (not the programmer) choose whatever is most appropriate.
Quoted 183 lines
The first patch is a simple coccinelle script to do the replacement and the rest are the results broken out by module. The script can be used again to make sure more bad usage doesn't creep in with new drivers.
v5 - rebase and fix a couple of the SW drivers.
rewording of commit messagesv4 - replace other unnecessary
rte_memcpyin ethdev.
replace memcpy with structure assignment where possible. fixup formatting in a couple places.v3 - rebase and rerun coccinelle script on 24.03
- consolidate patches by subtree
- remove inclusion ofrte_memcpy.hwhen no longer used.Stephen Hemminger (32):
cocci/rte_memcpy: add script to eliminate fixed sizerte_memcpy
eal: replace use of fixed sizerte_memcpy
ethdev: replace uses ofrte_memcpy
eventdev: replace use of fixed sizerte_memcpy
cryptodev: replace use of fixed sizerte_memcpy
ip_frag: replace use of fixed sizerte_memcpy
net: replace use of fixed sizerte_memcpy
lpm: replace use of fixed sizerte_memcpy
node: replace use of fixed sizerte_memcpy
pdcp: replace use of fixed sizerte_memcpy
pipeline: replace use of fixed sizerte_memcpy
rib: replace use of fixed sizerte_memcpy
security: replace use of fixed sizerte_memcpy
bus: remove unneededrte_memcpy.hincluderaw: replace use of fixed size rte_memcpy baseband: replace use of fixed size rte_memcpy common: replace use of fixed size rte_memcpy crypto: replace use of fixed size rte_memcpy event: replace use of fixed size rte_memcpy mempool: replace use of fixed size rte_memcpy ml/cnxk: replace use of fixed size rte_memcpy app/test-pmd: replace use of fixed size rte_memcpy app/graph: replace use of fixed size rte_memcpy app/test-eventdev: replace use of fixed size rte_memcpy app/test: replace use of fixed size rte_memcpy app/test-pipeline: remove unused rte_memcpy.h include app/test-bbdev: remove unnecessary include of rte_memcpy.h examples: replace use of fixed size rte_memcpy net/null: replace use of fixed size memcpy net/tap: replace use of fixed size rte_memcpy net/pcap: replace use of fixed size rte_memcpy net/af_xdp:: replace use of fixed size rte_memcpyapp/graph/neigh.c | 8 +- app/test-bbdev/test_bbdev.c | 1 - app/test-eventdev/test_pipeline_common.c | 19 ++-- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - app/test-pmd/cmdline.c | 48 ++++----- app/test-pmd/cmdline_flow.c | 24 ++--- app/test-pmd/config.c | 8 +- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - app/test/commands.c | 1 - app/test/packet_burst_generator.c | 4 +- app/test/test_crc.c | 5 +- app/test/test_cryptodev.c | 18 ++-- app/test/test_cryptodev_asym.c | 1 - app/test/test_cryptodev_security_pdcp.c | 1 - app/test/test_efd.c | 1 - app/test/test_efd_perf.c | 1 - app/test/test_event_crypto_adapter.c | 12 +-- app/test/test_event_dma_adapter.c | 4 +- app/test/test_eventdev.c | 1 - app/test/test_ipsec.c | 6 +- app/test/test_link_bonding_mode4.c | 8 +- app/test/test_mbuf.c | 1 - app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - app/test/test_rawdev.c | 1 - app/test/test_security_inline_proto.c | 36 +++---- app/test/test_service_cores.c | 1 - app/test/virtual_pmd.c | 3 +- devtools/cocci/rte_memcpy.cocci | 11 ++ drivers/baseband/acc/rte_acc100_pmd.c | 16 ++- drivers/baseband/acc/rte_vrb_pmd.c | 21 ++-- drivers/baseband/la12xx/bbdev_la12xx.c | 4 +- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/common/idpf/idpf_common_device.c | 4 +- drivers/common/idpf/idpf_common_virtchnl.c | 10 +- drivers/common/qat/qat_qp.c | 10 +- drivers/compress/qat/qat_comp.c | 8 +- drivers/crypto/ccp/ccp_crypto.c | 14 +-- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +- drivers/crypto/qat/qat_sym_session.c | 52 +++++---- .../scheduler/rte_cryptodev_scheduler.c | 6 +- drivers/crypto/scheduler/scheduler_failover.c | 12 +-- drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 - drivers/event/cnxk/cnxk_tim_evdev.c | 4 +- drivers/event/dlb2/dlb2.c | 4 +- drivers/event/dpaa/dpaa_eventdev.c | 1 - drivers/event/dpaa2/dpaa2_eventdev.c | 7 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 - drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 - drivers/event/octeontx/ssovf_evdev_selftest.c | 1 - drivers/event/octeontx/timvf_evdev.c | 4 +- drivers/mempool/dpaa/dpaa_mempool.c | 4 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 +- drivers/ml/cnxk/cn10k_ml_model.c | 8 +- drivers/ml/cnxk/cn10k_ml_ops.c | 11 +- drivers/ml/cnxk/cnxk_ml_ops.c | 2 +- drivers/ml/cnxk/mvtvm_ml_model.c | 8 +- drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/null/rte_eth_null.c | 6 +- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pcap/pcap_osdep_freebsd.c | 2 +- drivers/net/pcap/pcap_osdep_linux.c | 2 +- drivers/net/tap/rte_eth_tap.c | 14 +-- drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +- drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +- drivers/raw/ifpga/afu_pmd_n3000.c | 8 +- drivers/raw/ifpga/ifpga_rawdev.c | 11 +- drivers/raw/skeleton/skeleton_rawdev.c | 8 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 1 - examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 1 - examples/ip_fragmentation/main.c | 1 - examples/ip_reassembly/main.c | 1 - examples/ipv4_multicast/main.c | 1 - examples/l2fwd-cat/cat.c | 4 +- examples/l2fwd-jobstats/main.c | 1 - examples/l2fwd-keepalive/main.c | 1 - examples/l2fwd-macsec/main.c | 1 - examples/l2fwd/main.c | 1 - examples/l3fwd-power/main.c | 1 - examples/l3fwd/main.c | 1 - examples/link_status_interrupt/main.c | 1 - .../client_server_mp/mp_server/init.c | 1 - .../client_server_mp/mp_server/main.c | 1 - examples/multi_process/symmetric_mp/main.c | 1 - examples/ptpclient/ptpclient.c | 11 +- examples/qos_sched/app_thread.c | 1 - examples/qos_sched/main.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/vhost/main.c | 6 +- examples/vmdq/main.c | 7 +- examples/vmdq_dcb/main.c | 15 +-- lib/cryptodev/rte_cryptodev.c | 2 +- lib/eal/common/eal_common_options.c | 7 +- lib/ethdev/rte_ethdev.c | 12 +-- lib/ethdev/rte_flow.c | 101 +++++++++--------- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_dma_adapter.c | 4 +- lib/eventdev/rte_event_timer_adapter.c | 2 +- lib/fib/trie.c | 2 +- lib/ip_frag/rte_ipv6_fragmentation.c | 4 +- lib/ip_frag/rte_ipv6_reassembly.c | 6 +- lib/lpm/rte_lpm6.c | 3 +- lib/net/rte_ether.c | 2 +- lib/node/ip6_lookup.c | 8 +- lib/pdcp/pdcp_process.c | 36 +++---- lib/pipeline/rte_table_action.c | 8 +- lib/rib/rte_rib6.h | 5 +- lib/security/rte_security.c | 4 +- 131 files changed, 368 insertions(+), 450 deletions(-)create mode 100644
devtools/cocci/rte_memcpy.cocci
Re: [PATCH v5 00/32] replace use of rte_memcpy() with fixed size
Quoted 10 lines · On Sun, 26 May 2024 16:51:52 +0200 Mattias Rönnblom <[email protected]>…
Quoted 9 lines
This does not change the resulting binary on almost all architectures because x86 version of intrisics and glibc are the same, and other architectures were using
__builtin_constant_p().The main benefit is that analysis tools like fortify, Coverity, and ASAN analyzers can check these memcpy's. A recent example is that on Ubuntu 22.04 detected undefined use of memcpy such as:
memcpy(dst, NULL, 0)
Quoted 5 lines
Would it be possible to instead have a build mode where
rte_memcpy()is *always* delegating tomemcpy(), and run these tools on that configuration?It seems easier to just always using
rte_memcpy()in DPDK code, then let the platform (not the programmer) choose whatever is most appropriate.
I would prefer that rte_memcpy be laid to rest and go away. It never had a reason to be there.
Re: [PATCH v5 00/32] replace use of rte_memcpy() with fixed size
Quoted 13 lines · Stephen Hemminger
Quoted 10 lines · On Sun, 26 May 2024 16:51:52 +0200 Mattias Rönnblom <[email protected]>…
Quoted 9 lines
This does not change the resulting binary on almost all architectures because x86 version of intrisics and glibc are the same, and other architectures were using
__builtin_constant_p().The main benefit is that analysis tools like fortify, Coverity, and ASAN analyzers can check these memcpy's. A recent example is that on Ubuntu 22.04 detected undefined use of memcpy such as:
memcpy(dst, NULL, 0)
Quoted 7 lines
Quoted 5 lines
Would it be possible to instead have a build mode where
rte_memcpy()is *always* delegating tomemcpy(), and run these tools on that configuration?It seems easier to just always using
rte_memcpy()in DPDK code, then let the platform (not the programmer) choose whatever is most appropriate.I would prefer that
rte_memcpybe laid to rest and go away.
Sounds good, but is this piecemeal approach the way to do it. Why ask DPDK programmers to memorize rules about when to use memcpy() and when not to, when that can be coded into the rte_memcpy() implementation.
Worst case, when people have learned those rules, we'll change them. "Use rte_memcpy() only for large copies," or whatever it might be.
Use rte_memcpy() across the board until memcpy() is a complete replacement, for every use case, for every CPU/compiler/OS.
Applications using DPDK will benefit from any heuristics encoded into rte_memcpy.h. The won't run coccinelle script.
Quoted 1 line
It never had a reason to be there.
Sure, it did. Historically it has had better performance, up to at least fairly recently that seemed still be the case. I've patched DPDK to replace rte_memcpy() with memcpy() several times, and run with real-world apps. The result is always the same.
The compiler is in a better position than DPDK to implement memcpy(), so eventually the compiler will win.
RE: [PATCH v5 00/32] replace use of rte_memcpy() with fixed size
In reply to Stephen HemmingerQuoted 2 lines
I would prefer that
rte_memcpybe laid to rest and go away. It never had a reason to be there.
DPDK still contains remains of hand crafted code dating back from a time where compilers (read: the oldest compilers supported by DPDK) didn't produce efficient code. Rte_memcpy() is a prime example of this.
There are other examples, e.g. the use of Duff's Device directly in C source code.
This code was written a decade ago, and modern compilers are now much better at producing efficient code.
Testing would be able to verify the theory that modern compilers (read: the oldest compilers supported by DPDK) produce code that is as efficient as the hand crafted code. If so, the hand crafted code has outlived its purpose, and should be considered obsolete cruft and be completely removed.
Until we are certain that removing it doesn't degrade performance, we should keep it where it makes a difference (in the fast path).
Special thanks goes to Stephen for his efforts in cleaning up DPDK!