Commit 77d77f9f authored by Mitch Williams's avatar Mitch Williams Committed by David S. Miller

i40evf: store ring size in ring structs

Keep the descriptor ring size in the actual ring structs instead of in
the adapter struct. This enables us to use common tx and rx code with
the i40e PF driver.

Also update copyrights.

Change-ID: I2861e599b2b4c76441c062ea14400f4750f54d0e
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarSibai Li <sibai.li@intel.com>
Signed-off-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d15632d4
......@@ -196,8 +196,6 @@ struct i40evf_adapter {
/* RX */
struct i40e_ring *rx_rings[I40E_MAX_VSI_QP];
int txd_count;
int rxd_count;
u64 hw_csum_rx_error;
int num_msix_vectors;
struct msix_entry *msix_entries;
......
/*******************************************************************************
*
* Intel Ethernet Controller XL710 Family Linux Virtual Function Driver
* Copyright(c) 2013 Intel Corporation.
* Copyright(c) 2013 - 2014 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
......@@ -241,6 +241,7 @@ static int i40evf_set_ringparam(struct net_device *netdev,
{
struct i40evf_adapter *adapter = netdev_priv(netdev);
u32 new_rx_count, new_tx_count;
int i;
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
return -EINVAL;
......@@ -256,12 +257,14 @@ static int i40evf_set_ringparam(struct net_device *netdev,
new_rx_count = ALIGN(new_rx_count, I40EVF_REQ_DESCRIPTOR_MULTIPLE);
/* if nothing to do return success */
if ((new_tx_count == adapter->txd_count) &&
(new_rx_count == adapter->rxd_count))
if ((new_tx_count == adapter->tx_rings[0]->count) &&
(new_rx_count == adapter->rx_rings[0]->count))
return 0;
adapter->txd_count = new_tx_count;
adapter->rxd_count = new_rx_count;
for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) {
adapter->tx_rings[0]->count = new_tx_count;
adapter->rx_rings[0]->count = new_rx_count;
}
if (netif_running(netdev))
i40evf_reinit_locked(adapter);
......
......@@ -2025,9 +2025,6 @@ static void i40evf_init_task(struct work_struct *work)
adapter->flags |= I40EVF_FLAG_RX_CSUM_ENABLED;
adapter->txd_count = I40EVF_DEFAULT_TXD;
adapter->rxd_count = I40EVF_DEFAULT_RXD;
netdev->netdev_ops = &i40evf_netdev_ops;
i40evf_set_ethtool_ops(netdev);
netdev->watchdog_timeo = 5 * HZ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment