Skip to content

Commit 93ba168

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2018-06-11 This series contains fixes to ixgbe IPsec and MACVLAN. Alex provides the 5 fixes in this series, starting with fixing an issue where num_rx_pools was not being populated until after the queues and interrupts were reinitialized when enabling MACVLAN interfaces. Updated to use CONFIG_XFRM_OFFLOAD instead of CONFIG_XFRM, since the code requires CONFIG_XFRM_OFFLOAD to be enabled. Moved the IPsec initialization function to be more consistent with the placement of similar initialization functions and before the call to reset the hardware, which will clean up any link issues that may have been introduced. Fixed the boolean logic that was testing for transmit OR receive ready bits, when it should have been testing for transmit AND receive ready bits. Fixed the bit definitions for SECTXSTAT and SECRXSTAT registers and ensure that if IPsec is disabled on the part, do not enable it. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3f2d67b + 421d954 commit 93ba168

File tree

5 files changed

+48
-25
lines changed

5 files changed

+48
-25
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,9 @@ struct ixgbe_adapter {
760760
#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
761761
u32 *rss_key;
762762

763-
#ifdef CONFIG_XFRM
763+
#ifdef CONFIG_XFRM_OFFLOAD
764764
struct ixgbe_ipsec *ipsec;
765-
#endif /* CONFIG_XFRM */
765+
#endif /* CONFIG_XFRM_OFFLOAD */
766766
};
767767

768768
static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)

drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,16 @@ static void ixgbe_ipsec_stop_data(struct ixgbe_adapter *adapter)
158158
reg |= IXGBE_SECRXCTRL_RX_DIS;
159159
IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, reg);
160160

161-
IXGBE_WRITE_FLUSH(hw);
161+
/* If both Tx and Rx are ready there are no packets
162+
* that we need to flush so the loopback configuration
163+
* below is not necessary.
164+
*/
165+
t_rdy = IXGBE_READ_REG(hw, IXGBE_SECTXSTAT) &
166+
IXGBE_SECTXSTAT_SECTX_RDY;
167+
r_rdy = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT) &
168+
IXGBE_SECRXSTAT_SECRX_RDY;
169+
if (t_rdy && r_rdy)
170+
return;
162171

163172
/* If the tx fifo doesn't have link, but still has data,
164173
* we can't clear the tx sec block. Set the MAC loopback
@@ -185,7 +194,7 @@ static void ixgbe_ipsec_stop_data(struct ixgbe_adapter *adapter)
185194
IXGBE_SECTXSTAT_SECTX_RDY;
186195
r_rdy = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT) &
187196
IXGBE_SECRXSTAT_SECRX_RDY;
188-
} while (!t_rdy && !r_rdy && limit--);
197+
} while (!(t_rdy && r_rdy) && limit--);
189198

190199
/* undo loopback if we played with it earlier */
191200
if (!link) {
@@ -966,10 +975,22 @@ void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring,
966975
**/
967976
void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)
968977
{
978+
struct ixgbe_hw *hw = &adapter->hw;
969979
struct ixgbe_ipsec *ipsec;
980+
u32 t_dis, r_dis;
970981
size_t size;
971982

972-
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
983+
if (hw->mac.type == ixgbe_mac_82598EB)
984+
return;
985+
986+
/* If there is no support for either Tx or Rx offload
987+
* we should not be advertising support for IPsec.
988+
*/
989+
t_dis = IXGBE_READ_REG(hw, IXGBE_SECTXSTAT) &
990+
IXGBE_SECTXSTAT_SECTX_OFF_DIS;
991+
r_dis = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT) &
992+
IXGBE_SECRXSTAT_SECRX_OFF_DIS;
993+
if (t_dis || r_dis)
973994
return;
974995

975996
ipsec = kzalloc(sizeof(*ipsec), GFP_KERNEL);
@@ -1001,13 +1022,6 @@ void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)
10011022

10021023
adapter->netdev->xfrmdev_ops = &ixgbe_xfrmdev_ops;
10031024

1004-
#define IXGBE_ESP_FEATURES (NETIF_F_HW_ESP | \
1005-
NETIF_F_HW_ESP_TX_CSUM | \
1006-
NETIF_F_GSO_ESP)
1007-
1008-
adapter->netdev->features |= IXGBE_ESP_FEATURES;
1009-
adapter->netdev->hw_enc_features |= IXGBE_ESP_FEATURES;
1010-
10111025
return;
10121026

10131027
err2:

drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,14 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
593593
}
594594

595595
#endif
596+
/* To support macvlan offload we have to use num_tc to
597+
* restrict the queues that can be used by the device.
598+
* By doing this we can avoid reporting a false number of
599+
* queues.
600+
*/
601+
if (vmdq_i > 1)
602+
netdev_set_num_tc(adapter->netdev, 1);
603+
596604
/* populate TC0 for use by pool 0 */
597605
netdev_set_tc_queue(adapter->netdev, 0,
598606
adapter->num_rx_queues_per_pool, 0);

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6117,6 +6117,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter,
61176117
#ifdef CONFIG_IXGBE_DCB
61186118
ixgbe_init_dcb(adapter);
61196119
#endif
6120+
ixgbe_init_ipsec_offload(adapter);
61206121

61216122
/* default flow control settings */
61226123
hw->fc.requested_mode = ixgbe_fc_full;
@@ -8822,14 +8823,6 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
88228823
} else {
88238824
netdev_reset_tc(dev);
88248825

8825-
/* To support macvlan offload we have to use num_tc to
8826-
* restrict the queues that can be used by the device.
8827-
* By doing this we can avoid reporting a false number of
8828-
* queues.
8829-
*/
8830-
if (!tc && adapter->num_rx_pools > 1)
8831-
netdev_set_num_tc(dev, 1);
8832-
88338826
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
88348827
adapter->hw.fc.requested_mode = adapter->last_lfc_mode;
88358828

@@ -9904,7 +9897,7 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev,
99049897
* the TSO, so it's the exception.
99059898
*/
99069899
if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) {
9907-
#ifdef CONFIG_XFRM
9900+
#ifdef CONFIG_XFRM_OFFLOAD
99089901
if (!skb->sp)
99099902
#endif
99109903
features &= ~NETIF_F_TSO;
@@ -10437,6 +10430,14 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1043710430
if (hw->mac.type >= ixgbe_mac_82599EB)
1043810431
netdev->features |= NETIF_F_SCTP_CRC;
1043910432

10433+
#ifdef CONFIG_XFRM_OFFLOAD
10434+
#define IXGBE_ESP_FEATURES (NETIF_F_HW_ESP | \
10435+
NETIF_F_HW_ESP_TX_CSUM | \
10436+
NETIF_F_GSO_ESP)
10437+
10438+
if (adapter->ipsec)
10439+
netdev->features |= IXGBE_ESP_FEATURES;
10440+
#endif
1044010441
/* copy netdev features into list of user selectable features */
1044110442
netdev->hw_features |= netdev->features |
1044210443
NETIF_F_HW_VLAN_CTAG_FILTER |
@@ -10499,8 +10500,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1049910500
NETIF_F_FCOE_MTU;
1050010501
}
1050110502
#endif /* IXGBE_FCOE */
10502-
ixgbe_init_ipsec_offload(adapter);
10503-
1050410503
if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)
1050510504
netdev->hw_features |= NETIF_F_LRO;
1050610505
if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,15 @@ struct ixgbe_nvm_version {
599599
#define IXGBE_SECTXCTRL_STORE_FORWARD 0x00000004
600600

601601
#define IXGBE_SECTXSTAT_SECTX_RDY 0x00000001
602-
#define IXGBE_SECTXSTAT_ECC_TXERR 0x00000002
602+
#define IXGBE_SECTXSTAT_SECTX_OFF_DIS 0x00000002
603+
#define IXGBE_SECTXSTAT_ECC_TXERR 0x00000004
603604

604605
#define IXGBE_SECRXCTRL_SECRX_DIS 0x00000001
605606
#define IXGBE_SECRXCTRL_RX_DIS 0x00000002
606607

607608
#define IXGBE_SECRXSTAT_SECRX_RDY 0x00000001
608-
#define IXGBE_SECRXSTAT_ECC_RXERR 0x00000002
609+
#define IXGBE_SECRXSTAT_SECRX_OFF_DIS 0x00000002
610+
#define IXGBE_SECRXSTAT_ECC_RXERR 0x00000004
609611

610612
/* LinkSec (MacSec) Registers */
611613
#define IXGBE_LSECTXCAP 0x08A00

0 commit comments

Comments
 (0)