4 * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 #include <rte_malloc.h>
38 #include <rte_ethdev.h>
41 #include "rte_eth_bond.h"
42 #include "rte_eth_bond_private.h"
43 #include "rte_eth_bond_8023ad_private.h"
45 #define DEFAULT_POLLING_INTERVAL_10_MS (10)
48 valid_bonded_ethdev(struct rte_eth_dev *eth_dev)
52 /* Check valid pointer */
53 if (eth_dev->driver->pci_drv.name == NULL || driver_name == NULL)
56 /* Check string lengths are equal */
57 len = strlen(driver_name);
58 if (strlen(eth_dev->driver->pci_drv.name) != len)
62 return strncmp(eth_dev->driver->pci_drv.name, driver_name, len);
66 valid_port_id(uint8_t port_id)
68 /* Verify that port id is valid */
69 int ethdev_count = rte_eth_dev_count();
70 if (port_id >= ethdev_count) {
71 RTE_BOND_LOG(ERR, "Port Id %d is greater than rte_eth_dev_count %d",
72 port_id, ethdev_count);
80 valid_bonded_port_id(uint8_t port_id)
82 /* Verify that port id's are valid */
83 if (valid_port_id(port_id))
86 /* Verify that bonded_port_id refers to a bonded port */
87 if (valid_bonded_ethdev(&rte_eth_devices[port_id])) {
88 RTE_BOND_LOG(ERR, "Specified port Id %d is not a bonded eth_dev device",
97 valid_slave_port_id(uint8_t port_id)
99 /* Verify that port id's are valid */
100 if (valid_port_id(port_id))
103 /* Verify that port_id refers to a non bonded port */
104 if (!valid_bonded_ethdev(&rte_eth_devices[port_id]))
111 activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
113 struct bond_dev_private *internals = eth_dev->data->dev_private;
114 uint8_t active_count = internals->active_slave_count;
116 if (internals->mode == BONDING_MODE_8023AD)
117 bond_mode_8023ad_activate_slave(eth_dev, port_id);
119 if (internals->mode == BONDING_MODE_TLB
120 || internals->mode == BONDING_MODE_ALB) {
122 internals->tlb_slaves_order[active_count] = port_id;
125 RTE_VERIFY(internals->active_slave_count <
126 (RTE_DIM(internals->active_slaves) - 1));
128 internals->active_slaves[internals->active_slave_count] = port_id;
129 internals->active_slave_count++;
131 if (internals->mode == BONDING_MODE_TLB)
132 bond_tlb_activate_slave(internals);
133 if (internals->mode == BONDING_MODE_ALB)
134 bond_mode_alb_client_list_upd(eth_dev);
138 deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
141 struct bond_dev_private *internals = eth_dev->data->dev_private;
142 uint8_t active_count = internals->active_slave_count;
144 if (internals->mode == BONDING_MODE_8023AD) {
145 bond_mode_8023ad_stop(eth_dev);
146 bond_mode_8023ad_deactivate_slave(eth_dev, port_id);
147 } else if (internals->mode == BONDING_MODE_TLB
148 || internals->mode == BONDING_MODE_ALB)
149 bond_tlb_disable(internals);
151 slave_pos = find_slave_by_id(internals->active_slaves, active_count,
154 /* If slave was not at the end of the list
155 * shift active slaves up active array list */
156 if (slave_pos < active_count) {
158 memmove(internals->active_slaves + slave_pos,
159 internals->active_slaves + slave_pos + 1,
160 (active_count - slave_pos) *
161 sizeof(internals->active_slaves[0]));
164 RTE_VERIFY(active_count < RTE_DIM(internals->active_slaves));
165 internals->active_slave_count = active_count;
167 if (eth_dev->data->dev_started) {
168 if (internals->mode == BONDING_MODE_8023AD) {
169 bond_mode_8023ad_start(eth_dev);
170 } else if (internals->mode == BONDING_MODE_TLB) {
171 bond_tlb_enable(internals);
172 } else if (internals->mode == BONDING_MODE_ALB) {
173 bond_tlb_enable(internals);
174 bond_mode_alb_client_list_upd(eth_dev);
180 number_of_sockets(void)
184 const struct rte_memseg *ms = rte_eal_get_physmem_layout();
186 for (i = 0; ((i < RTE_MAX_MEMSEG) && (ms[i].addr != NULL)); i++) {
187 if (sockets < ms[i].socket_id)
188 sockets = ms[i].socket_id;
191 /* Number of sockets = maximum socket_id + 1 */
195 const char *driver_name = "Link Bonding PMD";
198 rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)
200 struct rte_pci_device *pci_dev = NULL;
201 struct bond_dev_private *internals = NULL;
202 struct rte_eth_dev *eth_dev = NULL;
203 struct eth_driver *eth_drv = NULL;
204 struct rte_pci_driver *pci_drv = NULL;
205 struct rte_pci_id *pci_id_table = NULL;
206 /* now do all data allocation - for eth_dev structure, dummy pci driver
207 * and internal (private) data
211 RTE_BOND_LOG(ERR, "Invalid name specified");
215 if (socket_id >= number_of_sockets()) {
217 "Invalid socket id specified to create bonded device on.");
221 pci_dev = rte_zmalloc_socket(name, sizeof(*pci_dev), 0, socket_id);
222 if (pci_dev == NULL) {
223 RTE_BOND_LOG(ERR, "Unable to malloc pci dev on socket");
227 eth_drv = rte_zmalloc_socket(name, sizeof(*eth_drv), 0, socket_id);
228 if (eth_drv == NULL) {
229 RTE_BOND_LOG(ERR, "Unable to malloc eth_drv on socket");
233 pci_drv = ð_drv->pci_drv;
235 pci_id_table = rte_zmalloc_socket(name, sizeof(*pci_id_table), 0, socket_id);
236 if (pci_id_table == NULL) {
237 RTE_BOND_LOG(ERR, "Unable to malloc pci_id_table on socket");
241 pci_drv->id_table = pci_id_table;
243 pci_drv->id_table->device_id = PCI_ANY_ID;
244 pci_drv->id_table->subsystem_device_id = PCI_ANY_ID;
245 pci_drv->id_table->vendor_id = PCI_ANY_ID;
246 pci_drv->id_table->subsystem_vendor_id = PCI_ANY_ID;
248 pci_drv->drv_flags = RTE_PCI_DRV_INTR_LSC;
250 internals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id);
251 if (internals == NULL) {
252 RTE_BOND_LOG(ERR, "Unable to malloc internals on socket");
256 /* reserve an ethdev entry */
257 eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);
258 if (eth_dev == NULL) {
259 RTE_BOND_LOG(ERR, "Unable to allocate rte_eth_dev");
263 pci_dev->numa_node = socket_id;
264 pci_drv->name = driver_name;
266 eth_dev->driver = eth_drv;
267 eth_dev->data->dev_private = internals;
268 eth_dev->data->nb_rx_queues = (uint16_t)1;
269 eth_dev->data->nb_tx_queues = (uint16_t)1;
271 TAILQ_INIT(&(eth_dev->link_intr_cbs));
273 eth_dev->data->dev_link.link_status = 0;
275 eth_dev->data->mac_addrs = rte_zmalloc_socket(name, ETHER_ADDR_LEN, 0,
278 eth_dev->data->dev_started = 0;
279 eth_dev->data->promiscuous = 0;
280 eth_dev->data->scattered_rx = 0;
281 eth_dev->data->all_multicast = 0;
283 eth_dev->dev_ops = &default_dev_ops;
284 eth_dev->pci_dev = pci_dev;
286 rte_spinlock_init(&internals->lock);
288 internals->port_id = eth_dev->data->port_id;
289 internals->mode = BONDING_MODE_INVALID;
290 internals->current_primary_port = 0;
291 internals->balance_xmit_policy = BALANCE_XMIT_POLICY_LAYER2;
292 internals->xmit_hash = xmit_l2_hash;
293 internals->user_defined_mac = 0;
294 internals->link_props_set = 0;
296 internals->link_status_polling_enabled = 0;
298 internals->link_status_polling_interval_ms = DEFAULT_POLLING_INTERVAL_10_MS;
299 internals->link_down_delay_ms = 0;
300 internals->link_up_delay_ms = 0;
302 internals->slave_count = 0;
303 internals->active_slave_count = 0;
304 internals->rx_offload_capa = 0;
305 internals->tx_offload_capa = 0;
307 memset(internals->active_slaves, 0, sizeof(internals->active_slaves));
308 memset(internals->slaves, 0, sizeof(internals->slaves));
310 /* Set mode 4 default configuration */
311 bond_mode_8023ad_setup(eth_dev, NULL);
312 if (bond_ethdev_mode_set(eth_dev, mode)) {
313 RTE_BOND_LOG(ERR, "Failed to set bonded device %d mode too %d",
314 eth_dev->data->port_id, mode);
318 return eth_dev->data->port_id;
322 rte_free(pci_id_table);
330 __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)
332 struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev;
333 struct bond_dev_private *internals;
334 struct bond_dev_private *temp_internals;
335 struct rte_eth_link link_props;
336 struct rte_eth_dev_info dev_info;
340 if (valid_slave_port_id(slave_port_id) != 0)
343 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
344 internals = bonded_eth_dev->data->dev_private;
346 /* Verify that new slave device is not already a slave of another
348 for (i = rte_eth_dev_count()-1; i >= 0; i--) {
349 if (valid_bonded_ethdev(&rte_eth_devices[i]) == 0) {
350 temp_internals = rte_eth_devices[i].data->dev_private;
352 for (j = 0; j < temp_internals->slave_count; j++) {
353 /* Device already a slave of a bonded device */
354 if (temp_internals->slaves[j].port_id == slave_port_id) {
355 RTE_BOND_LOG(ERR, "Slave port %d is already a slave",
363 slave_eth_dev = &rte_eth_devices[slave_port_id];
365 /* Add slave details to bonded device */
366 slave_add(internals, slave_eth_dev);
368 memset(&dev_info, 0, sizeof(dev_info));
369 rte_eth_dev_info_get(slave_port_id, &dev_info);
371 if (internals->slave_count < 1) {
372 /* if MAC is not user defined then use MAC of first slave add to
374 if (!internals->user_defined_mac)
375 mac_address_set(bonded_eth_dev, slave_eth_dev->data->mac_addrs);
377 /* Inherit eth dev link properties from first slave */
378 link_properties_set(bonded_eth_dev,
379 &(slave_eth_dev->data->dev_link));
381 /* Make primary slave */
382 internals->primary_port = slave_port_id;
384 /* Take the first dev's offload capabilities */
385 internals->rx_offload_capa = dev_info.rx_offload_capa;
386 internals->tx_offload_capa = dev_info.tx_offload_capa;
389 /* Check slave link properties are supported if props are set,
390 * all slaves must be the same */
391 if (internals->link_props_set) {
392 if (link_properties_valid(&(bonded_eth_dev->data->dev_link),
393 &(slave_eth_dev->data->dev_link))) {
395 "Slave port %d link speed/duplex not supported",
400 link_properties_set(bonded_eth_dev,
401 &(slave_eth_dev->data->dev_link));
403 internals->rx_offload_capa &= dev_info.rx_offload_capa;
404 internals->tx_offload_capa &= dev_info.tx_offload_capa;
407 internals->slave_count++;
409 /* Update all slave devices MACs*/
410 mac_address_slaves_update(bonded_eth_dev);
412 if (bonded_eth_dev->data->dev_started) {
413 if (slave_configure(bonded_eth_dev, slave_eth_dev) != 0) {
414 RTE_BOND_LOG(ERR, "rte_bond_slaves_configure: port=%d",
420 /* Register link status change callback with bonded device pointer as
422 rte_eth_dev_callback_register(slave_port_id, RTE_ETH_EVENT_INTR_LSC,
423 bond_ethdev_lsc_event_callback, &bonded_eth_dev->data->port_id);
425 /* If bonded device is started then we can add the slave to our active
427 if (bonded_eth_dev->data->dev_started) {
428 rte_eth_link_get_nowait(slave_port_id, &link_props);
430 if (link_props.link_status == 1)
431 activate_slave(bonded_eth_dev, slave_port_id);
438 rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id)
440 struct rte_eth_dev *bonded_eth_dev;
441 struct bond_dev_private *internals;
445 /* Verify that port id's are valid bonded and slave ports */
446 if (valid_bonded_port_id(bonded_port_id) != 0)
449 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
450 internals = bonded_eth_dev->data->dev_private;
452 rte_spinlock_lock(&internals->lock);
454 retval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id);
456 rte_spinlock_unlock(&internals->lock);
462 __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)
464 struct rte_eth_dev *bonded_eth_dev;
465 struct bond_dev_private *internals;
469 if (valid_slave_port_id(slave_port_id) != 0)
472 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
473 internals = bonded_eth_dev->data->dev_private;
475 /* first remove from active slave list */
476 slave_idx = find_slave_by_id(internals->active_slaves,
477 internals->active_slave_count, slave_port_id);
479 if (slave_idx < internals->active_slave_count)
480 deactivate_slave(bonded_eth_dev, slave_port_id);
483 /* now find in slave list */
484 for (i = 0; i < internals->slave_count; i++)
485 if (internals->slaves[i].port_id == slave_port_id) {
491 RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %d",
492 internals->slave_count);
496 /* Un-register link status change callback with bonded device pointer as
498 rte_eth_dev_callback_unregister(slave_port_id, RTE_ETH_EVENT_INTR_LSC,
499 bond_ethdev_lsc_event_callback,
500 &rte_eth_devices[bonded_port_id].data->port_id);
502 /* Restore original MAC address of slave device */
503 mac_address_set(&rte_eth_devices[slave_port_id],
504 &(internals->slaves[slave_idx].persisted_mac_addr));
506 slave_remove(internals, &rte_eth_devices[slave_port_id]);
508 /* first slave in the active list will be the primary by default,
509 * otherwise use first device in list */
510 if (internals->current_primary_port == slave_port_id) {
511 if (internals->active_slave_count > 0)
512 internals->current_primary_port = internals->active_slaves[0];
513 else if (internals->slave_count > 0)
514 internals->current_primary_port = internals->slaves[0].port_id;
516 internals->primary_port = 0;
519 if (internals->active_slave_count < 1) {
520 /* reset device link properties as no slaves are active */
521 link_properties_reset(&rte_eth_devices[bonded_port_id]);
523 /* if no slaves are any longer attached to bonded device and MAC is not
524 * user defined then clear MAC of bonded device as it will be reset
525 * when a new slave is added */
526 if (internals->slave_count < 1 && !internals->user_defined_mac)
527 memset(rte_eth_devices[bonded_port_id].data->mac_addrs, 0,
528 sizeof(*(rte_eth_devices[bonded_port_id].data->mac_addrs)));
530 if (internals->slave_count == 0) {
531 internals->rx_offload_capa = 0;
532 internals->tx_offload_capa = 0;
538 rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id)
540 struct rte_eth_dev *bonded_eth_dev;
541 struct bond_dev_private *internals;
544 if (valid_bonded_port_id(bonded_port_id) != 0)
547 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
548 internals = bonded_eth_dev->data->dev_private;
550 rte_spinlock_lock(&internals->lock);
552 retval = __eth_bond_slave_remove_lock_free(bonded_port_id, slave_port_id);
554 rte_spinlock_unlock(&internals->lock);
560 rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode)
562 if (valid_bonded_port_id(bonded_port_id) != 0)
565 return bond_ethdev_mode_set(&rte_eth_devices[bonded_port_id], mode);
569 rte_eth_bond_mode_get(uint8_t bonded_port_id)
571 struct bond_dev_private *internals;
573 if (valid_bonded_port_id(bonded_port_id) != 0)
576 internals = rte_eth_devices[bonded_port_id].data->dev_private;
578 return internals->mode;
582 rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id)
584 struct bond_dev_private *internals;
586 if (valid_bonded_port_id(bonded_port_id) != 0)
589 if (valid_slave_port_id(slave_port_id) != 0)
592 internals = rte_eth_devices[bonded_port_id].data->dev_private;
594 internals->user_defined_primary_port = 1;
595 internals->primary_port = slave_port_id;
597 bond_ethdev_primary_set(internals, slave_port_id);
603 rte_eth_bond_primary_get(uint8_t bonded_port_id)
605 struct bond_dev_private *internals;
607 if (valid_bonded_port_id(bonded_port_id) != 0)
610 internals = rte_eth_devices[bonded_port_id].data->dev_private;
612 if (internals->slave_count < 1)
615 return internals->current_primary_port;
619 rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len)
621 struct bond_dev_private *internals;
624 if (valid_bonded_port_id(bonded_port_id) != 0)
630 internals = rte_eth_devices[bonded_port_id].data->dev_private;
632 if (internals->slave_count > len)
635 for (i = 0; i < internals->slave_count; i++)
636 slaves[i] = internals->slaves[i].port_id;
638 return internals->slave_count;
642 rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[],
645 struct bond_dev_private *internals;
647 if (valid_bonded_port_id(bonded_port_id) != 0)
653 internals = rte_eth_devices[bonded_port_id].data->dev_private;
655 if (internals->active_slave_count > len)
658 memcpy(slaves, internals->active_slaves, internals->active_slave_count);
660 return internals->active_slave_count;
664 rte_eth_bond_mac_address_set(uint8_t bonded_port_id,
665 struct ether_addr *mac_addr)
667 struct rte_eth_dev *bonded_eth_dev;
668 struct bond_dev_private *internals;
670 if (valid_bonded_port_id(bonded_port_id) != 0)
673 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
674 internals = bonded_eth_dev->data->dev_private;
676 /* Set MAC Address of Bonded Device */
677 if (mac_address_set(bonded_eth_dev, mac_addr))
680 internals->user_defined_mac = 1;
682 /* Update all slave devices MACs*/
683 if (internals->slave_count > 0)
684 return mac_address_slaves_update(bonded_eth_dev);
690 rte_eth_bond_mac_address_reset(uint8_t bonded_port_id)
692 struct rte_eth_dev *bonded_eth_dev;
693 struct bond_dev_private *internals;
695 if (valid_bonded_port_id(bonded_port_id) != 0)
698 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
699 internals = bonded_eth_dev->data->dev_private;
701 internals->user_defined_mac = 0;
703 if (internals->slave_count > 0) {
704 /* Set MAC Address of Bonded Device */
705 if (mac_address_set(bonded_eth_dev,
706 &internals->slaves[internals->primary_port].persisted_mac_addr)
708 RTE_BOND_LOG(ERR, "Failed to set MAC address on bonded device");
711 /* Update all slave devices MAC addresses */
712 return mac_address_slaves_update(bonded_eth_dev);
714 /* No need to update anything as no slaves present */
719 rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy)
721 struct bond_dev_private *internals;
723 if (valid_bonded_port_id(bonded_port_id) != 0)
726 internals = rte_eth_devices[bonded_port_id].data->dev_private;
729 case BALANCE_XMIT_POLICY_LAYER2:
730 internals->balance_xmit_policy = policy;
731 internals->xmit_hash = xmit_l2_hash;
733 case BALANCE_XMIT_POLICY_LAYER23:
734 internals->balance_xmit_policy = policy;
735 internals->xmit_hash = xmit_l23_hash;
737 case BALANCE_XMIT_POLICY_LAYER34:
738 internals->balance_xmit_policy = policy;
739 internals->xmit_hash = xmit_l34_hash;
749 rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id)
751 struct bond_dev_private *internals;
753 if (valid_bonded_port_id(bonded_port_id) != 0)
756 internals = rte_eth_devices[bonded_port_id].data->dev_private;
758 return internals->balance_xmit_policy;
762 rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms)
764 struct bond_dev_private *internals;
766 if (valid_bonded_port_id(bonded_port_id) != 0)
769 internals = rte_eth_devices[bonded_port_id].data->dev_private;
770 internals->link_status_polling_interval_ms = internal_ms;
776 rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id)
778 struct bond_dev_private *internals;
780 if (valid_bonded_port_id(bonded_port_id) != 0)
783 internals = rte_eth_devices[bonded_port_id].data->dev_private;
785 return internals->link_status_polling_interval_ms;
789 rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms)
792 struct bond_dev_private *internals;
794 if (valid_bonded_port_id(bonded_port_id) != 0)
797 internals = rte_eth_devices[bonded_port_id].data->dev_private;
798 internals->link_down_delay_ms = delay_ms;
804 rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id)
806 struct bond_dev_private *internals;
808 if (valid_bonded_port_id(bonded_port_id) != 0)
811 internals = rte_eth_devices[bonded_port_id].data->dev_private;
813 return internals->link_down_delay_ms;
817 rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms)
820 struct bond_dev_private *internals;
822 if (valid_bonded_port_id(bonded_port_id) != 0)
825 internals = rte_eth_devices[bonded_port_id].data->dev_private;
826 internals->link_up_delay_ms = delay_ms;
832 rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id)
834 struct bond_dev_private *internals;
836 if (valid_bonded_port_id(bonded_port_id) != 0)
839 internals = rte_eth_devices[bonded_port_id].data->dev_private;
841 return internals->link_up_delay_ms;