4 * Copyright(c) 2010-2015 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(const struct rte_eth_dev *eth_dev)
50 /* Check valid pointer */
51 if (eth_dev->driver->pci_drv.name == NULL)
54 /* return 0 if driver name matches */
55 return eth_dev->driver->pci_drv.name != pmd_bond_driver_name;
59 valid_bonded_port_id(uint8_t port_id)
61 if (!rte_eth_dev_is_valid_port(port_id))
64 return valid_bonded_ethdev(&rte_eth_devices[port_id]);
68 valid_slave_port_id(uint8_t port_id)
70 /* Verify that port id's are valid */
71 if (!rte_eth_dev_is_valid_port(port_id))
74 /* Verify that port_id refers to a non bonded port */
75 if (!valid_bonded_ethdev(&rte_eth_devices[port_id]))
82 activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
84 struct bond_dev_private *internals = eth_dev->data->dev_private;
85 uint8_t active_count = internals->active_slave_count;
87 if (internals->mode == BONDING_MODE_8023AD)
88 bond_mode_8023ad_activate_slave(eth_dev, port_id);
90 if (internals->mode == BONDING_MODE_TLB
91 || internals->mode == BONDING_MODE_ALB) {
93 internals->tlb_slaves_order[active_count] = port_id;
96 RTE_VERIFY(internals->active_slave_count <
97 (RTE_DIM(internals->active_slaves) - 1));
99 internals->active_slaves[internals->active_slave_count] = port_id;
100 internals->active_slave_count++;
102 if (internals->mode == BONDING_MODE_TLB)
103 bond_tlb_activate_slave(internals);
104 if (internals->mode == BONDING_MODE_ALB)
105 bond_mode_alb_client_list_upd(eth_dev);
109 deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id)
112 struct bond_dev_private *internals = eth_dev->data->dev_private;
113 uint8_t active_count = internals->active_slave_count;
115 if (internals->mode == BONDING_MODE_8023AD) {
116 bond_mode_8023ad_stop(eth_dev);
117 bond_mode_8023ad_deactivate_slave(eth_dev, port_id);
118 } else if (internals->mode == BONDING_MODE_TLB
119 || internals->mode == BONDING_MODE_ALB)
120 bond_tlb_disable(internals);
122 slave_pos = find_slave_by_id(internals->active_slaves, active_count,
125 /* If slave was not at the end of the list
126 * shift active slaves up active array list */
127 if (slave_pos < active_count) {
129 memmove(internals->active_slaves + slave_pos,
130 internals->active_slaves + slave_pos + 1,
131 (active_count - slave_pos) *
132 sizeof(internals->active_slaves[0]));
135 RTE_VERIFY(active_count < RTE_DIM(internals->active_slaves));
136 internals->active_slave_count = active_count;
138 if (eth_dev->data->dev_started) {
139 if (internals->mode == BONDING_MODE_8023AD) {
140 bond_mode_8023ad_start(eth_dev);
141 } else if (internals->mode == BONDING_MODE_TLB) {
142 bond_tlb_enable(internals);
143 } else if (internals->mode == BONDING_MODE_ALB) {
144 bond_tlb_enable(internals);
145 bond_mode_alb_client_list_upd(eth_dev);
151 number_of_sockets(void)
155 const struct rte_memseg *ms = rte_eal_get_physmem_layout();
157 for (i = 0; ((i < RTE_MAX_MEMSEG) && (ms[i].addr != NULL)); i++) {
158 if (sockets < ms[i].socket_id)
159 sockets = ms[i].socket_id;
162 /* Number of sockets = maximum socket_id + 1 */
166 const char pmd_bond_driver_name[] = "rte_bond_pmd";
168 static struct rte_pci_id pci_id_table = {
169 .device_id = PCI_ANY_ID,
170 .subsystem_device_id = PCI_ANY_ID,
171 .vendor_id = PCI_ANY_ID,
172 .subsystem_vendor_id = PCI_ANY_ID,
175 static struct eth_driver rte_bond_pmd = {
177 .name = pmd_bond_driver_name,
178 .drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE,
179 .id_table = &pci_id_table,
184 rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)
186 struct rte_pci_device *pci_dev = NULL;
187 struct bond_dev_private *internals = NULL;
188 struct rte_eth_dev *eth_dev = NULL;
189 struct rte_pci_driver *pci_drv = NULL;
191 /* now do all data allocation - for eth_dev structure, dummy pci driver
192 * and internal (private) data
196 RTE_BOND_LOG(ERR, "Invalid name specified");
200 if (socket_id >= number_of_sockets()) {
202 "Invalid socket id specified to create bonded device on.");
206 pci_dev = rte_zmalloc_socket(name, sizeof(*pci_dev), 0, socket_id);
207 if (pci_dev == NULL) {
208 RTE_BOND_LOG(ERR, "Unable to malloc pci dev on socket");
212 pci_drv = &rte_bond_pmd.pci_drv;
214 internals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id);
215 if (internals == NULL) {
216 RTE_BOND_LOG(ERR, "Unable to malloc internals on socket");
220 /* reserve an ethdev entry */
221 eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);
222 if (eth_dev == NULL) {
223 RTE_BOND_LOG(ERR, "Unable to allocate rte_eth_dev");
227 pci_dev->numa_node = socket_id;
228 pci_drv->name = pmd_bond_driver_name;
229 pci_dev->driver = pci_drv;
231 eth_dev->driver = &rte_bond_pmd;
232 eth_dev->data->dev_private = internals;
233 eth_dev->data->nb_rx_queues = (uint16_t)1;
234 eth_dev->data->nb_tx_queues = (uint16_t)1;
236 TAILQ_INIT(&(eth_dev->link_intr_cbs));
238 eth_dev->data->dev_link.link_status = 0;
240 eth_dev->data->mac_addrs = rte_zmalloc_socket(name, ETHER_ADDR_LEN, 0,
243 eth_dev->data->dev_started = 0;
244 eth_dev->data->promiscuous = 0;
245 eth_dev->data->scattered_rx = 0;
246 eth_dev->data->all_multicast = 0;
248 eth_dev->dev_ops = &default_dev_ops;
249 eth_dev->pci_dev = pci_dev;
251 rte_spinlock_init(&internals->lock);
253 internals->port_id = eth_dev->data->port_id;
254 internals->mode = BONDING_MODE_INVALID;
255 internals->current_primary_port = 0;
256 internals->balance_xmit_policy = BALANCE_XMIT_POLICY_LAYER2;
257 internals->xmit_hash = xmit_l2_hash;
258 internals->user_defined_mac = 0;
259 internals->link_props_set = 0;
261 internals->link_status_polling_enabled = 0;
263 internals->link_status_polling_interval_ms = DEFAULT_POLLING_INTERVAL_10_MS;
264 internals->link_down_delay_ms = 0;
265 internals->link_up_delay_ms = 0;
267 internals->slave_count = 0;
268 internals->active_slave_count = 0;
269 internals->rx_offload_capa = 0;
270 internals->tx_offload_capa = 0;
272 memset(internals->active_slaves, 0, sizeof(internals->active_slaves));
273 memset(internals->slaves, 0, sizeof(internals->slaves));
275 /* Set mode 4 default configuration */
276 bond_mode_8023ad_setup(eth_dev, NULL);
277 if (bond_ethdev_mode_set(eth_dev, mode)) {
278 RTE_BOND_LOG(ERR, "Failed to set bonded device %d mode too %d",
279 eth_dev->data->port_id, mode);
283 return eth_dev->data->port_id;
288 rte_free(eth_dev->data->mac_addrs);
294 rte_eth_bond_free(const char *name)
296 struct rte_eth_dev *eth_dev = NULL;
298 /* now free all data allocation - for eth_dev structure,
299 * dummy pci driver and internal (private) data
302 /* find an ethdev entry */
303 eth_dev = rte_eth_dev_allocated(name);
307 if (eth_dev->data->dev_started == 1) {
308 bond_ethdev_stop(eth_dev);
309 bond_ethdev_close(eth_dev);
312 eth_dev->dev_ops = NULL;
313 eth_dev->rx_pkt_burst = NULL;
314 eth_dev->tx_pkt_burst = NULL;
316 rte_free(eth_dev->pci_dev);
317 rte_free(eth_dev->data->dev_private);
318 rte_free(eth_dev->data->mac_addrs);
320 rte_eth_dev_release_port(eth_dev);
326 __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)
328 struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev;
329 struct bond_dev_private *internals;
330 struct bond_dev_private *temp_internals;
331 struct rte_eth_link link_props;
332 struct rte_eth_dev_info dev_info;
336 if (valid_slave_port_id(slave_port_id) != 0)
339 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
340 internals = bonded_eth_dev->data->dev_private;
342 /* Verify that new slave device is not already a slave of another
344 for (i = rte_eth_dev_count()-1; i >= 0; i--) {
345 if (valid_bonded_ethdev(&rte_eth_devices[i]) == 0) {
346 temp_internals = rte_eth_devices[i].data->dev_private;
348 for (j = 0; j < temp_internals->slave_count; j++) {
349 /* Device already a slave of a bonded device */
350 if (temp_internals->slaves[j].port_id == slave_port_id) {
351 RTE_BOND_LOG(ERR, "Slave port %d is already a slave",
359 slave_eth_dev = &rte_eth_devices[slave_port_id];
361 /* Add slave details to bonded device */
362 slave_add(internals, slave_eth_dev);
364 rte_eth_dev_info_get(slave_port_id, &dev_info);
366 if (internals->slave_count < 1) {
367 /* if MAC is not user defined then use MAC of first slave add to
369 if (!internals->user_defined_mac)
370 mac_address_set(bonded_eth_dev, slave_eth_dev->data->mac_addrs);
372 /* Inherit eth dev link properties from first slave */
373 link_properties_set(bonded_eth_dev,
374 &(slave_eth_dev->data->dev_link));
376 /* Make primary slave */
377 internals->primary_port = slave_port_id;
379 /* Take the first dev's offload capabilities */
380 internals->rx_offload_capa = dev_info.rx_offload_capa;
381 internals->tx_offload_capa = dev_info.tx_offload_capa;
384 /* Check slave link properties are supported if props are set,
385 * all slaves must be the same */
386 if (internals->link_props_set) {
387 if (link_properties_valid(&(bonded_eth_dev->data->dev_link),
388 &(slave_eth_dev->data->dev_link))) {
390 "Slave port %d link speed/duplex not supported",
395 link_properties_set(bonded_eth_dev,
396 &(slave_eth_dev->data->dev_link));
398 internals->rx_offload_capa &= dev_info.rx_offload_capa;
399 internals->tx_offload_capa &= dev_info.tx_offload_capa;
402 internals->slave_count++;
404 /* Update all slave devices MACs*/
405 mac_address_slaves_update(bonded_eth_dev);
407 if (bonded_eth_dev->data->dev_started) {
408 if (slave_configure(bonded_eth_dev, slave_eth_dev) != 0) {
409 RTE_BOND_LOG(ERR, "rte_bond_slaves_configure: port=%d",
415 /* Register link status change callback with bonded device pointer as
417 rte_eth_dev_callback_register(slave_port_id, RTE_ETH_EVENT_INTR_LSC,
418 bond_ethdev_lsc_event_callback, &bonded_eth_dev->data->port_id);
420 /* If bonded device is started then we can add the slave to our active
422 if (bonded_eth_dev->data->dev_started) {
423 rte_eth_link_get_nowait(slave_port_id, &link_props);
425 if (link_props.link_status == 1)
426 activate_slave(bonded_eth_dev, slave_port_id);
433 rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id)
435 struct rte_eth_dev *bonded_eth_dev;
436 struct bond_dev_private *internals;
440 /* Verify that port id's are valid bonded and slave ports */
441 if (valid_bonded_port_id(bonded_port_id) != 0)
444 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
445 internals = bonded_eth_dev->data->dev_private;
447 rte_spinlock_lock(&internals->lock);
449 retval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id);
451 rte_spinlock_unlock(&internals->lock);
457 __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)
459 struct rte_eth_dev *bonded_eth_dev;
460 struct bond_dev_private *internals;
464 if (valid_slave_port_id(slave_port_id) != 0)
467 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
468 internals = bonded_eth_dev->data->dev_private;
470 /* first remove from active slave list */
471 slave_idx = find_slave_by_id(internals->active_slaves,
472 internals->active_slave_count, slave_port_id);
474 if (slave_idx < internals->active_slave_count)
475 deactivate_slave(bonded_eth_dev, slave_port_id);
478 /* now find in slave list */
479 for (i = 0; i < internals->slave_count; i++)
480 if (internals->slaves[i].port_id == slave_port_id) {
486 RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %d",
487 internals->slave_count);
491 /* Un-register link status change callback with bonded device pointer as
493 rte_eth_dev_callback_unregister(slave_port_id, RTE_ETH_EVENT_INTR_LSC,
494 bond_ethdev_lsc_event_callback,
495 &rte_eth_devices[bonded_port_id].data->port_id);
497 /* Restore original MAC address of slave device */
498 mac_address_set(&rte_eth_devices[slave_port_id],
499 &(internals->slaves[slave_idx].persisted_mac_addr));
501 slave_remove(internals, &rte_eth_devices[slave_port_id]);
503 /* first slave in the active list will be the primary by default,
504 * otherwise use first device in list */
505 if (internals->current_primary_port == slave_port_id) {
506 if (internals->active_slave_count > 0)
507 internals->current_primary_port = internals->active_slaves[0];
508 else if (internals->slave_count > 0)
509 internals->current_primary_port = internals->slaves[0].port_id;
511 internals->primary_port = 0;
514 if (internals->active_slave_count < 1) {
515 /* reset device link properties as no slaves are active */
516 link_properties_reset(&rte_eth_devices[bonded_port_id]);
518 /* if no slaves are any longer attached to bonded device and MAC is not
519 * user defined then clear MAC of bonded device as it will be reset
520 * when a new slave is added */
521 if (internals->slave_count < 1 && !internals->user_defined_mac)
522 memset(rte_eth_devices[bonded_port_id].data->mac_addrs, 0,
523 sizeof(*(rte_eth_devices[bonded_port_id].data->mac_addrs)));
525 if (internals->slave_count == 0) {
526 internals->rx_offload_capa = 0;
527 internals->tx_offload_capa = 0;
533 rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id)
535 struct rte_eth_dev *bonded_eth_dev;
536 struct bond_dev_private *internals;
539 if (valid_bonded_port_id(bonded_port_id) != 0)
542 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
543 internals = bonded_eth_dev->data->dev_private;
545 rte_spinlock_lock(&internals->lock);
547 retval = __eth_bond_slave_remove_lock_free(bonded_port_id, slave_port_id);
549 rte_spinlock_unlock(&internals->lock);
555 rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode)
557 if (valid_bonded_port_id(bonded_port_id) != 0)
560 return bond_ethdev_mode_set(&rte_eth_devices[bonded_port_id], mode);
564 rte_eth_bond_mode_get(uint8_t bonded_port_id)
566 struct bond_dev_private *internals;
568 if (valid_bonded_port_id(bonded_port_id) != 0)
571 internals = rte_eth_devices[bonded_port_id].data->dev_private;
573 return internals->mode;
577 rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id)
579 struct bond_dev_private *internals;
581 if (valid_bonded_port_id(bonded_port_id) != 0)
584 if (valid_slave_port_id(slave_port_id) != 0)
587 internals = rte_eth_devices[bonded_port_id].data->dev_private;
589 internals->user_defined_primary_port = 1;
590 internals->primary_port = slave_port_id;
592 bond_ethdev_primary_set(internals, slave_port_id);
598 rte_eth_bond_primary_get(uint8_t bonded_port_id)
600 struct bond_dev_private *internals;
602 if (valid_bonded_port_id(bonded_port_id) != 0)
605 internals = rte_eth_devices[bonded_port_id].data->dev_private;
607 if (internals->slave_count < 1)
610 return internals->current_primary_port;
614 rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len)
616 struct bond_dev_private *internals;
619 if (valid_bonded_port_id(bonded_port_id) != 0)
625 internals = rte_eth_devices[bonded_port_id].data->dev_private;
627 if (internals->slave_count > len)
630 for (i = 0; i < internals->slave_count; i++)
631 slaves[i] = internals->slaves[i].port_id;
633 return internals->slave_count;
637 rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[],
640 struct bond_dev_private *internals;
642 if (valid_bonded_port_id(bonded_port_id) != 0)
648 internals = rte_eth_devices[bonded_port_id].data->dev_private;
650 if (internals->active_slave_count > len)
653 memcpy(slaves, internals->active_slaves, internals->active_slave_count);
655 return internals->active_slave_count;
659 rte_eth_bond_mac_address_set(uint8_t bonded_port_id,
660 struct ether_addr *mac_addr)
662 struct rte_eth_dev *bonded_eth_dev;
663 struct bond_dev_private *internals;
665 if (valid_bonded_port_id(bonded_port_id) != 0)
668 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
669 internals = bonded_eth_dev->data->dev_private;
671 /* Set MAC Address of Bonded Device */
672 if (mac_address_set(bonded_eth_dev, mac_addr))
675 internals->user_defined_mac = 1;
677 /* Update all slave devices MACs*/
678 if (internals->slave_count > 0)
679 return mac_address_slaves_update(bonded_eth_dev);
685 rte_eth_bond_mac_address_reset(uint8_t bonded_port_id)
687 struct rte_eth_dev *bonded_eth_dev;
688 struct bond_dev_private *internals;
690 if (valid_bonded_port_id(bonded_port_id) != 0)
693 bonded_eth_dev = &rte_eth_devices[bonded_port_id];
694 internals = bonded_eth_dev->data->dev_private;
696 internals->user_defined_mac = 0;
698 if (internals->slave_count > 0) {
699 /* Set MAC Address of Bonded Device */
700 if (mac_address_set(bonded_eth_dev,
701 &internals->slaves[internals->primary_port].persisted_mac_addr)
703 RTE_BOND_LOG(ERR, "Failed to set MAC address on bonded device");
706 /* Update all slave devices MAC addresses */
707 return mac_address_slaves_update(bonded_eth_dev);
709 /* No need to update anything as no slaves present */
714 rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy)
716 struct bond_dev_private *internals;
718 if (valid_bonded_port_id(bonded_port_id) != 0)
721 internals = rte_eth_devices[bonded_port_id].data->dev_private;
724 case BALANCE_XMIT_POLICY_LAYER2:
725 internals->balance_xmit_policy = policy;
726 internals->xmit_hash = xmit_l2_hash;
728 case BALANCE_XMIT_POLICY_LAYER23:
729 internals->balance_xmit_policy = policy;
730 internals->xmit_hash = xmit_l23_hash;
732 case BALANCE_XMIT_POLICY_LAYER34:
733 internals->balance_xmit_policy = policy;
734 internals->xmit_hash = xmit_l34_hash;
744 rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id)
746 struct bond_dev_private *internals;
748 if (valid_bonded_port_id(bonded_port_id) != 0)
751 internals = rte_eth_devices[bonded_port_id].data->dev_private;
753 return internals->balance_xmit_policy;
757 rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms)
759 struct bond_dev_private *internals;
761 if (valid_bonded_port_id(bonded_port_id) != 0)
764 internals = rte_eth_devices[bonded_port_id].data->dev_private;
765 internals->link_status_polling_interval_ms = internal_ms;
771 rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id)
773 struct bond_dev_private *internals;
775 if (valid_bonded_port_id(bonded_port_id) != 0)
778 internals = rte_eth_devices[bonded_port_id].data->dev_private;
780 return internals->link_status_polling_interval_ms;
784 rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms)
787 struct bond_dev_private *internals;
789 if (valid_bonded_port_id(bonded_port_id) != 0)
792 internals = rte_eth_devices[bonded_port_id].data->dev_private;
793 internals->link_down_delay_ms = delay_ms;
799 rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id)
801 struct bond_dev_private *internals;
803 if (valid_bonded_port_id(bonded_port_id) != 0)
806 internals = rte_eth_devices[bonded_port_id].data->dev_private;
808 return internals->link_down_delay_ms;
812 rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms)
815 struct bond_dev_private *internals;
817 if (valid_bonded_port_id(bonded_port_id) != 0)
820 internals = rte_eth_devices[bonded_port_id].data->dev_private;
821 internals->link_up_delay_ms = delay_ms;
827 rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id)
829 struct bond_dev_private *internals;
831 if (valid_bonded_port_id(bonded_port_id) != 0)
834 internals = rte_eth_devices[bonded_port_id].data->dev_private;
836 return internals->link_up_delay_ms;