Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e42aa4f authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'i40e'



Aaron Brown says:

====================
Intel Wired LAN Driver Updates

This series contains updates to i40e and i40evf, primarily reset
handling / refactoring along with a fair amount of minor cleanup.

Jesse fixes some spelling, bumps the version and other trivial fixes.
Akeem sets a bit that is needed before shutdown in the case of
tx_timeout recovery failure.  Mitch refactors reset handling along
with a whole bunch of clean up.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 8815cbd9 ef8693eb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -647,9 +647,8 @@ static u16 i40e_clean_asq(struct i40e_hw *hw)
			desc_cb = *desc;
			cb_func(hw, &desc_cb);
		}
		memset((void *)desc, 0, sizeof(struct i40e_aq_desc));
		memset((void *)details, 0,
		       sizeof(struct i40e_asq_cmd_details));
		memset(desc, 0, sizeof(*desc));
		memset(details, 0, sizeof(*details));
		ntc++;
		if (ntc == asq->count)
			ntc = 0;
+22 −6
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ static const char i40e_driver_string[] =

#define DRV_VERSION_MAJOR 0
#define DRV_VERSION_MINOR 3
#define DRV_VERSION_BUILD 30
#define DRV_VERSION_BUILD 31
#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
	     __stringify(DRV_VERSION_MINOR) "." \
	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
@@ -305,6 +305,7 @@ static void i40e_tx_timeout(struct net_device *netdev)
		break;
	default:
		netdev_err(netdev, "tx_timeout recovery unsuccessful\n");
		set_bit(__I40E_DOWN, &vsi->state);
		i40e_down(vsi);
		break;
	}
@@ -5331,6 +5332,11 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
	/* restart the VSIs that were rebuilt and running before the reset */
	i40e_pf_unquiesce_all_vsi(pf);

	if (pf->num_alloc_vfs) {
		for (v = 0; v < pf->num_alloc_vfs; v++)
			i40e_reset_vf(&pf->vf[v], true);
	}

	/* tell the firmware that we're starting */
	dv.major_version = DRV_VERSION_MAJOR;
	dv.minor_version = DRV_VERSION_MINOR;
@@ -8070,6 +8076,16 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
		val &= ~I40E_PFGEN_PORTMDIO_NUM_VFLINK_STAT_ENA_MASK;
		wr32(hw, I40E_PFGEN_PORTMDIO_NUM, val);
		i40e_flush(hw);

		if (pci_num_vf(pdev)) {
			dev_info(&pdev->dev,
				 "Active VFs found, allocating resources.\n");
			err = i40e_alloc_vfs(pf, pci_num_vf(pdev));
			if (err)
				dev_info(&pdev->dev,
					 "Error %d allocating resources for existing VFs\n",
					 err);
		}
	}

	pfs_found++;
@@ -8165,16 +8181,16 @@ static void i40e_remove(struct pci_dev *pdev)

	i40e_ptp_stop(pf);

	if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
		i40e_free_vfs(pf);
		pf->flags &= ~I40E_FLAG_SRIOV_ENABLED;
	}

	/* no more scheduling of any task */
	set_bit(__I40E_DOWN, &pf->state);
	del_timer_sync(&pf->service_timer);
	cancel_work_sync(&pf->service_task);

	if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
		i40e_free_vfs(pf);
		pf->flags &= ~I40E_FLAG_SRIOV_ENABLED;
	}

	i40e_fdir_teardown(pf);

	/* If there is a switch structure or any orphans, remove them.
+1 −1
Original line number Diff line number Diff line
@@ -892,7 +892,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
	      rx_status & (1 << I40E_RX_DESC_STATUS_L3L4P_SHIFT)))
		return;

	/* likely incorrect csum if alternate IP extention headers found */
	/* likely incorrect csum if alternate IP extension headers found */
	if (rx_status & (1 << I40E_RX_DESC_STATUS_IPV6EXADD_SHIFT))
		return;

+14 −18
Original line number Diff line number Diff line
@@ -408,18 +408,10 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)
				 "Could not allocate VF broadcast filter\n");
	}

	if (!f) {
		dev_err(&pf->pdev->dev, "Unable to add ucast filter\n");
		ret = -ENOMEM;
		goto error_alloc_vsi_res;
	}

	/* program mac filter */
	ret = i40e_sync_vsi_filters(vsi);
	if (ret) {
	if (ret)
		dev_err(&pf->pdev->dev, "Unable to program ucast filters\n");
		goto error_alloc_vsi_res;
	}

error_alloc_vsi_res:
	return ret;
@@ -682,6 +674,7 @@ complete_reset:
	mdelay(10);
	i40e_alloc_vf_res(vf);
	i40e_enable_vf_mappings(vf);
	set_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states);

	/* tell the VF the reset is done */
	wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);
@@ -847,7 +840,7 @@ void i40e_free_vfs(struct i40e_pf *pf)
 *
 * allocate vf resources
 **/
static int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
{
	struct i40e_vf *vfs;
	int i, ret = 0;
@@ -855,14 +848,16 @@ static int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
	/* Disable interrupt 0 so we don't try to handle the VFLR. */
	i40e_irq_dynamic_disable_icr0(pf);

	/* Check to see if we're just allocating resources for extant VFs */
	if (pci_num_vf(pf->pdev) != num_alloc_vfs) {
		ret = pci_enable_sriov(pf->pdev, num_alloc_vfs);
		if (ret) {
			dev_err(&pf->pdev->dev,
			"pci_enable_sriov failed with error %d!\n", ret);
				"Failed to enable SR-IOV, error %d.\n", ret);
			pf->num_alloc_vfs = 0;
			goto err_iov;
		}

	}
	/* allocate memory */
	vfs = kzalloc(num_alloc_vfs * sizeof(struct i40e_vf), GFP_KERNEL);
	if (!vfs) {
@@ -1873,6 +1868,7 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)
			/* clear the bit in GLGEN_VFLRSTAT */
			wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), (1 << bit_idx));

			if (!test_bit(__I40E_DOWN, &pf->state))
				i40e_reset_vf(vf, true);
		}
	}
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ struct i40e_vf {

void i40e_free_vfs(struct i40e_pf *pf);
int i40e_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs);
int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode,
			   u32 v_retval, u8 *msg, u16 msglen);
int i40e_vc_process_vflr_event(struct i40e_pf *pf);
Loading