Skip to content

Commit 9215310

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Various netfilter fixlets from Pablo and the netfilter team. 2) Fix regression in IPVS caused by lack of PMTU exceptions on local routes in ipv6, from Julian Anastasov. 3) Check pskb_trim_rcsum for failure in DSA, from Zhouyang Jia. 4) Don't crash on poll in TLS, from Daniel Borkmann. 5) Revert SO_REUSE{ADDR,PORT} change, it regresses various things including Avahi mDNS. From Bart Van Assche. 6) Missing of_node_put in qcom/emac driver, from Yue Haibing. 7) We lack checking of the TCP checking in one special case during SYN receive, from Frank van der Linden. 8) Fix module init error paths of mac80211 hwsim, from Johannes Berg. 9) Handle 802.1ad properly in stmmac driver, from Elad Nachman. 10) Must grab HW caps before doing quirk checks in stmmac driver, from Jose Abreu. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (81 commits) net: stmmac: Run HWIF Quirks after getting HW caps neighbour: skip NTF_EXT_LEARNED entries during forced gc net: cxgb3: add error handling for sysfs_create_group tls: fix waitall behavior in tls_sw_recvmsg tls: fix use-after-free in tls_push_record l2tp: filter out non-PPP sessions in pppol2tp_tunnel_ioctl() l2tp: reject creation of non-PPP sessions on L2TPv2 tunnels mlxsw: spectrum_switchdev: Fix port_vlan refcounting mlxsw: spectrum_router: Align with new route replace logic mlxsw: spectrum_router: Allow appending to dev-only routes ipv6: Only emit append events for appended routes stmmac: added support for 802.1ad vlan stripping cfg80211: fix rcu in cfg80211_unregister_wdev mac80211: Move up init of TXQs mac80211_hwsim: fix module init error paths cfg80211: initialize sinfo in cfg80211_get_station nl80211: fix some kernel doc tag mistakes hv_netvsc: Fix the variable sizes in ipsecv2 and rsc offload rds: avoid unenecessary cong_update in loop transport l2tp: clean up stale tunnel or session in pppol2tp_connect's error path ...
2 parents de7f01c + 7cfde0a commit 9215310

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+681
-343
lines changed

drivers/net/ethernet/cavium/thunder/nic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ struct nicvf {
325325
struct tasklet_struct qs_err_task;
326326
struct work_struct reset_task;
327327
struct nicvf_work rx_mode_work;
328+
/* spinlock to protect workqueue arguments from concurrent access */
329+
spinlock_t rx_mode_wq_lock;
328330

329331
/* PTP timestamp */
330332
struct cavium_ptp *ptp_clock;

drivers/net/ethernet/cavium/thunder/nicvf_main.c

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,17 +1923,12 @@ static int nicvf_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
19231923
}
19241924
}
19251925

1926-
static void nicvf_set_rx_mode_task(struct work_struct *work_arg)
1926+
static void __nicvf_set_rx_mode_task(u8 mode, struct xcast_addr_list *mc_addrs,
1927+
struct nicvf *nic)
19271928
{
1928-
struct nicvf_work *vf_work = container_of(work_arg, struct nicvf_work,
1929-
work.work);
1930-
struct nicvf *nic = container_of(vf_work, struct nicvf, rx_mode_work);
19311929
union nic_mbx mbx = {};
19321930
int idx;
19331931

1934-
if (!vf_work)
1935-
return;
1936-
19371932
/* From the inside of VM code flow we have only 128 bits memory
19381933
* available to send message to host's PF, so send all mc addrs
19391934
* one by one, starting from flush command in case if kernel
@@ -1944,7 +1939,7 @@ static void nicvf_set_rx_mode_task(struct work_struct *work_arg)
19441939
mbx.xcast.msg = NIC_MBOX_MSG_RESET_XCAST;
19451940
nicvf_send_msg_to_pf(nic, &mbx);
19461941

1947-
if (vf_work->mode & BGX_XCAST_MCAST_FILTER) {
1942+
if (mode & BGX_XCAST_MCAST_FILTER) {
19481943
/* once enabling filtering, we need to signal to PF to add
19491944
* its' own LMAC to the filter to accept packets for it.
19501945
*/
@@ -1954,23 +1949,46 @@ static void nicvf_set_rx_mode_task(struct work_struct *work_arg)
19541949
}
19551950

19561951
/* check if we have any specific MACs to be added to PF DMAC filter */
1957-
if (vf_work->mc) {
1952+
if (mc_addrs) {
19581953
/* now go through kernel list of MACs and add them one by one */
1959-
for (idx = 0; idx < vf_work->mc->count; idx++) {
1954+
for (idx = 0; idx < mc_addrs->count; idx++) {
19601955
mbx.xcast.msg = NIC_MBOX_MSG_ADD_MCAST;
1961-
mbx.xcast.data.mac = vf_work->mc->mc[idx];
1956+
mbx.xcast.data.mac = mc_addrs->mc[idx];
19621957
nicvf_send_msg_to_pf(nic, &mbx);
19631958
}
1964-
kfree(vf_work->mc);
1959+
kfree(mc_addrs);
19651960
}
19661961

19671962
/* and finally set rx mode for PF accordingly */
19681963
mbx.xcast.msg = NIC_MBOX_MSG_SET_XCAST;
1969-
mbx.xcast.data.mode = vf_work->mode;
1964+
mbx.xcast.data.mode = mode;
19701965

19711966
nicvf_send_msg_to_pf(nic, &mbx);
19721967
}
19731968

1969+
static void nicvf_set_rx_mode_task(struct work_struct *work_arg)
1970+
{
1971+
struct nicvf_work *vf_work = container_of(work_arg, struct nicvf_work,
1972+
work.work);
1973+
struct nicvf *nic = container_of(vf_work, struct nicvf, rx_mode_work);
1974+
u8 mode;
1975+
struct xcast_addr_list *mc;
1976+
1977+
if (!vf_work)
1978+
return;
1979+
1980+
/* Save message data locally to prevent them from
1981+
* being overwritten by next ndo_set_rx_mode call().
1982+
*/
1983+
spin_lock(&nic->rx_mode_wq_lock);
1984+
mode = vf_work->mode;
1985+
mc = vf_work->mc;
1986+
vf_work->mc = NULL;
1987+
spin_unlock(&nic->rx_mode_wq_lock);
1988+
1989+
__nicvf_set_rx_mode_task(mode, mc, nic);
1990+
}
1991+
19741992
static void nicvf_set_rx_mode(struct net_device *netdev)
19751993
{
19761994
struct nicvf *nic = netdev_priv(netdev);
@@ -2004,9 +2022,12 @@ static void nicvf_set_rx_mode(struct net_device *netdev)
20042022
}
20052023
}
20062024
}
2025+
spin_lock(&nic->rx_mode_wq_lock);
2026+
kfree(nic->rx_mode_work.mc);
20072027
nic->rx_mode_work.mc = mc_list;
20082028
nic->rx_mode_work.mode = mode;
2009-
queue_delayed_work(nicvf_rx_mode_wq, &nic->rx_mode_work.work, 2 * HZ);
2029+
queue_delayed_work(nicvf_rx_mode_wq, &nic->rx_mode_work.work, 0);
2030+
spin_unlock(&nic->rx_mode_wq_lock);
20102031
}
20112032

20122033
static const struct net_device_ops nicvf_netdev_ops = {
@@ -2163,6 +2184,7 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
21632184
INIT_WORK(&nic->reset_task, nicvf_reset_task);
21642185

21652186
INIT_DELAYED_WORK(&nic->rx_mode_work.work, nicvf_set_rx_mode_task);
2187+
spin_lock_init(&nic->rx_mode_wq_lock);
21662188

21672189
err = register_netdev(netdev);
21682190
if (err) {

drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,10 +3362,17 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
33623362

33633363
err = sysfs_create_group(&adapter->port[0]->dev.kobj,
33643364
&cxgb3_attr_group);
3365+
if (err) {
3366+
dev_err(&pdev->dev, "cannot create sysfs group\n");
3367+
goto out_close_led;
3368+
}
33653369

33663370
print_port_info(adapter, ai);
33673371
return 0;
33683372

3373+
out_close_led:
3374+
t3_set_reg_field(adapter, A_T3DBG_GPIO_EN, F_GPIO0_OUT_VAL, 0);
3375+
33693376
out_free_dev:
33703377
iounmap(adapter->regs);
33713378
for (i = ai->nports0 + ai->nports1 - 1; i >= 0; --i)

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)