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

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


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
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
################################################################################
#
# 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
# under the terms and conditions of the GNU General Public License,
@@ -27,7 +27,17 @@

obj-$(CONFIG_FM10K) += fm10k.o

fm10k-objs := fm10k_main.o fm10k_common.o fm10k_pci.o \
	      fm10k_netdev.o fm10k_ethtool.o fm10k_pf.o fm10k_vf.o \
	      fm10k_mbx.o fm10k_iov.o fm10k_tlv.o \
	      fm10k_debugfs.o fm10k_ptp.o fm10k_dcbnl.o
fm10k-y := fm10k_main.o \
	   fm10k_common.o \
	   fm10k_pci.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
+11 −4
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

#include <linux/types.h>
#include <linux/etherdevice.h>
#include <linux/cpumask.h>
#include <linux/rtnetlink.h>
#include <linux/if_vlan.h>
#include <linux/pci.h>
@@ -66,6 +67,7 @@ struct fm10k_l2_accel {
enum fm10k_ring_state_t {
	__FM10K_TX_DETECT_HANG,
	__FM10K_HANG_CHECK_ARMED,
	__FM10K_TX_XPS_INIT_DONE,
};

#define check_for_tx_hang(ring) \
@@ -138,7 +140,7 @@ struct fm10k_ring {
					 * different for DCB and RSS modes
					 */
	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 next_to_alloc;
@@ -164,7 +166,7 @@ struct fm10k_ring_container {
	unsigned int total_packets;	/* total packets processed this int */
	u16 work_limit;			/* total work allowed per interrupt */
	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 */
};

@@ -209,6 +211,7 @@ struct fm10k_q_vector {
	struct fm10k_ring_container rx, tx;

	struct napi_struct napi;
	cpumask_t affinity_mask;
	char name[IFNAMSIZ + 9];

#ifdef CONFIG_DEBUG_FS
@@ -419,7 +422,7 @@ static inline u16 fm10k_desc_unused(struct fm10k_ring *ring)
	 (&(((union fm10k_rx_desc *)((R)->desc))[i]))

#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 */
#define TXD_USE_COUNT(S)	DIV_ROUND_UP((S), FM10K_MAX_DATA_PER_TXD)
@@ -440,7 +443,7 @@ union fm10k_ftag_info {
	struct {
		/* dglort and sglort combined into a single 32bit desc read */
		__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;
	} d;
	struct {
@@ -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);

/* DCB */
#ifdef CONFIG_DCB
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_ */
+0 −4
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@

#include "fm10k.h"

#ifdef CONFIG_DCB
/**
 * fm10k_dcbnl_ieee_getets - get the ETS configuration for the device
 * @dev: netdev interface for the device
@@ -155,7 +154,6 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = {
	.setdcbx	= fm10k_dcbnl_setdcbx,
};

#endif /* CONFIG_DCB */
/**
 * fm10k_dcbnl_set_ops - Configures dcbnl ops pointer for netdev
 * @dev: netdev interface for the device
@@ -164,11 +162,9 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = {
 **/
void fm10k_dcbnl_set_ops(struct net_device *dev)
{
#ifdef CONFIG_DCB
	struct fm10k_intfc *interface = netdev_priv(dev);
	struct fm10k_hw *hw = &interface->hw;

	if (hw->mac.type == fm10k_mac_pf)
		dev->dcbnl_ops = &fm10k_dcbnl_ops;
#endif /* CONFIG_DCB */
}
+0 −4
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@
 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 */

#ifdef CONFIG_DEBUG_FS

#include "fm10k.h"

#include <linux/debugfs.h>
@@ -258,5 +256,3 @@ void fm10k_dbg_exit(void)
	debugfs_remove_recursive(dbg_root);
	dbg_root = NULL;
}

#endif /* CONFIG_DEBUG_FS */
+10 −6
Original line number Diff line number Diff line
@@ -259,7 +259,8 @@ static int fm10k_get_sset_count(struct net_device *dev, int sset)
			stats_len += FM10K_DEBUG_STATS_LEN;

			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;
@@ -298,14 +299,16 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,

	if (interface->flags & FM10K_FLAG_DEBUG_STATS) {
		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 ==
				     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
		}
	}

	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 ==
			sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
	}
@@ -322,6 +325,7 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,
	if ((interface->flags & FM10K_FLAG_DEBUG_STATS) && iov_data) {
		for (i = 0; i < iov_data->num_vfs; i++) {
			struct fm10k_vf_info *vf_info;

			vf_info = &iov_data->vf_info[i];

			/* skip stats if we don't have a vf info */
@@ -331,7 +335,8 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,
			}

			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 ==
					     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
			}
@@ -1020,7 +1025,6 @@ static int fm10k_set_priv_flags(struct net_device *netdev, u32 priv_flags)
	return 0;
}


static u32 fm10k_get_reta_size(struct net_device __always_unused *netdev)
{
	return FM10K_RETA_SIZE * FM10K_RETA_ENTRIES_PER_REG;
Loading