Commit dec0d8e4 authored by Jeff Kirsher's avatar Jeff Kirsher

ixgbevf: Fix code comments and whitespace

Fix the code comments to align with drivers/net/ code commenting style,
as well as whitespace issues.  The whitespace issues resolve checkpatch
errors, like lines exceeding 80 chars (except for strings) and the use
of tabs where possible.

CC: <kernel-team@fb.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
parent 856f606e
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2012 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
...@@ -182,7 +181,7 @@ typedef u32 ixgbe_link_speed; ...@@ -182,7 +181,7 @@ typedef u32 ixgbe_link_speed;
#define IXGBE_TXD_CMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */ #define IXGBE_TXD_CMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
#define IXGBE_TXD_CMD_IC 0x04000000 /* Insert Checksum */ #define IXGBE_TXD_CMD_IC 0x04000000 /* Insert Checksum */
#define IXGBE_TXD_CMD_RS 0x08000000 /* Report Status */ #define IXGBE_TXD_CMD_RS 0x08000000 /* Report Status */
#define IXGBE_TXD_CMD_DEXT 0x20000000 /* Descriptor extension (0 = legacy) */ #define IXGBE_TXD_CMD_DEXT 0x20000000 /* Descriptor ext (0 = legacy) */
#define IXGBE_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */ #define IXGBE_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */
#define IXGBE_TXD_STAT_DD 0x00000001 /* Descriptor Done */ #define IXGBE_TXD_STAT_DD 0x00000001 /* Descriptor Done */
#define IXGBE_TXD_CMD (IXGBE_TXD_CMD_EOP | IXGBE_TXD_CMD_RS) #define IXGBE_TXD_CMD (IXGBE_TXD_CMD_EOP | IXGBE_TXD_CMD_RS)
......
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2014 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
...@@ -100,6 +99,7 @@ static const char ixgbe_gstrings_test[][ETH_GSTRING_LEN] = { ...@@ -100,6 +99,7 @@ static const char ixgbe_gstrings_test[][ETH_GSTRING_LEN] = {
"Register test (offline)", "Register test (offline)",
"Link test (on/offline)" "Link test (on/offline)"
}; };
#define IXGBE_TEST_LEN (sizeof(ixgbe_gstrings_test) / ETH_GSTRING_LEN) #define IXGBE_TEST_LEN (sizeof(ixgbe_gstrings_test) / ETH_GSTRING_LEN)
static int ixgbevf_get_settings(struct net_device *netdev, static int ixgbevf_get_settings(struct net_device *netdev,
...@@ -120,6 +120,7 @@ static int ixgbevf_get_settings(struct net_device *netdev, ...@@ -120,6 +120,7 @@ static int ixgbevf_get_settings(struct net_device *netdev,
if (link_up) { if (link_up) {
__u32 speed = SPEED_10000; __u32 speed = SPEED_10000;
switch (link_speed) { switch (link_speed) {
case IXGBE_LINK_SPEED_10GB_FULL: case IXGBE_LINK_SPEED_10GB_FULL:
speed = SPEED_10000; speed = SPEED_10000;
...@@ -145,12 +146,14 @@ static int ixgbevf_get_settings(struct net_device *netdev, ...@@ -145,12 +146,14 @@ static int ixgbevf_get_settings(struct net_device *netdev,
static u32 ixgbevf_get_msglevel(struct net_device *netdev) static u32 ixgbevf_get_msglevel(struct net_device *netdev)
{ {
struct ixgbevf_adapter *adapter = netdev_priv(netdev); struct ixgbevf_adapter *adapter = netdev_priv(netdev);
return adapter->msg_enable; return adapter->msg_enable;
} }
static void ixgbevf_set_msglevel(struct net_device *netdev, u32 data) static void ixgbevf_set_msglevel(struct net_device *netdev, u32 data)
{ {
struct ixgbevf_adapter *adapter = netdev_priv(netdev); struct ixgbevf_adapter *adapter = netdev_priv(netdev);
adapter->msg_enable = data; adapter->msg_enable = data;
} }
...@@ -185,7 +188,8 @@ static void ixgbevf_get_regs(struct net_device *netdev, ...@@ -185,7 +188,8 @@ static void ixgbevf_get_regs(struct net_device *netdev,
/* Interrupt */ /* Interrupt */
/* don't read EICR because it can clear interrupt causes, instead /* don't read EICR because it can clear interrupt causes, instead
* read EICS which is a shadow but doesn't clear EICR */ * read EICS which is a shadow but doesn't clear EICR
*/
regs_buff[5] = IXGBE_READ_REG(hw, IXGBE_VTEICS); regs_buff[5] = IXGBE_READ_REG(hw, IXGBE_VTEICS);
regs_buff[6] = IXGBE_READ_REG(hw, IXGBE_VTEICS); regs_buff[6] = IXGBE_READ_REG(hw, IXGBE_VTEICS);
regs_buff[7] = IXGBE_READ_REG(hw, IXGBE_VTEIMS); regs_buff[7] = IXGBE_READ_REG(hw, IXGBE_VTEIMS);
...@@ -404,7 +408,7 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev, ...@@ -404,7 +408,7 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, u64 *data) struct ethtool_stats *stats, u64 *data)
{ {
struct ixgbevf_adapter *adapter = netdev_priv(netdev); struct ixgbevf_adapter *adapter = netdev_priv(netdev);
char *base = (char *) adapter; char *base = (char *)adapter;
int i; int i;
#ifdef BP_EXTENDED_STATS #ifdef BP_EXTENDED_STATS
u64 rx_yields = 0, rx_cleaned = 0, rx_missed = 0, u64 rx_yields = 0, rx_cleaned = 0, rx_missed = 0,
...@@ -594,8 +598,7 @@ static int ixgbevf_reg_test(struct ixgbevf_adapter *adapter, u64 *data) ...@@ -594,8 +598,7 @@ static int ixgbevf_reg_test(struct ixgbevf_adapter *adapter, u64 *data)
} }
test = reg_test_vf; test = reg_test_vf;
/* /* Perform the register test, looping through the test table
* Perform the register test, looping through the test table
* until we either fail or reach the null entry. * until we either fail or reach the null entry.
*/ */
while (test->reg) { while (test->reg) {
...@@ -670,7 +673,8 @@ static void ixgbevf_diag_test(struct net_device *netdev, ...@@ -670,7 +673,8 @@ static void ixgbevf_diag_test(struct net_device *netdev,
hw_dbg(&adapter->hw, "offline testing starting\n"); hw_dbg(&adapter->hw, "offline testing starting\n");
/* Link test performed before hardware reset so autoneg doesn't /* Link test performed before hardware reset so autoneg doesn't
* interfere with test result */ * interfere with test result
*/
if (ixgbevf_link_test(adapter, &data[1])) if (ixgbevf_link_test(adapter, &data[1]))
eth_test->flags |= ETH_TEST_FL_FAILED; eth_test->flags |= ETH_TEST_FL_FAILED;
...@@ -724,7 +728,7 @@ static int ixgbevf_get_coalesce(struct net_device *netdev, ...@@ -724,7 +728,7 @@ static int ixgbevf_get_coalesce(struct net_device *netdev,
else else
ec->rx_coalesce_usecs = adapter->rx_itr_setting >> 2; ec->rx_coalesce_usecs = adapter->rx_itr_setting >> 2;
/* if in mixed tx/rx queues per vector mode, report only rx settings */ /* if in mixed Tx/Rx queues per vector mode, report only Rx settings */
if (adapter->q_vector[0]->tx.count && adapter->q_vector[0]->rx.count) if (adapter->q_vector[0]->tx.count && adapter->q_vector[0]->rx.count)
return 0; return 0;
...@@ -745,12 +749,11 @@ static int ixgbevf_set_coalesce(struct net_device *netdev, ...@@ -745,12 +749,11 @@ static int ixgbevf_set_coalesce(struct net_device *netdev,
int num_vectors, i; int num_vectors, i;
u16 tx_itr_param, rx_itr_param; u16 tx_itr_param, rx_itr_param;
/* don't accept tx specific changes if we've got mixed RxTx vectors */ /* don't accept Tx specific changes if we've got mixed RxTx vectors */
if (adapter->q_vector[0]->tx.count && adapter->q_vector[0]->rx.count if (adapter->q_vector[0]->tx.count &&
&& ec->tx_coalesce_usecs) adapter->q_vector[0]->rx.count && ec->tx_coalesce_usecs)
return -EINVAL; return -EINVAL;
if ((ec->rx_coalesce_usecs > (IXGBE_MAX_EITR >> 2)) || if ((ec->rx_coalesce_usecs > (IXGBE_MAX_EITR >> 2)) ||
(ec->tx_coalesce_usecs > (IXGBE_MAX_EITR >> 2))) (ec->tx_coalesce_usecs > (IXGBE_MAX_EITR >> 2)))
return -EINVAL; return -EINVAL;
...@@ -765,7 +768,6 @@ static int ixgbevf_set_coalesce(struct net_device *netdev, ...@@ -765,7 +768,6 @@ static int ixgbevf_set_coalesce(struct net_device *netdev,
else else
rx_itr_param = adapter->rx_itr_setting; rx_itr_param = adapter->rx_itr_setting;
if (ec->tx_coalesce_usecs > 1) if (ec->tx_coalesce_usecs > 1)
adapter->tx_itr_setting = ec->tx_coalesce_usecs << 2; adapter->tx_itr_setting = ec->tx_coalesce_usecs << 2;
else else
...@@ -781,10 +783,10 @@ static int ixgbevf_set_coalesce(struct net_device *netdev, ...@@ -781,10 +783,10 @@ static int ixgbevf_set_coalesce(struct net_device *netdev,
for (i = 0; i < num_vectors; i++) { for (i = 0; i < num_vectors; i++) {
q_vector = adapter->q_vector[i]; q_vector = adapter->q_vector[i];
if (q_vector->tx.count && !q_vector->rx.count) if (q_vector->tx.count && !q_vector->rx.count)
/* tx only */ /* Tx only */
q_vector->itr = tx_itr_param; q_vector->itr = tx_itr_param;
else else
/* rx only or mixed */ /* Rx only or mixed */
q_vector->itr = rx_itr_param; q_vector->itr = rx_itr_param;
ixgbevf_write_eitr(q_vector); ixgbevf_write_eitr(q_vector);
} }
......
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2014 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
...@@ -51,7 +50,8 @@ ...@@ -51,7 +50,8 @@
#define DESC_NEEDED (MAX_SKB_FRAGS + 4) #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
/* wrapper around a pointer to a socket buffer, /* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer */ * so a DMA handle can be stored along with the buffer
*/
struct ixgbevf_tx_buffer { struct ixgbevf_tx_buffer {
union ixgbe_adv_tx_desc *next_to_watch; union ixgbe_adv_tx_desc *next_to_watch;
unsigned long time_stamp; unsigned long time_stamp;
...@@ -132,9 +132,10 @@ struct ixgbevf_ring { ...@@ -132,9 +132,10 @@ struct ixgbevf_ring {
u8 __iomem *tail; u8 __iomem *tail;
struct sk_buff *skb; struct sk_buff *skb;
u16 reg_idx; /* holds the special value that gets the hardware register /* holds the special value that gets the hardware register offset
* offset associated with this ring, which is different * associated with this ring, which is different for DCB and RSS modes
* for DCB and RSS modes */ */
u16 reg_idx;
int queue_index; /* needed for multiqueue queue management */ int queue_index; /* needed for multiqueue queue management */
}; };
...@@ -186,9 +187,10 @@ struct ixgbevf_ring_container { ...@@ -186,9 +187,10 @@ struct ixgbevf_ring_container {
*/ */
struct ixgbevf_q_vector { struct ixgbevf_q_vector {
struct ixgbevf_adapter *adapter; struct ixgbevf_adapter *adapter;
u16 v_idx; /* index of q_vector within array, also used for /* index of q_vector within array, also used for finding the bit in
* finding the bit in EICR and friends that * EICR and friends that represents the vector for this ring
* represents the vector for this ring */ */
u16 v_idx;
u16 itr; /* Interrupt throttle rate written to EITR */ u16 itr; /* Interrupt throttle rate written to EITR */
struct napi_struct napi; struct napi_struct napi;
struct ixgbevf_ring_container rx, tx; struct ixgbevf_ring_container rx, tx;
...@@ -203,15 +205,17 @@ struct ixgbevf_q_vector { ...@@ -203,15 +205,17 @@ struct ixgbevf_q_vector {
#define IXGBEVF_QV_LOCKED (IXGBEVF_QV_OWNED | IXGBEVF_QV_STATE_DISABLED) #define IXGBEVF_QV_LOCKED (IXGBEVF_QV_OWNED | IXGBEVF_QV_STATE_DISABLED)
#define IXGBEVF_QV_STATE_NAPI_YIELD 8 /* NAPI yielded this QV */ #define IXGBEVF_QV_STATE_NAPI_YIELD 8 /* NAPI yielded this QV */
#define IXGBEVF_QV_STATE_POLL_YIELD 16 /* poll yielded this QV */ #define IXGBEVF_QV_STATE_POLL_YIELD 16 /* poll yielded this QV */
#define IXGBEVF_QV_YIELD (IXGBEVF_QV_STATE_NAPI_YIELD | IXGBEVF_QV_STATE_POLL_YIELD) #define IXGBEVF_QV_YIELD (IXGBEVF_QV_STATE_NAPI_YIELD | \
#define IXGBEVF_QV_USER_PEND (IXGBEVF_QV_STATE_POLL | IXGBEVF_QV_STATE_POLL_YIELD) IXGBEVF_QV_STATE_POLL_YIELD)
#define IXGBEVF_QV_USER_PEND (IXGBEVF_QV_STATE_POLL | \
IXGBEVF_QV_STATE_POLL_YIELD)
spinlock_t lock; spinlock_t lock;
#endif /* CONFIG_NET_RX_BUSY_POLL */ #endif /* CONFIG_NET_RX_BUSY_POLL */
}; };
#ifdef CONFIG_NET_RX_BUSY_POLL #ifdef CONFIG_NET_RX_BUSY_POLL
static inline void ixgbevf_qv_init_lock(struct ixgbevf_q_vector *q_vector) static inline void ixgbevf_qv_init_lock(struct ixgbevf_q_vector *q_vector)
{ {
spin_lock_init(&q_vector->lock); spin_lock_init(&q_vector->lock);
q_vector->state = IXGBEVF_QV_STATE_IDLE; q_vector->state = IXGBEVF_QV_STATE_IDLE;
} }
...@@ -220,6 +224,7 @@ static inline void ixgbevf_qv_init_lock(struct ixgbevf_q_vector *q_vector) ...@@ -220,6 +224,7 @@ static inline void ixgbevf_qv_init_lock(struct ixgbevf_q_vector *q_vector)
static inline bool ixgbevf_qv_lock_napi(struct ixgbevf_q_vector *q_vector) static inline bool ixgbevf_qv_lock_napi(struct ixgbevf_q_vector *q_vector)
{ {
int rc = true; int rc = true;
spin_lock_bh(&q_vector->lock); spin_lock_bh(&q_vector->lock);
if (q_vector->state & IXGBEVF_QV_LOCKED) { if (q_vector->state & IXGBEVF_QV_LOCKED) {
WARN_ON(q_vector->state & IXGBEVF_QV_STATE_NAPI); WARN_ON(q_vector->state & IXGBEVF_QV_STATE_NAPI);
...@@ -240,6 +245,7 @@ static inline bool ixgbevf_qv_lock_napi(struct ixgbevf_q_vector *q_vector) ...@@ -240,6 +245,7 @@ static inline bool ixgbevf_qv_lock_napi(struct ixgbevf_q_vector *q_vector)
static inline bool ixgbevf_qv_unlock_napi(struct ixgbevf_q_vector *q_vector) static inline bool ixgbevf_qv_unlock_napi(struct ixgbevf_q_vector *q_vector)
{ {
int rc = false; int rc = false;
spin_lock_bh(&q_vector->lock); spin_lock_bh(&q_vector->lock);
WARN_ON(q_vector->state & (IXGBEVF_QV_STATE_POLL | WARN_ON(q_vector->state & (IXGBEVF_QV_STATE_POLL |
IXGBEVF_QV_STATE_NAPI_YIELD)); IXGBEVF_QV_STATE_NAPI_YIELD));
...@@ -256,6 +262,7 @@ static inline bool ixgbevf_qv_unlock_napi(struct ixgbevf_q_vector *q_vector) ...@@ -256,6 +262,7 @@ static inline bool ixgbevf_qv_unlock_napi(struct ixgbevf_q_vector *q_vector)
static inline bool ixgbevf_qv_lock_poll(struct ixgbevf_q_vector *q_vector) static inline bool ixgbevf_qv_lock_poll(struct ixgbevf_q_vector *q_vector)
{ {
int rc = true; int rc = true;
spin_lock_bh(&q_vector->lock); spin_lock_bh(&q_vector->lock);
if ((q_vector->state & IXGBEVF_QV_LOCKED)) { if ((q_vector->state & IXGBEVF_QV_LOCKED)) {
q_vector->state |= IXGBEVF_QV_STATE_POLL_YIELD; q_vector->state |= IXGBEVF_QV_STATE_POLL_YIELD;
...@@ -275,6 +282,7 @@ static inline bool ixgbevf_qv_lock_poll(struct ixgbevf_q_vector *q_vector) ...@@ -275,6 +282,7 @@ static inline bool ixgbevf_qv_lock_poll(struct ixgbevf_q_vector *q_vector)
static inline bool ixgbevf_qv_unlock_poll(struct ixgbevf_q_vector *q_vector) static inline bool ixgbevf_qv_unlock_poll(struct ixgbevf_q_vector *q_vector)
{ {
int rc = false; int rc = false;
spin_lock_bh(&q_vector->lock); spin_lock_bh(&q_vector->lock);
WARN_ON(q_vector->state & (IXGBEVF_QV_STATE_NAPI)); WARN_ON(q_vector->state & (IXGBEVF_QV_STATE_NAPI));
...@@ -297,6 +305,7 @@ static inline bool ixgbevf_qv_busy_polling(struct ixgbevf_q_vector *q_vector) ...@@ -297,6 +305,7 @@ static inline bool ixgbevf_qv_busy_polling(struct ixgbevf_q_vector *q_vector)
static inline bool ixgbevf_qv_disable(struct ixgbevf_q_vector *q_vector) static inline bool ixgbevf_qv_disable(struct ixgbevf_q_vector *q_vector)
{ {
int rc = true; int rc = true;
spin_lock_bh(&q_vector->lock); spin_lock_bh(&q_vector->lock);
if (q_vector->state & IXGBEVF_QV_OWNED) if (q_vector->state & IXGBEVF_QV_OWNED)
rc = false; rc = false;
...@@ -307,8 +316,7 @@ static inline bool ixgbevf_qv_disable(struct ixgbevf_q_vector *q_vector) ...@@ -307,8 +316,7 @@ static inline bool ixgbevf_qv_disable(struct ixgbevf_q_vector *q_vector)
#endif /* CONFIG_NET_RX_BUSY_POLL */ #endif /* CONFIG_NET_RX_BUSY_POLL */
/* /* microsecond values for various ITR rates shifted by 2 to fit itr register
* microsecond values for various ITR rates shifted by 2 to fit itr register
* with the first 3 bits reserved 0 * with the first 3 bits reserved 0
*/ */
#define IXGBE_MIN_RSC_ITR 24 #define IXGBE_MIN_RSC_ITR 24
......
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2012 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
...@@ -52,10 +51,10 @@ static s32 ixgbevf_poll_for_msg(struct ixgbe_hw *hw) ...@@ -52,10 +51,10 @@ static s32 ixgbevf_poll_for_msg(struct ixgbe_hw *hw)
} }
/** /**
* ixgbevf_poll_for_ack - Wait for message acknowledgement * ixgbevf_poll_for_ack - Wait for message acknowledgment
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* *
* returns 0 if it successfully received a message acknowledgement * returns 0 if it successfully received a message acknowledgment
**/ **/
static s32 ixgbevf_poll_for_ack(struct ixgbe_hw *hw) static s32 ixgbevf_poll_for_ack(struct ixgbe_hw *hw)
{ {
...@@ -234,7 +233,7 @@ static s32 ixgbevf_obtain_mbx_lock_vf(struct ixgbe_hw *hw) ...@@ -234,7 +233,7 @@ static s32 ixgbevf_obtain_mbx_lock_vf(struct ixgbe_hw *hw)
/* Take ownership of the buffer */ /* Take ownership of the buffer */
IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU); IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU);
/* reserve mailbox for vf use */ /* reserve mailbox for VF use */
if (ixgbevf_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU) if (ixgbevf_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU)
ret_val = 0; ret_val = 0;
...@@ -254,8 +253,7 @@ static s32 ixgbevf_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) ...@@ -254,8 +253,7 @@ static s32 ixgbevf_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size)
s32 ret_val; s32 ret_val;
u16 i; u16 i;
/* lock the mailbox to prevent PF/VF race condition */
/* lock the mailbox to prevent pf/vf race condition */
ret_val = ixgbevf_obtain_mbx_lock_vf(hw); ret_val = ixgbevf_obtain_mbx_lock_vf(hw);
if (ret_val) if (ret_val)
goto out_no_write; goto out_no_write;
...@@ -279,7 +277,7 @@ static s32 ixgbevf_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) ...@@ -279,7 +277,7 @@ static s32 ixgbevf_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size)
} }
/** /**
* ixgbevf_read_mbx_vf - Reads a message from the inbox intended for vf * ixgbevf_read_mbx_vf - Reads a message from the inbox intended for VF
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* @msg: The message buffer * @msg: The message buffer
* @size: Length of buffer * @size: Length of buffer
...@@ -291,7 +289,7 @@ static s32 ixgbevf_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) ...@@ -291,7 +289,7 @@ static s32 ixgbevf_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size)
s32 ret_val = 0; s32 ret_val = 0;
u16 i; u16 i;
/* lock the mailbox to prevent pf/vf race condition */ /* lock the mailbox to prevent PF/VF race condition */
ret_val = ixgbevf_obtain_mbx_lock_vf(hw); ret_val = ixgbevf_obtain_mbx_lock_vf(hw);
if (ret_val) if (ret_val)
goto out_no_read; goto out_no_read;
...@@ -311,17 +309,18 @@ static s32 ixgbevf_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size) ...@@ -311,17 +309,18 @@ static s32 ixgbevf_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size)
} }
/** /**
* ixgbevf_init_mbx_params_vf - set initial values for vf mailbox * ixgbevf_init_mbx_params_vf - set initial values for VF mailbox
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* *
* Initializes the hw->mbx struct to correct values for vf mailbox * Initializes the hw->mbx struct to correct values for VF mailbox
*/ */
static s32 ixgbevf_init_mbx_params_vf(struct ixgbe_hw *hw) static s32 ixgbevf_init_mbx_params_vf(struct ixgbe_hw *hw)
{ {
struct ixgbe_mbx_info *mbx = &hw->mbx; struct ixgbe_mbx_info *mbx = &hw->mbx;
/* start mailbox as timed out and let the reset_hw call set the timeout /* start mailbox as timed out and let the reset_hw call set the timeout
* value to begin communications */ * value to begin communications
*/
mbx->timeout = 0; mbx->timeout = 0;
mbx->udelay = IXGBE_VF_MBX_INIT_DELAY; mbx->udelay = IXGBE_VF_MBX_INIT_DELAY;
......
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2012 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
...@@ -61,25 +60,23 @@ ...@@ -61,25 +60,23 @@
#define IXGBE_MBVFICR_VFACK_MASK 0xFFFF0000 /* bits for VF acks */ #define IXGBE_MBVFICR_VFACK_MASK 0xFFFF0000 /* bits for VF acks */
#define IXGBE_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ #define IXGBE_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */
/* If it's a IXGBE_VF_* msg then it originates in the VF and is sent to the /* If it's a IXGBE_VF_* msg then it originates in the VF and is sent to the
* PF. The reverse is true if it is IXGBE_PF_*. * PF. The reverse is true if it is IXGBE_PF_*.
* Message ACK's are the value or'd with 0xF0000000 * Message ACK's are the value or'd with 0xF0000000
*/ */
#define IXGBE_VT_MSGTYPE_ACK 0x80000000 /* Messages below or'd with /* Messages below or'd with this are the ACK */
* this are the ACK */ #define IXGBE_VT_MSGTYPE_ACK 0x80000000
#define IXGBE_VT_MSGTYPE_NACK 0x40000000 /* Messages below or'd with /* Messages below or'd with this are the NACK */
* this are the NACK */ #define IXGBE_VT_MSGTYPE_NACK 0x40000000
#define IXGBE_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still /* Indicates that VF is still clear to send requests */
* clear to send requests */ #define IXGBE_VT_MSGTYPE_CTS 0x20000000
#define IXGBE_VT_MSGINFO_SHIFT 16 #define IXGBE_VT_MSGINFO_SHIFT 16
/* bits 23:16 are used for exra info for certain messages */ /* bits 23:16 are used for exra info for certain messages */
#define IXGBE_VT_MSGINFO_MASK (0xFF << IXGBE_VT_MSGINFO_SHIFT) #define IXGBE_VT_MSGINFO_MASK (0xFF << IXGBE_VT_MSGINFO_SHIFT)
/* definitions to support mailbox API version negotiation */ /* definitions to support mailbox API version negotiation */
/* /* each element denotes a version of the API; existing numbers may not
* each element denotes a version of the API; existing numbers may not
* change; any additions must go at the end * change; any additions must go at the end
*/ */
enum ixgbe_pfvf_api_rev { enum ixgbe_pfvf_api_rev {
...@@ -107,7 +104,7 @@ enum ixgbe_pfvf_api_rev { ...@@ -107,7 +104,7 @@ enum ixgbe_pfvf_api_rev {
/* GET_QUEUES return data indices within the mailbox */ /* GET_QUEUES return data indices within the mailbox */
#define IXGBE_VF_TX_QUEUES 1 /* number of Tx queues supported */ #define IXGBE_VF_TX_QUEUES 1 /* number of Tx queues supported */
#define IXGBE_VF_RX_QUEUES 2 /* number of Rx queues supported */ #define IXGBE_VF_RX_QUEUES 2 /* number of Rx queues supported */
#define IXGBE_VF_TRANS_VLAN 3 /* Indication of port vlan */ #define IXGBE_VF_TRANS_VLAN 3 /* Indication of port VLAN */
#define IXGBE_VF_DEF_QUEUE 4 /* Default queue offset */ #define IXGBE_VF_DEF_QUEUE 4 /* Default queue offset */
/* length of permanent address message returned from PF */ /* length of permanent address message returned from PF */
......
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2014 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
......
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2012 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
...@@ -102,9 +101,10 @@ static s32 ixgbevf_reset_hw_vf(struct ixgbe_hw *hw) ...@@ -102,9 +101,10 @@ static s32 ixgbevf_reset_hw_vf(struct ixgbe_hw *hw)
mdelay(10); mdelay(10);
/* set our "perm_addr" based on info provided by PF */ /* set our "perm_addr" based on info provided by PF
/* also set up the mc_filter_type which is piggy backed * also set up the mc_filter_type which is piggy backed
* on the mac address in word 3 */ * on the mac address in word 3
*/
ret_val = mbx->ops.read_posted(hw, msgbuf, IXGBE_VF_PERMADDR_MSG_LEN); ret_val = mbx->ops.read_posted(hw, msgbuf, IXGBE_VF_PERMADDR_MSG_LEN);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
...@@ -138,8 +138,7 @@ static s32 ixgbevf_stop_hw_vf(struct ixgbe_hw *hw) ...@@ -138,8 +138,7 @@ static s32 ixgbevf_stop_hw_vf(struct ixgbe_hw *hw)
u32 reg_val; u32 reg_val;
u16 i; u16 i;
/* /* Set the adapter_stopped flag so other driver functions stop touching
* Set the adapter_stopped flag so other driver functions stop touching
* the hardware * the hardware
*/ */
hw->adapter_stopped = true; hw->adapter_stopped = true;
...@@ -182,7 +181,7 @@ static s32 ixgbevf_stop_hw_vf(struct ixgbe_hw *hw) ...@@ -182,7 +181,7 @@ static s32 ixgbevf_stop_hw_vf(struct ixgbe_hw *hw)
* *
* Extracts the 12 bits, from a multicast address, to determine which * Extracts the 12 bits, from a multicast address, to determine which
* bit-vector to set in the multicast table. The hardware uses 12 bits, from * bit-vector to set in the multicast table. The hardware uses 12 bits, from
* incoming rx multicast addresses, to determine the bit-vector to check in * incoming Rx multicast addresses, to determine the bit-vector to check in
* the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
* by the MO field of the MCSTCTRL. The MO field is set during initialization * by the MO field of the MCSTCTRL. The MO field is set during initialization
* to mc_filter_type. * to mc_filter_type.
...@@ -233,8 +232,7 @@ static s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr) ...@@ -233,8 +232,7 @@ static s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr)
s32 ret_val; s32 ret_val;
memset(msgbuf, 0, sizeof(msgbuf)); memset(msgbuf, 0, sizeof(msgbuf));
/* /* If index is one then this is the start of a new list and needs
* If index is one then this is the start of a new list and needs
* indication to the PF so it can do it's own list management. * indication to the PF so it can do it's own list management.
* If it is zero then that tells the PF to just clear all of * If it is zero then that tells the PF to just clear all of
* this VF's macvlans and there is no new list. * this VF's macvlans and there is no new list.
...@@ -348,7 +346,7 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, ...@@ -348,7 +346,7 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw,
} }
/** /**
* ixgbevf_set_vfta_vf - Set/Unset vlan filter table address * ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* @vlan: 12 bit VLAN ID * @vlan: 12 bit VLAN ID
* @vind: unused by VF drivers * @vind: unused by VF drivers
...@@ -462,7 +460,8 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw, ...@@ -462,7 +460,8 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
} }
/* if the read failed it could just be a mailbox collision, best wait /* if the read failed it could just be a mailbox collision, best wait
* until we are called again and don't report an error */ * until we are called again and don't report an error
*/
if (mbx->ops.read(hw, &in_msg, 1)) if (mbx->ops.read(hw, &in_msg, 1))
goto out; goto out;
...@@ -480,7 +479,8 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw, ...@@ -480,7 +479,8 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
} }
/* if we passed all the tests above then the link is up and we no /* if we passed all the tests above then the link is up and we no
* longer need to check for link */ * longer need to check for link
*/
mac->get_link_status = false; mac->get_link_status = false;
out: out:
...@@ -561,8 +561,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs, ...@@ -561,8 +561,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
if (!err) { if (!err) {
msg[0] &= ~IXGBE_VT_MSGTYPE_CTS; msg[0] &= ~IXGBE_VT_MSGTYPE_CTS;
/* /* if we we didn't get an ACK there must have been
* if we we didn't get an ACK there must have been
* some sort of mailbox error so we should treat it * some sort of mailbox error so we should treat it
* as such * as such
*/ */
......
/******************************************************************************* /*******************************************************************************
Intel 82599 Virtual Function driver Intel 82599 Virtual Function driver
Copyright(c) 1999 - 2014 Intel Corporation. Copyright(c) 1999 - 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, under the terms and conditions of the GNU General Public License,
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
more details. more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., this program; if not, see <http://www.gnu.org/licenses/>.
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in The full GNU General Public License is included in this distribution in
the file called "COPYING". the file called "COPYING".
...@@ -185,6 +184,7 @@ static inline void ixgbe_write_reg(struct ixgbe_hw *hw, u32 reg, u32 value) ...@@ -185,6 +184,7 @@ static inline void ixgbe_write_reg(struct ixgbe_hw *hw, u32 reg, u32 value)
return; return;
writel(value, reg_addr + reg); writel(value, reg_addr + reg);
} }
#define IXGBE_WRITE_REG(h, r, v) ixgbe_write_reg(h, r, v) #define IXGBE_WRITE_REG(h, r, v) ixgbe_write_reg(h, r, v)
u32 ixgbevf_read_reg(struct ixgbe_hw *hw, u32 reg); u32 ixgbevf_read_reg(struct ixgbe_hw *hw, u32 reg);
...@@ -195,6 +195,7 @@ static inline void ixgbe_write_reg_array(struct ixgbe_hw *hw, u32 reg, ...@@ -195,6 +195,7 @@ static inline void ixgbe_write_reg_array(struct ixgbe_hw *hw, u32 reg,
{ {
ixgbe_write_reg(hw, reg + (offset << 2), value); ixgbe_write_reg(hw, reg + (offset << 2), value);
} }
#define IXGBE_WRITE_REG_ARRAY(h, r, o, v) ixgbe_write_reg_array(h, r, o, v) #define IXGBE_WRITE_REG_ARRAY(h, r, o, v) ixgbe_write_reg_array(h, r, o, v)
static inline u32 ixgbe_read_reg_array(struct ixgbe_hw *hw, u32 reg, static inline u32 ixgbe_read_reg_array(struct ixgbe_hw *hw, u32 reg,
...@@ -202,6 +203,7 @@ static inline u32 ixgbe_read_reg_array(struct ixgbe_hw *hw, u32 reg, ...@@ -202,6 +203,7 @@ static inline u32 ixgbe_read_reg_array(struct ixgbe_hw *hw, u32 reg,
{ {
return ixgbevf_read_reg(hw, reg + (offset << 2)); return ixgbevf_read_reg(hw, reg + (offset << 2));
} }
#define IXGBE_READ_REG_ARRAY(h, r, o) ixgbe_read_reg_array(h, r, o) #define IXGBE_READ_REG_ARRAY(h, r, o) ixgbe_read_reg_array(h, r, o)
void ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size); void ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size);
...@@ -209,4 +211,3 @@ int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api); ...@@ -209,4 +211,3 @@ int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api);
int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs, int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
unsigned int *default_tc); unsigned int *default_tc);
#endif /* __IXGBE_VF_H__ */ #endif /* __IXGBE_VF_H__ */
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