Skip to content

Commit 9b53816

Browse files
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2017-04-20 This series contains updates to e1000, e1000e, igb/vf and ixgb. Tobias Klauser cleans up e1000, ixgb and igbvf from having a local function or structure for netdev stats. Bernd Faust fixes an issue for 82579 devices, where the clock frequency was being incorrectly set for these devices. These devices only support 96MHz, so make sure they are set to use only that. Yury Kylulin extends the work Jake and Alex did for ixgbe in MAC filter handling into the igb driver. Kim Tatt Chuah enables igb to wake up by packet and to read the necessary Wake Up Status (WUS) and Wake Up Packet Memory (WUPM) registers. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents e2989ee + 55c05dd commit 9b53816

File tree

12 files changed

+499
-134
lines changed

12 files changed

+499
-134
lines changed

drivers/net/ethernet/intel/e1000/e1000_main.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ static void e1000_watchdog(struct work_struct *work);
131131
static void e1000_82547_tx_fifo_stall_task(struct work_struct *work);
132132
static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
133133
struct net_device *netdev);
134-
static struct net_device_stats *e1000_get_stats(struct net_device *netdev);
135134
static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
136135
static int e1000_set_mac(struct net_device *netdev, void *p);
137136
static irqreturn_t e1000_intr(int irq, void *data);
@@ -846,7 +845,6 @@ static const struct net_device_ops e1000_netdev_ops = {
846845
.ndo_open = e1000_open,
847846
.ndo_stop = e1000_close,
848847
.ndo_start_xmit = e1000_xmit_frame,
849-
.ndo_get_stats = e1000_get_stats,
850848
.ndo_set_rx_mode = e1000_set_rx_mode,
851849
.ndo_set_mac_address = e1000_set_mac,
852850
.ndo_tx_timeout = e1000_tx_timeout,
@@ -3529,19 +3527,6 @@ static void e1000_reset_task(struct work_struct *work)
35293527
e1000_reinit_locked(adapter);
35303528
}
35313529

3532-
/**
3533-
* e1000_get_stats - Get System Network Statistics
3534-
* @netdev: network interface device structure
3535-
*
3536-
* Returns the address of the device statistics structure.
3537-
* The statistics are actually updated from the watchdog.
3538-
**/
3539-
static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
3540-
{
3541-
/* only return the current stats */
3542-
return &netdev->stats;
3543-
}
3544-
35453530
/**
35463531
* e1000_change_mtu - Change the Maximum Transfer Unit
35473532
* @netdev: network interface device structure

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,6 +3511,12 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
35113511

35123512
switch (hw->mac.type) {
35133513
case e1000_pch2lan:
3514+
/* Stable 96MHz frequency */
3515+
incperiod = INCPERIOD_96MHz;
3516+
incvalue = INCVALUE_96MHz;
3517+
shift = INCVALUE_SHIFT_96MHz;
3518+
adapter->cc.shift = shift + INCPERIOD_SHIFT_96MHz;
3519+
break;
35143520
case e1000_pch_lpt:
35153521
if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
35163522
/* Stable 96MHz frequency */

drivers/net/ethernet/intel/igb/e1000_defines.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@
3939
#define E1000_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */
4040
#define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */
4141

42+
/* Wake Up Status */
43+
#define E1000_WUS_EX 0x00000004 /* Directed Exact */
44+
#define E1000_WUS_ARPD 0x00000020 /* Directed ARP Request */
45+
#define E1000_WUS_IPV4 0x00000040 /* Directed IPv4 */
46+
#define E1000_WUS_IPV6 0x00000080 /* Directed IPv6 */
47+
#define E1000_WUS_NSD 0x00000400 /* Directed IPv6 Neighbor Solicitation */
48+
49+
/* Packet types that are enabled for wake packet delivery */
50+
#define WAKE_PKT_WUS ( \
51+
E1000_WUS_EX | \
52+
E1000_WUS_ARPD | \
53+
E1000_WUS_IPV4 | \
54+
E1000_WUS_IPV6 | \
55+
E1000_WUS_NSD)
56+
57+
/* Wake Up Packet Length */
58+
#define E1000_WUPL_MASK 0x00000FFF
59+
60+
/* Wake Up Packet Memory stores the first 128 bytes of the wake up packet */
61+
#define E1000_WUPM_BYTES 128
62+
4263
/* Extended Device Control */
4364
#define E1000_CTRL_EXT_SDP2_DATA 0x00000040 /* Value of SW Defineable Pin 2 */
4465
#define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Defineable Pin 3 */

drivers/net/ethernet/intel/igb/e1000_mbx.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555

5656
#define E1000_VF_RESET 0x01 /* VF requests reset */
5757
#define E1000_VF_SET_MAC_ADDR 0x02 /* VF requests to set MAC addr */
58+
/* VF requests to clear all unicast MAC filters */
59+
#define E1000_VF_MAC_FILTER_CLR (0x01 << E1000_VT_MSGINFO_SHIFT)
60+
/* VF requests to add unicast MAC filter */
61+
#define E1000_VF_MAC_FILTER_ADD (0x02 << E1000_VT_MSGINFO_SHIFT)
5862
#define E1000_VF_SET_MULTICAST 0x03 /* VF requests to set MC addr */
5963
#define E1000_VF_SET_VLAN 0x04 /* VF requests to set VLAN */
6064
#define E1000_VF_SET_LPE 0x05 /* VF requests to set VMOLR.LPE */

drivers/net/ethernet/intel/igb/igb.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ struct vf_data_storage {
111111
bool spoofchk_enabled;
112112
};
113113

114+
/* Number of unicast MAC filters reserved for the PF in the RAR registers */
115+
#define IGB_PF_MAC_FILTERS_RESERVED 3
116+
117+
struct vf_mac_filter {
118+
struct list_head l;
119+
int vf;
120+
bool free;
121+
u8 vf_mac[ETH_ALEN];
122+
};
123+
114124
#define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send data */
115125
#define IGB_VF_FLAG_UNI_PROMISC 0x00000002 /* VF has unicast promisc */
116126
#define IGB_VF_FLAG_MULTI_PROMISC 0x00000004 /* VF has multicast promisc */
@@ -449,6 +459,15 @@ struct igb_nfc_filter {
449459
u16 action;
450460
};
451461

462+
struct igb_mac_addr {
463+
u8 addr[ETH_ALEN];
464+
u8 queue;
465+
u8 state; /* bitmask */
466+
};
467+
468+
#define IGB_MAC_STATE_DEFAULT 0x1
469+
#define IGB_MAC_STATE_IN_USE 0x2
470+
452471
/* board specific private data structure */
453472
struct igb_adapter {
454473
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
@@ -575,6 +594,10 @@ struct igb_adapter {
575594
/* lock for RX network flow classification filter */
576595
spinlock_t nfc_lock;
577596
bool etype_bitmap[MAX_ETYPE_FILTER];
597+
598+
struct igb_mac_addr *mac_table;
599+
struct vf_mac_filter vf_macs;
600+
struct vf_mac_filter *vf_mac_list;
578601
};
579602

580603
/* flags controlling PTP/1588 function */

0 commit comments

Comments
 (0)