Commit 823aeda4 authored by David S. Miller's avatar David S. Miller

Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
100GbE Intel Wired LAN Driver Updates 2015-12-13

This series contains updates to fm10k only.

Jacob updates the driver to use ether_addr_copy() instead of copying
byte-by-byte in a for loop.  Fixed up CamelCase variable names and coding
style issues.  Cleaned up namespace pollution of fm10k_iov_msg_data_pf().
Cleaned up, by making it consistent, the use of VLAN and VLAN ID instead of
vlan or vid.  Lastly, update the driver to initialize XPS so that we can
take advantage of the kernel feature.

Alex Duyck fixed up the driver to free the resources associated with the
MSI-X vector table if the q_vector allocation failed.  Then fixed the driver
to check for msix_entries to be NULL and freed the IRQ if the mailbox API
returned an error on trying to connect.

Bruce cleans up whitespace and namespace pollution issues in the driver.
Also updates the driver to use the BIT() macro instead of bit-shifting coding.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f68766d8 504b0fdf
################################################################################ ################################################################################
# #
# Intel Ethernet Switch Host Interface Driver # Intel Ethernet Switch Host Interface Driver
# Copyright(c) 2013 - 2014 Intel Corporation. # Copyright(c) 2013 - 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,
...@@ -27,7 +27,17 @@ ...@@ -27,7 +27,17 @@
obj-$(CONFIG_FM10K) += fm10k.o obj-$(CONFIG_FM10K) += fm10k.o
fm10k-objs := fm10k_main.o fm10k_common.o fm10k_pci.o \ fm10k-y := fm10k_main.o \
fm10k_netdev.o fm10k_ethtool.o fm10k_pf.o fm10k_vf.o \ fm10k_common.o \
fm10k_mbx.o fm10k_iov.o fm10k_tlv.o \ fm10k_pci.o \
fm10k_debugfs.o fm10k_ptp.o fm10k_dcbnl.o fm10k_ptp.o \
fm10k_netdev.o \
fm10k_ethtool.o \
fm10k_pf.o \
fm10k_vf.o \
fm10k_mbx.o \
fm10k_iov.o \
fm10k_tlv.o
fm10k-$(CONFIG_DEBUG_FS) += fm10k_debugfs.o
fm10k-$(CONFIG_DCB) += fm10k_dcbnl.o
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/cpumask.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -66,6 +67,7 @@ struct fm10k_l2_accel { ...@@ -66,6 +67,7 @@ struct fm10k_l2_accel {
enum fm10k_ring_state_t { enum fm10k_ring_state_t {
__FM10K_TX_DETECT_HANG, __FM10K_TX_DETECT_HANG,
__FM10K_HANG_CHECK_ARMED, __FM10K_HANG_CHECK_ARMED,
__FM10K_TX_XPS_INIT_DONE,
}; };
#define check_for_tx_hang(ring) \ #define check_for_tx_hang(ring) \
...@@ -138,7 +140,7 @@ struct fm10k_ring { ...@@ -138,7 +140,7 @@ struct fm10k_ring {
* different for DCB and RSS modes * different for DCB and RSS modes
*/ */
u8 qos_pc; /* priority class of queue */ u8 qos_pc; /* priority class of queue */
u16 vid; /* default vlan ID of queue */ u16 vid; /* default VLAN ID of queue */
u16 count; /* amount of descriptors */ u16 count; /* amount of descriptors */
u16 next_to_alloc; u16 next_to_alloc;
...@@ -164,7 +166,7 @@ struct fm10k_ring_container { ...@@ -164,7 +166,7 @@ struct fm10k_ring_container {
unsigned int total_packets; /* total packets processed this int */ unsigned int total_packets; /* total packets processed this int */
u16 work_limit; /* total work allowed per interrupt */ u16 work_limit; /* total work allowed per interrupt */
u16 itr; /* interrupt throttle rate value */ u16 itr; /* interrupt throttle rate value */
u8 itr_scale; /* ITR adjustment scaler based on PCI speed */ u8 itr_scale; /* ITR adjustment based on PCI speed */
u8 count; /* total number of rings in vector */ u8 count; /* total number of rings in vector */
}; };
...@@ -209,6 +211,7 @@ struct fm10k_q_vector { ...@@ -209,6 +211,7 @@ struct fm10k_q_vector {
struct fm10k_ring_container rx, tx; struct fm10k_ring_container rx, tx;
struct napi_struct napi; struct napi_struct napi;
cpumask_t affinity_mask;
char name[IFNAMSIZ + 9]; char name[IFNAMSIZ + 9];
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
...@@ -419,7 +422,7 @@ static inline u16 fm10k_desc_unused(struct fm10k_ring *ring) ...@@ -419,7 +422,7 @@ static inline u16 fm10k_desc_unused(struct fm10k_ring *ring)
(&(((union fm10k_rx_desc *)((R)->desc))[i])) (&(((union fm10k_rx_desc *)((R)->desc))[i]))
#define FM10K_MAX_TXD_PWR 14 #define FM10K_MAX_TXD_PWR 14
#define FM10K_MAX_DATA_PER_TXD (1 << FM10K_MAX_TXD_PWR) #define FM10K_MAX_DATA_PER_TXD BIT(FM10K_MAX_TXD_PWR)
/* Tx Descriptors needed, worst case */ /* Tx Descriptors needed, worst case */
#define TXD_USE_COUNT(S) DIV_ROUND_UP((S), FM10K_MAX_DATA_PER_TXD) #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), FM10K_MAX_DATA_PER_TXD)
...@@ -440,7 +443,7 @@ union fm10k_ftag_info { ...@@ -440,7 +443,7 @@ union fm10k_ftag_info {
struct { struct {
/* dglort and sglort combined into a single 32bit desc read */ /* dglort and sglort combined into a single 32bit desc read */
__le32 glort; __le32 glort;
/* upper 16 bits of vlan are reserved 0 for swpri_type_user */ /* upper 16 bits of VLAN are reserved 0 for swpri_type_user */
__le32 vlan; __le32 vlan;
} d; } d;
struct { struct {
...@@ -557,5 +560,9 @@ int fm10k_get_ts_config(struct net_device *netdev, struct ifreq *ifr); ...@@ -557,5 +560,9 @@ int fm10k_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
int fm10k_set_ts_config(struct net_device *netdev, struct ifreq *ifr); int fm10k_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
/* DCB */ /* DCB */
#ifdef CONFIG_DCB
void fm10k_dcbnl_set_ops(struct net_device *dev); void fm10k_dcbnl_set_ops(struct net_device *dev);
#else
static inline void fm10k_dcbnl_set_ops(struct net_device *dev) {}
#endif
#endif /* _FM10K_H_ */ #endif /* _FM10K_H_ */
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "fm10k.h" #include "fm10k.h"
#ifdef CONFIG_DCB
/** /**
* fm10k_dcbnl_ieee_getets - get the ETS configuration for the device * fm10k_dcbnl_ieee_getets - get the ETS configuration for the device
* @dev: netdev interface for the device * @dev: netdev interface for the device
...@@ -155,7 +154,6 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = { ...@@ -155,7 +154,6 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = {
.setdcbx = fm10k_dcbnl_setdcbx, .setdcbx = fm10k_dcbnl_setdcbx,
}; };
#endif /* CONFIG_DCB */
/** /**
* fm10k_dcbnl_set_ops - Configures dcbnl ops pointer for netdev * fm10k_dcbnl_set_ops - Configures dcbnl ops pointer for netdev
* @dev: netdev interface for the device * @dev: netdev interface for the device
...@@ -164,11 +162,9 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = { ...@@ -164,11 +162,9 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = {
**/ **/
void fm10k_dcbnl_set_ops(struct net_device *dev) void fm10k_dcbnl_set_ops(struct net_device *dev)
{ {
#ifdef CONFIG_DCB
struct fm10k_intfc *interface = netdev_priv(dev); struct fm10k_intfc *interface = netdev_priv(dev);
struct fm10k_hw *hw = &interface->hw; struct fm10k_hw *hw = &interface->hw;
if (hw->mac.type == fm10k_mac_pf) if (hw->mac.type == fm10k_mac_pf)
dev->dcbnl_ops = &fm10k_dcbnl_ops; dev->dcbnl_ops = &fm10k_dcbnl_ops;
#endif /* CONFIG_DCB */
} }
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/ */
#ifdef CONFIG_DEBUG_FS
#include "fm10k.h" #include "fm10k.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
...@@ -258,5 +256,3 @@ void fm10k_dbg_exit(void) ...@@ -258,5 +256,3 @@ void fm10k_dbg_exit(void)
debugfs_remove_recursive(dbg_root); debugfs_remove_recursive(dbg_root);
dbg_root = NULL; dbg_root = NULL;
} }
#endif /* CONFIG_DEBUG_FS */
...@@ -127,7 +127,7 @@ static const struct fm10k_stats fm10k_gstrings_mbx_stats[] = { ...@@ -127,7 +127,7 @@ static const struct fm10k_stats fm10k_gstrings_mbx_stats[] = {
#define FM10K_MBX_STATS_LEN ARRAY_SIZE(fm10k_gstrings_mbx_stats) #define FM10K_MBX_STATS_LEN ARRAY_SIZE(fm10k_gstrings_mbx_stats)
#define FM10K_QUEUE_STATS_LEN(_n) \ #define FM10K_QUEUE_STATS_LEN(_n) \
( (_n) * 2 * (sizeof(struct fm10k_queue_stats) / sizeof(u64))) ((_n) * 2 * (sizeof(struct fm10k_queue_stats) / sizeof(u64)))
#define FM10K_STATIC_STATS_LEN (FM10K_GLOBAL_STATS_LEN + \ #define FM10K_STATIC_STATS_LEN (FM10K_GLOBAL_STATS_LEN + \
FM10K_NETDEV_STATS_LEN + \ FM10K_NETDEV_STATS_LEN + \
...@@ -259,7 +259,8 @@ static int fm10k_get_sset_count(struct net_device *dev, int sset) ...@@ -259,7 +259,8 @@ static int fm10k_get_sset_count(struct net_device *dev, int sset)
stats_len += FM10K_DEBUG_STATS_LEN; stats_len += FM10K_DEBUG_STATS_LEN;
if (iov_data) if (iov_data)
stats_len += FM10K_MBX_STATS_LEN * iov_data->num_vfs; stats_len += FM10K_MBX_STATS_LEN *
iov_data->num_vfs;
} }
return stats_len; return stats_len;
...@@ -298,14 +299,16 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev, ...@@ -298,14 +299,16 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,
if (interface->flags & FM10K_FLAG_DEBUG_STATS) { if (interface->flags & FM10K_FLAG_DEBUG_STATS) {
for (i = 0; i < FM10K_DEBUG_STATS_LEN; i++) { for (i = 0; i < FM10K_DEBUG_STATS_LEN; i++) {
p = (char *)interface + fm10k_gstrings_debug_stats[i].stat_offset; p = (char *)interface +
fm10k_gstrings_debug_stats[i].stat_offset;
*(data++) = (fm10k_gstrings_debug_stats[i].sizeof_stat == *(data++) = (fm10k_gstrings_debug_stats[i].sizeof_stat ==
sizeof(u64)) ? *(u64 *)p : *(u32 *)p; sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
} }
} }
for (i = 0; i < FM10K_MBX_STATS_LEN; i++) { for (i = 0; i < FM10K_MBX_STATS_LEN; i++) {
p = (char *)&interface->hw.mbx + fm10k_gstrings_mbx_stats[i].stat_offset; p = (char *)&interface->hw.mbx +
fm10k_gstrings_mbx_stats[i].stat_offset;
*(data++) = (fm10k_gstrings_mbx_stats[i].sizeof_stat == *(data++) = (fm10k_gstrings_mbx_stats[i].sizeof_stat ==
sizeof(u64)) ? *(u64 *)p : *(u32 *)p; sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
} }
...@@ -322,6 +325,7 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev, ...@@ -322,6 +325,7 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,
if ((interface->flags & FM10K_FLAG_DEBUG_STATS) && iov_data) { if ((interface->flags & FM10K_FLAG_DEBUG_STATS) && iov_data) {
for (i = 0; i < iov_data->num_vfs; i++) { for (i = 0; i < iov_data->num_vfs; i++) {
struct fm10k_vf_info *vf_info; struct fm10k_vf_info *vf_info;
vf_info = &iov_data->vf_info[i]; vf_info = &iov_data->vf_info[i];
/* skip stats if we don't have a vf info */ /* skip stats if we don't have a vf info */
...@@ -331,7 +335,8 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev, ...@@ -331,7 +335,8 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,
} }
for (j = 0; j < FM10K_MBX_STATS_LEN; j++) { for (j = 0; j < FM10K_MBX_STATS_LEN; j++) {
p = (char *)&vf_info->mbx + fm10k_gstrings_mbx_stats[j].stat_offset; p = (char *)&vf_info->mbx +
fm10k_gstrings_mbx_stats[j].stat_offset;
*(data++) = (fm10k_gstrings_mbx_stats[j].sizeof_stat == *(data++) = (fm10k_gstrings_mbx_stats[j].sizeof_stat ==
sizeof(u64)) ? *(u64 *)p : *(u32 *)p; sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
} }
...@@ -1020,7 +1025,6 @@ static int fm10k_set_priv_flags(struct net_device *netdev, u32 priv_flags) ...@@ -1020,7 +1025,6 @@ static int fm10k_set_priv_flags(struct net_device *netdev, u32 priv_flags)
return 0; return 0;
} }
static u32 fm10k_get_reta_size(struct net_device __always_unused *netdev) static u32 fm10k_get_reta_size(struct net_device __always_unused *netdev)
{ {
return FM10K_RETA_SIZE * FM10K_RETA_ENTRIES_PER_REG; return FM10K_RETA_SIZE * FM10K_RETA_ENTRIES_PER_REG;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "fm10k.h" #include "fm10k.h"
#define DRV_VERSION "0.15.2-k" #define DRV_VERSION "0.19.3-k"
const char fm10k_driver_version[] = DRV_VERSION; const char fm10k_driver_version[] = DRV_VERSION;
char fm10k_driver_name[] = "fm10k"; char fm10k_driver_name[] = "fm10k";
static const char fm10k_driver_string[] = static const char fm10k_driver_string[] =
...@@ -917,7 +917,7 @@ static u8 fm10k_tx_desc_flags(struct sk_buff *skb, u32 tx_flags) ...@@ -917,7 +917,7 @@ static u8 fm10k_tx_desc_flags(struct sk_buff *skb, u32 tx_flags)
/* set timestamping bits */ /* set timestamping bits */
if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
likely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) likely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS))
desc_flags |= FM10K_TXD_FLAG_TIME; desc_flags |= FM10K_TXD_FLAG_TIME;
/* set checksum offload bits */ /* set checksum offload bits */
desc_flags |= FM10K_SET_FLAG(tx_flags, FM10K_TX_FLAGS_CSUM, desc_flags |= FM10K_SET_FLAG(tx_flags, FM10K_TX_FLAGS_CSUM,
...@@ -1462,7 +1462,7 @@ static int fm10k_poll(struct napi_struct *napi, int budget) ...@@ -1462,7 +1462,7 @@ static int fm10k_poll(struct napi_struct *napi, int budget)
* allow the budget to go below 1 because we'll exit polling * allow the budget to go below 1 because we'll exit polling
*/ */
if (q_vector->rx.count > 1) if (q_vector->rx.count > 1)
per_ring_budget = max(budget/q_vector->rx.count, 1); per_ring_budget = max(budget / q_vector->rx.count, 1);
else else
per_ring_budget = budget; per_ring_budget = budget;
...@@ -1998,8 +1998,10 @@ int fm10k_init_queueing_scheme(struct fm10k_intfc *interface) ...@@ -1998,8 +1998,10 @@ int fm10k_init_queueing_scheme(struct fm10k_intfc *interface)
/* Allocate memory for queues */ /* Allocate memory for queues */
err = fm10k_alloc_q_vectors(interface); err = fm10k_alloc_q_vectors(interface);
if (err) if (err) {
fm10k_reset_msix_capability(interface);
return err; return err;
}
/* Map rings to devices, and map devices to physical queues */ /* Map rings to devices, and map devices to physical queues */
fm10k_assign_rings(interface); fm10k_assign_rings(interface);
......
...@@ -903,7 +903,7 @@ static void fm10k_mbx_create_disconnect_hdr(struct fm10k_mbx_info *mbx) ...@@ -903,7 +903,7 @@ static void fm10k_mbx_create_disconnect_hdr(struct fm10k_mbx_info *mbx)
} }
/** /**
* fm10k_mbx_create_fake_disconnect_hdr - Generate a false disconnect mailbox header * fm10k_mbx_create_fake_disconnect_hdr - Generate a false disconnect mbox hdr
* @mbx: pointer to mailbox * @mbx: pointer to mailbox
* *
* This function creates a fake disconnect header for loading into remote * This function creates a fake disconnect header for loading into remote
...@@ -2140,6 +2140,7 @@ s32 fm10k_sm_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx, ...@@ -2140,6 +2140,7 @@ s32 fm10k_sm_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,
{ {
mbx->mbx_reg = FM10K_GMBX; mbx->mbx_reg = FM10K_GMBX;
mbx->mbmem_reg = FM10K_MBMEM_PF(0); mbx->mbmem_reg = FM10K_MBMEM_PF(0);
/* start out in closed state */ /* start out in closed state */
mbx->state = FM10K_STATE_CLOSED; mbx->state = FM10K_STATE_CLOSED;
......
...@@ -608,7 +608,7 @@ static netdev_tx_t fm10k_xmit_frame(struct sk_buff *skb, struct net_device *dev) ...@@ -608,7 +608,7 @@ static netdev_tx_t fm10k_xmit_frame(struct sk_buff *skb, struct net_device *dev)
unsigned int r_idx = skb->queue_mapping; unsigned int r_idx = skb->queue_mapping;
int err; int err;
if ((skb->protocol == htons(ETH_P_8021Q)) && if ((skb->protocol == htons(ETH_P_8021Q)) &&
!skb_vlan_tag_present(skb)) { !skb_vlan_tag_present(skb)) {
/* FM10K only supports hardware tagging, any tags in frame /* FM10K only supports hardware tagging, any tags in frame
* are considered 2nd level or "outer" tags * are considered 2nd level or "outer" tags
...@@ -632,7 +632,7 @@ static netdev_tx_t fm10k_xmit_frame(struct sk_buff *skb, struct net_device *dev) ...@@ -632,7 +632,7 @@ static netdev_tx_t fm10k_xmit_frame(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
/* locate vlan header */ /* locate VLAN header */
vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN); vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
/* pull the 2 key pieces of data out of it */ /* pull the 2 key pieces of data out of it */
...@@ -705,7 +705,7 @@ static void fm10k_tx_timeout(struct net_device *netdev) ...@@ -705,7 +705,7 @@ static void fm10k_tx_timeout(struct net_device *netdev)
} else { } else {
netif_info(interface, drv, netdev, netif_info(interface, drv, netdev,
"Fake Tx hang detected with timeout of %d seconds\n", "Fake Tx hang detected with timeout of %d seconds\n",
netdev->watchdog_timeo/HZ); netdev->watchdog_timeo / HZ);
/* fake Tx hang - increase the kernel timeout */ /* fake Tx hang - increase the kernel timeout */
if (netdev->watchdog_timeo < TX_TIMEO_LIMIT) if (netdev->watchdog_timeo < TX_TIMEO_LIMIT)
...@@ -778,7 +778,7 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) ...@@ -778,7 +778,7 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
if (!set) if (!set)
clear_bit(vid, interface->active_vlans); clear_bit(vid, interface->active_vlans);
/* disable the default VID on ring if we have an active VLAN */ /* disable the default VLAN ID on ring if we have an active VLAN */
for (i = 0; i < interface->num_rx_queues; i++) { for (i = 0; i < interface->num_rx_queues; i++) {
struct fm10k_ring *rx_ring = interface->rx_ring[i]; struct fm10k_ring *rx_ring = interface->rx_ring[i];
u16 rx_vid = rx_ring->vid & (VLAN_N_VID - 1); u16 rx_vid = rx_ring->vid & (VLAN_N_VID - 1);
...@@ -789,7 +789,9 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) ...@@ -789,7 +789,9 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
rx_ring->vid &= ~FM10K_VLAN_CLEAR; rx_ring->vid &= ~FM10K_VLAN_CLEAR;
} }
/* Do not remove default VID related entries from VLAN and MAC tables */ /* Do not remove default VLAN ID related entries from VLAN and MAC
* tables
*/
if (!set && vid == hw->mac.default_vid) if (!set && vid == hw->mac.default_vid)
return 0; return 0;
...@@ -814,7 +816,7 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) ...@@ -814,7 +816,7 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
if (err) if (err)
goto err_out; goto err_out;
/* set vid prior to syncing/unsyncing the VLAN */ /* set VLAN ID prior to syncing/unsyncing the VLAN */
interface->vid = vid + (set ? VLAN_N_VID : 0); interface->vid = vid + (set ? VLAN_N_VID : 0);
/* Update the unicast and multicast address list to add/drop VLAN */ /* Update the unicast and multicast address list to add/drop VLAN */
......
...@@ -180,7 +180,8 @@ static void fm10k_reinit(struct fm10k_intfc *interface) ...@@ -180,7 +180,8 @@ static void fm10k_reinit(struct fm10k_intfc *interface)
err = fm10k_init_queueing_scheme(interface); err = fm10k_init_queueing_scheme(interface);
if (err) { if (err) {
dev_err(&interface->pdev->dev, "init_queueing_scheme failed: %d\n", err); dev_err(&interface->pdev->dev,
"init_queueing_scheme failed: %d\n", err);
goto reinit_err; goto reinit_err;
} }
...@@ -600,6 +601,13 @@ static void fm10k_configure_tx_ring(struct fm10k_intfc *interface, ...@@ -600,6 +601,13 @@ static void fm10k_configure_tx_ring(struct fm10k_intfc *interface,
fm10k_write_reg(hw, FM10K_PFVTCTL(reg_idx), fm10k_write_reg(hw, FM10K_PFVTCTL(reg_idx),
FM10K_PFVTCTL_FTAG_DESC_ENABLE); FM10K_PFVTCTL_FTAG_DESC_ENABLE);
/* Initialize XPS */
if (!test_and_set_bit(__FM10K_TX_XPS_INIT_DONE, &ring->state) &&
ring->q_vector)
netif_set_xps_queue(ring->netdev,
&ring->q_vector->affinity_mask,
ring->queue_index);
/* enable queue */ /* enable queue */
fm10k_write_reg(hw, FM10K_TXDCTL(reg_idx), txdctl); fm10k_write_reg(hw, FM10K_TXDCTL(reg_idx), txdctl);
} }
...@@ -715,7 +723,7 @@ static void fm10k_configure_rx_ring(struct fm10k_intfc *interface, ...@@ -715,7 +723,7 @@ static void fm10k_configure_rx_ring(struct fm10k_intfc *interface,
/* assign default VLAN to queue */ /* assign default VLAN to queue */
ring->vid = hw->mac.default_vid; ring->vid = hw->mac.default_vid;
/* if we have an active VLAN, disable default VID */ /* if we have an active VLAN, disable default VLAN ID */
if (test_bit(hw->mac.default_vid, interface->active_vlans)) if (test_bit(hw->mac.default_vid, interface->active_vlans))
ring->vid |= FM10K_VLAN_CLEAR; ring->vid |= FM10K_VLAN_CLEAR;
...@@ -919,7 +927,7 @@ void fm10k_netpoll(struct net_device *netdev) ...@@ -919,7 +927,7 @@ void fm10k_netpoll(struct net_device *netdev)
#endif #endif
#define FM10K_ERR_MSG(type) case (type): error = #type; break #define FM10K_ERR_MSG(type) case (type): error = #type; break
static void fm10k_handle_fault(struct fm10k_intfc *interface, int type, static void fm10k_handle_fault(struct fm10k_intfc *interface, int type,
struct fm10k_fault *fault) struct fm10k_fault *fault)
{ {
struct pci_dev *pdev = interface->pdev; struct pci_dev *pdev = interface->pdev;
struct fm10k_hw *hw = &interface->hw; struct fm10k_hw *hw = &interface->hw;
...@@ -1124,6 +1132,10 @@ void fm10k_mbx_free_irq(struct fm10k_intfc *interface) ...@@ -1124,6 +1132,10 @@ void fm10k_mbx_free_irq(struct fm10k_intfc *interface)
struct fm10k_hw *hw = &interface->hw; struct fm10k_hw *hw = &interface->hw;
int itr_reg; int itr_reg;
/* no mailbox IRQ to free if MSI-X is not enabled */
if (!interface->msix_entries)
return;
/* disconnect the mailbox */ /* disconnect the mailbox */
hw->mbx.ops.disconnect(hw, &hw->mbx); hw->mbx.ops.disconnect(hw, &hw->mbx);
...@@ -1292,7 +1304,7 @@ static s32 fm10k_update_pvid(struct fm10k_hw *hw, u32 **results, ...@@ -1292,7 +1304,7 @@ static s32 fm10k_update_pvid(struct fm10k_hw *hw, u32 **results,
if (!fm10k_glort_valid_pf(hw, glort)) if (!fm10k_glort_valid_pf(hw, glort))
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
/* verify VID is valid */ /* verify VLAN ID is valid */
if (pvid >= FM10K_VLAN_TABLE_VID_MAX) if (pvid >= FM10K_VLAN_TABLE_VID_MAX)
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
...@@ -1411,14 +1423,14 @@ static int fm10k_mbx_request_irq_pf(struct fm10k_intfc *interface) ...@@ -1411,14 +1423,14 @@ static int fm10k_mbx_request_irq_pf(struct fm10k_intfc *interface)
} }
/* Enable interrupts w/ no moderation for "other" interrupts */ /* Enable interrupts w/ no moderation for "other" interrupts */
fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_PCIeFault), other_itr); fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_pcie_fault), other_itr);
fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_SwitchUpDown), other_itr); fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_switch_up_down), other_itr);
fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_SRAM), other_itr); fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_sram), other_itr);
fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_MaxHoldTime), other_itr); fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_max_hold_time), other_itr);
fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_VFLR), other_itr); fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_vflr), other_itr);
/* Enable interrupts w/ moderation for mailbox */ /* Enable interrupts w/ moderation for mailbox */
fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_Mailbox), mbx_itr); fm10k_write_reg(hw, FM10K_INT_MAP(fm10k_int_mailbox), mbx_itr);
/* Enable individual interrupt causes */ /* Enable individual interrupt causes */
fm10k_write_reg(hw, FM10K_EIMR, FM10K_EIMR_ENABLE(PCA_FAULT) | fm10k_write_reg(hw, FM10K_EIMR, FM10K_EIMR_ENABLE(PCA_FAULT) |
...@@ -1446,10 +1458,15 @@ int fm10k_mbx_request_irq(struct fm10k_intfc *interface) ...@@ -1446,10 +1458,15 @@ int fm10k_mbx_request_irq(struct fm10k_intfc *interface)
err = fm10k_mbx_request_irq_pf(interface); err = fm10k_mbx_request_irq_pf(interface);
else else
err = fm10k_mbx_request_irq_vf(interface); err = fm10k_mbx_request_irq_vf(interface);
if (err)
return err;
/* connect mailbox */ /* connect mailbox */
if (!err) err = hw->mbx.ops.connect(hw, &hw->mbx);
err = hw->mbx.ops.connect(hw, &hw->mbx);
/* if the mailbox failed to connect, then free IRQ */
if (err)
fm10k_mbx_free_irq(interface);
return err; return err;
} }
...@@ -1478,8 +1495,10 @@ void fm10k_qv_free_irq(struct fm10k_intfc *interface) ...@@ -1478,8 +1495,10 @@ void fm10k_qv_free_irq(struct fm10k_intfc *interface)
if (!q_vector->tx.count && !q_vector->rx.count) if (!q_vector->tx.count && !q_vector->rx.count)
continue; continue;
/* disable interrupts */ /* clear the affinity_mask in the IRQ descriptor */
irq_set_affinity_hint(entry->vector, NULL);
/* disable interrupts */
writel(FM10K_ITR_MASK_SET, q_vector->itr); writel(FM10K_ITR_MASK_SET, q_vector->itr);
free_irq(entry->vector, q_vector); free_irq(entry->vector, q_vector);
...@@ -1537,6 +1556,9 @@ int fm10k_qv_request_irq(struct fm10k_intfc *interface) ...@@ -1537,6 +1556,9 @@ int fm10k_qv_request_irq(struct fm10k_intfc *interface)
goto err_out; goto err_out;
} }
/* assign the mask for this irq */
irq_set_affinity_hint(entry->vector, &q_vector->affinity_mask);
/* Enable q_vector */ /* Enable q_vector */
writel(FM10K_ITR_ENABLE, q_vector->itr); writel(FM10K_ITR_ENABLE, q_vector->itr);
...@@ -1557,8 +1579,10 @@ int fm10k_qv_request_irq(struct fm10k_intfc *interface) ...@@ -1557,8 +1579,10 @@ int fm10k_qv_request_irq(struct fm10k_intfc *interface)
if (!q_vector->tx.count && !q_vector->rx.count) if (!q_vector->tx.count && !q_vector->rx.count)
continue; continue;
/* disable interrupts */ /* clear the affinity_mask in the IRQ descriptor */
irq_set_affinity_hint(entry->vector, NULL);
/* disable interrupts */
writel(FM10K_ITR_MASK_SET, q_vector->itr); writel(FM10K_ITR_MASK_SET, q_vector->itr);
free_irq(entry->vector, q_vector); free_irq(entry->vector, q_vector);
...@@ -1857,17 +1881,18 @@ static void fm10k_slot_warn(struct fm10k_intfc *interface) ...@@ -1857,17 +1881,18 @@ static void fm10k_slot_warn(struct fm10k_intfc *interface)
return; return;
} }
if (max_gts < expected_gts) { if (max_gts >= expected_gts)
dev_warn(&interface->pdev->dev, return;
"This device requires %dGT/s of bandwidth for optimal performance.\n",
expected_gts); dev_warn(&interface->pdev->dev,
dev_warn(&interface->pdev->dev, "This device requires %dGT/s of bandwidth for optimal performance.\n",
"A %sslot with x%d lanes is suggested.\n", expected_gts);
(hw->bus_caps.speed == fm10k_bus_speed_2500 ? "2.5GT/s " : dev_warn(&interface->pdev->dev,
hw->bus_caps.speed == fm10k_bus_speed_5000 ? "5.0GT/s " : "A %sslot with x%d lanes is suggested.\n",
hw->bus_caps.speed == fm10k_bus_speed_8000 ? "8.0GT/s " : ""), (hw->bus_caps.speed == fm10k_bus_speed_2500 ? "2.5GT/s " :
hw->bus_caps.width); hw->bus_caps.speed == fm10k_bus_speed_5000 ? "5.0GT/s " :
} hw->bus_caps.speed == fm10k_bus_speed_8000 ? "8.0GT/s " : ""),
hw->bus_caps.width);
} }
/** /**
...@@ -1881,8 +1906,7 @@ static void fm10k_slot_warn(struct fm10k_intfc *interface) ...@@ -1881,8 +1906,7 @@ static void fm10k_slot_warn(struct fm10k_intfc *interface)
* The OS initialization, configuring of the interface private structure, * The OS initialization, configuring of the interface private structure,
* and a hardware reset occur. * and a hardware reset occur.
**/ **/
static int fm10k_probe(struct pci_dev *pdev, static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
const struct pci_device_id *ent)
{ {
struct net_device *netdev; struct net_device *netdev;
struct fm10k_intfc *interface; struct fm10k_intfc *interface;
...@@ -2286,7 +2310,8 @@ static void fm10k_io_resume(struct pci_dev *pdev) ...@@ -2286,7 +2310,8 @@ static void fm10k_io_resume(struct pci_dev *pdev)
err = fm10k_init_queueing_scheme(interface); err = fm10k_init_queueing_scheme(interface);
if (err) { if (err) {
dev_err(&interface->pdev->dev, "init_queueing_scheme failed: %d\n", err); dev_err(&interface->pdev->dev,
"init_queueing_scheme failed: %d\n", err);
return; return;
} }
......
...@@ -266,7 +266,6 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw) ...@@ -266,7 +266,6 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw)
{ {
u8 perm_addr[ETH_ALEN]; u8 perm_addr[ETH_ALEN];
u32 serial_num; u32 serial_num;
int i;
serial_num = fm10k_read_reg(hw, FM10K_SM_AREA(1)); serial_num = fm10k_read_reg(hw, FM10K_SM_AREA(1));
...@@ -288,10 +287,8 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw) ...@@ -288,10 +287,8 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw)
perm_addr[4] = (u8)(serial_num >> 8); perm_addr[4] = (u8)(serial_num >> 8);
perm_addr[5] = (u8)(serial_num); perm_addr[5] = (u8)(serial_num);
for (i = 0; i < ETH_ALEN; i++) { ether_addr_copy(hw->mac.perm_addr, perm_addr);
hw->mac.perm_addr[i] = perm_addr[i]; ether_addr_copy(hw->mac.addr, perm_addr);
hw->mac.addr[i] = perm_addr[i];
}
return 0; return 0;
} }
...@@ -332,7 +329,7 @@ static s32 fm10k_update_xc_addr_pf(struct fm10k_hw *hw, u16 glort, ...@@ -332,7 +329,7 @@ static s32 fm10k_update_xc_addr_pf(struct fm10k_hw *hw, u16 glort,
/* clear set bit from VLAN ID */ /* clear set bit from VLAN ID */
vid &= ~FM10K_VLAN_CLEAR; vid &= ~FM10K_VLAN_CLEAR;
/* if glort or vlan are not valid return error */ /* if glort or VLAN are not valid return error */
if (!fm10k_glort_valid_pf(hw, glort) || vid >= FM10K_VLAN_TABLE_VID_MAX) if (!fm10k_glort_valid_pf(hw, glort) || vid >= FM10K_VLAN_TABLE_VID_MAX)
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
...@@ -417,6 +414,7 @@ static s32 fm10k_update_xcast_mode_pf(struct fm10k_hw *hw, u16 glort, u8 mode) ...@@ -417,6 +414,7 @@ static s32 fm10k_update_xcast_mode_pf(struct fm10k_hw *hw, u16 glort, u8 mode)
if (mode > FM10K_XCAST_MODE_NONE) if (mode > FM10K_XCAST_MODE_NONE)
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
/* if glort is not valid return error */ /* if glort is not valid return error */
if (!fm10k_glort_valid_pf(hw, glort)) if (!fm10k_glort_valid_pf(hw, glort))
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
...@@ -924,7 +922,7 @@ static s32 fm10k_iov_assign_default_mac_vlan_pf(struct fm10k_hw *hw, ...@@ -924,7 +922,7 @@ static s32 fm10k_iov_assign_default_mac_vlan_pf(struct fm10k_hw *hw,
txqctl |= (vf_idx << FM10K_TXQCTL_TC_SHIFT) | txqctl |= (vf_idx << FM10K_TXQCTL_TC_SHIFT) |
FM10K_TXQCTL_VF | vf_idx; FM10K_TXQCTL_VF | vf_idx;
/* assign VID */ /* assign VLAN ID */
for (i = 0; i < queues_per_pool; i++) for (i = 0; i < queues_per_pool; i++)
fm10k_write_reg(hw, FM10K_TXQCTL(vf_q_idx + i), txqctl); fm10k_write_reg(hw, FM10K_TXQCTL(vf_q_idx + i), txqctl);
...@@ -1175,14 +1173,14 @@ s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *hw, u32 **results, ...@@ -1175,14 +1173,14 @@ s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *hw, u32 **results,
} }
/** /**
* fm10k_iov_select_vid - Select correct default VID * fm10k_iov_select_vid - Select correct default VLAN ID
* @hw: Pointer to hardware structure * @hw: Pointer to hardware structure
* @vid: VID to correct * @vid: VLAN ID to correct
* *
* Will report an error if VID is out of range. For VID = 0, it will return * Will report an error if the VLAN ID is out of range. For VID = 0, it will
* either the pf_vid or sw_vid depending on which one is set. * return either the pf_vid or sw_vid depending on which one is set.
*/ */
static inline s32 fm10k_iov_select_vid(struct fm10k_vf_info *vf_info, u16 vid) static s32 fm10k_iov_select_vid(struct fm10k_vf_info *vf_info, u16 vid)
{ {
if (!vid) if (!vid)
return vf_info->pf_vid ? vf_info->pf_vid : vf_info->sw_vid; return vf_info->pf_vid ? vf_info->pf_vid : vf_info->sw_vid;
...@@ -1235,8 +1233,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results, ...@@ -1235,8 +1233,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results,
err = fm10k_iov_select_vid(vf_info, (u16)vid); err = fm10k_iov_select_vid(vf_info, (u16)vid);
if (err < 0) if (err < 0)
return err; return err;
else
vid = err; vid = err;
/* update VSI info for VF in regards to VLAN table */ /* update VSI info for VF in regards to VLAN table */
err = hw->mac.ops.update_vlan(hw, vid, vf_info->vsi, set); err = hw->mac.ops.update_vlan(hw, vid, vf_info->vsi, set);
...@@ -1261,8 +1259,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results, ...@@ -1261,8 +1259,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results,
err = fm10k_iov_select_vid(vf_info, vlan); err = fm10k_iov_select_vid(vf_info, vlan);
if (err < 0) if (err < 0)
return err; return err;
else
vlan = (u16)err; vlan = (u16)err;
/* notify switch of request for new unicast address */ /* notify switch of request for new unicast address */
err = hw->mac.ops.update_uc_addr(hw, vf_info->glort, err = hw->mac.ops.update_uc_addr(hw, vf_info->glort,
...@@ -1287,8 +1285,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results, ...@@ -1287,8 +1285,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results,
err = fm10k_iov_select_vid(vf_info, vlan); err = fm10k_iov_select_vid(vf_info, vlan);
if (err < 0) if (err < 0)
return err; return err;
else
vlan = (u16)err; vlan = (u16)err;
/* notify switch of request for new multicast address */ /* notify switch of request for new multicast address */
err = hw->mac.ops.update_mc_addr(hw, vf_info->glort, err = hw->mac.ops.update_mc_addr(hw, vf_info->glort,
...@@ -1416,14 +1414,6 @@ s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *hw, u32 **results, ...@@ -1416,14 +1414,6 @@ s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *hw, u32 **results,
return err; return err;
} }
const struct fm10k_msg_data fm10k_iov_msg_data_pf[] = {
FM10K_TLV_MSG_TEST_HANDLER(fm10k_tlv_msg_test),
FM10K_VF_MSG_MSIX_HANDLER(fm10k_iov_msg_msix_pf),
FM10K_VF_MSG_MAC_VLAN_HANDLER(fm10k_iov_msg_mac_vlan_pf),
FM10K_VF_MSG_LPORT_STATE_HANDLER(fm10k_iov_msg_lport_state_pf),
FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error),
};
/** /**
* fm10k_update_stats_hw_pf - Updates hardware related statistics of PF * fm10k_update_stats_hw_pf - Updates hardware related statistics of PF
* @hw: pointer to hardware structure * @hw: pointer to hardware structure
...@@ -1451,9 +1441,10 @@ static void fm10k_update_hw_stats_pf(struct fm10k_hw *hw, ...@@ -1451,9 +1441,10 @@ static void fm10k_update_hw_stats_pf(struct fm10k_hw *hw,
xec = fm10k_read_hw_stats_32b(hw, FM10K_STATS_XEC, &stats->xec); xec = fm10k_read_hw_stats_32b(hw, FM10K_STATS_XEC, &stats->xec);
vlan_drop = fm10k_read_hw_stats_32b(hw, FM10K_STATS_VLAN_DROP, vlan_drop = fm10k_read_hw_stats_32b(hw, FM10K_STATS_VLAN_DROP,
&stats->vlan_drop); &stats->vlan_drop);
loopback_drop = fm10k_read_hw_stats_32b(hw, loopback_drop =
FM10K_STATS_LOOPBACK_DROP, fm10k_read_hw_stats_32b(hw,
&stats->loopback_drop); FM10K_STATS_LOOPBACK_DROP,
&stats->loopback_drop);
nodesc_drop = fm10k_read_hw_stats_32b(hw, nodesc_drop = fm10k_read_hw_stats_32b(hw,
FM10K_STATS_NODESC_DROP, FM10K_STATS_NODESC_DROP,
&stats->nodesc_drop); &stats->nodesc_drop);
...@@ -1698,8 +1689,8 @@ const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[] = { ...@@ -1698,8 +1689,8 @@ const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[] = {
* *
* This handler configures the default VLAN for the PF * This handler configures the default VLAN for the PF
**/ **/
s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results, static s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results,
struct fm10k_mbx_info *mbx) struct fm10k_mbx_info *mbx)
{ {
u16 glort, pvid; u16 glort, pvid;
u32 pvid_update; u32 pvid_update;
...@@ -1718,7 +1709,7 @@ s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results, ...@@ -1718,7 +1709,7 @@ s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results,
if (!fm10k_glort_valid_pf(hw, glort)) if (!fm10k_glort_valid_pf(hw, glort))
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
/* verify VID is valid */ /* verify VLAN ID is valid */
if (pvid >= FM10K_VLAN_TABLE_VID_MAX) if (pvid >= FM10K_VLAN_TABLE_VID_MAX)
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
......
/* Intel Ethernet Switch Host Interface Driver /* Intel Ethernet Switch Host Interface Driver
* Copyright(c) 2013 - 2014 Intel Corporation. * Copyright(c) 2013 - 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,
...@@ -107,8 +107,6 @@ extern const struct fm10k_tlv_attr fm10k_lport_map_msg_attr[]; ...@@ -107,8 +107,6 @@ extern const struct fm10k_tlv_attr fm10k_lport_map_msg_attr[];
#define FM10K_PF_MSG_LPORT_MAP_HANDLER(func) \ #define FM10K_PF_MSG_LPORT_MAP_HANDLER(func) \
FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_MAP, \ FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_MAP, \
fm10k_lport_map_msg_attr, func) fm10k_lport_map_msg_attr, func)
s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *, u32 **,
struct fm10k_mbx_info *);
extern const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[]; extern const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[];
#define FM10K_PF_MSG_UPDATE_PVID_HANDLER(func) \ #define FM10K_PF_MSG_UPDATE_PVID_HANDLER(func) \
FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_UPDATE_PVID, \ FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_UPDATE_PVID, \
...@@ -129,7 +127,6 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *, u32 **, ...@@ -129,7 +127,6 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *, u32 **,
struct fm10k_mbx_info *); struct fm10k_mbx_info *);
s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *, u32 **, s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *, u32 **,
struct fm10k_mbx_info *); struct fm10k_mbx_info *);
extern const struct fm10k_msg_data fm10k_iov_msg_data_pf[];
extern struct fm10k_info fm10k_pf_info; extern struct fm10k_info fm10k_pf_info;
#endif /* _FM10K_PF_H */ #endif /* _FM10K_PF_H */
/* Intel Ethernet Switch Host Interface Driver /* Intel Ethernet Switch Host Interface Driver
* Copyright(c) 2013 - 2014 Intel Corporation. * Copyright(c) 2013 - 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,
...@@ -48,8 +48,8 @@ s32 fm10k_tlv_msg_init(u32 *msg, u16 msg_id) ...@@ -48,8 +48,8 @@ s32 fm10k_tlv_msg_init(u32 *msg, u16 msg_id)
* the attribute buffer. It will return success if provided with a valid * the attribute buffer. It will return success if provided with a valid
* pointers. * pointers.
**/ **/
s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id, static s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id,
const unsigned char *string) const unsigned char *string)
{ {
u32 attr_data = 0, len = 0; u32 attr_data = 0, len = 0;
u32 *attr; u32 *attr;
...@@ -98,7 +98,7 @@ s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id, ...@@ -98,7 +98,7 @@ s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id,
* it in the array pointed by by string. It will return success if provided * it in the array pointed by by string. It will return success if provided
* with a valid pointers. * with a valid pointers.
**/ **/
s32 fm10k_tlv_attr_get_null_string(u32 *attr, unsigned char *string) static s32 fm10k_tlv_attr_get_null_string(u32 *attr, unsigned char *string)
{ {
u32 len; u32 len;
...@@ -353,7 +353,7 @@ s32 fm10k_tlv_attr_get_le_struct(u32 *attr, void *le_struct, u32 len) ...@@ -353,7 +353,7 @@ s32 fm10k_tlv_attr_get_le_struct(u32 *attr, void *le_struct, u32 len)
* function will return NULL on failure, and a pointer to the start * function will return NULL on failure, and a pointer to the start
* of the nested attributes on success. * of the nested attributes on success.
**/ **/
u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id) static u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id)
{ {
u32 *attr; u32 *attr;
...@@ -370,7 +370,7 @@ u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id) ...@@ -370,7 +370,7 @@ u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id)
} }
/** /**
* fm10k_tlv_attr_nest_start - Start a set of nested attributes * fm10k_tlv_attr_nest_stop - Stop a set of nested attributes
* @msg: Pointer to message block * @msg: Pointer to message block
* *
* This function closes off an existing set of nested attributes. The * This function closes off an existing set of nested attributes. The
...@@ -378,7 +378,7 @@ u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id) ...@@ -378,7 +378,7 @@ u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id)
* the case of a nest within the nest this would be the outer nest pointer. * the case of a nest within the nest this would be the outer nest pointer.
* This function will return success provided all pointers are valid. * This function will return success provided all pointers are valid.
**/ **/
s32 fm10k_tlv_attr_nest_stop(u32 *msg) static s32 fm10k_tlv_attr_nest_stop(u32 *msg)
{ {
u32 *attr; u32 *attr;
u32 len; u32 len;
...@@ -483,8 +483,8 @@ static s32 fm10k_tlv_attr_validate(u32 *attr, ...@@ -483,8 +483,8 @@ static s32 fm10k_tlv_attr_validate(u32 *attr,
* FM10K_NOT_IMPLEMENTED for any attribute that is outside of the array * FM10K_NOT_IMPLEMENTED for any attribute that is outside of the array
* and 0 on success. * and 0 on success.
**/ **/
s32 fm10k_tlv_attr_parse(u32 *attr, u32 **results, static s32 fm10k_tlv_attr_parse(u32 *attr, u32 **results,
const struct fm10k_tlv_attr *tlv_attr) const struct fm10k_tlv_attr *tlv_attr)
{ {
u32 i, attr_id, offset = 0; u32 i, attr_id, offset = 0;
s32 err = 0; s32 err = 0;
......
/* Intel Ethernet Switch Host Interface Driver /* Intel Ethernet Switch Host Interface Driver
* Copyright(c) 2013 - 2014 Intel Corporation. * Copyright(c) 2013 - 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,
...@@ -106,8 +106,6 @@ struct fm10k_msg_data { ...@@ -106,8 +106,6 @@ struct fm10k_msg_data {
#define FM10K_MSG_HANDLER(id, attr, func) { id, attr, func } #define FM10K_MSG_HANDLER(id, attr, func) { id, attr, func }
s32 fm10k_tlv_msg_init(u32 *, u16); s32 fm10k_tlv_msg_init(u32 *, u16);
s32 fm10k_tlv_attr_put_null_string(u32 *, u16, const unsigned char *);
s32 fm10k_tlv_attr_get_null_string(u32 *, unsigned char *);
s32 fm10k_tlv_attr_put_mac_vlan(u32 *, u16, const u8 *, u16); s32 fm10k_tlv_attr_put_mac_vlan(u32 *, u16, const u8 *, u16);
s32 fm10k_tlv_attr_get_mac_vlan(u32 *, u8 *, u16 *); s32 fm10k_tlv_attr_get_mac_vlan(u32 *, u8 *, u16 *);
s32 fm10k_tlv_attr_put_bool(u32 *, u16); s32 fm10k_tlv_attr_put_bool(u32 *, u16);
...@@ -147,9 +145,6 @@ s32 fm10k_tlv_attr_get_value(u32 *, void *, u32); ...@@ -147,9 +145,6 @@ s32 fm10k_tlv_attr_get_value(u32 *, void *, u32);
fm10k_tlv_attr_get_value(attr, ptr, sizeof(s64)) fm10k_tlv_attr_get_value(attr, ptr, sizeof(s64))
s32 fm10k_tlv_attr_put_le_struct(u32 *, u16, const void *, u32); s32 fm10k_tlv_attr_put_le_struct(u32 *, u16, const void *, u32);
s32 fm10k_tlv_attr_get_le_struct(u32 *, void *, u32); s32 fm10k_tlv_attr_get_le_struct(u32 *, void *, u32);
u32 *fm10k_tlv_attr_nest_start(u32 *, u16);
s32 fm10k_tlv_attr_nest_stop(u32 *);
s32 fm10k_tlv_attr_parse(u32 *, u32 **, const struct fm10k_tlv_attr *);
s32 fm10k_tlv_msg_parse(struct fm10k_hw *, u32 *, struct fm10k_mbx_info *, s32 fm10k_tlv_msg_parse(struct fm10k_hw *, u32 *, struct fm10k_mbx_info *,
const struct fm10k_msg_data *); const struct fm10k_msg_data *);
s32 fm10k_tlv_msg_error(struct fm10k_hw *hw, u32 **results, s32 fm10k_tlv_msg_error(struct fm10k_hw *hw, u32 **results,
......
...@@ -354,7 +354,7 @@ struct fm10k_hw; ...@@ -354,7 +354,7 @@ struct fm10k_hw;
#define FM10K_VLAN_TABLE_VID_MAX 4096 #define FM10K_VLAN_TABLE_VID_MAX 4096
#define FM10K_VLAN_TABLE_VSI_MAX 64 #define FM10K_VLAN_TABLE_VSI_MAX 64
#define FM10K_VLAN_LENGTH_SHIFT 16 #define FM10K_VLAN_LENGTH_SHIFT 16
#define FM10K_VLAN_CLEAR (1 << 15) #define FM10K_VLAN_CLEAR BIT(15)
#define FM10K_VLAN_ALL \ #define FM10K_VLAN_ALL \
((FM10K_VLAN_TABLE_VID_MAX - 1) << FM10K_VLAN_LENGTH_SHIFT) ((FM10K_VLAN_TABLE_VID_MAX - 1) << FM10K_VLAN_LENGTH_SHIFT)
...@@ -388,13 +388,13 @@ struct fm10k_hw; ...@@ -388,13 +388,13 @@ struct fm10k_hw;
#define FM10K_SW_SYSTIME_PULSE(_n) ((_n) + 0x02252) #define FM10K_SW_SYSTIME_PULSE(_n) ((_n) + 0x02252)
enum fm10k_int_source { enum fm10k_int_source {
fm10k_int_Mailbox = 0, fm10k_int_mailbox = 0,
fm10k_int_PCIeFault = 1, fm10k_int_pcie_fault = 1,
fm10k_int_SwitchUpDown = 2, fm10k_int_switch_up_down = 2,
fm10k_int_SwitchEvent = 3, fm10k_int_switch_event = 3,
fm10k_int_SRAM = 4, fm10k_int_sram = 4,
fm10k_int_VFLR = 5, fm10k_int_vflr = 5,
fm10k_int_MaxHoldTime = 6, fm10k_int_max_hold_time = 6,
fm10k_int_sources_max_pf fm10k_int_sources_max_pf
}; };
......
...@@ -442,6 +442,7 @@ static s32 fm10k_update_xcast_mode_vf(struct fm10k_hw *hw, u16 glort, u8 mode) ...@@ -442,6 +442,7 @@ static s32 fm10k_update_xcast_mode_vf(struct fm10k_hw *hw, u16 glort, u8 mode)
if (mode > FM10K_XCAST_MODE_NONE) if (mode > FM10K_XCAST_MODE_NONE)
return FM10K_ERR_PARAM; return FM10K_ERR_PARAM;
/* generate message requesting to change xcast mode */ /* generate message requesting to change xcast mode */
fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE); fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE);
fm10k_tlv_attr_put_u8(msg, FM10K_LPORT_STATE_MSG_XCAST_MODE, mode); fm10k_tlv_attr_put_u8(msg, FM10K_LPORT_STATE_MSG_XCAST_MODE, mode);
......
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