Commit 735dbc69 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'sfc-E100-VF-respresenters'



Edward Cree says:

====================
sfc: VF representors for EF100

This series adds representor netdevices for EF100 VFs, as a step towards
 supporting TC offload and vDPA usecases in future patches.
In this first series is basic netdevice creation and packet TX; the
 following series will add the RX path.

v3: dropped massive mcdi_pcol.h patch which was applied separately.
v2: converted comments on struct efx_nic members added in patch #4 to
 kernel-doc (Jakub).  While at it, also gave struct efx_rep its own kdoc
 since several members had comments on them.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 16576a03 84e7fc25
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ sfc-y += efx.o efx_common.o efx_channels.o nic.o \
			   ef100.o ef100_nic.o ef100_netdev.o \
			   ef100_ethtool.o ef100_rx.o ef100_tx.o
sfc-$(CONFIG_SFC_MTD)	+= mtd.o
sfc-$(CONFIG_SFC_SRIOV)	+= sriov.o ef10_sriov.o ef100_sriov.o
sfc-$(CONFIG_SFC_SRIOV)	+= sriov.o ef10_sriov.o ef100_sriov.o ef100_rep.o mae.o

obj-$(CONFIG_SFC)	+= sfc.o

+14 −2
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ static int ef100_net_stop(struct net_device *net_dev)
	netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n",
		  raw_smp_processor_id());

	efx_detach_reps(efx);
	netif_stop_queue(net_dev);
	efx_stop_all(efx);
	efx_mcdi_mac_fini_stats(efx);
@@ -176,6 +177,8 @@ static int ef100_net_open(struct net_device *net_dev)
	mutex_unlock(&efx->mac_lock);

	efx->state = STATE_NET_UP;
	if (netif_running(efx->net_dev))
		efx_attach_reps(efx);

	return 0;

@@ -195,6 +198,15 @@ static netdev_tx_t ef100_hard_start_xmit(struct sk_buff *skb,
					 struct net_device *net_dev)
{
	struct efx_nic *efx = efx_netdev_priv(net_dev);

	return __ef100_hard_start_xmit(skb, efx, net_dev, NULL);
}

netdev_tx_t __ef100_hard_start_xmit(struct sk_buff *skb,
				    struct efx_nic *efx,
				    struct net_device *net_dev,
				    struct efx_rep *efv)
{
	struct efx_tx_queue *tx_queue;
	struct efx_channel *channel;
	int rc;
@@ -209,7 +221,7 @@ static netdev_tx_t ef100_hard_start_xmit(struct sk_buff *skb,
	}

	tx_queue = &channel->tx_queue[0];
	rc = ef100_enqueue_skb(tx_queue, skb);
	rc = __ef100_enqueue_skb(tx_queue, skb, efv);
	if (rc == 0)
		return NETDEV_TX_OK;

@@ -312,7 +324,7 @@ void ef100_remove_netdev(struct efx_probe_data *probe_data)
	unregister_netdevice_notifier(&efx->netdev_notifier);
#if defined(CONFIG_SFC_SRIOV)
	if (!efx->type->is_vf)
		efx_ef100_pci_sriov_disable(efx);
		efx_ef100_pci_sriov_disable(efx, true);
#endif

	ef100_unregister_netdev(efx);
+5 −0
Original line number Diff line number Diff line
@@ -10,7 +10,12 @@
 */

#include <linux/netdevice.h>
#include "ef100_rep.h"

netdev_tx_t __ef100_hard_start_xmit(struct sk_buff *skb,
				    struct efx_nic *efx,
				    struct net_device *net_dev,
				    struct efx_rep *efv);
int ef100_netdev_event(struct notifier_block *this,
		       unsigned long event, void *ptr);
int ef100_probe_netdev(struct efx_probe_data *probe_data);
+7 −0
Original line number Diff line number Diff line
@@ -946,6 +946,7 @@ static int ef100_probe_main(struct efx_nic *efx)
	unsigned int bar_size = resource_size(&efx->pci_dev->resource[efx->mem_bar]);
	struct ef100_nic_data *nic_data;
	char fw_version[32];
	u32 priv_mask = 0;
	int i, rc;

	if (WARN_ON(bar_size == 0))
@@ -1027,6 +1028,12 @@ static int ef100_probe_main(struct efx_nic *efx)
	efx_mcdi_print_fwver(efx, fw_version, sizeof(fw_version));
	pci_dbg(efx->pci_dev, "Firmware version %s\n", fw_version);

	rc = efx_mcdi_get_privilege_mask(efx, &priv_mask);
	if (rc) /* non-fatal, and priv_mask will still be 0 */
		pci_info(efx->pci_dev,
			 "Failed to get privilege mask from FW, rc %d\n", rc);
	nic_data->grp_mae = !!(priv_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAE);

	if (compare_versions(fw_version, "1.1.0.1000") < 0) {
		pci_info(efx->pci_dev, "Firmware uses old event descriptors\n");
		rc = -EINVAL;
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ struct ef100_nic_data {
	u8 port_id[ETH_ALEN];
	DECLARE_BITMAP(evq_phases, EFX_MAX_CHANNELS);
	u64 stats[EF100_STAT_COUNT];
	bool grp_mae; /* MAE Privilege */
	u16 tso_max_hdr_len;
	u16 tso_max_payload_num_segs;
	u16 tso_max_frames;
Loading