X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fe1000%2Figb_flow.c;h=43fef889b5f4b540fbc3ab3943714c7d3632c0d7;hb=2ec9392ba1543a06bae7f155469bdc3c1bd9b8b6;hp=0738529139f09f9641b4f78b3a3aa8fe4656bd58;hpb=76e9a55b5b8248f5b48d3819a7c878fa11d68726;p=dpdk.git diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c index 0738529139..43fef889b5 100644 --- a/drivers/net/e1000/igb_flow.c +++ b/drivers/net/e1000/igb_flow.c @@ -49,6 +49,13 @@ #define IGB_FLEX_RAW_NUM 12 +struct igb_flow_mem_list igb_flow_list; +struct igb_ntuple_filter_list igb_filter_ntuple_list; +struct igb_ethertype_filter_list igb_filter_ethertype_list; +struct igb_syn_filter_list igb_filter_syn_list; +struct igb_flex_filter_list igb_filter_flex_list; +struct igb_rss_filter_list igb_filter_rss_list; + /** * Please aware there's an asumption for all the parsers. * rte_flow_item is using big endian, rte_flow_attr and @@ -548,9 +555,9 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr, * Mask bits of destination MAC address must be full * of 1 or full of 0. */ - if (!is_zero_ether_addr(ð_mask->src) || - (!is_zero_ether_addr(ð_mask->dst) && - !is_broadcast_ether_addr(ð_mask->dst))) { + if (!rte_is_zero_ether_addr(ð_mask->src) || + (!rte_is_zero_ether_addr(ð_mask->dst) && + !rte_is_broadcast_ether_addr(ð_mask->dst))) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, "Invalid ether address mask"); @@ -567,7 +574,7 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr, /* If mask bits of destination MAC address * are full of 1, set RTE_ETHTYPE_FLAGS_MAC. */ - if (is_broadcast_ether_addr(ð_mask->dst)) { + if (rte_is_broadcast_ether_addr(ð_mask->dst)) { filter->mac_addr = eth_spec->dst; filter->flags |= RTE_ETHTYPE_FLAGS_MAC; } else { @@ -700,8 +707,8 @@ igb_parse_ethertype_filter(struct rte_eth_dev *dev, } } - if (filter->ether_type == ETHER_TYPE_IPv4 || - filter->ether_type == ETHER_TYPE_IPv6) { + if (filter->ether_type == RTE_ETHER_TYPE_IPV4 || + filter->ether_type == RTE_ETHER_TYPE_IPV6) { memset(filter, 0, sizeof(struct rte_eth_ethertype_filter)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -866,13 +873,13 @@ cons_parse_syn_filter(const struct rte_flow_attr *attr, tcp_spec = item->spec; tcp_mask = item->mask; - if (!(tcp_spec->hdr.tcp_flags & TCP_SYN_FLAG) || + if (!(tcp_spec->hdr.tcp_flags & RTE_TCP_SYN_FLAG) || tcp_mask->hdr.src_port || tcp_mask->hdr.dst_port || tcp_mask->hdr.sent_seq || tcp_mask->hdr.recv_ack || tcp_mask->hdr.data_off || - tcp_mask->hdr.tcp_flags != TCP_SYN_FLAG || + tcp_mask->hdr.tcp_flags != RTE_TCP_SYN_FLAG || tcp_mask->hdr.rx_win || tcp_mask->hdr.cksum || tcp_mask->hdr.tcp_urp) { @@ -1307,6 +1314,7 @@ igb_parse_rss_filter(struct rte_eth_dev *dev, struct igb_rte_flow_rss_conf *rss_conf, struct rte_flow_error *error) { + struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); const struct rte_flow_action *act; const struct rte_flow_action_rss *rss; uint16_t n, index; @@ -1357,11 +1365,14 @@ igb_parse_rss_filter(struct rte_eth_dev *dev, return rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, act, "RSS hash key must be exactly 40 bytes"); - if (rss->queue_num > RTE_DIM(rss_conf->queue)) + if (((hw->mac.type == e1000_82576) && + (rss->queue_num > IGB_MAX_RX_QUEUE_NUM_82576)) || + ((hw->mac.type != e1000_82576) && + (rss->queue_num > IGB_MAX_RX_QUEUE_NUM))) return rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, act, "too many queues for RSS context"); - if (igb_rss_conf_init(rss_conf, rss)) + if (igb_rss_conf_init(dev, rss_conf, rss)) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, "RSS context initialization failure"); @@ -1370,7 +1381,7 @@ igb_parse_rss_filter(struct rte_eth_dev *dev, index++; NEXT_ITEM_OF_ACTION(act, actions, index); if (act->type != RTE_FLOW_ACTION_TYPE_END) { - memset(rss_conf, 0, sizeof(struct rte_eth_rss_conf)); + memset(rss_conf, 0, sizeof(struct igb_rte_flow_rss_conf)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, "Not supported action."); @@ -1574,7 +1585,7 @@ igb_flow_create(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "failed to allocate memory"); goto out; } - igb_rss_conf_init(&rss_filter_ptr->filter_info, + igb_rss_conf_init(dev, &rss_filter_ptr->filter_info, &rss_conf.conf); TAILQ_INSERT_TAIL(&igb_filter_rss_list, rss_filter_ptr, entries);