List comments

GET /api/patches/179/comments/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "id": 412,
        "web_url": "https://patches.dpdk.org/comment/412/",
        "msgid": "<D01A7BF4.27B3%rsanford@akamai.com>",
        "date": "2014-08-20T20:24:10",
        "subject": "Re: [dpdk-dev] [PATCH 1/6] bond: link status interrupt support",
        "submitter": {
            "id": 59,
            "url": "https://patches.dpdk.org/api/people/59/",
            "name": "Sanford, Robert",
            "email": "rsanford@akamai.com"
        },
        "content": "Reviewed-by: Robert Sanford <rsanford@akamai.com>\n\n\n>Adding support for lsc interrupt from bonded device to link\n>bonding library with supporting unit tests in the test application.\n>\n>Signed-off-by: Declan Doherty <declan.doherty@intel.com>\n>---\n> app/test/test_link_bonding.c           |  216\n>+++++++++++++++++++++++++++-----\n> lib/librte_pmd_bond/rte_eth_bond_api.c |    4 +\n> lib/librte_pmd_bond/rte_eth_bond_pmd.c |    6 +\n> 3 files changed, 192 insertions(+), 34 deletions(-)\n>\n>diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c\n>index 5c1303e..02823b6 100644\n>--- a/app/test/test_link_bonding.c\n>+++ b/app/test/test_link_bonding.c\n>@@ -39,6 +39,7 @@\n> #include <inttypes.h>\n> #include <errno.h>\n> #include <sys/queue.h>\n>+#include <sys/time.h>\n>\n> #include <rte_byteorder.h>\n> #include <rte_common.h>\n>@@ -224,10 +225,15 @@ static struct rte_eth_txconf tx_conf_default = {\n> };\n>\n> static int\n>-configure_ethdev(uint8_t port_id, uint8_t start)\n>+configure_ethdev(uint8_t port_id, uint8_t start, uint8_t en_isr)\n> {\n>       int q_id;\n>\n>+      if (en_isr)\n>+              default_pmd_conf.intr_conf.lsc = 1;\n>+      else\n>+              default_pmd_conf.intr_conf.lsc = 0;\n>+\n>       if (rte_eth_dev_configure(port_id, test_params->nb_rx_q,\n>                       test_params->nb_tx_q, &default_pmd_conf) != 0) {\n>               goto error;\n>@@ -312,7 +318,7 @@ test_setup(void)\n>\n>                       printf(\"Created virtual ethdev %s\\n\", pmd_name);\n>\n>-                      retval = configure_ethdev(test_params->slave_port_ids[i], 1);\n>+                      retval = configure_ethdev(test_params->slave_port_ids[i], 1, 0);\n>                       if (retval != 0) {\n>                               printf(\"Failed to configure virtual ethdev %s\\n\", pmd_name);\n>                               return -1;\n>@@ -341,7 +347,7 @@ test_create_bonded_device(void)\n>               TEST_ASSERT(test_params->bonded_port_id >= 0,\n>                               \"Failed to create bonded ethdev %s\", BONDED_DEV_NAME);\n>\n>-              TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0),\n>+              TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0,\n>0),\n>                               \"Failed to configure bonded ethdev %s\", BONDED_DEV_NAME);\n>       }\n>\n>@@ -1078,12 +1084,12 @@ test_set_explicit_bonded_mac(void)\n>\n>\n> static int\n>-initialize_bonded_device_with_slaves(uint8_t bonding_mode,\n>+initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t\n>bond_en_isr,\n>               uint8_t number_of_slaves, uint8_t enable_slave)\n> {\n>       /* configure bonded device */\n>-      TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0),\n>-                      \"Failed to configure bonding port (%d) in mode %d \"\n>+      TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0,\n>+                      bond_en_isr), \"Failed to configure bonding port (%d) in mode %d \"\n>                       \"with (%d) slaves.\", test_params->bonded_port_id, bonding_mode,\n>                       number_of_slaves);\n>\n>@@ -1116,8 +1122,8 @@ test_adding_slave_after_bonded_device_started(void)\n> {\n>       int i;\n>\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 4,\n>0) !=\n>-                      0)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n>4, 0)\n>+                      != 0)\n>               return -1;\n>\n>       /* Enabled slave devices */\n>@@ -1141,6 +1147,147 @@\n>test_adding_slave_after_bonded_device_started(void)\n>       return remove_slaves_and_stop_bonded_device();\n> }\n>\n>+#define TEST_STATUS_INTERRUPT_SLAVE_COUNT     4\n>+#define TEST_LSC_WAIT_TIMEOUT_MS      500\n>+\n>+int test_lsc_interupt_count;\n>+\n>+static pthread_mutex_t mutex;\n>+static pthread_cond_t cvar;\n>+\n>+static void\n>+test_bonding_lsc_event_callback(uint8_t port_id __rte_unused,\n>+              enum rte_eth_event_type type  __rte_unused, void *param __rte_unused)\n>+{\n>+      pthread_mutex_lock(&mutex);\n>+      test_lsc_interupt_count++;\n>+\n>+      pthread_cond_signal(&cvar);\n>+      pthread_mutex_unlock(&mutex);\n>+}\n>+\n>+static inline int\n>+lsc_timeout(int wait_us)\n>+{\n>+      int retval = 0;\n>+\n>+      struct timespec ts;\n>+      struct timeval tp;\n>+\n>+      gettimeofday(&tp, NULL);\n>+\n>+      /* Convert from timeval to timespec */\n>+      ts.tv_sec  = tp.tv_sec;\n>+      ts.tv_nsec = tp.tv_usec * 1000;\n>+      ts.tv_nsec += wait_us * 1000;\n>+\n>+      pthread_mutex_lock(&mutex);\n>+      if (test_lsc_interupt_count < 1)\n>+              retval = pthread_cond_timedwait(&cvar, &mutex, &ts);\n>+\n>+      pthread_mutex_unlock(&mutex);\n>+\n>+      if (test_lsc_interupt_count  < 1)\n>+               return retval;\n>+\n>+      return 0;\n>+}\n>+\n>+static int\n>+test_status_interrupt(void)\n>+{\n>+      int slave_count;\n>+      uint8_t slaves[RTE_MAX_ETHPORTS];\n>+\n>+      pthread_mutex_init(&mutex, NULL);\n>+      pthread_cond_init(&cvar, NULL);\n>+\n>+      /* initialized bonding device with T slaves */\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 1,\n>+                      TEST_STATUS_INTERRUPT_SLAVE_COUNT, 1) != 0)\n>+              return -1;\n>+\n>+      test_lsc_interupt_count = 0;\n>+\n>+      /* register link status change interrupt callback */\n>+      rte_eth_dev_callback_register(test_params->bonded_port_id,\n>+                      RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,\n>+                      &test_params->bonded_port_id);\n>+\n>+      slave_count =\n>rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n>+                      slaves, RTE_MAX_ETHPORTS);\n>+\n>+      TEST_ASSERT_EQUAL(slave_count, TEST_STATUS_INTERRUPT_SLAVE_COUNT,\n>+                      \"Number of active slaves (%d) is not as expected (%d)\",\n>+                      slave_count, TEST_STATUS_INTERRUPT_SLAVE_COUNT);\n>+\n>+      /* Bring all 4 slaves link status to down and test that we have\n>received a\n>+       * lsc interrupts */\n>+      virtual_ethdev_simulate_link_status_interrupt(\n>+                      test_params->slave_port_ids[0], 0);\n>+      virtual_ethdev_simulate_link_status_interrupt(\n>+                      test_params->slave_port_ids[1], 0);\n>+      virtual_ethdev_simulate_link_status_interrupt(\n>+                      test_params->slave_port_ids[2], 0);\n>+\n>+      TEST_ASSERT_EQUAL(test_lsc_interupt_count, 0,\n>+                      \"Received a link status change interrupt unexpectedly\");\n>+\n>+      virtual_ethdev_simulate_link_status_interrupt(\n>+                      test_params->slave_port_ids[3], 0);\n>+\n>+      TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) == 0,\n>+                      \"timed out waiting for interrupt\");\n>+\n>+      TEST_ASSERT(test_lsc_interupt_count > 0,\n>+                      \"Did not receive link status change interrupt\");\n>+\n>+      slave_count =\n>rte_eth_bond_active_slaves_get(test_params->bonded_port_id,\n>+                      slaves, RTE_MAX_ETHPORTS);\n>+\n>+      TEST_ASSERT_EQUAL(slave_count, 0,\n>+                      \"Number of active slaves (%d) is not as expected (%d)\",\n>+                      slave_count, 0);\n>+\n>+      /* bring one slave port up so link status will change */\n>+      test_lsc_interupt_count = 0;\n>+\n>+      virtual_ethdev_simulate_link_status_interrupt(\n>+                      test_params->slave_port_ids[0], 1);\n>+\n>+      TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) == 0,\n>+                      \"timed out waiting for interrupt\");\n>+\n>+      /* test that we have received another lsc interrupt */\n>+      TEST_ASSERT(test_lsc_interupt_count > 0,\n>+                      \"Did not receive link status change interrupt\");\n>+\n>+      /* Verify that calling the same slave lsc interrupt doesn't cause\n>another\n>+       * lsc interrupt from bonded device */\n>+      test_lsc_interupt_count = 0;\n>+\n>+      virtual_ethdev_simulate_link_status_interrupt(\n>+                      test_params->slave_port_ids[0], 1);\n>+\n>+      TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) != 0,\n>+                      \"received unexpected interrupt\");\n>+\n>+      TEST_ASSERT_EQUAL(test_lsc_interupt_count, 0,\n>+                      \"Did not receive link status change interrupt\");\n>+\n>+\n>+      /* unregister lsc callback before exiting */\n>+      rte_eth_dev_callback_unregister(test_params->bonded_port_id,\n>+                              RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,\n>+                              &test_params->bonded_port_id);\n>+\n>+      pthread_mutex_destroy(&mutex);\n>+      pthread_cond_destroy(&cvar);\n>+\n>+      /* Clean up and remove slaves from bonded device */\n>+      return remove_slaves_and_stop_bonded_device();\n>+}\n>+\n> static int\n> generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size,\n>               uint8_t vlan, uint8_t ipv4, uint8_t toggle_dst_mac,\n>@@ -1209,7 +1356,7 @@ test_roundrobin_tx_burst(void)\n>       struct rte_mbuf *pkt_burst[MAX_PKT_BURST];\n>       struct rte_eth_stats port_stats;\n>\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 2, 1)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n>2, 1)\n>                       != 0)\n>               return -1;\n>\n>@@ -1279,7 +1426,7 @@ test_roundrobin_rx_burst_on_single_slave(void)\n>       int i, j, nb_rx, burst_size = 25;\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 4,\n>1) !=\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n>4, 1) !=\n>                       0)\n>               return -1;\n>\n>@@ -1369,7 +1516,7 @@ test_roundrobin_rx_burst_on_multiple_slaves(void)\n>\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 4,\n>1) !=\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n>4, 1) !=\n>                       0)\n>               return -1;\n>\n>@@ -1461,7 +1608,7 @@ test_roundrobin_verify_mac_assignment(void)\n>       rte_eth_macaddr_get(test_params->slave_port_ids[2],\n>&expected_mac_addr_2);\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 4, 1)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n>4, 1)\n>                       != 0)\n>               return -1;\n>\n>@@ -1552,7 +1699,7 @@\n>test_roundrobin_verify_promiscuous_enable_disable(void)\n>       int i, promiscuous_en;\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 4,\n>1) !=\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n>4, 1) !=\n>                       0)\n>               return -1;\n>\n>@@ -1616,7 +1763,7 @@\n>test_roundrobin_verify_slave_link_status_change_behaviour(void)\n>\n>       /* Initialize bonded device with TEST_RR_LINK_STATUS_SLAVE_COUNT slaves\n>        * in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN,\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ROUND_ROBIN, 0,\n>                       TEST_RR_LINK_STATUS_SLAVE_COUNT, 1) != 0)\n>               return -1;\n>\n>@@ -1757,7 +1904,7 @@ test_activebackup_tx_burst(void)\n>       struct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n>       struct rte_eth_stats port_stats;\n>\n>-      retval =\n>initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 2, 1);\n>+      retval =\n>initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1);\n>       if (retval != 0) {\n>               printf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n>               return -1;\n>@@ -1854,7 +2001,7 @@ test_activebackup_rx_burst(void)\n>       int i, j, nb_rx, burst_size = 17;\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP,\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n>                       TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1)\n>                       != 0)\n>               return -1;\n>@@ -1948,7 +2095,7 @@\n>test_activebackup_verify_promiscuous_enable_disable(void)\n>       int i, primary_port, promiscuous_en;\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 4,\n>1)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n>4, 1)\n>                       != 0)\n>               return -1;\n>\n>@@ -2018,7 +2165,7 @@ test_activebackup_verify_mac_assignment(void)\n>       rte_eth_macaddr_get(test_params->slave_port_ids[1],\n>&expected_mac_addr_1);\n>\n>       /* Initialize bonded device with 2 slaves in active backup mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 2,\n>1)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n>2, 1)\n>                       != 0)\n>               return -1;\n>\n>@@ -2157,7 +2304,7 @@\n>test_activebackup_verify_slave_link_status_change_failover(void)\n>       }\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP,\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n>                       TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1)\n>                       != 0)\n>               return -1;\n>@@ -2328,7 +2475,7 @@ test_balance_xmit_policy_configuration(void)\n> {\n>       int retval;\n>\n>-      retval =\n>initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP,\n>+      retval =\n>initialize_bonded_device_with_slaves(BONDING_MODE_ACTIVE_BACKUP, 0,\n>                       2, 1);\n>       if (retval != 0) {\n>               printf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n>@@ -2408,7 +2555,7 @@ test_balance_l2_tx_burst(void)\n>       int retval, i;\n>       struct rte_eth_stats port_stats;\n>\n>-      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE,\n>+      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0,\n>                       TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT, 1);\n>       if (retval != 0) {\n>               printf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n>@@ -2506,7 +2653,7 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t\n>ipv4,\n>\n>       struct rte_eth_stats port_stats;\n>\n>-      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 2,\n>1);\n>+      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0,\n>2, 1);\n>       if (retval != 0) {\n>               printf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n>               return -1;\n>@@ -2634,7 +2781,7 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t\n>ipv4,\n>\n>       struct rte_eth_stats port_stats;\n>\n>-      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 2,\n>1);\n>+      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0,\n>2, 1);\n>       if (retval != 0) {\n>               printf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n>               return -1;\n>@@ -2772,7 +2919,7 @@ test_balance_rx_burst(void)\n>       memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst));\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 3, 1)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 3, 1)\n>                       != 0)\n>               return -1;\n>\n>@@ -2861,7 +3008,7 @@ test_balance_verify_promiscuous_enable_disable(void)\n>       int i, promiscuous_en;\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 4, 1) !=\n>0)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 4, 1)\n>!= 0)\n>               return -1;\n>\n>       rte_eth_promiscuous_enable(test_params->bonded_port_id);\n>@@ -2915,7 +3062,7 @@ test_balance_verify_mac_assignment(void)\n>       rte_eth_macaddr_get(test_params->slave_port_ids[1],\n>&expected_mac_addr_1);\n>\n>       /* Initialize bonded device with 2 slaves in active backup mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 2, 1) !=\n>0)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 2, 1)\n>!= 0)\n>               return -1;\n>\n>       /* Verify that bonded MACs is that of first slave and that the other\n>slave\n>@@ -3045,7 +3192,7 @@\n>test_balance_verify_slave_link_status_change_behaviour(void)\n>       memset(pkt_burst, 0, sizeof(pkt_burst));\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE,\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0,\n>                       TEST_BALANCE_LINK_STATUS_SLAVE_COUNT, 1) != 0)\n>               return -1;\n>\n>@@ -3237,7 +3384,7 @@ test_broadcast_tx_burst(void)\n>\n>       struct rte_eth_stats port_stats;\n>\n>-      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST,\n>2, 1);\n>+      retval = initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST,\n>0, 2, 1);\n>       if (retval != 0) {\n>               printf(\"Failed to initialize_bonded_device_with_slaves.\\n\");\n>               return -1;\n>@@ -3327,7 +3474,7 @@ test_broadcast_rx_burst(void)\n>       memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst));\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 3, 1)\n>!= 0)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 0, 3,\n>1) != 0)\n>               return -1;\n>\n>\n>@@ -3419,7 +3566,7 @@\n>test_broadcast_verify_promiscuous_enable_disable(void)\n>       int i, promiscuous_en;\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 4, 1) !=\n>0)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BALANCE, 0, 4, 1)\n>!= 0)\n>               return -1;\n>\n>       rte_eth_promiscuous_enable(test_params->bonded_port_id);\n>@@ -3475,7 +3622,7 @@ test_broadcast_verify_mac_assignment(void)\n>       rte_eth_macaddr_get(test_params->slave_port_ids[2],\n>&expected_mac_addr_1);\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 4, 1)\n>!= 0)\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 0, 4,\n>1) != 0)\n>               return -1;\n>\n>       /* Verify that all MACs are the same as first slave added to bonded\n>@@ -3575,7 +3722,7 @@\n>test_broadcast_verify_slave_link_status_change_behaviour(void)\n>       memset(pkt_burst, 0, sizeof(pkt_burst));\n>\n>       /* Initialize bonded device with 4 slaves in round robin mode */\n>-      if (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST,\n>+      if (initialize_bonded_device_with_slaves(BONDING_MODE_BROADCAST, 0,\n>                       BROADCAST_LINK_STATUS_NUM_OF_SLAVES, 1) != 0)\n>               return -1;\n>\n>@@ -3711,7 +3858,7 @@ test_reconfigure_bonded_device(void)\n>       test_params->nb_rx_q = 4;\n>       test_params->nb_tx_q = 4;\n>\n>-      if (configure_ethdev(test_params->bonded_port_id, 0)  != 0) {\n>+      if (configure_ethdev(test_params->bonded_port_id, 0, 0)  != 0) {\n>               printf(\"failed to reconfigure bonded device\");\n>               return -1;\n>       }\n>@@ -3720,7 +3867,7 @@ test_reconfigure_bonded_device(void)\n>       test_params->nb_rx_q = 2;\n>       test_params->nb_tx_q = 2;\n>\n>-      if (configure_ethdev(test_params->bonded_port_id, 0)  != 0) {\n>+      if (configure_ethdev(test_params->bonded_port_id, 0, 0)  != 0) {\n>               printf(\"failed to reconfigure bonded device with less rx/tx queues\");\n>               return -1;\n>       }\n>@@ -3768,6 +3915,7 @@ static struct unit_test_suite\n>link_bonding_test_suite  = {\n>               TEST_CASE(test_set_bonding_mode),\n>               TEST_CASE(test_set_primary_slave),\n>               TEST_CASE(test_set_explicit_bonded_mac),\n>+              TEST_CASE(test_status_interrupt),\n>               TEST_CASE(test_adding_slave_after_bonded_device_started),\n>               TEST_CASE(test_roundrobin_tx_burst),\n>               TEST_CASE(test_roundrobin_rx_burst_on_single_slave),\n>diff --git a/lib/librte_pmd_bond/rte_eth_bond_api.c\n>b/lib/librte_pmd_bond/rte_eth_bond_api.c\n>index 75f5694..dd33119 100644\n>--- a/lib/librte_pmd_bond/rte_eth_bond_api.c\n>+++ b/lib/librte_pmd_bond/rte_eth_bond_api.c\n>@@ -177,6 +177,8 @@ rte_eth_bond_create(const char *name, uint8_t mode,\n>uint8_t socket_id)\n>       pci_drv->id_table->vendor_id = PCI_ANY_ID;\n>       pci_drv->id_table->subsystem_vendor_id = PCI_ANY_ID;\n>\n>+      pci_drv->drv_flags = RTE_PCI_DRV_INTR_LSC;\n>+\n>       internals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id);\n>       if (internals == NULL) {\n>               RTE_LOG(ERR, PMD, \"Unable to malloc internals on socket\\n\");\n>@@ -200,6 +202,8 @@ rte_eth_bond_create(const char *name, uint8_t mode,\n>uint8_t socket_id)\n>       eth_dev->data->nb_rx_queues = (uint16_t)1;\n>       eth_dev->data->nb_tx_queues = (uint16_t)1;\n>\n>+      TAILQ_INIT(&(eth_dev->callbacks));\n>+\n>       eth_dev->data->dev_link.link_status = 0;\n>\n>       eth_dev->data->mac_addrs = rte_zmalloc_socket(name, ETHER_ADDR_LEN, 0,\n>diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c\n>b/lib/librte_pmd_bond/rte_eth_bond_pmd.c\n>index d72d6ed..cd3eecf 100644\n>--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c\n>+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c\n>@@ -921,6 +921,7 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum\n>rte_eth_event_type type,\n>       struct rte_eth_link link;\n>\n>       int i, valid_slave = 0, active_pos = -1;\n>+      uint8_t lsc_flag = 0;\n>\n>       if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL)\n>               return;\n>@@ -966,6 +967,7 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum\n>rte_eth_event_type type,\n>                       /* If first active slave, then change link status */\n>                       bonded_eth_dev->data->dev_link.link_status = 1;\n>                       internals->current_primary_port = port_id;\n>+                      lsc_flag = 1;\n>\n>                       /* Inherit eth dev link properties from first active slave */\n>                       link_properties_set(bonded_eth_dev,\n>@@ -990,6 +992,7 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum\n>rte_eth_event_type type,\n>               /* No active slaves, change link status to down and reset other\n>                * link properties */\n>               if (internals->active_slave_count < 1) {\n>+                      lsc_flag = 1;\n>                       bonded_eth_dev->data->dev_link.link_status = 0;\n>\n>                       link_properties_reset(bonded_eth_dev);\n>@@ -1005,6 +1008,9 @@ bond_ethdev_lsc_event_callback(uint8_t port_id,\n>enum rte_eth_event_type type,\n>                               internals->current_primary_port = internals->primary_port;\n>               }\n>       }\n>+\n>+      if (lsc_flag)\n>+              _rte_eth_dev_callback_process(bonded_eth_dev, RTE_ETH_EVENT_INTR_LSC);\n> }\n>\n> struct eth_dev_ops default_dev_ops = {\n>--\n>1.7.0.7\n>",
        "headers": {
            "Thread-Index": "Ac+8tLQOcbo1ty7ZRxSG1kGB/n3Eug==",
            "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
            "X-MS-Has-Attach": "",
            "Date": "Wed, 20 Aug 2014 15:24:10 -0500",
            "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
            "In-Reply-To": "<1408456313-28812-2-git-send-email-declan.doherty@intel.com>",
            "Message-ID": "<D01A7BF4.27B3%rsanford@akamai.com>",
            "X-BeenThere": "dev@dpdk.org",
            "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
            "Accept-Language": "en-US",
            "References": "<1408456313-28812-1-git-send-email-declan.doherty@intel.com>\n\t<1408456313-28812-2-git-send-email-declan.doherty@intel.com>",
            "X-MS-TNEF-Correlator": "",
            "Return-Path": "<rsanford@akamai.com>",
            "To": "Declan Doherty <declan.doherty@intel.com>, \"dev@dpdk.org\" <dev@dpdk.org>",
            "user-agent": "Microsoft-MacOutlook/14.4.3.140616",
            "MIME-Version": "1.0",
            "Received": [
                "from prod-mail-xrelay06.akamai.com (prod-mail-xrelay06.akamai.com\n\t[96.6.114.98]) by dpdk.org (Postfix) with ESMTP id 2C2055932\n\tfor <dev@dpdk.org>; Wed, 20 Aug 2014 22:20:40 +0200 (CEST)",
                "from prod-mail-xrelay06.akamai.com (localhost.localdomain\n\t[127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id 22DC0165830;\n\tWed, 20 Aug 2014 20:24:13 +0000 (GMT)",
                "from prod-mail-relay09.akamai.com (prod-mail-relay09.akamai.com\n\t[172.27.22.68])\n\tby prod-mail-xrelay06.akamai.com (Postfix) with ESMTP id 17CEA1656CA; \n\tWed, 20 Aug 2014 20:24:13 +0000 (GMT)",
                "from ustx2ex-cashub.dfw01.corp.akamai.com\n\t(ustx2ex-cashub7.dfw01.corp.akamai.com [172.27.25.73])\n\tby prod-mail-relay09.akamai.com (Postfix) with ESMTP id 153361E05C;\n\tWed, 20 Aug 2014 20:24:13 +0000 (GMT)",
                "from USMBX2.msg.corp.akamai.com ([169.254.1.85]) by\n\tustx2ex-cashub7.dfw01.corp.akamai.com ([172.27.25.73]) with mapi;\n\tWed, 20 Aug 2014 15:24:12 -0500"
            ],
            "From": "\"Sanford, Robert\" <rsanford@akamai.com>",
            "Precedence": "list",
            "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
            "Content-Transfer-Encoding": "quoted-printable",
            "Subject": "Re: [dpdk-dev] [PATCH 1/6] bond: link status interrupt support",
            "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
            "X-List-Received-Date": "Wed, 20 Aug 2014 20:20:40 -0000",
            "acceptlanguage": "en-US",
            "Content-Language": "en-US",
            "Content-Type": "text/plain; charset=\"us-ascii\"",
            "List-Post": "<mailto:dev@dpdk.org>",
            "Thread-Topic": "[dpdk-dev] [PATCH 1/6] bond: link status interrupt support",
            "X-Mailman-Version": "2.1.15"
        }
    }
]