git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: add rte prefix to ether structures
[dpdk.git]
/
lib
/
librte_kni
/
rte_kni.c
diff --git
a/lib/librte_kni/rte_kni.c
b/lib/librte_kni/rte_kni.c
index
c9726d4
..
7a41788
100644
(file)
--- a/
lib/librte_kni/rte_kni.c
+++ b/
lib/librte_kni/rte_kni.c
@@
-2,7
+2,7
@@
* Copyright(c) 2010-2014 Intel Corporation
*/
* Copyright(c) 2010-2014 Intel Corporation
*/
-#ifndef RTE_EXEC_ENV_LINUX
APP
+#ifndef RTE_EXEC_ENV_LINUX
#error "KNI is not supported"
#endif
#error "KNI is not supported"
#endif
@@
-21,7
+21,7
@@
#include <rte_tailq.h>
#include <rte_rwlock.h>
#include <rte_eal_memconfig.h>
#include <rte_tailq.h>
#include <rte_rwlock.h>
#include <rte_eal_memconfig.h>
-#include <
exec-env/
rte_kni_common.h>
+#include <rte_kni_common.h>
#include "rte_kni_fifo.h"
#define MAX_MBUF_BURST_NUM 32
#include "rte_kni_fifo.h"
#define MAX_MBUF_BURST_NUM 32
@@
-234,7
+234,7
@@
rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
goto kni_fail;
}
goto kni_fail;
}
- s
nprintf(kni->name, RTE_KNI_NAMESIZE, "%s", conf->name
);
+ s
trlcpy(kni->name, conf->name, RTE_KNI_NAMESIZE
);
if (ops)
memcpy(&kni->ops, ops, sizeof(struct rte_kni_ops));
if (ops)
memcpy(&kni->ops, ops, sizeof(struct rte_kni_ops));
@@
-255,7
+255,7
@@
rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
memcpy(dev_info.mac_addr, conf->mac_addr, ETHER_ADDR_LEN);
memcpy(dev_info.mac_addr, conf->mac_addr, ETHER_ADDR_LEN);
- s
nprintf(dev_info.name, RTE_KNI_NAMESIZE, "%s", conf->name
);
+ s
trlcpy(dev_info.name, conf->name, RTE_KNI_NAMESIZE
);
RTE_LOG(INFO, KNI, "pci: %02x:%02x:%02x \t %02x:%02x\n",
dev_info.bus, dev_info.devid, dev_info.function,
RTE_LOG(INFO, KNI, "pci: %02x:%02x:%02x \t %02x:%02x\n",
dev_info.bus, dev_info.devid, dev_info.function,
@@
-400,7
+400,7
@@
rte_kni_release(struct rte_kni *kni)
if (te == NULL)
goto unlock;
if (te == NULL)
goto unlock;
- s
nprintf(dev_info.name, sizeof(dev_info.name), "%s", kni->name
);
+ s
trlcpy(dev_info.name, kni->name, sizeof(dev_info.name)
);
if (ioctl(kni_fd, RTE_KNI_IOCTL_RELEASE, &dev_info) < 0) {
RTE_LOG(ERR, KNI, "Fail to release kni device\n");
goto unlock;
if (ioctl(kni_fd, RTE_KNI_IOCTL_RELEASE, &dev_info) < 0) {
RTE_LOG(ERR, KNI, "Fail to release kni device\n");
goto unlock;
@@
-451,7
+451,7
@@
kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])
RTE_LOG(INFO, KNI, "Configure mac address of %d", port_id);
ret = rte_eth_dev_default_mac_addr_set(port_id,
RTE_LOG(INFO, KNI, "Configure mac address of %d", port_id);
ret = rte_eth_dev_default_mac_addr_set(port_id,
-
(struct
ether_addr *)mac_addr);
+
(struct rte_
ether_addr *)mac_addr);
if (ret < 0)
RTE_LOG(ERR, KNI, "Failed to config mac_addr for port %d\n",
port_id);
if (ret < 0)
RTE_LOG(ERR, KNI, "Failed to config mac_addr for port %d\n",
port_id);
@@
-483,7
+483,7
@@
int
rte_kni_handle_request(struct rte_kni *kni)
{
unsigned ret;
rte_kni_handle_request(struct rte_kni *kni)
{
unsigned ret;
- struct rte_kni_request *req;
+ struct rte_kni_request *req
= NULL
;
if (kni == NULL)
return -1;
if (kni == NULL)
return -1;