X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsfc%2Fsfc_flow.c;h=c3ea43a6fb001614786fec713853472c4d3bf094;hb=e16408499412e67a6afab8eca3d7496b770ac0e9;hp=ae36934e0bdeb5a4084a0bad665770d8ef86cc39;hpb=e01f84f42cad7cb05edbf9ddea98ce8c1a519814;p=dpdk.git diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index ae36934e0b..c3ea43a6fb 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -1,4 +1,6 @@ /*- + * BSD LICENSE + * * Copyright (c) 2017 Solarflare Communications Inc. * All rights reserved. * @@ -205,8 +207,10 @@ sfc_flow_parse_void(__rte_unused const struct rte_flow_item *item, * * @param item[in] * Item specification. Only source and destination addresses and - * Ethernet type fields are supported. If the mask is NULL, default - * mask will be used. Ranging is not supported. + * Ethernet type fields are supported. In addition to full and + * empty masks of destination address, individual/group mask is + * also supported. If the mask is NULL, default mask will be used. + * Ranging is not supported. * @param efx_spec[in, out] * EFX filter specification to update. * @param[out] error @@ -225,6 +229,9 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, .src.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, .type = 0xffff, }; + const uint8_t ig_mask[EFX_MAC_ADDR_LEN] = { + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + }; rc = sfc_flow_parse_init(item, (const void **)&spec, @@ -244,6 +251,14 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, efx_spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC; rte_memcpy(efx_spec->efs_loc_mac, spec->dst.addr_bytes, EFX_MAC_ADDR_LEN); + } else if (memcmp(mask->dst.addr_bytes, ig_mask, + EFX_MAC_ADDR_LEN) == 0) { + if (is_unicast_ether_addr(&spec->dst)) + efx_spec->efs_match_flags |= + EFX_FILTER_MATCH_UNKNOWN_UCAST_DST; + else + efx_spec->efs_match_flags |= + EFX_FILTER_MATCH_UNKNOWN_MCAST_DST; } else if (!is_zero_ether_addr(&mask->dst)) { goto fail_bad_mask; } @@ -822,8 +837,7 @@ sfc_flow_parse_pattern(const struct rte_flow_item pattern[], return -rte_errno; } - for (; pattern != NULL && - pattern->type != RTE_FLOW_ITEM_TYPE_END; pattern++) { + for (; pattern->type != RTE_FLOW_ITEM_TYPE_END; pattern++) { item = sfc_flow_get_item(pattern->type); if (item == NULL) { rte_flow_error_set(error, ENOTSUP, @@ -853,13 +867,6 @@ sfc_flow_parse_pattern(const struct rte_flow_item pattern[], prev_layer = item->layer; } - if (pattern == NULL) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, NULL, - "NULL item"); - return -rte_errno; - } - return 0; }