src/dpdk/drivers/net/sfc/sfc_mae.c
static int
sfc_mae_actions_bundle_sync(const struct rte_flow_action *action,
			    struct sfc_mae_actions_bundle *bundle,
			    efx_mae_actions_t *spec,
			    struct rte_flow_error *error)
{
	enum sfc_mae_actions_bundle_type bundle_type_new;
	int rc;

	switch (action->type) {
	case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
	case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
	case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
		bundle_type_new = SFC_MAE_ACTIONS_BUNDLE_VLAN_PUSH;
		break;
	default:
		/*
		 * Self-sufficient actions, including END, are handled in this
		 * case. No checks for unsupported actions are needed here
		 * because parsing doesn't occur at this point.
		 */
		bundle_type_new = SFC_MAE_ACTIONS_BUNDLE_EMPTY;
		break;
	}

	if (bundle_type_new != bundle->type ||
	    (bundle->actions_mask & (1ULL << action->type)) != 0) {
		rc = sfc_mae_actions_bundle_submit(bundle, spec);
		if (rc != 0)
			goto fail_submit;

		memset(bundle, 0, sizeof(*bundle));
	}

	bundle->type = bundle_type_new;

	return 0;

fail_submit:
	return rte_flow_error_set(error, rc,
			RTE_FLOW_ERROR_TYPE_ACTION, NULL,
			"Failed to request the (group of) action(s)");
}
/*
 * Given the type of the next RTE flow action in the line, decide
 * whether a new bundle is about to start, and, if this is the case,
 * submit and reset the current bundle.
 */
Given the type of the next RTE flow action in the line, decide
whether a new bundle is about to start, and, if this is the case,
submit and reset the current bundle.
Given the type of the next RTE flow action in the line decide whether a new bundle is about to start and if this is the case submit and reset the current bundle .
static int
sfc_mae_actions_bundle_sync(const struct rte_flow_action *action,
			    struct sfc_mae_actions_bundle *bundle,
			    efx_mae_actions_t *spec,
			    struct rte_flow_error *error)
{
	enum sfc_mae_actions_bundle_type bundle_type_new;
	int rc;
	switch (action->type) {
	case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
	case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
	case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
		bundle_type_new = SFC_MAE_ACTIONS_BUNDLE_VLAN_PUSH;
		break;
	default:
		bundle_type_new = SFC_MAE_ACTIONS_BUNDLE_EMPTY;
		break;
	}
	if (bundle_type_new != bundle->type ||
	    (bundle->actions_mask & (1ULL << action->type)) != 0) {
		rc = sfc_mae_actions_bundle_submit(bundle, spec);
		if (rc != 0)
			goto fail_submit;
		memset(bundle, 0, sizeof(*bundle));
	}
	bundle->type = bundle_type_new;
	return 0;
fail_submit:
	return rte_flow_error_set(error, rc,
			RTE_FLOW_ERROR_TYPE_ACTION, NULL,
			"Failed to request the (group of) action(s)");
}
static int sfc_mae_actions_bundle_sync ( const struct rte_flow_action * action , struct sfc_mae_actions_bundle * bundle , efx_mae_actions_t * spec , struct rte_flow_error * error ) { enum sfc_mae_actions_bundle_type bundle_type_new ; int rc ; switch ( action -> type ) { case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN : case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID : case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP : bundle_type_new = SFC_MAE_ACTIONS_BUNDLE_VLAN_PUSH ; break ; default : bundle_type_new = SFC_MAE_ACTIONS_BUNDLE_EMPTY ; break ; } if ( bundle_type_new != bundle -> type || ( bundle -> actions_mask & ( 1ULL << action -> type ) ) != 0 ) { rc = sfc_mae_actions_bundle_submit ( bundle , spec ) ; if ( rc != 0 ) goto fail_submit ; memset ( bundle , 0 , sizeof ( * bundle ) ) ; } bundle -> type = bundle_type_new ; return 0 ; fail_submit : return rte_flow_error_set ( error , rc , RTE_FLOW_ERROR_TYPE_ACTION , NULL , " " ) ; }
Given the type of the next RTE flow action in the line, decide
 whether a new bundle is about to start, and, if this is the case,
 submit and reset the current bundle.
Given the type of the next RTE flow action in the line decide whether a new bundle is about to start and if this is the case submit and reset the current bundle .
/*
		 * Self-sufficient actions, including END, are handled in this
		 * case. No checks for unsupported actions are needed here
		 * because parsing doesn't occur at this point.
		 */