diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_arfs.c | 48 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_ddp.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_debugfs.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_eswitch.c | 6 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_lag.c | 3 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_ptp.c | 1 | 
6 files changed, 59 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_arfs.c b/drivers/net/ethernet/intel/ice/ice_arfs.c index 2bc5c7f59844..1f7834c03550 100644 --- a/drivers/net/ethernet/intel/ice/ice_arfs.c +++ b/drivers/net/ethernet/intel/ice/ice_arfs.c @@ -378,6 +378,50 @@ ice_arfs_is_perfect_flow_set(struct ice_hw *hw, __be16 l3_proto, u8 l4_proto)  }  /** + * ice_arfs_cmp - Check if aRFS filter matches this flow. + * @fltr_info: filter info of the saved ARFS entry. + * @fk: flow dissector keys. + * @n_proto:  One of htons(ETH_P_IP) or htons(ETH_P_IPV6). + * @ip_proto: One of IPPROTO_TCP or IPPROTO_UDP. + * + * Since this function assumes limited values for n_proto and ip_proto, it + * is meant to be called only from ice_rx_flow_steer(). + * + * Return: + * * true	- fltr_info refers to the same flow as fk. + * * false	- fltr_info and fk refer to different flows. + */ +static bool +ice_arfs_cmp(const struct ice_fdir_fltr *fltr_info, const struct flow_keys *fk, +	     __be16 n_proto, u8 ip_proto) +{ +	/* Determine if the filter is for IPv4 or IPv6 based on flow_type, +	 * which is one of ICE_FLTR_PTYPE_NONF_IPV{4,6}_{TCP,UDP}. +	 */ +	bool is_v4 = fltr_info->flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP || +		     fltr_info->flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP; + +	/* Following checks are arranged in the quickest and most discriminative +	 * fields first for early failure. +	 */ +	if (is_v4) +		return n_proto == htons(ETH_P_IP) && +			fltr_info->ip.v4.src_port == fk->ports.src && +			fltr_info->ip.v4.dst_port == fk->ports.dst && +			fltr_info->ip.v4.src_ip == fk->addrs.v4addrs.src && +			fltr_info->ip.v4.dst_ip == fk->addrs.v4addrs.dst && +			fltr_info->ip.v4.proto == ip_proto; + +	return fltr_info->ip.v6.src_port == fk->ports.src && +		fltr_info->ip.v6.dst_port == fk->ports.dst && +		fltr_info->ip.v6.proto == ip_proto && +		!memcmp(&fltr_info->ip.v6.src_ip, &fk->addrs.v6addrs.src, +			sizeof(struct in6_addr)) && +		!memcmp(&fltr_info->ip.v6.dst_ip, &fk->addrs.v6addrs.dst, +			sizeof(struct in6_addr)); +} + +/**   * ice_rx_flow_steer - steer the Rx flow to where application is being run   * @netdev: ptr to the netdev being adjusted   * @skb: buffer with required header information @@ -448,6 +492,10 @@ ice_rx_flow_steer(struct net_device *netdev, const struct sk_buff *skb,  			continue;  		fltr_info = &arfs_entry->fltr_info; + +		if (!ice_arfs_cmp(fltr_info, &fk, n_proto, ip_proto)) +			continue; +  		ret = fltr_info->fltr_id;  		if (fltr_info->q_index == rxq_idx || diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.c b/drivers/net/ethernet/intel/ice/ice_ddp.c index 59323c019544..351824dc3c62 100644 --- a/drivers/net/ethernet/intel/ice/ice_ddp.c +++ b/drivers/net/ethernet/intel/ice/ice_ddp.c @@ -2301,6 +2301,8 @@ enum ice_ddp_state ice_copy_and_init_pkg(struct ice_hw *hw, const u8 *buf,  		return ICE_DDP_PKG_ERR;  	buf_copy = devm_kmemdup(ice_hw_to_dev(hw), buf, len, GFP_KERNEL); +	if (!buf_copy) +		return ICE_DDP_PKG_ERR;  	state = ice_init_pkg(hw, buf_copy, len);  	if (!ice_is_init_pkg_successful(state)) { diff --git a/drivers/net/ethernet/intel/ice/ice_debugfs.c b/drivers/net/ethernet/intel/ice/ice_debugfs.c index 9fc0fd95a13d..cb71eca6a85b 100644 --- a/drivers/net/ethernet/intel/ice/ice_debugfs.c +++ b/drivers/net/ethernet/intel/ice/ice_debugfs.c @@ -606,7 +606,7 @@ void ice_debugfs_fwlog_init(struct ice_pf *pf)  	pf->ice_debugfs_pf_fwlog = debugfs_create_dir("fwlog",  						      pf->ice_debugfs_pf); -	if (IS_ERR(pf->ice_debugfs_pf)) +	if (IS_ERR(pf->ice_debugfs_pf_fwlog))  		goto err_create_module_files;  	fw_modules_dir = debugfs_create_dir("modules", diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c index 6aae03771746..2e4f0969035f 100644 --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c @@ -508,10 +508,14 @@ err_create_repr:   */  int ice_eswitch_attach_vf(struct ice_pf *pf, struct ice_vf *vf)  { -	struct ice_repr *repr = ice_repr_create_vf(vf);  	struct devlink *devlink = priv_to_devlink(pf); +	struct ice_repr *repr;  	int err; +	if (!ice_is_eswitch_mode_switchdev(pf)) +		return 0; + +	repr = ice_repr_create_vf(vf);  	if (IS_ERR(repr))  		return PTR_ERR(repr); diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c index 2410aee59fb2..d132eb477551 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -2226,7 +2226,8 @@ bool ice_lag_is_switchdev_running(struct ice_pf *pf)  	struct ice_lag *lag = pf->lag;  	struct net_device *tmp_nd; -	if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG) || !lag) +	if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG) || +	    !lag || !lag->upper_netdev)  		return false;  	rcu_read_lock(); diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index b79a148ed0f2..55cad824c5b9 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -2299,6 +2299,7 @@ static int ice_capture_crosststamp(ktime_t *device,  	ts = ((u64)ts_hi << 32) | ts_lo;  	system->cycles = ts;  	system->cs_id = CSID_X86_ART; +	system->use_nsecs = true;  	/* Read Device source clock time */  	ts_lo = rd32(hw, cfg->dev_time_l[tmr_idx]);  | 
