aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/net/intelxvf.c
diff options
context:
space:
mode:
authorVishvananda Ishaya <vish.ishaya@oracle.com>2017-03-09 13:54:13 +0000
committerMichael Brown <mcb30@ipxe.org>2017-03-09 13:56:22 +0000
commit1d049002622da6a5a9cc98c42fd4dd27dc741b96 (patch)
treef5ef75498ab111610a6ed1a759d272053ba0786d /src/drivers/net/intelxvf.c
parent9db9221ea0e3a7a4b32cf7fbdb17a46af474ce2b (diff)
downloadipxe-1d049002622da6a5a9cc98c42fd4dd27dc741b96.tar.gz
[intel] Reset all virtual function settings
Some VF data is not cleared with reset, so make sure to return all the settings to default before configuring the VF. This fixes an issue where network packets would fail to be received if the VF was previously used by the linux ixgbevf driver. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/intelxvf.c')
-rw-r--r--src/drivers/net/intelxvf.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/drivers/net/intelxvf.c b/src/drivers/net/intelxvf.c
index 91a10b10f..2caeec27e 100644
--- a/src/drivers/net/intelxvf.c
+++ b/src/drivers/net/intelxvf.c
@@ -216,6 +216,7 @@ static int intelxvf_open ( struct net_device *netdev ) {
uint32_t rxdctl;
uint32_t srrctl;
uint32_t dca_rxctrl;
+ unsigned int i;
int vlan_thing;
int rc;
@@ -252,6 +253,15 @@ static int intelxvf_open ( struct net_device *netdev ) {
goto err_mbox_set_mtu;
}
+ /* Reset all descriptor rings */
+ for ( i = 0 ; i < INTELXVF_NUM_RINGS ; i++ ) {
+ intel_reset_ring ( intel, INTELXVF_TD ( i ) );
+ intel_reset_ring ( intel, INTELXVF_RD ( i ) );
+ }
+
+ /* Reset packet split receive type register */
+ writel ( 0, intel->regs + INTELXVF_PSRTYPE );
+
/* Get queue configuration. Ignore failures, since the host
* may not support this message.
*/
@@ -260,9 +270,9 @@ static int intelxvf_open ( struct net_device *netdev ) {
if ( vlan_thing ) {
DBGC ( intel, "INTEL %p stripping VLAN tags (thing=%d)\n",
intel, vlan_thing );
- rxdctl = readl ( intel->regs + INTELXVF_RD + INTEL_xDCTL );
+ rxdctl = readl ( intel->regs + INTELXVF_RD(0) + INTEL_xDCTL );
rxdctl |= INTELX_RXDCTL_VME;
- writel ( rxdctl, intel->regs + INTELXVF_RD + INTEL_xDCTL );
+ writel ( rxdctl, intel->regs + INTELXVF_RD(0) + INTEL_xDCTL );
}
/* Create transmit descriptor ring */
@@ -283,9 +293,12 @@ static int intelxvf_open ( struct net_device *netdev ) {
/* Configure receive buffer sizes and set receive descriptor type */
srrctl = readl ( intel->regs + INTELXVF_SRRCTL );
srrctl &= ~( INTELXVF_SRRCTL_BSIZE_MASK |
+ INTELXVF_SRRCTL_BHDRSIZE_MASK |
INTELXVF_SRRCTL_DESCTYPE_MASK );
srrctl |= ( INTELXVF_SRRCTL_BSIZE_DEFAULT |
- INTELXVF_SRRCTL_DESCTYPE_DEFAULT );
+ INTELXVF_SRRCTL_BHDRSIZE_DEFAULT |
+ INTELXVF_SRRCTL_DESCTYPE_DEFAULT |
+ INTELXVF_SRRCTL_DROP_EN );
writel ( srrctl, intel->regs + INTELXVF_SRRCTL );
/* Clear "must-be-zero" bit for direct cache access (DCA). We
@@ -434,9 +447,9 @@ static int intelxvf_probe ( struct pci_device *pci ) {
netdev->dev = &pci->dev;
memset ( intel, 0, sizeof ( *intel ) );
intel_init_mbox ( &intel->mbox, INTELXVF_MBCTRL, INTELXVF_MBMEM );
- intel_init_ring ( &intel->tx, INTEL_NUM_TX_DESC, INTELXVF_TD,
+ intel_init_ring ( &intel->tx, INTEL_NUM_TX_DESC, INTELXVF_TD(0),
intel_describe_tx_adv );
- intel_init_ring ( &intel->rx, INTEL_NUM_RX_DESC, INTELXVF_RD,
+ intel_init_ring ( &intel->rx, INTEL_NUM_RX_DESC, INTELXVF_RD(0),
intel_describe_rx );
/* Fix up PCI device */