X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Flink_status_interrupt%2Fmain.c;h=f4e3969a6bfbdf57cf6d4e99653678eb927cf248;hb=39f403e0d5bb;hp=97379fa3d6091a03b559563aa7835012213027db;hpb=9d5ca5323910591f2cafbac5070fcb5b6d02d022;p=dpdk.git diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index 97379fa3d6..f4e3969a6b 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -53,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -116,7 +114,7 @@ static const struct rte_eth_conf port_conf = { .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 0, /**< CRC stripped by hardware */ + .hw_strip_crc = 1, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -469,14 +467,16 @@ lsi_parse_args(int argc, char **argv) * Pointer to(address of) the parameters. * * @return - * void. + * int. */ -static void -lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param) +static int +lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, + void *ret_param) { struct rte_eth_link link; RTE_SET_USED(param); + RTE_SET_USED(ret_param); printf("\n\nIn registered callback...\n"); printf("Event type: %s\n", type == RTE_ETH_EVENT_INTR_LSC ? "LSC interrupt" : "unknown event"); @@ -488,6 +488,8 @@ lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param) ("full-duplex") : ("half-duplex")); } else printf("Port %d Link Down\n\n", port_id); + + return 0; } /* Check the link status of all ports in up to 9s, and print them finally */ @@ -646,6 +648,13 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", ret, (unsigned) portid); + ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, + &nb_txd); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "rte_eth_dev_adjust_nb_rx_tx_desc: err=%d, port=%u\n", + ret, (unsigned) portid); + /* register lsi interrupt callback, need to be after * rte_eth_dev_configure(). if (intr_conf.lsc == 0), no * lsc interrupt will be present, and below callback to