Commit 484a75b1 authored by Edward Cree's avatar Edward Cree Committed by David S. Miller
Browse files

sfc: use efx_has_cap for capability checks outside of NIC-specific code



Removes some efx_ef10_nic_data references from common code.

Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be904b85
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -829,8 +829,7 @@ static int efx_mcdi_filter_insert_def(struct efx_nic *efx,
		efx_filter_set_uc_def(&spec);

	if (encap_type) {
		if (nic_data->datapath_caps &
		    (1 << MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_LBN))
		if (efx_has_cap(efx, VXLAN_NVGRE, FLAGS1))
			efx_filter_set_encap_type(&spec, encap_type);
		else
			/*
@@ -1309,8 +1308,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx)
	rc = efx_mcdi_filter_table_probe_matches(efx, table, false);
	if (rc)
		goto fail;
	if (nic_data->datapath_caps &
		   (1 << MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_LBN))
	if (efx_has_cap(efx, VXLAN_NVGRE, FLAGS1))
		rc = efx_mcdi_filter_table_probe_matches(efx, table, true);
	if (rc)
		goto fail;
@@ -1920,7 +1918,6 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive
{
	MCDI_DECLARE_BUF(inbuf, MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN);
	MCDI_DECLARE_BUF(outbuf, MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN);
	struct efx_ef10_nic_data *nic_data = efx->nic_data;
	size_t outlen;
	int rc;
	u32 alloc_type = exclusive ?
@@ -1938,8 +1935,7 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive
		return 0;
	}

	if (nic_data->datapath_caps &
	    1 << MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_LBN)
	if (efx_has_cap(efx, RX_RSS_LIMITED, FLAGS1))
		return -EOPNOTSUPP;

	MCDI_SET_DWORD(inbuf, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID,
@@ -1960,8 +1956,7 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive
	if (context_size)
		*context_size = rss_spread;

	if (nic_data->datapath_caps &
	    1 << MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_LBN)
	if (efx_has_cap(efx, ADDITIONAL_RSS_MODES, FLAGS1))
		efx_mcdi_set_rss_context_flags(efx, ctx);

	return 0;
+1 −6
Original line number Diff line number Diff line
@@ -352,12 +352,7 @@ static int efx_phc_enable(struct ptp_clock_info *ptp,

bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx)
{
	struct efx_ef10_nic_data *nic_data = efx->nic_data;

	return ((efx_nic_rev(efx) >= EFX_REV_HUNT_A0) &&
		(nic_data->datapath_caps2 &
		 (1 << MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_TIMESTAMPING_LBN)
		));
	return efx_has_cap(efx, TX_MAC_TIMESTAMPING, FLAGS2);
}

/* PTP 'extra' channel is still a traffic channel, but we only create TX queues