X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fpipeline%2Fobj.c;h=b79f044ac761654872077121c82a01971798c901;hb=7c0c63c9a53964d40b27da618ab94303f28ea92e;hp=467cda5a6daccd1cc7720cf1d7f346d146307861;hpb=e2b8dc5256c0c6d567c136401de67d3249b9086b;p=dpdk.git diff --git a/examples/pipeline/obj.c b/examples/pipeline/obj.c index 467cda5a6d..b79f044ac7 100644 --- a/examples/pipeline/obj.c +++ b/examples/pipeline/obj.c @@ -16,12 +16,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include @@ -133,8 +127,8 @@ mempool_find(struct obj *obj, const char *name) static struct rte_eth_conf port_conf_default = { .link_speeds = 0, .rxmode = { - .mq_mode = ETH_MQ_RX_NONE, - .max_rx_pkt_len = 9000, /* Jumbo frame max packet len */ + .mq_mode = RTE_ETH_MQ_RX_NONE, + .mtu = 9000 - (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN), /* Jumbo frame MTU */ .split_hdr_size = 0, /* Header split buffer size */ }, .rx_adv_conf = { @@ -145,12 +139,12 @@ static struct rte_eth_conf port_conf_default = { }, }, .txmode = { - .mq_mode = ETH_MQ_TX_NONE, + .mq_mode = RTE_ETH_MQ_TX_NONE, }, .lpbk_mode = 0, }; -#define RETA_CONF_SIZE (ETH_RSS_RETA_SIZE_512 / RTE_RETA_GROUP_SIZE) +#define RETA_CONF_SIZE (RTE_ETH_RSS_RETA_SIZE_512 / RTE_ETH_RETA_GROUP_SIZE) static int rss_setup(uint16_t port_id, @@ -165,11 +159,11 @@ rss_setup(uint16_t port_id, memset(reta_conf, 0, sizeof(reta_conf)); for (i = 0; i < reta_size; i++) - reta_conf[i / RTE_RETA_GROUP_SIZE].mask = UINT64_MAX; + reta_conf[i / RTE_ETH_RETA_GROUP_SIZE].mask = UINT64_MAX; for (i = 0; i < reta_size; i++) { - uint32_t reta_id = i / RTE_RETA_GROUP_SIZE; - uint32_t reta_pos = i % RTE_RETA_GROUP_SIZE; + uint32_t reta_id = i / RTE_ETH_RETA_GROUP_SIZE; + uint32_t reta_pos = i % RTE_ETH_RETA_GROUP_SIZE; uint32_t rss_qs_pos = i % rss->n_queues; reta_conf[reta_id].reta[reta_pos] = @@ -227,7 +221,7 @@ link_create(struct obj *obj, const char *name, struct link_params *params) rss = params->rx.rss; if (rss) { if ((port_info.reta_size == 0) || - (port_info.reta_size > ETH_RSS_RETA_SIZE_512)) + (port_info.reta_size > RTE_ETH_RSS_RETA_SIZE_512)) return NULL; if ((rss->n_queues == 0) || @@ -245,9 +239,9 @@ link_create(struct obj *obj, const char *name, struct link_params *params) /* Port */ memcpy(&port_conf, &port_conf_default, sizeof(port_conf)); if (rss) { - port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS; + port_conf.rxmode.mq_mode = RTE_ETH_MQ_RX_RSS; port_conf.rx_adv_conf.rss_conf.rss_hf = - (ETH_RSS_IP | ETH_RSS_TCP | ETH_RSS_UDP) & + (RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP) & port_info.flow_type_rss_offloads; } @@ -356,7 +350,7 @@ link_is_up(struct obj *obj, const char *name) if (rte_eth_link_get(link->port_id, &link_params) < 0) return 0; - return (link_params.link_status == ETH_LINK_DOWN) ? 0 : 1; + return (link_params.link_status == RTE_ETH_LINK_DOWN) ? 0 : 1; } struct link * @@ -543,70 +537,6 @@ pipeline_create(struct obj *obj, const char *name, int numa_node) if (status) goto error; - status = rte_swx_pipeline_port_in_type_register(p, - "ethdev", - &rte_swx_port_ethdev_reader_ops); - if (status) - goto error; - - status = rte_swx_pipeline_port_out_type_register(p, - "ethdev", - &rte_swx_port_ethdev_writer_ops); - if (status) - goto error; - - status = rte_swx_pipeline_port_in_type_register(p, - "ring", - &rte_swx_port_ring_reader_ops); - if (status) - goto error; - - status = rte_swx_pipeline_port_out_type_register(p, - "ring", - &rte_swx_port_ring_writer_ops); - if (status) - goto error; - -#ifdef RTE_PORT_PCAP - status = rte_swx_pipeline_port_in_type_register(p, - "source", - &rte_swx_port_source_ops); - if (status) - goto error; -#endif - - status = rte_swx_pipeline_port_out_type_register(p, - "sink", - &rte_swx_port_sink_ops); - if (status) - goto error; - - status = rte_swx_pipeline_port_in_type_register(p, - "fd", - &rte_swx_port_fd_reader_ops); - if (status) - goto error; - - status = rte_swx_pipeline_port_out_type_register(p, - "fd", - &rte_swx_port_fd_writer_ops); - if (status) - goto error; - - status = rte_swx_pipeline_table_type_register(p, - "exact", - RTE_SWX_TABLE_MATCH_EXACT, - &rte_swx_table_exact_match_ops); - if (status) - goto error; - - status = rte_swx_pipeline_table_type_register(p, - "wildcard", - RTE_SWX_TABLE_MATCH_WILDCARD, - &rte_swx_table_wildcard_match_ops); - if (status) - goto error; - /* Node allocation */ pipeline = calloc(1, sizeof(struct pipeline)); if (pipeline == NULL)