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
net/pcap: truncate packet if it is too large
[dpdk.git]
/
lib
/
librte_ethdev
/
rte_flow.c
diff --git
a/lib/librte_ethdev/rte_flow.c
b/lib/librte_ethdev/rte_flow.c
index
8ec9c90
..
87a3e8c
100644
(file)
--- a/
lib/librte_ethdev/rte_flow.c
+++ b/
lib/librte_ethdev/rte_flow.c
@@
-218,12
+218,21
@@
rte_flow_expand_rss_item_complete(const struct rte_flow_item *item)
{
enum rte_flow_item_type ret = RTE_FLOW_ITEM_TYPE_VOID;
uint16_t ether_type = 0;
{
enum rte_flow_item_type ret = RTE_FLOW_ITEM_TYPE_VOID;
uint16_t ether_type = 0;
+ uint16_t ether_type_m;
uint8_t ip_next_proto = 0;
uint8_t ip_next_proto = 0;
+ uint8_t ip_next_proto_m;
if (item == NULL || item->spec == NULL)
return ret;
switch (item->type) {
case RTE_FLOW_ITEM_TYPE_ETH:
if (item == NULL || item->spec == NULL)
return ret;
switch (item->type) {
case RTE_FLOW_ITEM_TYPE_ETH:
+ if (item->mask)
+ ether_type_m = ((const struct rte_flow_item_eth *)
+ (item->mask))->type;
+ else
+ ether_type_m = rte_flow_item_eth_mask.type;
+ if (ether_type_m != RTE_BE16(0xFFFF))
+ break;
ether_type = ((const struct rte_flow_item_eth *)
(item->spec))->type;
if (rte_be_to_cpu_16(ether_type) == RTE_ETHER_TYPE_IPV4)
ether_type = ((const struct rte_flow_item_eth *)
(item->spec))->type;
if (rte_be_to_cpu_16(ether_type) == RTE_ETHER_TYPE_IPV4)
@@
-234,6
+243,13
@@
rte_flow_expand_rss_item_complete(const struct rte_flow_item *item)
ret = RTE_FLOW_ITEM_TYPE_VLAN;
break;
case RTE_FLOW_ITEM_TYPE_VLAN:
ret = RTE_FLOW_ITEM_TYPE_VLAN;
break;
case RTE_FLOW_ITEM_TYPE_VLAN:
+ if (item->mask)
+ ether_type_m = ((const struct rte_flow_item_vlan *)
+ (item->mask))->inner_type;
+ else
+ ether_type_m = rte_flow_item_vlan_mask.inner_type;
+ if (ether_type_m != RTE_BE16(0xFFFF))
+ break;
ether_type = ((const struct rte_flow_item_vlan *)
(item->spec))->inner_type;
if (rte_be_to_cpu_16(ether_type) == RTE_ETHER_TYPE_IPV4)
ether_type = ((const struct rte_flow_item_vlan *)
(item->spec))->inner_type;
if (rte_be_to_cpu_16(ether_type) == RTE_ETHER_TYPE_IPV4)
@@
-244,6
+260,14
@@
rte_flow_expand_rss_item_complete(const struct rte_flow_item *item)
ret = RTE_FLOW_ITEM_TYPE_VLAN;
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
ret = RTE_FLOW_ITEM_TYPE_VLAN;
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
+ if (item->mask)
+ ip_next_proto_m = ((const struct rte_flow_item_ipv4 *)
+ (item->mask))->hdr.next_proto_id;
+ else
+ ip_next_proto_m =
+ rte_flow_item_ipv4_mask.hdr.next_proto_id;
+ if (ip_next_proto_m != 0xFF)
+ break;
ip_next_proto = ((const struct rte_flow_item_ipv4 *)
(item->spec))->hdr.next_proto_id;
if (ip_next_proto == IPPROTO_UDP)
ip_next_proto = ((const struct rte_flow_item_ipv4 *)
(item->spec))->hdr.next_proto_id;
if (ip_next_proto == IPPROTO_UDP)
@@
-256,6
+280,14
@@
rte_flow_expand_rss_item_complete(const struct rte_flow_item *item)
ret = RTE_FLOW_ITEM_TYPE_IPV6;
break;
case RTE_FLOW_ITEM_TYPE_IPV6:
ret = RTE_FLOW_ITEM_TYPE_IPV6;
break;
case RTE_FLOW_ITEM_TYPE_IPV6:
+ if (item->mask)
+ ip_next_proto_m = ((const struct rte_flow_item_ipv6 *)
+ (item->mask))->hdr.proto;
+ else
+ ip_next_proto_m =
+ rte_flow_item_ipv6_mask.hdr.proto;
+ if (ip_next_proto_m != 0xFF)
+ break;
ip_next_proto = ((const struct rte_flow_item_ipv6 *)
(item->spec))->hdr.proto;
if (ip_next_proto == IPPROTO_UDP)
ip_next_proto = ((const struct rte_flow_item_ipv6 *)
(item->spec))->hdr.proto;
if (ip_next_proto == IPPROTO_UDP)
@@
-1039,6
+1071,7
@@
rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size,
int elt = 0;
const struct rte_flow_item *last_item = NULL;
int elt = 0;
const struct rte_flow_item *last_item = NULL;
+ memset(&missed_item, 0, sizeof(missed_item));
lsize = offsetof(struct rte_flow_expand_rss, entry) +
elt_n * sizeof(buf->entry[0]);
if (lsize <= size) {
lsize = offsetof(struct rte_flow_expand_rss, entry) +
elt_n * sizeof(buf->entry[0]);
if (lsize <= size) {