replace bzero with memset

The standard for DPDK is to use memset() not bzero which
is a leftover BSD-ism.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Stephen Hemminger 2015-12-01 19:24:10 -08:00 committed by Thomas Monjalon
parent 1685a92a15
commit 6c76533ccf
3 changed files with 8 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;