Skip to content

Commit ca9922c

Browse files
committed
Remove some useless code of kni.
1 parent fbd5b1e commit ca9922c

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

lib/ff_dpdk_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ init_port_start(void)
590590
}
591591
}
592592
#endif
593+
593594
for (i = 0; i < total_nb_ports; i++) {
594595
uint16_t port_id, u_port_id;
595596
struct ff_port_cfg *pconf = NULL;
@@ -612,7 +613,6 @@ init_port_start(void)
612613
nb_slaves = 0;
613614
}
614615

615-
616616
for (j = 0; j <= nb_slaves; j++) {
617617
if (j < nb_slaves) {
618618
port_id = pconf->slave_portid_list[j];

lib/ff_dpdk_kni.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,6 @@ kni_config_network_interface(uint16_t port_id, uint8_t if_up)
189189
return ret;
190190
}
191191

192-
static void
193-
print_ethaddr(const char *name, struct rte_ether_addr *mac_addr)
194-
{
195-
char buf[RTE_ETHER_ADDR_FMT_SIZE];
196-
rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, mac_addr);
197-
printf("\t%s%s\n", name, buf);
198-
}
199-
200-
201192
/* Callback for request of configuring mac address */
202193
static int
203194
kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])
@@ -209,7 +200,8 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])
209200
return -EINVAL;
210201
}
211202

212-
print_ethaddr("Address:", (struct rte_ether_addr *)mac_addr);
203+
printf("Port %u Address:"RTE_ETHER_ADDR_PRT_FMT"\n",
204+
port_id, RTE_ETHER_ADDR_BYTES((struct rte_ether_addr *)mac_addr));
213205

214206
ret = rte_eth_dev_default_mac_addr_set(port_id,
215207
(struct rte_ether_addr *)mac_addr);
@@ -538,7 +530,6 @@ ff_kni_alloc(uint16_t port_id, unsigned socket_id, int type, int port_idx,
538530
struct rte_mempool *mbuf_pool, unsigned ring_queue_size)
539531
{
540532
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
541-
struct rte_eth_dev_info dev_info;
542533
struct rte_ether_addr addr = {{0}};
543534
int ret;
544535

@@ -556,16 +547,9 @@ ff_kni_alloc(uint16_t port_id, unsigned socket_id, int type, int port_idx,
556547
kni_stat[port_id]->tx_packets = 0;
557548
kni_stat[port_id]->tx_dropped = 0;
558549

559-
memset(&dev_info, 0, sizeof(dev_info));
560-
ret = rte_eth_dev_info_get(port_id, &dev_info);
561-
if (ret != 0) {
562-
rte_panic("kni get dev info %u failed!\n", port_id);
563-
}
564-
565550
/* Get the interface default mac address */
566551
rte_eth_macaddr_get(port_id,
567552
(struct rte_ether_addr *)&addr);
568-
569553
printf("ff_kni_alloc get Port %u MAC:"RTE_ETHER_ADDR_PRT_FMT"\n",
570554
(unsigned)port_id, RTE_ETHER_ADDR_BYTES(&addr));
571555

0 commit comments

Comments
 (0)