eth.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * INET An implementation of the TCP/IP protocol suite for the LINUX
  4. * operating system. INET is implemented using the BSD Socket
  5. * interface as the means of communication with the user level.
  6. *
  7. * Ethernet-type device handling.
  8. *
  9. * Version: @(#)eth.c 1.0.7 05/25/93
  10. *
  11. * Authors: Ross Biro
  12. * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  13. * Mark Evans, <evansmp@uhura.aston.ac.uk>
  14. * Florian La Roche, <rzsfl@rz.uni-sb.de>
  15. * Alan Cox, <gw4pts@gw4pts.ampr.org>
  16. *
  17. * Fixes:
  18. * Mr Linux : Arp problems
  19. * Alan Cox : Generic queue tidyup (very tiny here)
  20. * Alan Cox : eth_header ntohs should be htons
  21. * Alan Cox : eth_rebuild_header missing an htons and
  22. * minor other things.
  23. * Tegge : Arp bug fixes.
  24. * Florian : Removed many unnecessary functions, code cleanup
  25. * and changes for new arp and skbuff.
  26. * Alan Cox : Redid header building to reflect new format.
  27. * Alan Cox : ARP only when compiled with CONFIG_INET
  28. * Greg Page : 802.2 and SNAP stuff.
  29. * Alan Cox : MAC layer pointers/new format.
  30. * Paul Gortmaker : eth_copy_and_sum shouldn't csum padding.
  31. * Alan Cox : Protect against forwarding explosions with
  32. * older network drivers and IFF_ALLMULTI.
  33. * Christer Weinigel : Better rebuild header message.
  34. * Andrew Morton : 26Feb01: kill ether_setup() - use netdev_boot_setup().
  35. */
  36. #include <linux/module.h>
  37. #include <linux/types.h>
  38. #include <linux/kernel.h>
  39. #include <linux/string.h>
  40. #include <linux/mm.h>
  41. #include <linux/socket.h>
  42. #include <linux/in.h>
  43. #include <linux/inet.h>
  44. #include <linux/ip.h>
  45. #include <linux/netdevice.h>
  46. #include <linux/nvmem-consumer.h>
  47. #include <linux/etherdevice.h>
  48. #include <linux/skbuff.h>
  49. #include <linux/errno.h>
  50. #include <linux/init.h>
  51. #include <linux/if_ether.h>
  52. #include <linux/of_net.h>
  53. #include <linux/pci.h>
  54. #include <linux/property.h>
  55. #include <net/dst.h>
  56. #include <net/arp.h>
  57. #include <net/sock.h>
  58. #include <net/ipv6.h>
  59. #include <net/ip.h>
  60. #include <net/dsa.h>
  61. #include <net/flow_dissector.h>
  62. #include <net/gro.h>
  63. #include <linux/uaccess.h>
  64. #include <net/pkt_sched.h>
  65. /**
  66. * eth_header - create the Ethernet header
  67. * @skb: buffer to alter
  68. * @dev: source device
  69. * @type: Ethernet type field
  70. * @daddr: destination address (NULL leave destination address)
  71. * @saddr: source address (NULL use device source address)
  72. * @len: packet length (<= skb->len)
  73. *
  74. *
  75. * Set the protocol type. For a packet of type ETH_P_802_3/2 we put the length
  76. * in here instead.
  77. */
  78. int eth_header(struct sk_buff *skb, struct net_device *dev,
  79. unsigned short type,
  80. const void *daddr, const void *saddr, unsigned int len)
  81. {
  82. struct ethhdr *eth = skb_push(skb, ETH_HLEN);
  83. if (type != ETH_P_802_3 && type != ETH_P_802_2)
  84. eth->h_proto = htons(type);
  85. else
  86. eth->h_proto = htons(len);
  87. /*
  88. * Set the source hardware address.
  89. */
  90. if (!saddr)
  91. saddr = dev->dev_addr;
  92. memcpy(eth->h_source, saddr, ETH_ALEN);
  93. if (daddr) {
  94. memcpy(eth->h_dest, daddr, ETH_ALEN);
  95. return ETH_HLEN;
  96. }
  97. /*
  98. * Anyway, the loopback-device should never use this function...
  99. */
  100. if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
  101. eth_zero_addr(eth->h_dest);
  102. return ETH_HLEN;
  103. }
  104. return -ETH_HLEN;
  105. }
  106. EXPORT_SYMBOL(eth_header);
  107. /**
  108. * eth_get_headlen - determine the length of header for an ethernet frame
  109. * @dev: pointer to network device
  110. * @data: pointer to start of frame
  111. * @len: total length of frame
  112. *
  113. * Make a best effort attempt to pull the length for all of the headers for
  114. * a given frame in a linear buffer.
  115. */
  116. u32 eth_get_headlen(const struct net_device *dev, const void *data, u32 len)
  117. {
  118. const unsigned int flags = FLOW_DISSECTOR_F_PARSE_1ST_FRAG;
  119. const struct ethhdr *eth = (const struct ethhdr *)data;
  120. struct flow_keys_basic keys;
  121. /* this should never happen, but better safe than sorry */
  122. if (unlikely(len < sizeof(*eth)))
  123. return len;
  124. /* parse any remaining L2/L3 headers, check for L4 */
  125. if (!skb_flow_dissect_flow_keys_basic(dev_net(dev), NULL, &keys, data,
  126. eth->h_proto, sizeof(*eth),
  127. len, flags))
  128. return max_t(u32, keys.control.thoff, sizeof(*eth));
  129. /* parse for any L4 headers */
  130. return min_t(u32, __skb_get_poff(NULL, data, &keys, len), len);
  131. }
  132. EXPORT_SYMBOL(eth_get_headlen);
  133. /**
  134. * eth_type_trans - determine the packet's protocol ID.
  135. * @skb: received socket data
  136. * @dev: receiving network device
  137. *
  138. * The rule here is that we
  139. * assume 802.3 if the type field is short enough to be a length.
  140. * This is normal practice and works for any 'now in use' protocol.
  141. */
  142. __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
  143. {
  144. unsigned short _service_access_point;
  145. const unsigned short *sap;
  146. const struct ethhdr *eth;
  147. skb->dev = dev;
  148. skb_reset_mac_header(skb);
  149. eth = eth_skb_pull_mac(skb);
  150. eth_skb_pkt_type(skb, dev);
  151. /*
  152. * Some variants of DSA tagging don't have an ethertype field
  153. * at all, so we check here whether one of those tagging
  154. * variants has been configured on the receiving interface,
  155. * and if so, set skb->protocol without looking at the packet.
  156. */
  157. if (unlikely(netdev_uses_dsa(dev)))
  158. return htons(ETH_P_XDSA);
  159. if (likely(eth_proto_is_802_3(eth->h_proto)))
  160. return eth->h_proto;
  161. /*
  162. * This is a magic hack to spot IPX packets. Older Novell breaks
  163. * the protocol design and runs IPX over 802.3 without an 802.2 LLC
  164. * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
  165. * won't work for fault tolerant netware but does for the rest.
  166. */
  167. sap = skb_header_pointer(skb, 0, sizeof(*sap), &_service_access_point);
  168. if (sap && *sap == 0xFFFF)
  169. return htons(ETH_P_802_3);
  170. /*
  171. * Real 802.2 LLC
  172. */
  173. return htons(ETH_P_802_2);
  174. }
  175. EXPORT_SYMBOL(eth_type_trans);
  176. /**
  177. * eth_header_parse - extract hardware address from packet
  178. * @skb: packet to extract header from
  179. * @haddr: destination buffer
  180. */
  181. int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr)
  182. {
  183. const struct ethhdr *eth = eth_hdr(skb);
  184. memcpy(haddr, eth->h_source, ETH_ALEN);
  185. return ETH_ALEN;
  186. }
  187. EXPORT_SYMBOL(eth_header_parse);
  188. /**
  189. * eth_header_cache - fill cache entry from neighbour
  190. * @neigh: source neighbour
  191. * @hh: destination cache entry
  192. * @type: Ethernet type field
  193. *
  194. * Create an Ethernet header template from the neighbour.
  195. */
  196. int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type)
  197. {
  198. struct ethhdr *eth;
  199. const struct net_device *dev = neigh->dev;
  200. eth = (struct ethhdr *)
  201. (((u8 *) hh->hh_data) + (HH_DATA_OFF(sizeof(*eth))));
  202. if (type == htons(ETH_P_802_3))
  203. return -1;
  204. eth->h_proto = type;
  205. memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
  206. memcpy(eth->h_dest, neigh->ha, ETH_ALEN);
  207. /* Pairs with READ_ONCE() in neigh_resolve_output(),
  208. * neigh_hh_output() and neigh_update_hhs().
  209. */
  210. smp_store_release(&hh->hh_len, ETH_HLEN);
  211. return 0;
  212. }
  213. EXPORT_SYMBOL(eth_header_cache);
  214. /**
  215. * eth_header_cache_update - update cache entry
  216. * @hh: destination cache entry
  217. * @dev: network device
  218. * @haddr: new hardware address
  219. *
  220. * Called by Address Resolution module to notify changes in address.
  221. */
  222. void eth_header_cache_update(struct hh_cache *hh,
  223. const struct net_device *dev,
  224. const unsigned char *haddr)
  225. {
  226. memcpy(((u8 *) hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)),
  227. haddr, ETH_ALEN);
  228. }
  229. EXPORT_SYMBOL(eth_header_cache_update);
  230. /**
  231. * eth_header_parse_protocol - extract protocol from L2 header
  232. * @skb: packet to extract protocol from
  233. */
  234. __be16 eth_header_parse_protocol(const struct sk_buff *skb)
  235. {
  236. const struct ethhdr *eth = eth_hdr(skb);
  237. return eth->h_proto;
  238. }
  239. EXPORT_SYMBOL(eth_header_parse_protocol);
  240. /**
  241. * eth_prepare_mac_addr_change - prepare for mac change
  242. * @dev: network device
  243. * @p: socket address
  244. */
  245. int eth_prepare_mac_addr_change(struct net_device *dev, void *p)
  246. {
  247. struct sockaddr *addr = p;
  248. if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev))
  249. return -EBUSY;
  250. if (!is_valid_ether_addr(addr->sa_data))
  251. return -EADDRNOTAVAIL;
  252. return 0;
  253. }
  254. EXPORT_SYMBOL(eth_prepare_mac_addr_change);
  255. /**
  256. * eth_commit_mac_addr_change - commit mac change
  257. * @dev: network device
  258. * @p: socket address
  259. */
  260. void eth_commit_mac_addr_change(struct net_device *dev, void *p)
  261. {
  262. struct sockaddr *addr = p;
  263. eth_hw_addr_set(dev, addr->sa_data);
  264. }
  265. EXPORT_SYMBOL(eth_commit_mac_addr_change);
  266. /**
  267. * eth_mac_addr - set new Ethernet hardware address
  268. * @dev: network device
  269. * @p: socket address
  270. *
  271. * Change hardware address of device.
  272. *
  273. * This doesn't change hardware matching, so needs to be overridden
  274. * for most real devices.
  275. */
  276. int eth_mac_addr(struct net_device *dev, void *p)
  277. {
  278. int ret;
  279. ret = eth_prepare_mac_addr_change(dev, p);
  280. if (ret < 0)
  281. return ret;
  282. eth_commit_mac_addr_change(dev, p);
  283. return 0;
  284. }
  285. EXPORT_SYMBOL(eth_mac_addr);
  286. int eth_validate_addr(struct net_device *dev)
  287. {
  288. if (!is_valid_ether_addr(dev->dev_addr))
  289. return -EADDRNOTAVAIL;
  290. return 0;
  291. }
  292. EXPORT_SYMBOL(eth_validate_addr);
  293. const struct header_ops eth_header_ops ____cacheline_aligned = {
  294. .create = eth_header,
  295. .parse = eth_header_parse,
  296. .cache = eth_header_cache,
  297. .cache_update = eth_header_cache_update,
  298. .parse_protocol = eth_header_parse_protocol,
  299. };
  300. /**
  301. * ether_setup - setup Ethernet network device
  302. * @dev: network device
  303. *
  304. * Fill in the fields of the device structure with Ethernet-generic values.
  305. */
  306. void ether_setup(struct net_device *dev)
  307. {
  308. dev->header_ops = &eth_header_ops;
  309. dev->type = ARPHRD_ETHER;
  310. dev->hard_header_len = ETH_HLEN;
  311. dev->min_header_len = ETH_HLEN;
  312. dev->mtu = ETH_DATA_LEN;
  313. dev->min_mtu = ETH_MIN_MTU;
  314. dev->max_mtu = ETH_DATA_LEN;
  315. dev->addr_len = ETH_ALEN;
  316. dev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
  317. dev->flags = IFF_BROADCAST|IFF_MULTICAST;
  318. dev->priv_flags |= IFF_TX_SKB_SHARING;
  319. eth_broadcast_addr(dev->broadcast);
  320. }
  321. EXPORT_SYMBOL(ether_setup);
  322. /**
  323. * alloc_etherdev_mqs - Allocates and sets up an Ethernet device
  324. * @sizeof_priv: Size of additional driver-private structure to be allocated
  325. * for this Ethernet device
  326. * @txqs: The number of TX queues this device has.
  327. * @rxqs: The number of RX queues this device has.
  328. *
  329. * Fill in the fields of the device structure with Ethernet-generic
  330. * values. Basically does everything except registering the device.
  331. *
  332. * Constructs a new net device, complete with a private data area of
  333. * size (sizeof_priv). A 32-byte (not bit) alignment is enforced for
  334. * this private data area.
  335. */
  336. struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
  337. unsigned int rxqs)
  338. {
  339. return alloc_netdev_mqs(sizeof_priv, "eth%d", NET_NAME_ENUM,
  340. ether_setup, txqs, rxqs);
  341. }
  342. EXPORT_SYMBOL(alloc_etherdev_mqs);
  343. ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len)
  344. {
  345. return sysfs_emit(buf, "%*phC\n", len, addr);
  346. }
  347. EXPORT_SYMBOL(sysfs_format_mac);
  348. struct sk_buff *eth_gro_receive(struct list_head *head, struct sk_buff *skb)
  349. {
  350. const struct packet_offload *ptype;
  351. unsigned int hlen, off_eth;
  352. struct sk_buff *pp = NULL;
  353. struct ethhdr *eh, *eh2;
  354. struct sk_buff *p;
  355. __be16 type;
  356. int flush = 1;
  357. off_eth = skb_gro_offset(skb);
  358. hlen = off_eth + sizeof(*eh);
  359. eh = skb_gro_header(skb, hlen, off_eth);
  360. if (unlikely(!eh))
  361. goto out;
  362. flush = 0;
  363. list_for_each_entry(p, head, list) {
  364. if (!NAPI_GRO_CB(p)->same_flow)
  365. continue;
  366. eh2 = (struct ethhdr *)(p->data + off_eth);
  367. if (compare_ether_header(eh, eh2)) {
  368. NAPI_GRO_CB(p)->same_flow = 0;
  369. continue;
  370. }
  371. }
  372. type = eh->h_proto;
  373. ptype = gro_find_receive_by_type(type);
  374. if (ptype == NULL) {
  375. flush = 1;
  376. goto out;
  377. }
  378. skb_gro_pull(skb, sizeof(*eh));
  379. skb_gro_postpull_rcsum(skb, eh, sizeof(*eh));
  380. pp = indirect_call_gro_receive_inet(ptype->callbacks.gro_receive,
  381. ipv6_gro_receive, inet_gro_receive,
  382. head, skb);
  383. out:
  384. skb_gro_flush_final(skb, pp, flush);
  385. return pp;
  386. }
  387. EXPORT_SYMBOL(eth_gro_receive);
  388. int eth_gro_complete(struct sk_buff *skb, int nhoff)
  389. {
  390. struct ethhdr *eh = (struct ethhdr *)(skb->data + nhoff);
  391. __be16 type = eh->h_proto;
  392. struct packet_offload *ptype;
  393. int err = -ENOSYS;
  394. if (skb->encapsulation)
  395. skb_set_inner_mac_header(skb, nhoff);
  396. ptype = gro_find_complete_by_type(type);
  397. if (ptype != NULL)
  398. err = INDIRECT_CALL_INET(ptype->callbacks.gro_complete,
  399. ipv6_gro_complete, inet_gro_complete,
  400. skb, nhoff + sizeof(*eh));
  401. return err;
  402. }
  403. EXPORT_SYMBOL(eth_gro_complete);
  404. static struct packet_offload eth_packet_offload __read_mostly = {
  405. .type = cpu_to_be16(ETH_P_TEB),
  406. .priority = 10,
  407. .callbacks = {
  408. .gro_receive = eth_gro_receive,
  409. .gro_complete = eth_gro_complete,
  410. },
  411. };
  412. static int __init eth_offload_init(void)
  413. {
  414. dev_add_offload(&eth_packet_offload);
  415. return 0;
  416. }
  417. fs_initcall(eth_offload_init);
  418. unsigned char * __weak arch_get_platform_mac_address(void)
  419. {
  420. return NULL;
  421. }
  422. int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr)
  423. {
  424. unsigned char *addr;
  425. int ret;
  426. ret = of_get_mac_address(dev->of_node, mac_addr);
  427. if (!ret)
  428. return 0;
  429. addr = arch_get_platform_mac_address();
  430. if (!addr)
  431. return -ENODEV;
  432. ether_addr_copy(mac_addr, addr);
  433. return 0;
  434. }
  435. EXPORT_SYMBOL(eth_platform_get_mac_address);
  436. /**
  437. * platform_get_ethdev_address - Set netdev's MAC address from a given device
  438. * @dev: Pointer to the device
  439. * @netdev: Pointer to netdev to write the address to
  440. *
  441. * Wrapper around eth_platform_get_mac_address() which writes the address
  442. * directly to netdev->dev_addr.
  443. */
  444. int platform_get_ethdev_address(struct device *dev, struct net_device *netdev)
  445. {
  446. u8 addr[ETH_ALEN] __aligned(2);
  447. int ret;
  448. ret = eth_platform_get_mac_address(dev, addr);
  449. if (!ret)
  450. eth_hw_addr_set(netdev, addr);
  451. return ret;
  452. }
  453. EXPORT_SYMBOL(platform_get_ethdev_address);
  454. /**
  455. * nvmem_get_mac_address - Obtain the MAC address from an nvmem cell named
  456. * 'mac-address' associated with given device.
  457. *
  458. * @dev: Device with which the mac-address cell is associated.
  459. * @addrbuf: Buffer to which the MAC address will be copied on success.
  460. *
  461. * Returns 0 on success or a negative error number on failure.
  462. */
  463. int nvmem_get_mac_address(struct device *dev, void *addrbuf)
  464. {
  465. struct nvmem_cell *cell;
  466. const void *mac;
  467. size_t len;
  468. cell = nvmem_cell_get(dev, "mac-address");
  469. if (IS_ERR(cell))
  470. return PTR_ERR(cell);
  471. mac = nvmem_cell_read(cell, &len);
  472. nvmem_cell_put(cell);
  473. if (IS_ERR(mac))
  474. return PTR_ERR(mac);
  475. if (len != ETH_ALEN || !is_valid_ether_addr(mac)) {
  476. kfree(mac);
  477. return -EINVAL;
  478. }
  479. ether_addr_copy(addrbuf, mac);
  480. kfree(mac);
  481. return 0;
  482. }
  483. static int fwnode_get_mac_addr(struct fwnode_handle *fwnode,
  484. const char *name, char *addr)
  485. {
  486. int ret;
  487. ret = fwnode_property_read_u8_array(fwnode, name, addr, ETH_ALEN);
  488. if (ret)
  489. return ret;
  490. if (!is_valid_ether_addr(addr))
  491. return -EINVAL;
  492. return 0;
  493. }
  494. /**
  495. * fwnode_get_mac_address - Get the MAC from the firmware node
  496. * @fwnode: Pointer to the firmware node
  497. * @addr: Address of buffer to store the MAC in
  498. *
  499. * Search the firmware node for the best MAC address to use. 'mac-address' is
  500. * checked first, because that is supposed to contain to "most recent" MAC
  501. * address. If that isn't set, then 'local-mac-address' is checked next,
  502. * because that is the default address. If that isn't set, then the obsolete
  503. * 'address' is checked, just in case we're using an old device tree.
  504. *
  505. * Note that the 'address' property is supposed to contain a virtual address of
  506. * the register set, but some DTS files have redefined that property to be the
  507. * MAC address.
  508. *
  509. * All-zero MAC addresses are rejected, because those could be properties that
  510. * exist in the firmware tables, but were not updated by the firmware. For
  511. * example, the DTS could define 'mac-address' and 'local-mac-address', with
  512. * zero MAC addresses. Some older U-Boots only initialized 'local-mac-address'.
  513. * In this case, the real MAC is in 'local-mac-address', and 'mac-address'
  514. * exists but is all zeros.
  515. */
  516. int fwnode_get_mac_address(struct fwnode_handle *fwnode, char *addr)
  517. {
  518. if (!fwnode_get_mac_addr(fwnode, "mac-address", addr) ||
  519. !fwnode_get_mac_addr(fwnode, "local-mac-address", addr) ||
  520. !fwnode_get_mac_addr(fwnode, "address", addr))
  521. return 0;
  522. return -ENOENT;
  523. }
  524. EXPORT_SYMBOL(fwnode_get_mac_address);
  525. /**
  526. * device_get_mac_address - Get the MAC for a given device
  527. * @dev: Pointer to the device
  528. * @addr: Address of buffer to store the MAC in
  529. */
  530. int device_get_mac_address(struct device *dev, char *addr)
  531. {
  532. return fwnode_get_mac_address(dev_fwnode(dev), addr);
  533. }
  534. EXPORT_SYMBOL(device_get_mac_address);
  535. /**
  536. * device_get_ethdev_address - Set netdev's MAC address from a given device
  537. * @dev: Pointer to the device
  538. * @netdev: Pointer to netdev to write the address to
  539. *
  540. * Wrapper around device_get_mac_address() which writes the address
  541. * directly to netdev->dev_addr.
  542. */
  543. int device_get_ethdev_address(struct device *dev, struct net_device *netdev)
  544. {
  545. u8 addr[ETH_ALEN];
  546. int ret;
  547. ret = device_get_mac_address(dev, addr);
  548. if (!ret)
  549. eth_hw_addr_set(netdev, addr);
  550. return ret;
  551. }
  552. EXPORT_SYMBOL(device_get_ethdev_address);