@@ -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 */
202193static int
203194kni_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