Commit 8f609845 authored by David S. Miller's avatar David S. Miller

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
This series contains updates to ixgbe, ixgbevf and igb.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 41d06b13 4b9ea462
################################################################################ ################################################################################
# #
# Intel 82575 PCI-Express Ethernet Linux driver # Intel 82575 PCI-Express Ethernet Linux driver
# Copyright(c) 1999 - 2012 Intel Corporation. # Copyright(c) 1999 - 2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2012 Intel Corporation. Copyright(c) 2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
......
/******************************************************************************* /*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation. Copyright(c) 2007-2013 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,
...@@ -69,7 +69,8 @@ char igb_driver_name[] = "igb"; ...@@ -69,7 +69,8 @@ char igb_driver_name[] = "igb";
char igb_driver_version[] = DRV_VERSION; char igb_driver_version[] = DRV_VERSION;
static const char igb_driver_string[] = static const char igb_driver_string[] =
"Intel(R) Gigabit Ethernet Network Driver"; "Intel(R) Gigabit Ethernet Network Driver";
static const char igb_copyright[] = "Copyright (c) 2007-2012 Intel Corporation."; static const char igb_copyright[] =
"Copyright (c) 2007-2013 Intel Corporation.";
static const struct e1000_info *igb_info_tbl[] = { static const struct e1000_info *igb_info_tbl[] = {
[board_82575] = &e1000_82575_info, [board_82575] = &e1000_82575_info,
...@@ -5930,7 +5931,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector) ...@@ -5930,7 +5931,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
break; break;
/* prevent any other reads prior to eop_desc */ /* prevent any other reads prior to eop_desc */
rmb(); read_barrier_depends();
/* if DD is not set pending work has not been completed */ /* if DD is not set pending work has not been completed */
if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD))) if (!(eop_desc->wb.status & cpu_to_le32(E1000_TXD_STAT_DD)))
......
...@@ -96,16 +96,23 @@ ...@@ -96,16 +96,23 @@
/* How many Rx Buffers do we bundle into one write to the hardware ? */ /* How many Rx Buffers do we bundle into one write to the hardware ? */
#define IXGBE_RX_BUFFER_WRITE 16 /* Must be power of 2 */ #define IXGBE_RX_BUFFER_WRITE 16 /* Must be power of 2 */
#define IXGBE_TX_FLAGS_CSUM (u32)(1) enum ixgbe_tx_flags {
#define IXGBE_TX_FLAGS_HW_VLAN (u32)(1 << 1) /* cmd_type flags */
#define IXGBE_TX_FLAGS_SW_VLAN (u32)(1 << 2) IXGBE_TX_FLAGS_HW_VLAN = 0x01,
#define IXGBE_TX_FLAGS_TSO (u32)(1 << 3) IXGBE_TX_FLAGS_TSO = 0x02,
#define IXGBE_TX_FLAGS_IPV4 (u32)(1 << 4) IXGBE_TX_FLAGS_TSTAMP = 0x04,
#define IXGBE_TX_FLAGS_FCOE (u32)(1 << 5)
#define IXGBE_TX_FLAGS_FSO (u32)(1 << 6) /* olinfo flags */
#define IXGBE_TX_FLAGS_TXSW (u32)(1 << 7) IXGBE_TX_FLAGS_CC = 0x08,
#define IXGBE_TX_FLAGS_TSTAMP (u32)(1 << 8) IXGBE_TX_FLAGS_IPV4 = 0x10,
#define IXGBE_TX_FLAGS_NO_IFCS (u32)(1 << 9) IXGBE_TX_FLAGS_CSUM = 0x20,
/* software defined flags */
IXGBE_TX_FLAGS_SW_VLAN = 0x40,
IXGBE_TX_FLAGS_FCOE = 0x80,
};
/* VLAN info */
#define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000 #define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000
#define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0xe0000000 #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0xe0000000
#define IXGBE_TX_FLAGS_VLAN_PRIO_SHIFT 29 #define IXGBE_TX_FLAGS_VLAN_PRIO_SHIFT 29
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/dcbnl.h> #include <linux/dcbnl.h>
#include "ixgbe_dcb_82598.h" #include "ixgbe_dcb_82598.h"
#include "ixgbe_dcb_82599.h" #include "ixgbe_dcb_82599.h"
#include "ixgbe_sriov.h"
/* Callbacks for DCB netlink in the kernel */ /* Callbacks for DCB netlink in the kernel */
#define BIT_DCB_MODE 0x01 #define BIT_DCB_MODE 0x01
...@@ -643,9 +644,11 @@ static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev, ...@@ -643,9 +644,11 @@ static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
return err; return err;
err = dcb_ieee_setapp(dev, app); err = dcb_ieee_setapp(dev, app);
if (err)
return err;
#ifdef IXGBE_FCOE #ifdef IXGBE_FCOE
if (!err && app->selector == IEEE_8021QAZ_APP_SEL_ETHERTYPE && if (app->selector == IEEE_8021QAZ_APP_SEL_ETHERTYPE &&
app->protocol == ETH_P_FCOE) { app->protocol == ETH_P_FCOE) {
u8 app_mask = dcb_ieee_getapp_mask(dev, app); u8 app_mask = dcb_ieee_getapp_mask(dev, app);
...@@ -656,6 +659,23 @@ static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev, ...@@ -656,6 +659,23 @@ static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
ixgbe_dcbnl_devreset(dev); ixgbe_dcbnl_devreset(dev);
} }
#endif #endif
/* VF devices should use default UP when available */
if (app->selector == IEEE_8021QAZ_APP_SEL_ETHERTYPE &&
app->protocol == 0) {
int vf;
adapter->default_up = app->priority;
for (vf = 0; vf < adapter->num_vfs; vf++) {
struct vf_data_storage *vfinfo = &adapter->vfinfo[vf];
if (!vfinfo->pf_qos)
ixgbe_set_vmvir(adapter, vfinfo->pf_vlan,
app->priority, vf);
}
}
return 0; return 0;
} }
...@@ -683,6 +703,24 @@ static int ixgbe_dcbnl_ieee_delapp(struct net_device *dev, ...@@ -683,6 +703,24 @@ static int ixgbe_dcbnl_ieee_delapp(struct net_device *dev,
ixgbe_dcbnl_devreset(dev); ixgbe_dcbnl_devreset(dev);
} }
#endif #endif
/* IF default priority is being removed clear VF default UP */
if (app->selector == IEEE_8021QAZ_APP_SEL_ETHERTYPE &&
app->protocol == 0 && adapter->default_up == app->priority) {
int vf;
long unsigned int app_mask = dcb_ieee_getapp_mask(dev, app);
int qos = app_mask ? find_first_bit(&app_mask, 8) : 0;
adapter->default_up = qos;
for (vf = 0; vf < adapter->num_vfs; vf++) {
struct vf_data_storage *vfinfo = &adapter->vfinfo[vf];
if (!vfinfo->pf_qos)
ixgbe_set_vmvir(adapter, vfinfo->pf_vlan,
qos, vf);
}
}
return err; return err;
} }
......
...@@ -544,15 +544,14 @@ int ixgbe_fso(struct ixgbe_ring *tx_ring, ...@@ -544,15 +544,14 @@ int ixgbe_fso(struct ixgbe_ring *tx_ring,
first->gso_segs = DIV_ROUND_UP(skb->len - *hdr_len, first->gso_segs = DIV_ROUND_UP(skb->len - *hdr_len,
skb_shinfo(skb)->gso_size); skb_shinfo(skb)->gso_size);
first->bytecount += (first->gso_segs - 1) * *hdr_len; first->bytecount += (first->gso_segs - 1) * *hdr_len;
first->tx_flags |= IXGBE_TX_FLAGS_FSO; first->tx_flags |= IXGBE_TX_FLAGS_TSO;
} }
/* set flag indicating FCOE to ixgbe_tx_map call */ /* set flag indicating FCOE to ixgbe_tx_map call */
first->tx_flags |= IXGBE_TX_FLAGS_FCOE; first->tx_flags |= IXGBE_TX_FLAGS_FCOE | IXGBE_TX_FLAGS_CC;
/* mss_l4len_id: use 1 for FSO as TSO, no need for L4LEN */ /* mss_l4len_id: use 0 for FSO as TSO, no need for L4LEN */
mss_l4len_idx = skb_shinfo(skb)->gso_size << IXGBE_ADVTXD_MSS_SHIFT; mss_l4len_idx = skb_shinfo(skb)->gso_size << IXGBE_ADVTXD_MSS_SHIFT;
mss_l4len_idx |= 1 << IXGBE_ADVTXD_IDX_SHIFT;
/* vlan_macip_lens: HEADLEN, MACLEN, VLAN tag */ /* vlan_macip_lens: HEADLEN, MACLEN, VLAN tag */
vlan_macip_lens = skb_transport_offset(skb) + vlan_macip_lens = skb_transport_offset(skb) +
......
...@@ -5899,6 +5899,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, ...@@ -5899,6 +5899,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
u32 vlan_macip_lens, type_tucmd; u32 vlan_macip_lens, type_tucmd;
u32 mss_l4len_idx, l4len; u32 mss_l4len_idx, l4len;
if (skb->ip_summed != CHECKSUM_PARTIAL)
return 0;
if (!skb_is_gso(skb)) if (!skb_is_gso(skb))
return 0; return 0;
...@@ -5941,10 +5944,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, ...@@ -5941,10 +5944,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
first->gso_segs = skb_shinfo(skb)->gso_segs; first->gso_segs = skb_shinfo(skb)->gso_segs;
first->bytecount += (first->gso_segs - 1) * *hdr_len; first->bytecount += (first->gso_segs - 1) * *hdr_len;
/* mss_l4len_id: use 1 as index for TSO */ /* mss_l4len_id: use 0 as index for TSO */
mss_l4len_idx = l4len << IXGBE_ADVTXD_L4LEN_SHIFT; mss_l4len_idx = l4len << IXGBE_ADVTXD_L4LEN_SHIFT;
mss_l4len_idx |= skb_shinfo(skb)->gso_size << IXGBE_ADVTXD_MSS_SHIFT; mss_l4len_idx |= skb_shinfo(skb)->gso_size << IXGBE_ADVTXD_MSS_SHIFT;
mss_l4len_idx |= 1 << IXGBE_ADVTXD_IDX_SHIFT;
/* vlan_macip_lens: HEADLEN, MACLEN, VLAN tag */ /* vlan_macip_lens: HEADLEN, MACLEN, VLAN tag */
vlan_macip_lens = skb_network_header_len(skb); vlan_macip_lens = skb_network_header_len(skb);
...@@ -5966,12 +5968,9 @@ static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring, ...@@ -5966,12 +5968,9 @@ static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring,
u32 type_tucmd = 0; u32 type_tucmd = 0;
if (skb->ip_summed != CHECKSUM_PARTIAL) { if (skb->ip_summed != CHECKSUM_PARTIAL) {
if (!(first->tx_flags & IXGBE_TX_FLAGS_HW_VLAN)) { if (!(first->tx_flags & IXGBE_TX_FLAGS_HW_VLAN) &&
if (unlikely(skb->no_fcs)) !(first->tx_flags & IXGBE_TX_FLAGS_CC))
first->tx_flags |= IXGBE_TX_FLAGS_NO_IFCS;
if (!(first->tx_flags & IXGBE_TX_FLAGS_TXSW))
return; return;
}
} else { } else {
u8 l4_hdr = 0; u8 l4_hdr = 0;
switch (first->protocol) { switch (first->protocol) {
...@@ -6029,30 +6028,32 @@ static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring, ...@@ -6029,30 +6028,32 @@ static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring,
type_tucmd, mss_l4len_idx); type_tucmd, mss_l4len_idx);
} }
static __le32 ixgbe_tx_cmd_type(u32 tx_flags) #define IXGBE_SET_FLAG(_input, _flag, _result) \
((_flag <= _result) ? \
((u32)(_input & _flag) * (_result / _flag)) : \
((u32)(_input & _flag) / (_flag / _result)))
static u32 ixgbe_tx_cmd_type(struct sk_buff *skb, u32 tx_flags)
{ {
/* set type for advanced descriptor with frame checksum insertion */ /* set type for advanced descriptor with frame checksum insertion */
__le32 cmd_type = cpu_to_le32(IXGBE_ADVTXD_DTYP_DATA | u32 cmd_type = IXGBE_ADVTXD_DTYP_DATA |
IXGBE_ADVTXD_DCMD_DEXT); IXGBE_ADVTXD_DCMD_DEXT |
IXGBE_ADVTXD_DCMD_IFCS;
/* set HW vlan bit if vlan is present */ /* set HW vlan bit if vlan is present */
if (tx_flags & IXGBE_TX_FLAGS_HW_VLAN) cmd_type |= IXGBE_SET_FLAG(tx_flags, IXGBE_TX_FLAGS_HW_VLAN,
cmd_type |= cpu_to_le32(IXGBE_ADVTXD_DCMD_VLE); IXGBE_ADVTXD_DCMD_VLE);
if (tx_flags & IXGBE_TX_FLAGS_TSTAMP)
cmd_type |= cpu_to_le32(IXGBE_ADVTXD_MAC_TSTAMP);
/* set segmentation enable bits for TSO/FSO */ /* set segmentation enable bits for TSO/FSO */
#ifdef IXGBE_FCOE cmd_type |= IXGBE_SET_FLAG(tx_flags, IXGBE_TX_FLAGS_TSO,
if (tx_flags & (IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_FSO)) IXGBE_ADVTXD_DCMD_TSE);
#else
if (tx_flags & IXGBE_TX_FLAGS_TSO) /* set timestamp bit if present */
#endif cmd_type |= IXGBE_SET_FLAG(tx_flags, IXGBE_TX_FLAGS_TSTAMP,
cmd_type |= cpu_to_le32(IXGBE_ADVTXD_DCMD_TSE); IXGBE_ADVTXD_MAC_TSTAMP);
/* insert frame checksum */ /* insert frame checksum */
if (!(tx_flags & IXGBE_TX_FLAGS_NO_IFCS)) cmd_type ^= IXGBE_SET_FLAG(skb->no_fcs, 1, IXGBE_ADVTXD_DCMD_IFCS);
cmd_type |= cpu_to_le32(IXGBE_ADVTXD_DCMD_IFCS);
return cmd_type; return cmd_type;
} }
...@@ -6060,36 +6061,27 @@ static __le32 ixgbe_tx_cmd_type(u32 tx_flags) ...@@ -6060,36 +6061,27 @@ static __le32 ixgbe_tx_cmd_type(u32 tx_flags)
static void ixgbe_tx_olinfo_status(union ixgbe_adv_tx_desc *tx_desc, static void ixgbe_tx_olinfo_status(union ixgbe_adv_tx_desc *tx_desc,
u32 tx_flags, unsigned int paylen) u32 tx_flags, unsigned int paylen)
{ {
__le32 olinfo_status = cpu_to_le32(paylen << IXGBE_ADVTXD_PAYLEN_SHIFT); u32 olinfo_status = paylen << IXGBE_ADVTXD_PAYLEN_SHIFT;
/* enable L4 checksum for TSO and TX checksum offload */ /* enable L4 checksum for TSO and TX checksum offload */
if (tx_flags & IXGBE_TX_FLAGS_CSUM) olinfo_status |= IXGBE_SET_FLAG(tx_flags,
olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_TXSM); IXGBE_TX_FLAGS_CSUM,
IXGBE_ADVTXD_POPTS_TXSM);
/* enble IPv4 checksum for TSO */ /* enble IPv4 checksum for TSO */
if (tx_flags & IXGBE_TX_FLAGS_IPV4) olinfo_status |= IXGBE_SET_FLAG(tx_flags,
olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_IXSM); IXGBE_TX_FLAGS_IPV4,
IXGBE_ADVTXD_POPTS_IXSM);
/* use index 1 context for TSO/FSO/FCOE */
#ifdef IXGBE_FCOE
if (tx_flags & (IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_FCOE))
#else
if (tx_flags & IXGBE_TX_FLAGS_TSO)
#endif
olinfo_status |= cpu_to_le32(1 << IXGBE_ADVTXD_IDX_SHIFT);
/* /*
* Check Context must be set if Tx switch is enabled, which it * Check Context must be set if Tx switch is enabled, which it
* always is for case where virtual functions are running * always is for case where virtual functions are running
*/ */
#ifdef IXGBE_FCOE olinfo_status |= IXGBE_SET_FLAG(tx_flags,
if (tx_flags & (IXGBE_TX_FLAGS_TXSW | IXGBE_TX_FLAGS_FCOE)) IXGBE_TX_FLAGS_CC,
#else IXGBE_ADVTXD_CC);
if (tx_flags & IXGBE_TX_FLAGS_TXSW)
#endif
olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_CC);
tx_desc->read.olinfo_status = olinfo_status; tx_desc->read.olinfo_status = cpu_to_le32(olinfo_status);
} }
#define IXGBE_TXD_CMD (IXGBE_TXD_CMD_EOP | \ #define IXGBE_TXD_CMD (IXGBE_TXD_CMD_EOP | \
...@@ -6099,22 +6091,22 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, ...@@ -6099,22 +6091,22 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
struct ixgbe_tx_buffer *first, struct ixgbe_tx_buffer *first,
const u8 hdr_len) const u8 hdr_len)
{ {
dma_addr_t dma;
struct sk_buff *skb = first->skb; struct sk_buff *skb = first->skb;
struct ixgbe_tx_buffer *tx_buffer; struct ixgbe_tx_buffer *tx_buffer;
union ixgbe_adv_tx_desc *tx_desc; union ixgbe_adv_tx_desc *tx_desc;
struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0]; struct skb_frag_struct *frag;
unsigned int data_len = skb->data_len; dma_addr_t dma;
unsigned int size = skb_headlen(skb); unsigned int data_len, size;
unsigned int paylen = skb->len - hdr_len;
u32 tx_flags = first->tx_flags; u32 tx_flags = first->tx_flags;
__le32 cmd_type; u32 cmd_type = ixgbe_tx_cmd_type(skb, tx_flags);
u16 i = tx_ring->next_to_use; u16 i = tx_ring->next_to_use;
tx_desc = IXGBE_TX_DESC(tx_ring, i); tx_desc = IXGBE_TX_DESC(tx_ring, i);
ixgbe_tx_olinfo_status(tx_desc, tx_flags, paylen); ixgbe_tx_olinfo_status(tx_desc, tx_flags, skb->len - hdr_len);
cmd_type = ixgbe_tx_cmd_type(tx_flags);
size = skb_headlen(skb);
data_len = skb->data_len;
#ifdef IXGBE_FCOE #ifdef IXGBE_FCOE
if (tx_flags & IXGBE_TX_FLAGS_FCOE) { if (tx_flags & IXGBE_TX_FLAGS_FCOE) {
...@@ -6128,19 +6120,22 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, ...@@ -6128,19 +6120,22 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
#endif #endif
dma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE); dma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE);
tx_buffer = first;
for (frag = &skb_shinfo(skb)->frags[0];; frag++) {
if (dma_mapping_error(tx_ring->dev, dma)) if (dma_mapping_error(tx_ring->dev, dma))
goto dma_error; goto dma_error;
/* record length, and DMA address */ /* record length, and DMA address */
dma_unmap_len_set(first, len, size); dma_unmap_len_set(tx_buffer, len, size);
dma_unmap_addr_set(first, dma, dma); dma_unmap_addr_set(tx_buffer, dma, dma);
tx_desc->read.buffer_addr = cpu_to_le64(dma); tx_desc->read.buffer_addr = cpu_to_le64(dma);
for (;;) {
while (unlikely(size > IXGBE_MAX_DATA_PER_TXD)) { while (unlikely(size > IXGBE_MAX_DATA_PER_TXD)) {
tx_desc->read.cmd_type_len = tx_desc->read.cmd_type_len =
cmd_type | cpu_to_le32(IXGBE_MAX_DATA_PER_TXD); cpu_to_le32(cmd_type ^ IXGBE_MAX_DATA_PER_TXD);
i++; i++;
tx_desc++; tx_desc++;
...@@ -6148,18 +6143,18 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, ...@@ -6148,18 +6143,18 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
tx_desc = IXGBE_TX_DESC(tx_ring, 0); tx_desc = IXGBE_TX_DESC(tx_ring, 0);
i = 0; i = 0;
} }
tx_desc->read.olinfo_status = 0;
dma += IXGBE_MAX_DATA_PER_TXD; dma += IXGBE_MAX_DATA_PER_TXD;
size -= IXGBE_MAX_DATA_PER_TXD; size -= IXGBE_MAX_DATA_PER_TXD;
tx_desc->read.buffer_addr = cpu_to_le64(dma); tx_desc->read.buffer_addr = cpu_to_le64(dma);
tx_desc->read.olinfo_status = 0;
} }
if (likely(!data_len)) if (likely(!data_len))
break; break;
tx_desc->read.cmd_type_len = cmd_type | cpu_to_le32(size); tx_desc->read.cmd_type_len = cpu_to_le32(cmd_type ^ size);
i++; i++;
tx_desc++; tx_desc++;
...@@ -6167,6 +6162,7 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, ...@@ -6167,6 +6162,7 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
tx_desc = IXGBE_TX_DESC(tx_ring, 0); tx_desc = IXGBE_TX_DESC(tx_ring, 0);
i = 0; i = 0;
} }
tx_desc->read.olinfo_status = 0;
#ifdef IXGBE_FCOE #ifdef IXGBE_FCOE
size = min_t(unsigned int, data_len, skb_frag_size(frag)); size = min_t(unsigned int, data_len, skb_frag_size(frag));
...@@ -6177,22 +6173,13 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, ...@@ -6177,22 +6173,13 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
dma = skb_frag_dma_map(tx_ring->dev, frag, 0, size, dma = skb_frag_dma_map(tx_ring->dev, frag, 0, size,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(tx_ring->dev, dma))
goto dma_error;
tx_buffer = &tx_ring->tx_buffer_info[i]; tx_buffer = &tx_ring->tx_buffer_info[i];
dma_unmap_len_set(tx_buffer, len, size);
dma_unmap_addr_set(tx_buffer, dma, dma);
tx_desc->read.buffer_addr = cpu_to_le64(dma);
tx_desc->read.olinfo_status = 0;
frag++;
} }
/* write last descriptor with RS and EOP bits */ /* write last descriptor with RS and EOP bits */
cmd_type |= cpu_to_le32(size) | cpu_to_le32(IXGBE_TXD_CMD); cmd_type |= size | IXGBE_TXD_CMD;
tx_desc->read.cmd_type_len = cmd_type; tx_desc->read.cmd_type_len = cpu_to_le32(cmd_type);
netdev_tx_sent_queue(txring_txq(tx_ring), first->bytecount); netdev_tx_sent_queue(txring_txq(tx_ring), first->bytecount);
...@@ -6453,7 +6440,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, ...@@ -6453,7 +6440,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
* Tx switch had been disabled. * Tx switch had been disabled.
*/ */
if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
tx_flags |= IXGBE_TX_FLAGS_TXSW; tx_flags |= IXGBE_TX_FLAGS_CC;
#endif #endif
/* DCB maps skb priorities 0-7 onto 3 bit PCP of VLAN tag. */ /* DCB maps skb priorities 0-7 onto 3 bit PCP of VLAN tag. */
......
...@@ -447,15 +447,6 @@ static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe) ...@@ -447,15 +447,6 @@ static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe)
IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr); IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
} }
static void ixgbe_set_vmvir(struct ixgbe_adapter *adapter,
u16 vid, u16 qos, u32 vf)
{
struct ixgbe_hw *hw = &adapter->hw;
u32 vmvir = vid | (qos << VLAN_PRIO_SHIFT) | IXGBE_VMVIR_VLANA_DEFAULT;
IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf), vmvir);
}
static void ixgbe_clear_vmvir(struct ixgbe_adapter *adapter, u32 vf) static void ixgbe_clear_vmvir(struct ixgbe_adapter *adapter, u32 vf)
{ {
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
......
...@@ -47,6 +47,14 @@ void ixgbe_enable_sriov(struct ixgbe_adapter *adapter, ...@@ -47,6 +47,14 @@ void ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
const struct ixgbe_info *ii); const struct ixgbe_info *ii);
#endif #endif
static inline void ixgbe_set_vmvir(struct ixgbe_adapter *adapter,
u16 vid, u16 qos, u32 vf)
{
struct ixgbe_hw *hw = &adapter->hw;
u32 vmvir = vid | (qos << VLAN_PRIO_SHIFT) | IXGBE_VMVIR_VLANA_DEFAULT;
IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf), vmvir);
}
#endif /* _IXGBE_SRIOV_H_ */ #endif /* _IXGBE_SRIOV_H_ */
...@@ -750,12 +750,37 @@ static void ixgbevf_set_itr(struct ixgbevf_q_vector *q_vector) ...@@ -750,12 +750,37 @@ static void ixgbevf_set_itr(struct ixgbevf_q_vector *q_vector)
static irqreturn_t ixgbevf_msix_other(int irq, void *data) static irqreturn_t ixgbevf_msix_other(int irq, void *data)
{ {
struct ixgbevf_adapter *adapter = data; struct ixgbevf_adapter *adapter = data;
struct pci_dev *pdev = adapter->pdev;
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
u32 msg;
bool got_ack = false;
hw->mac.get_link_status = 1; hw->mac.get_link_status = 1;
if (!hw->mbx.ops.check_for_ack(hw))
got_ack = true;
if (!test_bit(__IXGBEVF_DOWN, &adapter->state)) if (!hw->mbx.ops.check_for_msg(hw)) {
mod_timer(&adapter->watchdog_timer, jiffies); hw->mbx.ops.read(hw, &msg, 1);
if ((msg & IXGBE_MBVFICR_VFREQ_MASK) == IXGBE_PF_CONTROL_MSG) {
mod_timer(&adapter->watchdog_timer,
round_jiffies(jiffies + 1));
adapter->link_up = false;
}
if (msg & IXGBE_VT_MSGTYPE_NACK)
dev_info(&pdev->dev,
"Last Request of type %2.2x to PF Nacked\n",
msg & 0xFF);
hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFSTS;
}
/* checking for the ack clears the PFACK bit. Place
* it back in the v2p_mailbox cache so that anyone
* polling for an ack will not miss it
*/
if (got_ack)
hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFACK;
IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_other); IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_other);
...@@ -2095,6 +2120,9 @@ void ixgbevf_update_stats(struct ixgbevf_adapter *adapter) ...@@ -2095,6 +2120,9 @@ void ixgbevf_update_stats(struct ixgbevf_adapter *adapter)
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
int i; int i;
if (!adapter->link_up)
return;
UPDATE_VF_COUNTER_32bit(IXGBE_VFGPRC, adapter->stats.last_vfgprc, UPDATE_VF_COUNTER_32bit(IXGBE_VFGPRC, adapter->stats.last_vfgprc,
adapter->stats.vfgprc); adapter->stats.vfgprc);
UPDATE_VF_COUNTER_32bit(IXGBE_VFGPTC, adapter->stats.last_vfgptc, UPDATE_VF_COUNTER_32bit(IXGBE_VFGPTC, adapter->stats.last_vfgptc,
...@@ -2217,7 +2245,8 @@ static void ixgbevf_watchdog_task(struct work_struct *work) ...@@ -2217,7 +2245,8 @@ static void ixgbevf_watchdog_task(struct work_struct *work)
if (link_up) { if (link_up) {
if (!netif_carrier_ok(netdev)) { if (!netif_carrier_ok(netdev)) {
hw_dbg(&adapter->hw, "NIC Link is Up, %u Gbps\n", dev_info(&adapter->pdev->dev,
"NIC Link is Up, %u Gbps\n",
(link_speed == IXGBE_LINK_SPEED_10GB_FULL) ? (link_speed == IXGBE_LINK_SPEED_10GB_FULL) ?
10 : 1); 10 : 1);
netif_carrier_on(netdev); netif_carrier_on(netdev);
...@@ -2227,7 +2256,7 @@ static void ixgbevf_watchdog_task(struct work_struct *work) ...@@ -2227,7 +2256,7 @@ static void ixgbevf_watchdog_task(struct work_struct *work)
adapter->link_up = false; adapter->link_up = false;
adapter->link_speed = 0; adapter->link_speed = 0;
if (netif_carrier_ok(netdev)) { if (netif_carrier_ok(netdev)) {
hw_dbg(&adapter->hw, "NIC Link is Down\n"); dev_info(&adapter->pdev->dev, "NIC Link is Down\n");
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_tx_stop_all_queues(netdev); netif_tx_stop_all_queues(netdev);
} }
......
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