src/dpdk/drivers/net/ixgbe/base/ixgbe_82599.c
s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
					union ixgbe_atr_input *input,
					union ixgbe_atr_input *input_mask,
					u16 soft_id, u8 queue, bool cloud_mode)
{
	s32 err = IXGBE_ERR_CONFIG;
	UNREFERENCED_1PARAMETER(cloud_mode);

	DEBUGFUNC("ixgbe_fdir_add_perfect_filter_82599");

	/*
	 * Check flow_type formatting, and bail out before we touch the hardware
	 * if there's a configuration issue
	 */
	switch (input->formatted.flow_type) {
	case IXGBE_ATR_FLOW_TYPE_IPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_IPV4:
		input_mask->formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK;
		if (input->formatted.dst_port || input->formatted.src_port) {
			DEBUGOUT(" Error on src/dst port\n");
			return IXGBE_ERR_CONFIG;
		}
		break;
	case IXGBE_ATR_FLOW_TYPE_SCTPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_SCTPV4:
		if (input->formatted.dst_port || input->formatted.src_port) {
			DEBUGOUT(" Error on src/dst port\n");
			return IXGBE_ERR_CONFIG;
		}
		/* fall through */
	case IXGBE_ATR_FLOW_TYPE_TCPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_TCPV4:
	case IXGBE_ATR_FLOW_TYPE_UDPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_UDPV4:
		input_mask->formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK |
						  IXGBE_ATR_L4TYPE_MASK;
		break;
	default:
		DEBUGOUT(" Error on flow type input\n");
		return err;
	}

	/* program input mask into the HW */
	err = ixgbe_fdir_set_input_mask_82599(hw, input_mask, cloud_mode);
	if (err)
		return err;

	/* apply mask and compute/store hash */
	ixgbe_atr_compute_perfect_hash_82599(input, input_mask);

	/* program filters to filter memory */
	return ixgbe_fdir_write_perfect_filter_82599(hw, input,
						     soft_id, queue, cloud_mode);
}
/**
 * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter
 * @hw: pointer to hardware structure
 * @input: input bitstream
 * @input_mask: mask for the input bitstream
 * @soft_id: software index for the filters
 * @queue: queue index to direct traffic to
 * @cloud_mode: unused
 *
 * Note that the caller to this function must lock before calling, since the
 * hardware writes must be protected from one another.
 **/


Note that the caller to this function must lock before calling, since the
hardware writes must be protected from one another.
Note that the caller to this function must lock before calling since the hardware writes must be protected from one another .
s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
					union ixgbe_atr_input *input,
					union ixgbe_atr_input *input_mask,
					u16 soft_id, u8 queue, bool cloud_mode)
{
	s32 err = IXGBE_ERR_CONFIG;
	UNREFERENCED_1PARAMETER(cloud_mode);
	DEBUGFUNC("ixgbe_fdir_add_perfect_filter_82599");
	switch (input->formatted.flow_type) {
	case IXGBE_ATR_FLOW_TYPE_IPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_IPV4:
		input_mask->formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK;
		if (input->formatted.dst_port || input->formatted.src_port) {
			DEBUGOUT(" Error on src/dst port\n");
			return IXGBE_ERR_CONFIG;
		}
		break;
	case IXGBE_ATR_FLOW_TYPE_SCTPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_SCTPV4:
		if (input->formatted.dst_port || input->formatted.src_port) {
			DEBUGOUT(" Error on src/dst port\n");
			return IXGBE_ERR_CONFIG;
		}
	case IXGBE_ATR_FLOW_TYPE_TCPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_TCPV4:
	case IXGBE_ATR_FLOW_TYPE_UDPV4:
	case IXGBE_ATR_FLOW_TYPE_TUNNELED_UDPV4:
		input_mask->formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK |
						  IXGBE_ATR_L4TYPE_MASK;
		break;
	default:
		DEBUGOUT(" Error on flow type input\n");
		return err;
	}
	err = ixgbe_fdir_set_input_mask_82599(hw, input_mask, cloud_mode);
	if (err)
		return err;
	ixgbe_atr_compute_perfect_hash_82599(input, input_mask);
	return ixgbe_fdir_write_perfect_filter_82599(hw, input,
						     soft_id, queue, cloud_mode);
}
s32 ixgbe_fdir_add_perfect_filter_82599 ( struct ixgbe_hw * hw , union ixgbe_atr_input * input , union ixgbe_atr_input * input_mask , u16 soft_id , u8 queue , bool cloud_mode ) { s32 err = IXGBE_ERR_CONFIG ; UNREFERENCED_1PARAMETER ( cloud_mode ) ; DEBUGFUNC ( " " ) ; switch ( input -> formatted . flow_type ) { case IXGBE_ATR_FLOW_TYPE_IPV4 : case IXGBE_ATR_FLOW_TYPE_TUNNELED_IPV4 : input_mask -> formatted . flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK ; if ( input -> formatted . dst_port || input -> formatted . src_port ) { DEBUGOUT ( " \n " ) ; return IXGBE_ERR_CONFIG ; } break ; case IXGBE_ATR_FLOW_TYPE_SCTPV4 : case IXGBE_ATR_FLOW_TYPE_TUNNELED_SCTPV4 : if ( input -> formatted . dst_port || input -> formatted . src_port ) { DEBUGOUT ( " \n " ) ; return IXGBE_ERR_CONFIG ; } case IXGBE_ATR_FLOW_TYPE_TCPV4 : case IXGBE_ATR_FLOW_TYPE_TUNNELED_TCPV4 : case IXGBE_ATR_FLOW_TYPE_UDPV4 : case IXGBE_ATR_FLOW_TYPE_TUNNELED_UDPV4 : input_mask -> formatted . flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK | IXGBE_ATR_L4TYPE_MASK ; break ; default : DEBUGOUT ( " \n " ) ; return err ; } err = ixgbe_fdir_set_input_mask_82599 ( hw , input_mask , cloud_mode ) ; if ( err ) return err ; ixgbe_atr_compute_perfect_hash_82599 ( input , input_mask ) ; return ixgbe_fdir_write_perfect_filter_82599 ( hw , input , soft_id , queue , cloud_mode ) ; }
ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter
 @hw: pointer to hardware structure
 @input: input bitstream
 @input_mask: mask for the input bitstream
 @soft_id: software index for the filters
 @queue: queue index to direct traffic to
 @cloud_mode: unused
ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter @hw : pointer to hardware structure @input : input bitstream @input_mask : mask for the input bitstream @soft_id : software index for the filters @queue : queue index to direct traffic to @cloud_mode : unused
/*
	 * Check flow_type formatting, and bail out before we touch the hardware
	 * if there's a configuration issue
	 */ /* fall through */ /* program input mask into the HW */ /* apply mask and compute/store hash */ /* program filters to filter memory */