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

Commit 9b894cdd authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'aquantia-fixes'



Igor Russkikh says:

====================
Aquantia atlantic hot fixes 03-2018

This is a set of atlantic driver hot fixes for various areas:

Some issues with hardware reset covered,
Fixed napi_poll flood happening on some traffic conditions,
Allow system to change MAC address on live device,
Add pci shutdown handler.

patch v2:
- reverse christmas tree
- remove driver private parameter, replacing it with define.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1959031e c89bf1cd
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,8 @@
#define AQ_CFG_TX_FRAME_MAX  (16U * 1024U)
#define AQ_CFG_TX_FRAME_MAX  (16U * 1024U)
#define AQ_CFG_RX_FRAME_MAX  (4U * 1024U)
#define AQ_CFG_RX_FRAME_MAX  (4U * 1024U)


#define AQ_CFG_TX_CLEAN_BUDGET 256U

/* LRO */
/* LRO */
#define AQ_CFG_IS_LRO_DEF           1U
#define AQ_CFG_IS_LRO_DEF           1U


+22 −0
Original line number Original line Diff line number Diff line
@@ -247,6 +247,8 @@ void aq_nic_ndev_init(struct aq_nic_s *self)
	self->ndev->hw_features |= aq_hw_caps->hw_features;
	self->ndev->hw_features |= aq_hw_caps->hw_features;
	self->ndev->features = aq_hw_caps->hw_features;
	self->ndev->features = aq_hw_caps->hw_features;
	self->ndev->priv_flags = aq_hw_caps->hw_priv_flags;
	self->ndev->priv_flags = aq_hw_caps->hw_priv_flags;
	self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

	self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN;
	self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN;
	self->ndev->max_mtu = aq_hw_caps->mtu - ETH_FCS_LEN - ETH_HLEN;
	self->ndev->max_mtu = aq_hw_caps->mtu - ETH_FCS_LEN - ETH_HLEN;


@@ -937,3 +939,23 @@ int aq_nic_change_pm_state(struct aq_nic_s *self, pm_message_t *pm_msg)
out:
out:
	return err;
	return err;
}
}

void aq_nic_shutdown(struct aq_nic_s *self)
{
	int err = 0;

	if (!self->ndev)
		return;

	rtnl_lock();

	netif_device_detach(self->ndev);

	err = aq_nic_stop(self);
	if (err < 0)
		goto err_exit;
	aq_nic_deinit(self);

err_exit:
	rtnl_unlock();
}
 No newline at end of file
+1 −0
Original line number Original line Diff line number Diff line
@@ -118,5 +118,6 @@ struct aq_nic_cfg_s *aq_nic_get_cfg(struct aq_nic_s *self);
u32 aq_nic_get_fw_version(struct aq_nic_s *self);
u32 aq_nic_get_fw_version(struct aq_nic_s *self);
int aq_nic_change_pm_state(struct aq_nic_s *self, pm_message_t *pm_msg);
int aq_nic_change_pm_state(struct aq_nic_s *self, pm_message_t *pm_msg);
int aq_nic_update_interrupt_moderation_settings(struct aq_nic_s *self);
int aq_nic_update_interrupt_moderation_settings(struct aq_nic_s *self);
void aq_nic_shutdown(struct aq_nic_s *self);


#endif /* AQ_NIC_H */
#endif /* AQ_NIC_H */
+15 −0
Original line number Original line Diff line number Diff line
@@ -323,6 +323,20 @@ static void aq_pci_remove(struct pci_dev *pdev)
	pci_disable_device(pdev);
	pci_disable_device(pdev);
}
}


static void aq_pci_shutdown(struct pci_dev *pdev)
{
	struct aq_nic_s *self = pci_get_drvdata(pdev);

	aq_nic_shutdown(self);

	pci_disable_device(pdev);

	if (system_state == SYSTEM_POWER_OFF) {
		pci_wake_from_d3(pdev, false);
		pci_set_power_state(pdev, PCI_D3hot);
	}
}

static int aq_pci_suspend(struct pci_dev *pdev, pm_message_t pm_msg)
static int aq_pci_suspend(struct pci_dev *pdev, pm_message_t pm_msg)
{
{
	struct aq_nic_s *self = pci_get_drvdata(pdev);
	struct aq_nic_s *self = pci_get_drvdata(pdev);
@@ -345,6 +359,7 @@ static struct pci_driver aq_pci_ops = {
	.remove = aq_pci_remove,
	.remove = aq_pci_remove,
	.suspend = aq_pci_suspend,
	.suspend = aq_pci_suspend,
	.resume = aq_pci_resume,
	.resume = aq_pci_resume,
	.shutdown = aq_pci_shutdown,
};
};


module_pci_driver(aq_pci_ops);
module_pci_driver(aq_pci_ops);
+5 −2
Original line number Original line Diff line number Diff line
@@ -136,11 +136,12 @@ void aq_ring_queue_stop(struct aq_ring_s *ring)
		netif_stop_subqueue(ndev, ring->idx);
		netif_stop_subqueue(ndev, ring->idx);
}
}


void aq_ring_tx_clean(struct aq_ring_s *self)
bool aq_ring_tx_clean(struct aq_ring_s *self)
{
{
	struct device *dev = aq_nic_get_dev(self->aq_nic);
	struct device *dev = aq_nic_get_dev(self->aq_nic);
	unsigned int budget = AQ_CFG_TX_CLEAN_BUDGET;


	for (; self->sw_head != self->hw_head;
	for (; self->sw_head != self->hw_head && budget--;
		self->sw_head = aq_ring_next_dx(self, self->sw_head)) {
		self->sw_head = aq_ring_next_dx(self, self->sw_head)) {
		struct aq_ring_buff_s *buff = &self->buff_ring[self->sw_head];
		struct aq_ring_buff_s *buff = &self->buff_ring[self->sw_head];


@@ -167,6 +168,8 @@ void aq_ring_tx_clean(struct aq_ring_s *self)
		buff->pa = 0U;
		buff->pa = 0U;
		buff->eop_index = 0xffffU;
		buff->eop_index = 0xffffU;
	}
	}

	return !!budget;
}
}


#define AQ_SKB_ALIGN SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
#define AQ_SKB_ALIGN SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
Loading