* [dpdk-dev] [PATCH 1/3] test-pmd: use memset not bzero
2015-12-02 3:24 [dpdk-dev] [PATCH 0/3] replace bzero with memset Stephen Hemminger
@ 2015-12-02 3:24 ` Stephen Hemminger
2015-12-02 3:24 ` [dpdk-dev] [PATCH 2/3] xen-virt: " Stephen Hemminger
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-12-02 3:24 UTC (permalink / raw)
To: dev
The standard for DPDK is to use memset() not bzero which
is a leftover BSD-ism.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/testpmd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 093952f..98ae46d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1512,7 +1512,7 @@ attach_port(char *identifier)
nb_ports = rte_eth_dev_count();
/* set_default_fwd_ports_config(); */
- bzero(fwd_ports_ids, sizeof(fwd_ports_ids));
+ memset(fwd_ports_ids, 0, sizeof(fwd_ports_ids));
i = 0;
FOREACH_PORT(j, ports) {
fwd_ports_ids[i] = j;
@@ -1547,7 +1547,7 @@ detach_port(uint8_t port_id)
nb_ports = rte_eth_dev_count();
/* set_default_fwd_ports_config(); */
- bzero(fwd_ports_ids, sizeof(fwd_ports_ids));
+ memset(fwd_ports_ids, 0, sizeof(fwd_ports_ids));
i = 0;
FOREACH_PORT(pi, ports) {
fwd_ports_ids[i] = pi;
--
2.1.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 2/3] xen-virt: use memset not bzero
2015-12-02 3:24 [dpdk-dev] [PATCH 0/3] replace bzero with memset Stephen Hemminger
2015-12-02 3:24 ` [dpdk-dev] [PATCH 1/3] test-pmd: use memset not bzero Stephen Hemminger
@ 2015-12-02 3:24 ` Stephen Hemminger
2015-12-02 3:24 ` [dpdk-dev] [PATCH 3/3] qat: use memset instead of bzero Stephen Hemminger
2015-12-02 8:28 ` [dpdk-dev] [PATCH 0/3] replace bzero with memset De Lara Guarch, Pablo
3 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-12-02 3:24 UTC (permalink / raw)
To: dev
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/xenvirt/rte_eth_xenvirt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c
index e83c08c..3353bcb 100644
--- a/drivers/net/xenvirt/rte_eth_xenvirt.c
+++ b/drivers/net/xenvirt/rte_eth_xenvirt.c
@@ -640,7 +640,8 @@ eth_dev_xenvirt_create(const char *name, const char *params,
struct pmd_internals *internals = NULL;
struct rte_eth_dev *eth_dev = NULL;
struct xenvirt_dict dict;
- bzero(&dict, sizeof(struct xenvirt_dict));
+
+ memset(&dict, 0, sizeof(struct xenvirt_dict));
RTE_LOG(INFO, PMD, "Creating virtio rings backed ethdev on numa socket %u\n",
numa_node);
--
2.1.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 3/3] qat: use memset instead of bzero
2015-12-02 3:24 [dpdk-dev] [PATCH 0/3] replace bzero with memset Stephen Hemminger
2015-12-02 3:24 ` [dpdk-dev] [PATCH 1/3] test-pmd: use memset not bzero Stephen Hemminger
2015-12-02 3:24 ` [dpdk-dev] [PATCH 2/3] xen-virt: " Stephen Hemminger
@ 2015-12-02 3:24 ` Stephen Hemminger
2015-12-02 8:28 ` [dpdk-dev] [PATCH 0/3] replace bzero with memset De Lara Guarch, Pablo
3 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-12-02 3:24 UTC (permalink / raw)
To: dev
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/dpdk_qat/crypto.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/examples/dpdk_qat/crypto.c b/examples/dpdk_qat/crypto.c
index c03ea78..8954bf8 100644
--- a/examples/dpdk_qat/crypto.c
+++ b/examples/dpdk_qat/crypto.c
@@ -307,7 +307,7 @@ getCoreAffinity(Cpa32U *coreAffinity, const CpaInstanceHandle instanceHandle)
Cpa16U i = 0;
CpaStatus status = CPA_STATUS_SUCCESS;
- bzero(&info, sizeof(CpaInstanceInfo2));
+ memset(&info, 0, sizeof(CpaInstanceInfo2));
status = cpaCyInstanceGetInfo2(instanceHandle, &info);
if (CPA_STATUS_SUCCESS != status) {
@@ -380,7 +380,7 @@ initCySymSession(const int pkt_cipher_alg,
CpaBoolean isCrypto = CPA_TRUE, isHmac = CPA_TRUE;
CpaCySymSessionSetupData sessionSetupData;
- bzero(&sessionSetupData, sizeof(CpaCySymSessionSetupData));
+ memset(&sessionSetupData, 0, sizeof(CpaCySymSessionSetupData));
/* Assumption: key length is set to each algorithm's max length */
switch (pkt_cipher_alg) {
@@ -781,7 +781,7 @@ crypto_encrypt(struct rte_mbuf *rte_buff, enum cipher_alg c, enum hash_alg h)
lcore_id = rte_lcore_id();
- bzero(opData, sizeof(CpaCySymDpOpData));
+ memset(opData, 0, sizeof(CpaCySymDpOpData));
opData->srcBuffer = opData->dstBuffer = PACKET_DATA_START_PHYS(rte_buff);
opData->srcBufferLen = opData->dstBufferLen = rte_buff->data_len;
@@ -856,7 +856,7 @@ crypto_decrypt(struct rte_mbuf *rte_buff, enum cipher_alg c, enum hash_alg h)
lcore_id = rte_lcore_id();
- bzero(opData, sizeof(CpaCySymDpOpData));
+ memset(opData, 0, sizeof(CpaCySymDpOpData));
opData->dstBuffer = opData->srcBuffer = PACKET_DATA_START_PHYS(rte_buff);
opData->dstBufferLen = opData->srcBufferLen = rte_buff->data_len;
--
2.1.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 0/3] replace bzero with memset
2015-12-02 3:24 [dpdk-dev] [PATCH 0/3] replace bzero with memset Stephen Hemminger
` (2 preceding siblings ...)
2015-12-02 3:24 ` [dpdk-dev] [PATCH 3/3] qat: use memset instead of bzero Stephen Hemminger
@ 2015-12-02 8:28 ` De Lara Guarch, Pablo
2015-12-06 22:51 ` Thomas Monjalon
3 siblings, 1 reply; 6+ messages in thread
From: De Lara Guarch, Pablo @ 2015-12-02 8:28 UTC (permalink / raw)
To: Stephen Hemminger, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen
> Hemminger
> Sent: Wednesday, December 02, 2015 3:24 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 0/3] replace bzero with memset
>
> The DPDK is mostly consistent about using the POSIX standard
> memset instead of bzero; but there seem to be some leftover BSD
> hold outs.
>
> Stephen Hemminger (3):
> test-pmd: use memset not bzero
> xen-virt: use memset not bzero
> qat: use memset instead of bzero
>
> app/test-pmd/testpmd.c | 4 ++--
> drivers/net/xenvirt/rte_eth_xenvirt.c | 3 ++-
> examples/dpdk_qat/crypto.c | 8 ++++----
> 3 files changed, 8 insertions(+), 7 deletions(-)
>
> --
> 2.1.4
Series-Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread