- if (a[ODP_DP_ATTR_SAMPLING]) {
- dp->sampling = nl_attr_get(a[ODP_DP_ATTR_SAMPLING]);
- }
-
- if (a[ODP_DP_ATTR_MCGROUPS]) {
- static const struct nl_policy odp_mcgroup_policy[] = {
- [ODP_PACKET_CMD_MISS] = { .type = NL_A_U32, .optional = true },
- [ODP_PACKET_CMD_ACTION] = { .type = NL_A_U32, .optional = true },
- [ODP_PACKET_CMD_SAMPLE] = { .type = NL_A_U32, .optional = true },
- };
-
- struct nlattr *mcgroups[ARRAY_SIZE(odp_mcgroup_policy)];
-
- if (!nl_parse_nested(a[ODP_DP_ATTR_MCGROUPS], odp_mcgroup_policy,
- mcgroups, ARRAY_SIZE(odp_mcgroup_policy))) {
- return EINVAL;
- }
-
- if (mcgroups[ODP_PACKET_CMD_MISS]) {
- dp->mcgroups[DPIF_UC_MISS]
- = nl_attr_get_u32(mcgroups[ODP_PACKET_CMD_MISS]);
- }
- if (mcgroups[ODP_PACKET_CMD_ACTION]) {
- dp->mcgroups[DPIF_UC_ACTION]
- = nl_attr_get_u32(mcgroups[ODP_PACKET_CMD_ACTION]);
- }
- if (mcgroups[ODP_PACKET_CMD_SAMPLE]) {
- dp->mcgroups[DPIF_UC_SAMPLE]
- = nl_attr_get_u32(mcgroups[ODP_PACKET_CMD_SAMPLE]);
- }