git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus/pci: fix Windows kernel driver categories
[dpdk.git]
/
drivers
/
net
/
e1000
/
igb_flow.c
diff --git
a/drivers/net/e1000/igb_flow.c
b/drivers/net/e1000/igb_flow.c
index
d1c0b4b
..
33f6b1d
100644
(file)
--- a/
drivers/net/e1000/igb_flow.c
+++ b/
drivers/net/e1000/igb_flow.c
@@
-15,8
+15,8
@@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <
rte_
ethdev_driver.h>
-#include <
rte_
ethdev_pci.h>
+#include <ethdev_driver.h>
+#include <ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
#include <rte_atomic.h>
#include <rte_memory.h>
#include <rte_eal.h>
#include <rte_atomic.h>
@@
-49,6
+49,13
@@
#define IGB_FLEX_RAW_NUM 12
#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
/**
* Please aware there's an asumption for all the parsers.
* rte_flow_item is using big endian, rte_flow_attr and
@@
-379,6
+386,15
@@
cons_parse_ntuple_filter(const struct rte_flow_attr *attr,
return -rte_errno;
}
return -rte_errno;
}
+ /* not supported */
+ if (attr->transfer) {
+ memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+ attr, "No support for transfer.");
+ return -rte_errno;
+ }
+
if (attr->priority > 0xFFFF) {
memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
rte_flow_error_set(error, EINVAL,
if (attr->priority > 0xFFFF) {
memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
rte_flow_error_set(error, EINVAL,
@@
-539,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.
*/
* 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");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item, "Invalid ether address mask");
@@
-558,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 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 {
filter->mac_addr = eth_spec->dst;
filter->flags |= RTE_ETHTYPE_FLAGS_MAC;
} else {
@@
-623,6
+639,14
@@
cons_parse_ethertype_filter(const struct rte_flow_attr *attr,
return -rte_errno;
}
return -rte_errno;
}
+ /* Not supported */
+ if (attr->transfer) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+ attr, "No support for transfer.");
+ return -rte_errno;
+ }
+
/* Not supported */
if (attr->priority) {
rte_flow_error_set(error, EINVAL,
/* Not supported */
if (attr->priority) {
rte_flow_error_set(error, EINVAL,
@@
-683,8
+707,8
@@
igb_parse_ethertype_filter(struct rte_eth_dev *dev,
}
}
}
}
- if (filter->ether_type ==
ETHER_TYPE_IPv
4 ||
- filter->ether_type ==
ETHER_TYPE_IPv
6) {
+ if (filter->ether_type ==
RTE_ETHER_TYPE_IPV
4 ||
+ filter->ether_type ==
RTE_ETHER_TYPE_IPV
6) {
memset(filter, 0, sizeof(struct rte_eth_ethertype_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
memset(filter, 0, sizeof(struct rte_eth_ethertype_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@
-849,13
+873,13
@@
cons_parse_syn_filter(const struct rte_flow_attr *attr,
tcp_spec = item->spec;
tcp_mask = item->mask;
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.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) {
tcp_mask->hdr.rx_win ||
tcp_mask->hdr.cksum ||
tcp_mask->hdr.tcp_urp) {
@@
-923,6
+947,15
@@
cons_parse_syn_filter(const struct rte_flow_attr *attr,
return -rte_errno;
}
return -rte_errno;
}
+ /* not supported */
+ if (attr->transfer) {
+ memset(filter, 0, sizeof(struct rte_eth_syn_filter));
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+ attr, "No support for transfer.");
+ return -rte_errno;
+ }
+
/* Support 2 priorities, the lowest or highest. */
if (!attr->priority) {
filter->hig_pri = 0;
/* Support 2 priorities, the lowest or highest. */
if (!attr->priority) {
filter->hig_pri = 0;
@@
-1008,7
+1041,7
@@
static int
cons_parse_flex_filter(const struct rte_flow_attr *attr,
const struct rte_flow_item pattern[],
const struct rte_flow_action actions[],
cons_parse_flex_filter(const struct rte_flow_attr *attr,
const struct rte_flow_item pattern[],
const struct rte_flow_action actions[],
- struct
rte_eth
_flex_filter *filter,
+ struct
igb
_flex_filter *filter,
struct rte_flow_error *error)
{
const struct rte_flow_item *item;
struct rte_flow_error *error)
{
const struct rte_flow_item *item;
@@
-1069,7
+1102,7
@@
item_loop:
if (!raw_mask->length ||
!raw_mask->relative) {
if (!raw_mask->length ||
!raw_mask->relative) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item, "Not supported by flex filter");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item, "Not supported by flex filter");
@@
-1083,7
+1116,7
@@
item_loop:
for (j = 0; j < raw_spec->length; j++) {
if (raw_mask->pattern[j] != 0xFF) {
for (j = 0; j < raw_spec->length; j++) {
if (raw_mask->pattern[j] != 0xFF) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item, "Not supported by flex filter");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item, "Not supported by flex filter");
@@
-1107,8
+1140,8
@@
item_loop:
}
if ((raw_spec->length + offset + total_offset) >
}
if ((raw_spec->length + offset + total_offset) >
-
RTE
_FLEX_FILTER_MAXLEN) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+
IGB
_FLEX_FILTER_MAXLEN) {
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item, "Not supported by flex filter");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item, "Not supported by flex filter");
@@
-1171,7
+1204,7
@@
item_loop:
/* check if the first not void action is QUEUE. */
NEXT_ITEM_OF_ACTION(act, actions, index);
if (act->type != RTE_FLOW_ACTION_TYPE_QUEUE) {
/* check if the first not void action is QUEUE. */
NEXT_ITEM_OF_ACTION(act, actions, index);
if (act->type != RTE_FLOW_ACTION_TYPE_QUEUE) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
act, "Not supported action.");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
act, "Not supported action.");
@@
-1185,7
+1218,7
@@
item_loop:
index++;
NEXT_ITEM_OF_ACTION(act, actions, index);
if (act->type != RTE_FLOW_ACTION_TYPE_END) {
index++;
NEXT_ITEM_OF_ACTION(act, actions, index);
if (act->type != RTE_FLOW_ACTION_TYPE_END) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
act, "Not supported action.");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
act, "Not supported action.");
@@
-1195,7
+1228,7
@@
item_loop:
/* parse attr */
/* must be input direction */
if (!attr->ingress) {
/* parse attr */
/* must be input direction */
if (!attr->ingress) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,
attr, "Only support ingress.");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,
attr, "Only support ingress.");
@@
-1204,15
+1237,24
@@
item_loop:
/* not supported */
if (attr->egress) {
/* not supported */
if (attr->egress) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
attr, "Not support egress.");
return -rte_errno;
}
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
attr, "Not support egress.");
return -rte_errno;
}
+ /* not supported */
+ if (attr->transfer) {
+ memset(filter, 0, sizeof(struct igb_flex_filter));
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+ attr, "No support for transfer.");
+ return -rte_errno;
+ }
+
if (attr->priority > 0xFFFF) {
if (attr->priority > 0xFFFF) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,
attr, "Error priority.");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,
attr, "Error priority.");
@@
-1229,7
+1271,7
@@
igb_parse_flex_filter(struct rte_eth_dev *dev,
const struct rte_flow_attr *attr,
const struct rte_flow_item pattern[],
const struct rte_flow_action actions[],
const struct rte_flow_attr *attr,
const struct rte_flow_item pattern[],
const struct rte_flow_action actions[],
- struct
rte_eth
_flex_filter *filter,
+ struct
igb
_flex_filter *filter,
struct rte_flow_error *error)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct rte_flow_error *error)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@
-1241,7
+1283,7
@@
igb_parse_flex_filter(struct rte_eth_dev *dev,
actions, filter, error);
if (filter->queue >= IGB_MAX_RX_QUEUE_NUM) {
actions, filter, error);
if (filter->queue >= IGB_MAX_RX_QUEUE_NUM) {
- memset(filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(filter, 0, sizeof(struct
igb
_flex_filter));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
NULL, "queue number not supported by flex filter");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
NULL, "queue number not supported by flex filter");
@@
-1272,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 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;
const struct rte_flow_action *act;
const struct rte_flow_action_rss *rss;
uint16_t n, index;
@@
-1322,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");
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");
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");
return rte_flow_error_set
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act,
"RSS context initialization failure");
@@
-1335,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) {
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.");
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
act, "Not supported action.");
@@
-1361,6
+1407,15
@@
igb_parse_rss_filter(struct rte_eth_dev *dev,
return -rte_errno;
}
return -rte_errno;
}
+ /* not supported */
+ if (attr->transfer) {
+ memset(rss_conf, 0, sizeof(struct igb_rte_flow_rss_conf));
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+ attr, "No support for transfer.");
+ return -rte_errno;
+ }
+
if (attr->priority > 0xFFFF) {
memset(rss_conf, 0, sizeof(struct igb_rte_flow_rss_conf));
rte_flow_error_set(error, EINVAL,
if (attr->priority > 0xFFFF) {
memset(rss_conf, 0, sizeof(struct igb_rte_flow_rss_conf));
rte_flow_error_set(error, EINVAL,
@@
-1389,7
+1444,7
@@
igb_flow_create(struct rte_eth_dev *dev,
struct rte_eth_ntuple_filter ntuple_filter;
struct rte_eth_ethertype_filter ethertype_filter;
struct rte_eth_syn_filter syn_filter;
struct rte_eth_ntuple_filter ntuple_filter;
struct rte_eth_ethertype_filter ethertype_filter;
struct rte_eth_syn_filter syn_filter;
- struct
rte_eth
_flex_filter flex_filter;
+ struct
igb
_flex_filter flex_filter;
struct igb_rte_flow_rss_conf rss_conf;
struct rte_flow *flow = NULL;
struct igb_ntuple_filter_ele *ntuple_filter_ptr;
struct igb_rte_flow_rss_conf rss_conf;
struct rte_flow *flow = NULL;
struct igb_ntuple_filter_ele *ntuple_filter_ptr;
@@
-1494,7
+1549,7
@@
igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
goto out;
}
- memset(&flex_filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(&flex_filter, 0, sizeof(struct
igb
_flex_filter));
ret = igb_parse_flex_filter(dev, attr, pattern,
actions, &flex_filter, error);
if (!ret) {
ret = igb_parse_flex_filter(dev, attr, pattern,
actions, &flex_filter, error);
if (!ret) {
@@
-1509,7
+1564,7
@@
igb_flow_create(struct rte_eth_dev *dev,
rte_memcpy(&flex_filter_ptr->filter_info,
&flex_filter,
rte_memcpy(&flex_filter_ptr->filter_info,
&flex_filter,
- sizeof(struct
rte_eth
_flex_filter));
+ sizeof(struct
igb
_flex_filter));
TAILQ_INSERT_TAIL(&igb_filter_flex_list,
flex_filter_ptr, entries);
flow->rule = flex_filter_ptr;
TAILQ_INSERT_TAIL(&igb_filter_flex_list,
flex_filter_ptr, entries);
flow->rule = flex_filter_ptr;
@@
-1530,7
+1585,7
@@
igb_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
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);
&rss_conf.conf);
TAILQ_INSERT_TAIL(&igb_filter_rss_list,
rss_filter_ptr, entries);
@@
-1566,7
+1621,7
@@
igb_flow_validate(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_ntuple_filter ntuple_filter;
struct rte_eth_ethertype_filter ethertype_filter;
struct rte_eth_syn_filter syn_filter;
struct rte_eth_ntuple_filter ntuple_filter;
struct rte_eth_ethertype_filter ethertype_filter;
struct rte_eth_syn_filter syn_filter;
- struct
rte_eth
_flex_filter flex_filter;
+ struct
igb
_flex_filter flex_filter;
struct igb_rte_flow_rss_conf rss_conf;
int ret;
struct igb_rte_flow_rss_conf rss_conf;
int ret;
@@
-1588,7
+1643,7
@@
igb_flow_validate(__rte_unused struct rte_eth_dev *dev,
if (!ret)
return 0;
if (!ret)
return 0;
- memset(&flex_filter, 0, sizeof(struct
rte_eth
_flex_filter));
+ memset(&flex_filter, 0, sizeof(struct
igb
_flex_filter));
ret = igb_parse_flex_filter(dev, attr, pattern,
actions, &flex_filter, error);
if (!ret)
ret = igb_parse_flex_filter(dev, attr, pattern,
actions, &flex_filter, error);
if (!ret)