History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller: 1) nfnetlink timestamp taken from wrong skb, fix from Florian Westphal. 2) Revert some msleep conversions in rtlwifi as these spots are in atomic context, from Larry Finger. 3) Validate that NFTA_SET_TABLE attribute is actually specified when we call nf_tables_getset(). From Phil Turnbull. 4) Don't do mdio_reset in stmmac driver with spinlock held as that can sleep, from Vincent Palatin. 5) sk_filter() does things other than run a BPF filter, so we should not elide it's call just because sk->sk_filter is NULL. Fix from Eric Dumazet. 6) Fix missing backlog updates in several packet schedulers, from Cong Wang. 7) bnx2x driver should allow VLAN add/remove while the interface is down, from Michal Schmidt. 8) Several RDS/TCP race fixes from Sowmini Varadhan. 9) fq_codel scheduler doesn't return correct queue length in dumps, from Eric Dumazet. 10) Fix TCP stats for tail loss probe and early retransmit in ipv6, from Yuchung Cheng. 11) Properly initialize udp_tunnel_socket_cfg in l2tp_tunnel_create(), from Guillaume Nault. 12) qfq scheduler leaks SKBs if a kzalloc fails, fix from Florian Westphal. 13) sock_fprog passed into PACKET_FANOUT_DATA needs compat handling, from Willem de Bruijn. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (85 commits) vmxnet3: segCnt can be 1 for LRO packets packet: compat support for sock_fprog stmmac: fix parameter to dwmac4_set_umac_addr() net/mlx5e: Fix blue flame quota logic net/mlx5e: Use ndo_stop explicitly at shutdown flow net/mlx5: E-Switch, always set mc_promisc for allmulti vports net/mlx5: E-Switch, Modify node guid on vf set MAC net/mlx5: E-Switch, Fix vport enable flow net/mlx5: E-Switch, Use the correct error check on returned pointers net/mlx5: E-Switch, Use the correct free() function net/mlx5: Fix E-Switch flow steering capabilities check net/mlx5: Fix flow steering NIC capabilities check net/mlx5: Fix root flow table update net/mlx5: Fix MLX5_CMD_OP_MAX to be defined correctly net/mlx5: Fix masking of reserved bits in XRCD number net/mlx5: Fix the size of modify QP mailbox mlxsw: spectrum: Don't sleep during ndo_get_phys_port_name() mlxsw: spectrum: Make split flow match firmware requirements wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel cfg80211: remove get/set antenna and tx power warnings ...

Linus Torvalds committed 10 years ago

Commit 698ea542 parents 729d378 502195393 files · +828 −460Browse files

Unified · Split

93 files
  1. MAINTAINERS +1 −0
  2. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +62 −89
  3. drivers/net/ethernet/broadcom/bnxt/bnxt.c +25 −21
  4. drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h +1 −0
  5. drivers/net/ethernet/ethoc.c +4 −3
  6. drivers/net/ethernet/freescale/fec_main.c +4 −4
  7. drivers/net/ethernet/freescale/gianfar.c +2 −1
  8. drivers/net/ethernet/mediatek/mtk_eth_soc.c +34 −6
  9. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 −4
  10. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +2 −1
  11. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +43 −26
  12. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +25 −15
  13. drivers/net/ethernet/mellanox/mlx5/core/qp.c +1 −1
  14. drivers/net/ethernet/mellanox/mlx5/core/vport.c +38 −0
  15. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +112 −91
  16. drivers/net/ethernet/mellanox/mlxsw/spectrum.h +5 −0
  17. drivers/net/ethernet/qlogic/qed/qed_main.c +36 −9
  18. drivers/net/ethernet/qlogic/qed/qed_sriov.h +3 −1
  19. drivers/net/ethernet/qlogic/qede/qede_main.c +2 −0
  20. drivers/net/ethernet/sfc/mcdi_port.c +4 −3
  21. drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +1 −1
  22. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 −2
  23. drivers/net/ethernet/ti/cpsw.c +1 −1
  24. drivers/net/vmxnet3/vmxnet3_drv.c +1 −1
  25. drivers/net/vmxnet3/vmxnet3_int.h +2 −2
  26. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +16 −0
  27. drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +2 −0
  28. drivers/net/wireless/mac80211_hwsim.c +1 −0
  29. drivers/net/wireless/realtek/rtlwifi/core.c +3 −3
  30. include/linux/mlx5/device.h +6 −2
  31. include/linux/mlx5/mlx5_ifc.h +9 −3
  32. include/linux/mlx5/qp.h +1 −0
  33. include/linux/mlx5/vport.h +2 −0
  34. include/net/compat.h +1 −0
  35. include/net/ip_vs.h +1 −1
  36. include/net/netfilter/nf_queue.h +2 −2
  37. include/net/netns/netfilter.h +2 −0
  38. include/net/pkt_cls.h +7 −3
  39. include/net/sch_generic.h +5 −1
  40. include/uapi/linux/gtp.h +1 −1
  41. kernel/trace/bpf_trace.c +2 −2
  42. net/bridge/br_fdb.c +2 −0
  43. net/compat.c +17 −3
  44. net/core/gen_stats.c +2 −0
  45. net/core/net-sysfs.c +1 −0
  46. net/ipv4/udp.c +5 −5
  47. net/ipv6/ip6_gre.c +3 −0
  48. net/ipv6/ip6_output.c +3 −8
  49. net/ipv6/netfilter/nf_dup_ipv6.c +1 −0
  50. net/ipv6/tcp_ipv6.c +3 −1
  51. net/ipv6/udp.c +6 −6
  52. net/l2tp/l2tp_core.c +1 −1
  53. net/mac80211/mesh.c +4 −0
  54. net/mac80211/sta_info.h +1 −1
  55. net/netfilter/ipvs/ip_vs_conn.c +3 −2
  56. net/netfilter/ipvs/ip_vs_core.c +3 −2
  57. net/netfilter/nf_conntrack_ftp.c +1 −0
  58. net/netfilter/nf_conntrack_helper.c +4 −5
  59. net/netfilter/nf_conntrack_irc.c +1 −0
  60. net/netfilter/nf_conntrack_sane.c +1 −0
  61. net/netfilter/nf_conntrack_sip.c +1 −0
  62. net/netfilter/nf_conntrack_standalone.c +0 −2
  63. net/netfilter/nf_conntrack_tftp.c +1 −0
  64. net/netfilter/nf_queue.c +8 −9
  65. net/netfilter/nf_tables_api.c +2 −0
  66. net/netfilter/nfnetlink_queue.c +13 −7
  67. net/netfilter/x_tables.c +2 −2
  68. net/packet/af_packet.c +25 −0
  69. net/rds/rds.h +2 −0
  70. net/rds/recv.c +2 −0
  71. net/rds/send.c +1 −0
  72. net/rds/tcp.c +75 −3
  73. net/rds/tcp.h +1 −0
  74. net/rds/tcp_connect.c +1 −1
  75. net/rds/tcp_listen.c +7 −13
  76. net/rds/threads.c +8 −2
  77. net/rxrpc/rxkad.c +1 −3
  78. net/sched/act_police.c +11 −22
  79. net/sched/cls_flower.c +3 −3
  80. net/sched/cls_u32.c +40 −32
  81. net/sched/sch_drr.c +4 −0
  82. net/sched/sch_fq_codel.c +19 −7
  83. net/sched/sch_generic.c +2 −0
  84. net/sched/sch_hfsc.c +4 −8
  85. net/sched/sch_ingress.c +12 −0
  86. net/sched/sch_prio.c +4 −0
  87. net/sched/sch_qfq.c +4 −2
  88. net/sched/sch_red.c +4 −0
  89. net/sched/sch_tbf.c +4 −0
  90. net/tipc/netlink_compat.c +2 −1
  91. net/wireless/core.c +0 −2
  92. net/wireless/wext-core.c +23 −2
  93. tools/testing/selftests/net/reuseport_bpf.c +5 −5
MAINTAINERS+1−0
@@ -8009,6 +8009,7 @@ Q: http://patchwork.kernel.org/project/linux-wireless/list/ · 8008 unmodified lines
80098009 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
80108010 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
80118011 S: Maintained
8012+F: Documentation/devicetree/bindings/net/wireless/
80128013 F: drivers/net/wireless/
80138014
80148015 NETXEN (1/10) GbE SUPPORT
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+62−89
@@ -12895,52 +12895,71 @@ static int __bnx2x_vlan_configure_vid(struct bnx2x *bp, u16 vid, bool add) · 12894 unmodified lines
1289512895 return rc;
1289612896 }
1289712897
12898−int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp)
12898+static int bnx2x_vlan_configure_vid_list(struct bnx2x *bp)
1289912899 {
1290012900 struct bnx2x_vlan_entry *vlan;
1290112901 int rc = 0;
1290212902
12903− if (!bp->vlan_cnt) {
12904− DP(NETIF_MSG_IFUP, "No need to re-configure vlan filters\n");
12905− return 0;
12906− }
12907−
12903+ /* Configure all non-configured entries */
1290812904 list_for_each_entry(vlan, &bp->vlan_reg, link) {
12909− /* Prepare for cleanup in case of errors */
12910− if (rc) {
12911− vlan->hw = false;
12912− continue;
12913− }
12914−
12915− if (!vlan->hw)
12905+ if (vlan->hw)
1291612906 continue;
1291712907
12918− DP(NETIF_MSG_IFUP, "Re-configuring vlan 0x%04x\n", vlan->vid);
12908+ if (bp->vlan_cnt >= bp->vlan_credit)
12909+ return -ENOBUFS;
1291912910
1292012911 rc = __bnx2x_vlan_configure_vid(bp, vlan->vid, true);
1292112912 if (rc) {
12922− BNX2X_ERR("Unable to configure VLAN %d\n", vlan->vid);
12923− vlan->hw = false;
12924− rc = -EINVAL;
12925− continue;
12913+ BNX2X_ERR("Unable to config VLAN %d\n", vlan->vid);
12914+ return rc;
1292612915 }
12916+
12917+ DP(NETIF_MSG_IFUP, "HW configured for VLAN %d\n", vlan->vid);
12918+ vlan->hw = true;
12919+ bp->vlan_cnt++;
1292712920 }
1292812921
12929− return rc;
12922+ return 0;
12923+}
12924+
12925+static void bnx2x_vlan_configure(struct bnx2x *bp, bool set_rx_mode)
12926+{
12927+ bool need_accept_any_vlan;
12928+
12929+ need_accept_any_vlan = !!bnx2x_vlan_configure_vid_list(bp);
12930+
12931+ if (bp->accept_any_vlan != need_accept_any_vlan) {
12932+ bp->accept_any_vlan = need_accept_any_vlan;
12933+ DP(NETIF_MSG_IFUP, "Accept all VLAN %s\n",
12934+ bp->accept_any_vlan ? "raised" : "cleared");
12935+ if (set_rx_mode) {
12936+ if (IS_PF(bp))
12937+ bnx2x_set_rx_mode_inner(bp);
12938+ else
12939+ bnx2x_vfpf_storm_rx_mode(bp);
12940+ }
12941+ }
12942+}
12943+
12944+int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp)
12945+{
12946+ struct bnx2x_vlan_entry *vlan;
12947+
12948+ /* The hw forgot all entries after reload */
12949+ list_for_each_entry(vlan, &bp->vlan_reg, link)
12950+ vlan->hw = false;
12951+ bp->vlan_cnt = 0;
12952+
12953+ /* Don't set rx mode here. Our caller will do it. */
12954+ bnx2x_vlan_configure(bp, false);
12955+
12956+ return 0;
1293012957 }
1293112958
1293212959 static int bnx2x_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
1293312960 {
1293412961 struct bnx2x *bp = netdev_priv(dev);
1293512962 struct bnx2x_vlan_entry *vlan;
12936− bool hw = false;
12937− int rc = 0;
12938−
12939− if (!netif_running(bp->dev)) {
12940− DP(NETIF_MSG_IFUP,
12941− "Ignoring VLAN configuration the interface is down\n");
12942− return -EFAULT;
12943− }
1294412963
1294512964 DP(NETIF_MSG_IFUP, "Adding VLAN %d\n", vid);
1294612965
@@ -12948,93 +12967,47 @@ static int bnx2x_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) · 1 unmodified line
1294812967 if (!vlan)
1294912968 return -ENOMEM;
1295012969
12951− bp->vlan_cnt++;
12952− if (bp->vlan_cnt > bp->vlan_credit && !bp->accept_any_vlan) {
12953− DP(NETIF_MSG_IFUP, "Accept all VLAN raised\n");
12954− bp->accept_any_vlan = true;
12955− if (IS_PF(bp))
12956− bnx2x_set_rx_mode_inner(bp);
12957− else
12958− bnx2x_vfpf_storm_rx_mode(bp);
12959− } else if (bp->vlan_cnt <= bp->vlan_credit) {
12960− rc = __bnx2x_vlan_configure_vid(bp, vid, true);
12961− hw = true;
12962− }
12963−
1296412970 vlan->vid = vid;
12965− vlan->hw = hw;
12971+ vlan->hw = false;
12972+ list_add_tail(&vlan->link, &bp->vlan_reg);
1296612973
12967− if (!rc) {
12968− list_add(&vlan->link, &bp->vlan_reg);
12969− } else {
12970− bp->vlan_cnt--;
12971− kfree(vlan);
12972− }
12973−
12974− DP(NETIF_MSG_IFUP, "Adding VLAN result %d\n", rc);
12974+ if (netif_running(dev))
12975+ bnx2x_vlan_configure(bp, true);
1297512976
12976− return rc;
12977+ return 0;
1297712978 }
1297812979
1297912980 static int bnx2x_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
1298012981 {
1298112982 struct bnx2x *bp = netdev_priv(dev);
1298212983 struct bnx2x_vlan_entry *vlan;
12984+ bool found = false;
1298312985 int rc = 0;
1298412986
12985− if (!netif_running(bp->dev)) {
12986− DP(NETIF_MSG_IFUP,
12987− "Ignoring VLAN configuration the interface is down\n");
12988− return -EFAULT;
12989− }
12990−
1299112987 DP(NETIF_MSG_IFUP, "Removing VLAN %d\n", vid);
1299212988
12993− if (!bp->vlan_cnt) {
12994− BNX2X_ERR("Unable to kill VLAN %d\n", vid);
12995− return -EINVAL;
12996− }
12997−
1299812989 list_for_each_entry(vlan, &bp->vlan_reg, link)
12999− if (vlan->vid == vid)
12990+ if (vlan->vid == vid) {
12991+ found = true;
1300012992 break;
12993+ }
1300112994
13002− if (vlan->vid != vid) {
12995+ if (!found) {
1300312996 BNX2X_ERR("Unable to kill VLAN %d - not found\n", vid);
1300412997 return -EINVAL;
1300512998 }
1300612999
13007− if (vlan->hw)
13000+ if (netif_running(dev) && vlan->hw) {
1300813001 rc = __bnx2x_vlan_configure_vid(bp, vid, false);
13002+ DP(NETIF_MSG_IFUP, "HW deconfigured for VLAN %d\n", vid);
13003+ bp->vlan_cnt--;
13004+ }
1300913005
1301013006 list_del(&vlan->link);
1301113007 kfree(vlan);
1301213008
13013− bp->vlan_cnt--;
13014−
13015− if (bp->vlan_cnt <= bp->vlan_credit && bp->accept_any_vlan) {
13016− /* Configure all non-configured entries */
13017− list_for_each_entry(vlan, &bp->vlan_reg, link) {
13018− if (vlan->hw)
13019− continue;
13020−
13021− rc = __bnx2x_vlan_configure_vid(bp, vlan->vid, true);
13022− if (rc) {
13023− BNX2X_ERR("Unable to config VLAN %d\n",
13024− vlan->vid);
13025− continue;
13026− }
13027− DP(NETIF_MSG_IFUP, "HW configured for VLAN %d\n",
13028− vlan->vid);
13029− vlan->hw = true;
13030− }
13031− DP(NETIF_MSG_IFUP, "Accept all VLAN Removed\n");
13032− bp->accept_any_vlan = false;
13033− if (IS_PF(bp))
13034− bnx2x_set_rx_mode_inner(bp);
13035− else
13036− bnx2x_vfpf_storm_rx_mode(bp);
13037− }
13009+ if (netif_running(dev))
13010+ bnx2x_vlan_configure(bp, true);
1303813011
1303913012 DP(NETIF_MSG_IFUP, "Removing VLAN result %d\n", rc);
1304013013
drivers/net/ethernet/broadcom/bnxt/bnxt.c+25−21
@@ -286,7 +286,9 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) · 285 unmodified lines
286286 cpu_to_le32(DB_KEY_TX_PUSH | DB_LONG_TX_PUSH | prod);
287287 txr->tx_prod = prod;
288288
289+ tx_buf->is_push = 1;
289290 netdev_tx_sent_queue(txq, skb->len);
291+ wmb(); /* Sync is_push and byte queue before pushing data */
290292
291293 push_len = (length + sizeof(*tx_push) + 7) / 8;
292294 if (push_len > 16) {
@@ -298,7 +300,6 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) · 5 unmodified lines
298300 push_len);
299301 }
300302
301− tx_buf->is_push = 1;
302303 goto tx_done;
303304 }
304305
@@ -1112,19 +1113,13 @@ static inline struct sk_buff *bnxt_tpa_end(struct bnxt *bp, · 807 unmodified lines
11121113 if (tpa_info->hash_type != PKT_HASH_TYPE_NONE)
11131114 skb_set_hash(skb, tpa_info->rss_hash, tpa_info->hash_type);
11141115
1115− if (tpa_info->flags2 & RX_CMP_FLAGS2_META_FORMAT_VLAN) {
1116− netdev_features_t features = skb->dev->features;
1116+ if ((tpa_info->flags2 & RX_CMP_FLAGS2_META_FORMAT_VLAN) &&
1117+ (skb->dev->features & NETIF_F_HW_VLAN_CTAG_RX)) {
11171118 u16 vlan_proto = tpa_info->metadata >>
11181119 RX_CMP_FLAGS2_METADATA_TPID_SFT;
1120+ u16 vtag = tpa_info->metadata & RX_CMP_FLAGS2_METADATA_VID_MASK;
11191121
1120− if (((features & NETIF_F_HW_VLAN_CTAG_RX) &&
1121− vlan_proto == ETH_P_8021Q) ||
1122− ((features & NETIF_F_HW_VLAN_STAG_RX) &&
1123− vlan_proto == ETH_P_8021AD)) {
1124− __vlan_hwaccel_put_tag(skb, htons(vlan_proto),
1125− tpa_info->metadata &
1126− RX_CMP_FLAGS2_METADATA_VID_MASK);
1127− }
1122+ __vlan_hwaccel_put_tag(skb, htons(vlan_proto), vtag);
11281123 }
11291124
11301125 skb_checksum_none_assert(skb);
@@ -1277,19 +1272,14 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_napi *bnapi, u32 *raw_cons, · 146 unmodified lines
12771272
12781273 skb->protocol = eth_type_trans(skb, dev);
12791274
1280− if (rxcmp1->rx_cmp_flags2 &
1281− cpu_to_le32(RX_CMP_FLAGS2_META_FORMAT_VLAN)) {
1282− netdev_features_t features = skb->dev->features;
1275+ if ((rxcmp1->rx_cmp_flags2 &
1276+ cpu_to_le32(RX_CMP_FLAGS2_META_FORMAT_VLAN)) &&
1277+ (skb->dev->features & NETIF_F_HW_VLAN_CTAG_RX)) {
12831278 u32 meta_data = le32_to_cpu(rxcmp1->rx_cmp_meta_data);
1279+ u16 vtag = meta_data & RX_CMP_FLAGS2_METADATA_VID_MASK;
12841280 u16 vlan_proto = meta_data >> RX_CMP_FLAGS2_METADATA_TPID_SFT;
12851281
1286− if (((features & NETIF_F_HW_VLAN_CTAG_RX) &&
1287− vlan_proto == ETH_P_8021Q) ||
1288− ((features & NETIF_F_HW_VLAN_STAG_RX) &&
1289− vlan_proto == ETH_P_8021AD))
1290− __vlan_hwaccel_put_tag(skb, htons(vlan_proto),
1291− meta_data &
1292− RX_CMP_FLAGS2_METADATA_VID_MASK);
1282+ __vlan_hwaccel_put_tag(skb, htons(vlan_proto), vtag);
12931283 }
12941284
12951285 skb_checksum_none_assert(skb);
@@ -5466,6 +5456,20 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, · 4170 unmodified lines
54665456
54675457 if (!bnxt_rfs_capable(bp))
54685458 features &= ~NETIF_F_NTUPLE;
5459+
5460+ /* Both CTAG and STAG VLAN accelaration on the RX side have to be
5461+ * turned on or off together.
5462+ */
5463+ if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) !=
5464+ (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) {
5465+ if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
5466+ features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
5467+ NETIF_F_HW_VLAN_STAG_RX);
5468+ else
5469+ features |= NETIF_F_HW_VLAN_CTAG_RX |
5470+ NETIF_F_HW_VLAN_STAG_RX;
5471+ }
5472+
54695473 return features;
54705474 }
54715475
drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h+1−0
@@ -144,6 +144,7 @@ CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN · 143 unmodified lines
144144 CH_PCI_ID_TABLE_FENTRY(0x5015), /* T502-bt */
145145 CH_PCI_ID_TABLE_FENTRY(0x5016), /* T580-OCP-SO */
146146 CH_PCI_ID_TABLE_FENTRY(0x5017), /* T520-OCP-SO */
147+ CH_PCI_ID_TABLE_FENTRY(0x5018), /* T540-BT */
147148 CH_PCI_ID_TABLE_FENTRY(0x5080), /* Custom T540-cr */
148149 CH_PCI_ID_TABLE_FENTRY(0x5081), /* Custom T540-LL-cr */
149150 CH_PCI_ID_TABLE_FENTRY(0x5082), /* Custom T504-cr */
drivers/net/ethernet/ethoc.c+4−3
@@ -1195,7 +1195,7 @@ static int ethoc_probe(struct platform_device *pdev) · 1194 unmodified lines
11951195 priv->mdio = mdiobus_alloc();
11961196 if (!priv->mdio) {
11971197 ret = -ENOMEM;
1198− goto free;
1198+ goto free2;
11991199 }
12001200
12011201 priv->mdio->name = "ethoc-mdio";
@@ -1208,7 +1208,7 @@ static int ethoc_probe(struct platform_device *pdev) · 6 unmodified lines
12081208 ret = mdiobus_register(priv->mdio);
12091209 if (ret) {
12101210 dev_err(&netdev->dev, "failed to register MDIO bus\n");
1211− goto free;
1211+ goto free2;
12121212 }
12131213
12141214 ret = ethoc_mdio_probe(netdev);
@@ -1241,9 +1241,10 @@ error2: · 26 unmodified lines
12411241 error:
12421242 mdiobus_unregister(priv->mdio);
12431243 mdiobus_free(priv->mdio);
1244−free:
1244+free2:
12451245 if (priv->clk)
12461246 clk_disable_unprepare(priv->clk);
1247+free:
12471248 free_netdev(netdev);
12481249 out:
12491250 return ret;
drivers/net/ethernet/freescale/fec_main.c+4−4
@@ -2416,24 +2416,24 @@ fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec) · 2415 unmodified lines
24162416 return -EOPNOTSUPP;
24172417
24182418 if (ec->rx_max_coalesced_frames > 255) {
2419− pr_err("Rx coalesced frames exceed hardware limiation");
2419+ pr_err("Rx coalesced frames exceed hardware limitation\n");
24202420 return -EINVAL;
24212421 }
24222422
24232423 if (ec->tx_max_coalesced_frames > 255) {
2424− pr_err("Tx coalesced frame exceed hardware limiation");
2424+ pr_err("Tx coalesced frame exceed hardware limitation\n");
24252425 return -EINVAL;
24262426 }
24272427
24282428 cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
24292429 if (cycle > 0xFFFF) {
2430− pr_err("Rx coalesed usec exceeed hardware limiation");
2430+ pr_err("Rx coalesced usec exceed hardware limitation\n");
24312431 return -EINVAL;
24322432 }
24332433
24342434 cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
24352435 if (cycle > 0xFFFF) {
2436− pr_err("Rx coalesed usec exceeed hardware limiation");
2436+ pr_err("Rx coalesced usec exceed hardware limitation\n");
24372437 return -EINVAL;
24382438 }
24392439
drivers/net/ethernet/freescale/gianfar.c+2−1
@@ -2440,7 +2440,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) · 2439 unmodified lines
24402440 tx_queue->tx_ring_size);
24412441
24422442 if (likely(!nr_frags)) {
2443− lstatus |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT);
2443+ if (likely(!do_tstamp))
2444+ lstatus |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT);
24442445 } else {
24452446 u32 lstatus_start = lstatus;
24462447
drivers/net/ethernet/mediatek/mtk_eth_soc.c+34−6
@@ -133,6 +133,8 @@ static int mtk_mdio_read(struct mii_bus *bus, int phy_addr, int phy_reg) · 132 unmodified lines
133133 static void mtk_phy_link_adjust(struct net_device *dev)
134134 {
135135 struct mtk_mac *mac = netdev_priv(dev);
136+ u16 lcl_adv = 0, rmt_adv = 0;
137+ u8 flowctrl;
136138 u32 mcr = MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG |
137139 MAC_MCR_FORCE_MODE | MAC_MCR_TX_EN |
138140 MAC_MCR_RX_EN | MAC_MCR_BACKOFF_EN |
@@ -150,11 +152,30 @@ static void mtk_phy_link_adjust(struct net_device *dev) · 11 unmodified lines
150152 if (mac->phy_dev->link)
151153 mcr |= MAC_MCR_FORCE_LINK;
152154
153− if (mac->phy_dev->duplex)
155+ if (mac->phy_dev->duplex) {
154156 mcr |= MAC_MCR_FORCE_DPX;
155157
156− if (mac->phy_dev->pause)
157− mcr |= MAC_MCR_FORCE_RX_FC | MAC_MCR_FORCE_TX_FC;
158+ if (mac->phy_dev->pause)
159+ rmt_adv = LPA_PAUSE_CAP;
160+ if (mac->phy_dev->asym_pause)
161+ rmt_adv |= LPA_PAUSE_ASYM;
162+
163+ if (mac->phy_dev->advertising & ADVERTISED_Pause)
164+ lcl_adv |= ADVERTISE_PAUSE_CAP;
165+ if (mac->phy_dev->advertising & ADVERTISED_Asym_Pause)
166+ lcl_adv |= ADVERTISE_PAUSE_ASYM;
167+
168+ flowctrl = mii_resolve_flowctrl_fdx(lcl_adv, rmt_adv);
169+
170+ if (flowctrl & FLOW_CTRL_TX)
171+ mcr |= MAC_MCR_FORCE_TX_FC;
172+ if (flowctrl & FLOW_CTRL_RX)
173+ mcr |= MAC_MCR_FORCE_RX_FC;
174+
175+ netif_dbg(mac->hw, link, dev, "rx pause %s, tx pause %s\n",
176+ flowctrl & FLOW_CTRL_RX ? "enabled" : "disabled",
177+ flowctrl & FLOW_CTRL_TX ? "enabled" : "disabled");
178+ }
158179
159180 mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
160181
@@ -208,10 +229,16 @@ static int mtk_phy_connect(struct mtk_mac *mac) · 47 unmodified lines
208229 u32 val, ge_mode;
209230
210231 np = of_parse_phandle(mac->of_node, "phy-handle", 0);
232+ if (!np && of_phy_is_fixed_link(mac->of_node))
233+ if (!of_phy_register_fixed_link(mac->of_node))
234+ np = of_node_get(mac->of_node);
211235 if (!np)
212236 return -ENODEV;
213237
214238 switch (of_get_phy_mode(np)) {
239+ case PHY_INTERFACE_MODE_RGMII_TXID:
240+ case PHY_INTERFACE_MODE_RGMII_RXID:
241+ case PHY_INTERFACE_MODE_RGMII_ID:
215242 case PHY_INTERFACE_MODE_RGMII:
216243 ge_mode = 0;
217244 break;
@@ -236,7 +263,8 @@ static int mtk_phy_connect(struct mtk_mac *mac) · 18 unmodified lines
236263 mac->phy_dev->autoneg = AUTONEG_ENABLE;
237264 mac->phy_dev->speed = 0;
238265 mac->phy_dev->duplex = 0;
239− mac->phy_dev->supported &= PHY_BASIC_FEATURES;
266+ mac->phy_dev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause |
267+ SUPPORTED_Asym_Pause;
240268 mac->phy_dev->advertising = mac->phy_dev->supported |
241269 ADVERTISED_Autoneg;
242270 phy_start_aneg(mac->phy_dev);
@@ -280,7 +308,7 @@ static int mtk_mdio_init(struct mtk_eth *eth) · 37 unmodified lines
280308 return 0;
281309
282310 err_free_bus:
283− kfree(eth->mii_bus);
311+ mdiobus_free(eth->mii_bus);
284312
285313 err_put_node:
286314 of_node_put(mii_np);
@@ -295,7 +323,7 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth) · 8 unmodified lines
295323
296324 mdiobus_unregister(eth->mii_bus);
297325 of_node_put(eth->mii_bus->dev.of_node);
298− kfree(eth->mii_bus);
326+ mdiobus_free(eth->mii_bus);
299327 }
300328
301329 static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+1−4
@@ -3192,10 +3192,7 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv) · 3191 unmodified lines
31923192 flush_workqueue(priv->wq);
31933193 if (test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state)) {
31943194 netif_device_detach(netdev);
3195− mutex_lock(&priv->state_lock);
3196− if (test_bit(MLX5E_STATE_OPENED, &priv->state))
3197− mlx5e_close_locked(netdev);
3198− mutex_unlock(&priv->state_lock);
3195+ mlx5e_close(netdev);
31993196 } else {
32003197 unregister_netdev(netdev);
32013198 }
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c+2−1
@@ -317,7 +317,8 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) · 316 unmodified lines
317317 while ((sq->pc & wq->sz_m1) > sq->edge)
318318 mlx5e_send_nop(sq, false);
319319
320− sq->bf_budget = bf ? sq->bf_budget - 1 : 0;
320+ if (bf)
321+ sq->bf_budget--;
321322
322323 sq->stats.packets++;
323324 sq->stats.bytes += num_bytes;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+43−26
@@ -383,7 +383,7 @@ __esw_fdb_set_vport_rule(struct mlx5_eswitch *esw, u32 vport, bool rx_rule, · 382 unmodified lines
383383 match_v,
384384 MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,
385385 0, &dest);
386− if (IS_ERR_OR_NULL(flow_rule)) {
386+ if (IS_ERR(flow_rule)) {
387387 pr_warn(
388388 "FDB: Failed to add flow rule: dmac_v(%pM) dmac_c(%pM) -> vport(%d), err(%ld)\n",
389389 dmac_v, dmac_c, vport, PTR_ERR(flow_rule));
@@ -457,7 +457,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports) · 67 unmodified lines
457457
458458 table_size = BIT(MLX5_CAP_ESW_FLOWTABLE_FDB(dev, log_max_ft_size));
459459 fdb = mlx5_create_flow_table(root_ns, 0, table_size, 0);
460− if (IS_ERR_OR_NULL(fdb)) {
460+ if (IS_ERR(fdb)) {
461461 err = PTR_ERR(fdb);
462462 esw_warn(dev, "Failed to create FDB Table err %d\n", err);
463463 goto out;
@@ -474,7 +474,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports) · 10 unmodified lines
474474 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, table_size - 3);
475475 eth_broadcast_addr(dmac);
476476 g = mlx5_create_flow_group(fdb, flow_group_in);
477− if (IS_ERR_OR_NULL(g)) {
477+ if (IS_ERR(g)) {
478478 err = PTR_ERR(g);
479479 esw_warn(dev, "Failed to create flow group err(%d)\n", err);
480480 goto out;
@@ -489,7 +489,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports) · 8 unmodified lines
489489 eth_zero_addr(dmac);
490490 dmac[0] = 0x01;
491491 g = mlx5_create_flow_group(fdb, flow_group_in);
492− if (IS_ERR_OR_NULL(g)) {
492+ if (IS_ERR(g)) {
493493 err = PTR_ERR(g);
494494 esw_warn(dev, "Failed to create allmulti flow group err(%d)\n", err);
495495 goto out;
@@ -506,7 +506,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports) · 10 unmodified lines
506506 MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, table_size - 1);
507507 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, table_size - 1);
508508 g = mlx5_create_flow_group(fdb, flow_group_in);
509− if (IS_ERR_OR_NULL(g)) {
509+ if (IS_ERR(g)) {
510510 err = PTR_ERR(g);
511511 esw_warn(dev, "Failed to create promisc flow group err(%d)\n", err);
512512 goto out;
@@ -529,7 +529,7 @@ out: · 16 unmodified lines
529529 }
530530 }
531531
532− kfree(flow_group_in);
532+ kvfree(flow_group_in);
533533 return err;
534534 }
535535
@@ -651,6 +651,7 @@ static void update_allmulti_vports(struct mlx5_eswitch *esw, · 115 unmodified lines
651651 esw_fdb_set_vport_rule(esw,
652652 mac,
653653 vport_idx);
654+ iter_vaddr->mc_promisc = true;
654655 break;
655656 case MLX5_ACTION_DEL:
656657 if (!iter_vaddr)
@@ -1060,7 +1061,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw, · 403 unmodified lines
10601061 return;
10611062
10621063 acl = mlx5_create_vport_flow_table(root_ns, 0, table_size, 0, vport->vport);
1063− if (IS_ERR_OR_NULL(acl)) {
1064+ if (IS_ERR(acl)) {
10641065 err = PTR_ERR(acl);
10651066 esw_warn(dev, "Failed to create E-Switch vport[%d] egress flow Table, err(%d)\n",
10661067 vport->vport, err);
@@ -1075,7 +1076,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw, · 8 unmodified lines
10751076 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 0);
10761077
10771078 vlan_grp = mlx5_create_flow_group(acl, flow_group_in);
1078− if (IS_ERR_OR_NULL(vlan_grp)) {
1079+ if (IS_ERR(vlan_grp)) {
10791080 err = PTR_ERR(vlan_grp);
10801081 esw_warn(dev, "Failed to create E-Switch vport[%d] egress allowed vlans flow group, err(%d)\n",
10811082 vport->vport, err);
@@ -1086,7 +1087,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw, · 4 unmodified lines
10861087 MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, 1);
10871088 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 1);
10881089 drop_grp = mlx5_create_flow_group(acl, flow_group_in);
1089− if (IS_ERR_OR_NULL(drop_grp)) {
1090+ if (IS_ERR(drop_grp)) {
10901091 err = PTR_ERR(drop_grp);
10911092 esw_warn(dev, "Failed to create E-Switch vport[%d] egress drop flow group, err(%d)\n",
10921093 vport->vport, err);
@@ -1097,7 +1098,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw, · 4 unmodified lines
10971098 vport->egress.drop_grp = drop_grp;
10981099 vport->egress.allowed_vlans_grp = vlan_grp;
10991100 out:
1100− kfree(flow_group_in);
1101+ kvfree(flow_group_in);
11011102 if (err && !IS_ERR_OR_NULL(vlan_grp))
11021103 mlx5_destroy_flow_group(vlan_grp);
11031104 if (err && !IS_ERR_OR_NULL(acl))
@@ -1174,7 +1175,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw, · 70 unmodified lines
11741175 return;
11751176
11761177 acl = mlx5_create_vport_flow_table(root_ns, 0, table_size, 0, vport->vport);
1177− if (IS_ERR_OR_NULL(acl)) {
1178+ if (IS_ERR(acl)) {
11781179 err = PTR_ERR(acl);
11791180 esw_warn(dev, "Failed to create E-Switch vport[%d] ingress flow Table, err(%d)\n",
11801181 vport->vport, err);
@@ -1192,7 +1193,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw, · 11 unmodified lines
11921193 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 0);
11931194
11941195 g = mlx5_create_flow_group(acl, flow_group_in);
1195− if (IS_ERR_OR_NULL(g)) {
1196+ if (IS_ERR(g)) {
11961197 err = PTR_ERR(g);
11971198 esw_warn(dev, "Failed to create E-Switch vport[%d] ingress untagged spoofchk flow group, err(%d)\n",
11981199 vport->vport, err);
@@ -1207,7 +1208,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw, · 8 unmodified lines
12071208 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 1);
12081209
12091210 g = mlx5_create_flow_group(acl, flow_group_in);
1210− if (IS_ERR_OR_NULL(g)) {
1211+ if (IS_ERR(g)) {
12111212 err = PTR_ERR(g);
12121213 esw_warn(dev, "Failed to create E-Switch vport[%d] ingress untagged flow group, err(%d)\n",
12131214 vport->vport, err);
@@ -1223,7 +1224,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw, · 9 unmodified lines
12231224 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 2);
12241225
12251226 g = mlx5_create_flow_group(acl, flow_group_in);
1226− if (IS_ERR_OR_NULL(g)) {
1227+ if (IS_ERR(g)) {
12271228 err = PTR_ERR(g);
12281229 esw_warn(dev, "Failed to create E-Switch vport[%d] ingress spoofchk flow group, err(%d)\n",
12291230 vport->vport, err);
@@ -1236,7 +1237,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw, · 6 unmodified lines
12361237 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 3);
12371238
12381239 g = mlx5_create_flow_group(acl, flow_group_in);
1239− if (IS_ERR_OR_NULL(g)) {
1240+ if (IS_ERR(g)) {
12401241 err = PTR_ERR(g);
12411242 esw_warn(dev, "Failed to create E-Switch vport[%d] ingress drop flow group, err(%d)\n",
12421243 vport->vport, err);
@@ -1259,7 +1260,7 @@ out: · 16 unmodified lines
12591260 mlx5_destroy_flow_table(vport->ingress.acl);
12601261 }
12611262
1262− kfree(flow_group_in);
1263+ kvfree(flow_group_in);
12631264 }
12641265
12651266 static void esw_vport_cleanup_ingress_rules(struct mlx5_eswitch *esw,
@@ -1363,7 +1364,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw, · 97 unmodified lines
13631364 match_v,
13641365 MLX5_FLOW_CONTEXT_ACTION_ALLOW,
13651366 0, NULL);
1366− if (IS_ERR_OR_NULL(vport->ingress.allow_rule)) {
1367+ if (IS_ERR(vport->ingress.allow_rule)) {
13671368 err = PTR_ERR(vport->ingress.allow_rule);
13681369 pr_warn("vport[%d] configure ingress allow rule, err(%d)\n",
13691370 vport->vport, err);
@@ -1380,7 +1381,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw, · 10 unmodified lines
13801381 match_v,
13811382 MLX5_FLOW_CONTEXT_ACTION_DROP,
13821383 0, NULL);
1383− if (IS_ERR_OR_NULL(vport->ingress.drop_rule)) {
1384+ if (IS_ERR(vport->ingress.drop_rule)) {
13841385 err = PTR_ERR(vport->ingress.drop_rule);
13851386 pr_warn("vport[%d] configure ingress drop rule, err(%d)\n",
13861387 vport->vport, err);
@@ -1439,7 +1440,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw, · 52 unmodified lines
14391440 match_v,
14401441 MLX5_FLOW_CONTEXT_ACTION_ALLOW,
14411442 0, NULL);
1442− if (IS_ERR_OR_NULL(vport->egress.allowed_vlan)) {
1443+ if (IS_ERR(vport->egress.allowed_vlan)) {
14431444 err = PTR_ERR(vport->egress.allowed_vlan);
14441445 pr_warn("vport[%d] configure egress allowed vlan rule failed, err(%d)\n",
14451446 vport->vport, err);
@@ -1457,7 +1458,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw, · 11 unmodified lines
14571458 match_v,
14581459 MLX5_FLOW_CONTEXT_ACTION_DROP,
14591460 0, NULL);
1460− if (IS_ERR_OR_NULL(vport->egress.drop_rule)) {
1461+ if (IS_ERR(vport->egress.drop_rule)) {
14611462 err = PTR_ERR(vport->egress.drop_rule);
14621463 pr_warn("vport[%d] configure egress drop rule failed, err(%d)\n",
14631464 vport->vport, err);
@@ -1491,14 +1492,11 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num, · 27 unmodified lines
14911492
14921493 /* Sync with current vport context */
14931494 vport->enabled_events = enable_events;
1494− esw_vport_change_handle_locked(vport);
1495−
14961495 vport->enabled = true;
14971496
14981497 /* only PF is trusted by default */
14991498 vport->trusted = (vport_num) ? false : true;
1500−
1501− arm_vport_context_events_cmd(esw->dev, vport_num, enable_events);
1499+ esw_vport_change_handle_locked(vport);
15021500
15031501 esw->enabled_vports++;
15041502 esw_debug(esw->dev, "Enabled VPORT(%d)\n", vport_num);
@@ -1728,11 +1726,24 @@ void mlx5_eswitch_vport_event(struct mlx5_eswitch *esw, struct mlx5_eqe *eqe) · 223 unmodified lines
17281726 (esw && MLX5_CAP_GEN(esw->dev, vport_group_manager) && mlx5_core_is_pf(esw->dev))
17291727 #define LEGAL_VPORT(esw, vport) (vport >= 0 && vport < esw->total_vports)
17301728
1729+static void node_guid_gen_from_mac(u64 *node_guid, u8 mac[ETH_ALEN])
1730+{
1731+ ((u8 *)node_guid)[7] = mac[0];
1732+ ((u8 *)node_guid)[6] = mac[1];
1733+ ((u8 *)node_guid)[5] = mac[2];
1734+ ((u8 *)node_guid)[4] = 0xff;
1735+ ((u8 *)node_guid)[3] = 0xfe;
1736+ ((u8 *)node_guid)[2] = mac[3];
1737+ ((u8 *)node_guid)[1] = mac[4];
1738+ ((u8 *)node_guid)[0] = mac[5];
1739+}
1740+
17311741 int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
17321742 int vport, u8 mac[ETH_ALEN])
17331743 {
1734− int err = 0;
17351744 struct mlx5_vport *evport;
1745+ u64 node_guid;
1746+ int err = 0;
17361747
17371748 if (!ESW_ALLOWED(esw))
17381749 return -EPERM;
@@ -1756,11 +1767,17 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, · 17 unmodified lines
17561767 return err;
17571768 }
17581769
1770+ node_guid_gen_from_mac(&node_guid, mac);
1771+ err = mlx5_modify_nic_vport_node_guid(esw->dev, vport, node_guid);
1772+ if (err)
1773+ mlx5_core_warn(esw->dev,
1774+ "Failed to set vport %d node guid, err = %d. RDMA_CM will not function properly for this VF.\n",
1775+ vport, err);
1776+
17591777 mutex_lock(&esw->state_lock);
17601778 if (evport->enabled)
17611779 err = esw_vport_ingress_config(esw, evport);
17621780 mutex_unlock(&esw->state_lock);
1763−
17641781 return err;
17651782 }
17661783
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+25−15
@@ -1292,8 +1292,8 @@ static int update_root_ft_destroy(struct mlx5_flow_table *ft) · 1291 unmodified lines
12921292 ft->id);
12931293 return err;
12941294 }
1295− root->root_ft = new_root_ft;
12961295 }
1296+ root->root_ft = new_root_ft;
12971297 return 0;
12981298 }
12991299
@@ -1767,6 +1767,9 @@ static void cleanup_root_ns(struct mlx5_core_dev *dev) · 467 unmodified lines
17671767
17681768 void mlx5_cleanup_fs(struct mlx5_core_dev *dev)
17691769 {
1770+ if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
1771+ return;
1772+
17701773 cleanup_root_ns(dev);
17711774 cleanup_single_prio_root_ns(dev, dev->priv.fdb_root_ns);
17721775 cleanup_single_prio_root_ns(dev, dev->priv.esw_egress_root_ns);
@@ -1828,29 +1831,36 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) · 55 unmodified lines
18281831 {
18291832 int err = 0;
18301833
1834+ if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
1835+ return 0;
1836+
18311837 err = mlx5_init_fc_stats(dev);
18321838 if (err)
18331839 return err;
18341840
1835− if (MLX5_CAP_GEN(dev, nic_flow_table)) {
1841+ if (MLX5_CAP_GEN(dev, nic_flow_table) &&
1842+ MLX5_CAP_FLOWTABLE_NIC_RX(dev, ft_support)) {
18361843 err = init_root_ns(dev);
18371844 if (err)
18381845 goto err;
18391846 }
1847+
18401848 if (MLX5_CAP_GEN(dev, eswitch_flow_table)) {
1841− err = init_fdb_root_ns(dev);
1842− if (err)
1843− goto err;
1844− }
1845− if (MLX5_CAP_ESW_EGRESS_ACL(dev, ft_support)) {
1846− err = init_egress_acl_root_ns(dev);
1847− if (err)
1848− goto err;
1849− }
1850− if (MLX5_CAP_ESW_INGRESS_ACL(dev, ft_support)) {
1851− err = init_ingress_acl_root_ns(dev);
1852− if (err)
1853− goto err;
1849+ if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) {
1850+ err = init_fdb_root_ns(dev);
1851+ if (err)
1852+ goto err;
1853+ }
1854+ if (MLX5_CAP_ESW_EGRESS_ACL(dev, ft_support)) {
1855+ err = init_egress_acl_root_ns(dev);
1856+ if (err)
1857+ goto err;
1858+ }
1859+ if (MLX5_CAP_ESW_INGRESS_ACL(dev, ft_support)) {
1860+ err = init_ingress_acl_root_ns(dev);
1861+ if (err)
1862+ goto err;
1863+ }
18541864 }
18551865
18561866 return 0;
drivers/net/ethernet/mellanox/mlx5/core/qp.c+1−1
@@ -418,7 +418,7 @@ int mlx5_core_xrcd_alloc(struct mlx5_core_dev *dev, u32 *xrcdn) · 417 unmodified lines
418418 if (out.hdr.status)
419419 err = mlx5_cmd_status_to_err(&out.hdr);
420420 else
421− *xrcdn = be32_to_cpu(out.xrcdn);
421+ *xrcdn = be32_to_cpu(out.xrcdn) & 0xffffff;
422422
423423 return err;
424424 }
drivers/net/ethernet/mellanox/mlx5/core/vport.c+38−0
@@ -508,6 +508,44 @@ int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid) · 507 unmodified lines
508508 }
509509 EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_node_guid);
510510
511+int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
512+ u32 vport, u64 node_guid)
513+{
514+ int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in);
515+ void *nic_vport_context;
516+ u8 *guid;
517+ void *in;
518+ int err;
519+
520+ if (!vport)
521+ return -EINVAL;
522+ if (!MLX5_CAP_GEN(mdev, vport_group_manager))
523+ return -EACCES;
524+ if (!MLX5_CAP_ESW(mdev, nic_vport_node_guid_modify))
525+ return -ENOTSUPP;
526+
527+ in = mlx5_vzalloc(inlen);
528+ if (!in)
529+ return -ENOMEM;
530+
531+ MLX5_SET(modify_nic_vport_context_in, in,
532+ field_select.node_guid, 1);
533+ MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport);
534+ MLX5_SET(modify_nic_vport_context_in, in, other_vport, !!vport);
535+
536+ nic_vport_context = MLX5_ADDR_OF(modify_nic_vport_context_in,
537+ in, nic_vport_context);
538+ guid = MLX5_ADDR_OF(nic_vport_context, nic_vport_context,
539+ node_guid);
540+ MLX5_SET64(nic_vport_context, nic_vport_context, node_guid, node_guid);
541+
542+ err = mlx5_modify_nic_vport_context(mdev, in, inlen);
543+
544+ kvfree(in);
545+
546+ return err;
547+}
548+
511549 int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
512550 u16 *qkey_viol_cntr)
513551 {
drivers/net/ethernet/mellanox/mlxsw/spectrum.c+112−91
@@ -247,15 +247,23 @@ static int mlxsw_sp_port_mtu_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 mtu) · 246 unmodified lines
247247 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pmtu), pmtu_pl);
248248 }
249249
250−static int mlxsw_sp_port_swid_set(struct mlxsw_sp_port *mlxsw_sp_port, u8 swid)
250+static int __mlxsw_sp_port_swid_set(struct mlxsw_sp *mlxsw_sp, u8 local_port,
251+ u8 swid)
251252 {
252− struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
253253 char pspa_pl[MLXSW_REG_PSPA_LEN];
254254
255− mlxsw_reg_pspa_pack(pspa_pl, swid, mlxsw_sp_port->local_port);
255+ mlxsw_reg_pspa_pack(pspa_pl, swid, local_port);
256256 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pspa), pspa_pl);
257257 }
258258
259+static int mlxsw_sp_port_swid_set(struct mlxsw_sp_port *mlxsw_sp_port, u8 swid)
260+{
261+ struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
262+
263+ return __mlxsw_sp_port_swid_set(mlxsw_sp, mlxsw_sp_port->local_port,
264+ swid);
265+}
266+
259267 static int mlxsw_sp_port_vp_mode_set(struct mlxsw_sp_port *mlxsw_sp_port,
260268 bool enable)
261269 {
@@ -305,9 +313,9 @@ mlxsw_sp_port_system_port_mapping_set(struct mlxsw_sp_port *mlxsw_sp_port) · 43 unmodified lines
305313 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sspr), sspr_pl);
306314 }
307315
308−static int __mlxsw_sp_port_module_info_get(struct mlxsw_sp *mlxsw_sp,
309− u8 local_port, u8 *p_module,
310− u8 *p_width, u8 *p_lane)
316+static int mlxsw_sp_port_module_info_get(struct mlxsw_sp *mlxsw_sp,
317+ u8 local_port, u8 *p_module,
318+ u8 *p_width, u8 *p_lane)
311319 {
312320 char pmlp_pl[MLXSW_REG_PMLP_LEN];
313321 int err;
@@ -322,16 +330,6 @@ static int __mlxsw_sp_port_module_info_get(struct mlxsw_sp *mlxsw_sp, · 8 unmodified lines
322330 return 0;
323331 }
324332
325−static int mlxsw_sp_port_module_info_get(struct mlxsw_sp *mlxsw_sp,
326− u8 local_port, u8 *p_module,
327− u8 *p_width)
328−{
329− u8 lane;
330−
331− return __mlxsw_sp_port_module_info_get(mlxsw_sp, local_port, p_module,
332− p_width, &lane);
333−}
334−
335333 static int mlxsw_sp_port_module_map(struct mlxsw_sp *mlxsw_sp, u8 local_port,
336334 u8 module, u8 width, u8 lane)
337335 {
@@ -949,17 +947,11 @@ static int mlxsw_sp_port_get_phys_port_name(struct net_device *dev, char *name, · 611 unmodified lines
949947 size_t len)
950948 {
951949 struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
952− u8 module, width, lane;
950+ u8 module = mlxsw_sp_port->mapping.module;
951+ u8 width = mlxsw_sp_port->mapping.width;
952+ u8 lane = mlxsw_sp_port->mapping.lane;
953953 int err;
954954
955− err = __mlxsw_sp_port_module_info_get(mlxsw_sp_port->mlxsw_sp,
956− mlxsw_sp_port->local_port,
957− &module, &width, &lane);
958− if (err) {
959− netdev_err(dev, "Failed to retrieve module information\n");
960− return err;
961− }
962−
963955 if (!mlxsw_sp_port->split)
964956 err = snprintf(name, len, "p%d", module + 1);
965957 else
@@ -1681,8 +1673,8 @@ static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port) · 715 unmodified lines
16811673 return 0;
16821674 }
16831675
1684−static int __mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
1685− bool split, u8 module, u8 width)
1676+static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
1677+ bool split, u8 module, u8 width, u8 lane)
16861678 {
16871679 struct mlxsw_sp_port *mlxsw_sp_port;
16881680 struct net_device *dev;
@@ -1697,6 +1689,9 @@ static int __mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port, · 8 unmodified lines
16971689 mlxsw_sp_port->mlxsw_sp = mlxsw_sp;
16981690 mlxsw_sp_port->local_port = local_port;
16991691 mlxsw_sp_port->split = split;
1692+ mlxsw_sp_port->mapping.module = module;
1693+ mlxsw_sp_port->mapping.width = width;
1694+ mlxsw_sp_port->mapping.lane = lane;
17001695 bytes = DIV_ROUND_UP(VLAN_N_VID, BITS_PER_BYTE);
17011696 mlxsw_sp_port->active_vlans = kzalloc(bytes, GFP_KERNEL);
17021697 if (!mlxsw_sp_port->active_vlans) {
@@ -1839,28 +1834,6 @@ err_port_active_vlans_alloc: · 136 unmodified lines
18391834 return err;
18401835 }
18411836
1842−static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
1843− bool split, u8 module, u8 width, u8 lane)
1844−{
1845− int err;
1846−
1847− err = mlxsw_sp_port_module_map(mlxsw_sp, local_port, module, width,
1848− lane);
1849− if (err)
1850− return err;
1851−
1852− err = __mlxsw_sp_port_create(mlxsw_sp, local_port, split, module,
1853− width);
1854− if (err)
1855− goto err_port_create;
1856−
1857− return 0;
1858−
1859−err_port_create:
1860− mlxsw_sp_port_module_unmap(mlxsw_sp, local_port);
1861− return err;
1862−}
1863−
18641837 static void mlxsw_sp_port_vports_fini(struct mlxsw_sp_port *mlxsw_sp_port)
18651838 {
18661839 struct net_device *dev = mlxsw_sp_port->dev;
@@ -1909,8 +1882,8 @@ static void mlxsw_sp_ports_remove(struct mlxsw_sp *mlxsw_sp) · 42 unmodified lines
19091882
19101883 static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp)
19111884 {
1885+ u8 module, width, lane;
19121886 size_t alloc_size;
1913− u8 module, width;
19141887 int i;
19151888 int err;
19161889
@@ -1921,13 +1894,14 @@ static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp) · 4 unmodified lines
19211894
19221895 for (i = 1; i < MLXSW_PORT_MAX_PORTS; i++) {
19231896 err = mlxsw_sp_port_module_info_get(mlxsw_sp, i, &module,
1924− &width);
1897+ &width, &lane);
19251898 if (err)
19261899 goto err_port_module_info_get;
19271900 if (!width)
19281901 continue;
19291902 mlxsw_sp->port_to_module[i] = module;
1930− err = __mlxsw_sp_port_create(mlxsw_sp, i, false, module, width);
1903+ err = mlxsw_sp_port_create(mlxsw_sp, i, false, module, width,
1904+ lane);
19311905 if (err)
19321906 goto err_port_create;
19331907 }
@@ -1948,12 +1922,85 @@ static u8 mlxsw_sp_cluster_base_port_get(u8 local_port) · 14 unmodified lines
19481922 return local_port - offset;
19491923 }
19501924
1925+static int mlxsw_sp_port_split_create(struct mlxsw_sp *mlxsw_sp, u8 base_port,
1926+ u8 module, unsigned int count)
1927+{
1928+ u8 width = MLXSW_PORT_MODULE_MAX_WIDTH / count;
1929+ int err, i;
1930+
1931+ for (i = 0; i < count; i++) {
1932+ err = mlxsw_sp_port_module_map(mlxsw_sp, base_port + i, module,
1933+ width, i * width);
1934+ if (err)
1935+ goto err_port_module_map;
1936+ }
1937+
1938+ for (i = 0; i < count; i++) {
1939+ err = __mlxsw_sp_port_swid_set(mlxsw_sp, base_port + i, 0);
1940+ if (err)
1941+ goto err_port_swid_set;
1942+ }
1943+
1944+ for (i = 0; i < count; i++) {
1945+ err = mlxsw_sp_port_create(mlxsw_sp, base_port + i, true,
1946+ module, width, i * width);
1947+ if (err)
1948+ goto err_port_create;
1949+ }
1950+
1951+ return 0;
1952+
1953+err_port_create:
1954+ for (i--; i >= 0; i--)
1955+ mlxsw_sp_port_remove(mlxsw_sp, base_port + i);
1956+ i = count;
1957+err_port_swid_set:
1958+ for (i--; i >= 0; i--)
1959+ __mlxsw_sp_port_swid_set(mlxsw_sp, base_port + i,
1960+ MLXSW_PORT_SWID_DISABLED_PORT);
1961+ i = count;
1962+err_port_module_map:
1963+ for (i--; i >= 0; i--)
1964+ mlxsw_sp_port_module_unmap(mlxsw_sp, base_port + i);
1965+ return err;
1966+}
1967+
1968+static void mlxsw_sp_port_unsplit_create(struct mlxsw_sp *mlxsw_sp,
1969+ u8 base_port, unsigned int count)
1970+{
1971+ u8 local_port, module, width = MLXSW_PORT_MODULE_MAX_WIDTH;
1972+ int i;
1973+
1974+ /* Split by four means we need to re-create two ports, otherwise
1975+ * only one.
1976+ */
1977+ count = count / 2;
1978+
1979+ for (i = 0; i < count; i++) {
1980+ local_port = base_port + i * 2;
1981+ module = mlxsw_sp->port_to_module[local_port];
1982+
1983+ mlxsw_sp_port_module_map(mlxsw_sp, local_port, module, width,
1984+ 0);
1985+ }
1986+
1987+ for (i = 0; i < count; i++)
1988+ __mlxsw_sp_port_swid_set(mlxsw_sp, base_port + i * 2, 0);
1989+
1990+ for (i = 0; i < count; i++) {
1991+ local_port = base_port + i * 2;
1992+ module = mlxsw_sp->port_to_module[local_port];
1993+
1994+ mlxsw_sp_port_create(mlxsw_sp, local_port, false, module,
1995+ width, 0);
1996+ }
1997+}
1998+
19511999 static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
19522000 unsigned int count)
19532001 {
19542002 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
19552003 struct mlxsw_sp_port *mlxsw_sp_port;
1956− u8 width = MLXSW_PORT_MODULE_MAX_WIDTH / count;
19572004 u8 module, cur_width, base_port;
19582005 int i;
19592006 int err;
@@ -1965,18 +2012,14 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port, · 5 unmodified lines
19652012 return -EINVAL;
19662013 }
19672014
2015+ module = mlxsw_sp_port->mapping.module;
2016+ cur_width = mlxsw_sp_port->mapping.width;
2017+
19682018 if (count != 2 && count != 4) {
19692019 netdev_err(mlxsw_sp_port->dev, "Port can only be split into 2 or 4 ports\n");
19702020 return -EINVAL;
19712021 }
19722022
1973− err = mlxsw_sp_port_module_info_get(mlxsw_sp, local_port, &module,
1974− &cur_width);
1975− if (err) {
1976− netdev_err(mlxsw_sp_port->dev, "Failed to get port's width\n");
1977− return err;
1978− }
1979−
19802023 if (cur_width != MLXSW_PORT_MODULE_MAX_WIDTH) {
19812024 netdev_err(mlxsw_sp_port->dev, "Port cannot be split further\n");
19822025 return -EINVAL;
@@ -2001,25 +2044,16 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port, · 18 unmodified lines
20012044 for (i = 0; i < count; i++)
20022045 mlxsw_sp_port_remove(mlxsw_sp, base_port + i);
20032046
2004− for (i = 0; i < count; i++) {
2005− err = mlxsw_sp_port_create(mlxsw_sp, base_port + i, true,
2006− module, width, i * width);
2007− if (err) {
2008− dev_err(mlxsw_sp->bus_info->dev, "Failed to create split port\n");
2009− goto err_port_create;
2010− }
2047+ err = mlxsw_sp_port_split_create(mlxsw_sp, base_port, module, count);
2048+ if (err) {
2049+ dev_err(mlxsw_sp->bus_info->dev, "Failed to create split ports\n");
2050+ goto err_port_split_create;
20112051 }
20122052
20132053 return 0;
20142054
2015−err_port_create:
2016− for (i--; i >= 0; i--)
2017− mlxsw_sp_port_remove(mlxsw_sp, base_port + i);
2018− for (i = 0; i < count / 2; i++) {
2019− module = mlxsw_sp->port_to_module[base_port + i * 2];
2020− mlxsw_sp_port_create(mlxsw_sp, base_port + i * 2, false,
2021− module, MLXSW_PORT_MODULE_MAX_WIDTH, 0);
2022− }
2055+err_port_split_create:
2056+ mlxsw_sp_port_unsplit_create(mlxsw_sp, base_port, count);
20232057 return err;
20242058 }
20252059
@@ -2027,10 +2061,9 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port) · 1 unmodified line
20272061 {
20282062 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
20292063 struct mlxsw_sp_port *mlxsw_sp_port;
2030− u8 module, cur_width, base_port;
2064+ u8 cur_width, base_port;
20312065 unsigned int count;
20322066 int i;
2033− int err;
20342067
20352068 mlxsw_sp_port = mlxsw_sp->ports[local_port];
20362069 if (!mlxsw_sp_port) {
@@ -2044,12 +2077,7 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port) · 7 unmodified lines
20442077 return -EINVAL;
20452078 }
20462079
2047− err = mlxsw_sp_port_module_info_get(mlxsw_sp, local_port, &module,
2048− &cur_width);
2049− if (err) {
2050− netdev_err(mlxsw_sp_port->dev, "Failed to get port's width\n");
2051− return err;
2052− }
2080+ cur_width = mlxsw_sp_port->mapping.width;
20532081 count = cur_width == 1 ? 4 : 2;
20542082
20552083 base_port = mlxsw_sp_cluster_base_port_get(local_port);
@@ -2061,14 +2089,7 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port) · 5 unmodified lines
20612089 for (i = 0; i < count; i++)
20622090 mlxsw_sp_port_remove(mlxsw_sp, base_port + i);
20632091
2064− for (i = 0; i < count / 2; i++) {
2065− module = mlxsw_sp->port_to_module[base_port + i * 2];
2066− err = mlxsw_sp_port_create(mlxsw_sp, base_port + i * 2, false,
2067− module, MLXSW_PORT_MODULE_MAX_WIDTH,
2068− 0);
2069− if (err)
2070− dev_err(mlxsw_sp->bus_info->dev, "Failed to reinstantiate port\n");
2071− }
2092+ mlxsw_sp_port_unsplit_create(mlxsw_sp, base_port, count);
20722093
20732094 return 0;
20742095 }
drivers/net/ethernet/mellanox/mlxsw/spectrum.h+5−0
@@ -229,6 +229,11 @@ struct mlxsw_sp_port { · 228 unmodified lines
229229 struct ieee_maxrate *maxrate;
230230 struct ieee_pfc *pfc;
231231 } dcb;
232+ struct {
233+ u8 module;
234+ u8 width;
235+ u8 lane;
236+ } mapping;
232237 /* 802.1Q bridge VLANs */
233238 unsigned long *active_vlans;
234239 unsigned long *untagged_vlans;
drivers/net/ethernet/qlogic/qed/qed_main.c+36−9
@@ -1105,6 +1105,39 @@ static int qed_get_port_type(u32 media_type) · 1104 unmodified lines
11051105 return port_type;
11061106 }
11071107
1108+static int qed_get_link_data(struct qed_hwfn *hwfn,
1109+ struct qed_mcp_link_params *params,
1110+ struct qed_mcp_link_state *link,
1111+ struct qed_mcp_link_capabilities *link_caps)
1112+{
1113+ void *p;
1114+
1115+ if (!IS_PF(hwfn->cdev)) {
1116+ qed_vf_get_link_params(hwfn, params);
1117+ qed_vf_get_link_state(hwfn, link);
1118+ qed_vf_get_link_caps(hwfn, link_caps);
1119+
1120+ return 0;
1121+ }
1122+
1123+ p = qed_mcp_get_link_params(hwfn);
1124+ if (!p)
1125+ return -ENXIO;
1126+ memcpy(params, p, sizeof(*params));
1127+
1128+ p = qed_mcp_get_link_state(hwfn);
1129+ if (!p)
1130+ return -ENXIO;
1131+ memcpy(link, p, sizeof(*link));
1132+
1133+ p = qed_mcp_get_link_capabilities(hwfn);
1134+ if (!p)
1135+ return -ENXIO;
1136+ memcpy(link_caps, p, sizeof(*link_caps));
1137+
1138+ return 0;
1139+}
1140+
11081141 static void qed_fill_link(struct qed_hwfn *hwfn,
11091142 struct qed_link_output *if_link)
11101143 {
@@ -1116,15 +1149,9 @@ static void qed_fill_link(struct qed_hwfn *hwfn, · 5 unmodified lines
11161149 memset(if_link, 0, sizeof(*if_link));
11171150
11181151 /* Prepare source inputs */
1119− if (IS_PF(hwfn->cdev)) {
1120− memcpy(&params, qed_mcp_get_link_params(hwfn), sizeof(params));
1121− memcpy(&link, qed_mcp_get_link_state(hwfn), sizeof(link));
1122− memcpy(&link_caps, qed_mcp_get_link_capabilities(hwfn),
1123− sizeof(link_caps));
1124− } else {
1125− qed_vf_get_link_params(hwfn, &params);
1126− qed_vf_get_link_state(hwfn, &link);
1127− qed_vf_get_link_caps(hwfn, &link_caps);
1152+ if (qed_get_link_data(hwfn, &params, &link, &link_caps)) {
1153+ dev_warn(&hwfn->cdev->pdev->dev, "no link data available\n");
1154+ return;
11281155 }
11291156
11301157 /* Set the link parameters to pass to protocol driver */
drivers/net/ethernet/qlogic/qed/qed_sriov.h+3−1
@@ -12,11 +12,13 @@ · 11 unmodified lines
1212 #include "qed_vf.h"
1313 #define QED_VF_ARRAY_LENGTH (3)
1414
15+#ifdef CONFIG_QED_SRIOV
1516 #define IS_VF(cdev) ((cdev)->b_is_vf)
1617 #define IS_PF(cdev) (!((cdev)->b_is_vf))
17−#ifdef CONFIG_QED_SRIOV
1818 #define IS_PF_SRIOV(p_hwfn) (!!((p_hwfn)->cdev->p_iov_info))
1919 #else
20+#define IS_VF(cdev) (0)
21+#define IS_PF(cdev) (1)
2022 #define IS_PF_SRIOV(p_hwfn) (0)
2123 #endif
2224 #define IS_PF_SRIOV_ALLOC(p_hwfn) (!!((p_hwfn)->pf_iov_info))
drivers/net/ethernet/qlogic/qede/qede_main.c+2−0
@@ -87,7 +87,9 @@ static const struct pci_device_id qede_pci_tbl[] = { · 86 unmodified lines
8787 {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_100), QEDE_PRIVATE_PF},
8888 {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_50), QEDE_PRIVATE_PF},
8989 {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_25), QEDE_PRIVATE_PF},
90+#ifdef CONFIG_QED_SRIOV
9091 {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_IOV), QEDE_PRIVATE_VF},
92+#endif
9193 { 0 }
9294 };
9395
drivers/net/ethernet/sfc/mcdi_port.c+4−3
@@ -189,11 +189,12 @@ static u32 mcdi_to_ethtool_cap(u32 media, u32 cap) · 188 unmodified lines
189189
190190 case MC_CMD_MEDIA_XFP:
191191 case MC_CMD_MEDIA_SFP_PLUS:
192− result |= SUPPORTED_FIBRE;
193− break;
194−
195192 case MC_CMD_MEDIA_QSFP_PLUS:
196193 result |= SUPPORTED_FIBRE;
194+ if (cap & (1 << MC_CMD_PHY_CAP_1000FDX_LBN))
195+ result |= SUPPORTED_1000baseT_Full;
196+ if (cap & (1 << MC_CMD_PHY_CAP_10000FDX_LBN))
197+ result |= SUPPORTED_10000baseT_Full;
197198 if (cap & (1 << MC_CMD_PHY_CAP_40000FDX_LBN))
198199 result |= SUPPORTED_40000baseCR4_Full;
199200 break;
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c+1−1
@@ -156,7 +156,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw, · 155 unmodified lines
156156 struct netdev_hw_addr *ha;
157157
158158 netdev_for_each_uc_addr(ha, dev) {
159− dwmac4_set_umac_addr(ioaddr, ha->addr, reg);
159+ dwmac4_set_umac_addr(hw, ha->addr, reg);
160160 reg++;
161161 }
162162 }
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+4−2
@@ -3450,8 +3450,6 @@ int stmmac_resume(struct device *dev) · 3449 unmodified lines
34503450 if (!netif_running(ndev))
34513451 return 0;
34523452
3453− spin_lock_irqsave(&priv->lock, flags);
3454−
34553453 /* Power Down bit, into the PM register, is cleared
34563454 * automatically as soon as a magic packet or a Wake-up frame
34573455 * is received. Anyway, it's better to manually clear
@@ -3459,7 +3457,9 @@ int stmmac_resume(struct device *dev) · 1 unmodified line
34593457 * from another devices (e.g. serial console).
34603458 */
34613459 if (device_may_wakeup(priv->device)) {
3460+ spin_lock_irqsave(&priv->lock, flags);
34623461 priv->hw->mac->pmt(priv->hw, 0);
3462+ spin_unlock_irqrestore(&priv->lock, flags);
34633463 priv->irq_wake = 0;
34643464 } else {
34653465 pinctrl_pm_select_default_state(priv->device);
@@ -3473,6 +3473,8 @@ int stmmac_resume(struct device *dev) · 7 unmodified lines
34733473
34743474 netif_device_attach(ndev);
34753475
3476+ spin_lock_irqsave(&priv->lock, flags);
3477+
34763478 priv->cur_rx = 0;
34773479 priv->dirty_rx = 0;
34783480 priv->dirty_tx = 0;
drivers/net/ethernet/ti/cpsw.c+1−1
@@ -1339,7 +1339,7 @@ static int cpsw_ndo_open(struct net_device *ndev) · 1338 unmodified lines
13391339 if (priv->coal_intvl != 0) {
13401340 struct ethtool_coalesce coal;
13411341
1342− coal.rx_coalesce_usecs = (priv->coal_intvl << 4);
1342+ coal.rx_coalesce_usecs = priv->coal_intvl;
13431343 cpsw_set_coalesce(ndev, &coal);
13441344 }
13451345
drivers/net/vmxnet3/vmxnet3_drv.c+1−1
@@ -1369,7 +1369,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, · 1368 unmodified lines
13691369 rcdlro = (struct Vmxnet3_RxCompDescExt *)rcd;
13701370
13711371 segCnt = rcdlro->segCnt;
1372− BUG_ON(segCnt <= 1);
1372+ WARN_ON_ONCE(segCnt == 0);
13731373 mss = rcdlro->mss;
13741374 if (unlikely(segCnt <= 1))
13751375 segCnt = 0;
drivers/net/vmxnet3/vmxnet3_int.h+2−2
@@ -69,10 +69,10 @@ · 68 unmodified lines
6969 /*
7070 * Version numbers
7171 */
72−#define VMXNET3_DRIVER_VERSION_STRING "1.4.7.0-k"
72+#define VMXNET3_DRIVER_VERSION_STRING "1.4.8.0-k"
7373
7474 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
75−#define VMXNET3_DRIVER_VERSION_NUM 0x01040700
75+#define VMXNET3_DRIVER_VERSION_NUM 0x01040800
7676
7777 #if defined(CONFIG_PCI_MSI)
7878 /* RSS only makes sense if MSI-X is supported. */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c+16−0
@@ -2540,12 +2540,14 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, · 2539 unmodified lines
25402540 const u8 *mac, struct station_info *sinfo)
25412541 {
25422542 struct brcmf_if *ifp = netdev_priv(ndev);
2543+ struct brcmf_scb_val_le scb_val;
25432544 s32 err = 0;
25442545 struct brcmf_sta_info_le sta_info_le;
25452546 u32 sta_flags;
25462547 u32 is_tdls_peer;
25472548 s32 total_rssi;
25482549 s32 count_rssi;
2550+ int rssi;
25492551 u32 i;
25502552
25512553 brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac);
@@ -2629,6 +2631,20 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, · 77 unmodified lines
26292631 sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
26302632 total_rssi /= count_rssi;
26312633 sinfo->signal = total_rssi;
2634+ } else if (test_bit(BRCMF_VIF_STATUS_CONNECTED,
2635+ &ifp->vif->sme_state)) {
2636+ memset(&scb_val, 0, sizeof(scb_val));
2637+ err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
2638+ &scb_val, sizeof(scb_val));
2639+ if (err) {
2640+ brcmf_err("Could not get rssi (%d)\n", err);
2641+ goto done;
2642+ } else {
2643+ rssi = le32_to_cpu(scb_val.val);
2644+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
2645+ sinfo->signal = rssi;
2646+ brcmf_dbg(CONN, "RSSI %d dBm\n", rssi);
2647+ }
26322648 }
26332649 }
26342650 done:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c+2−0
@@ -1157,6 +1157,8 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf) · 1156 unmodified lines
11571157 brcmu_pkt_buf_free_skb(skb);
11581158 return;
11591159 }
1160+
1161+ skb->protocol = eth_type_trans(skb, ifp->ndev);
11601162 brcmf_netif_rx(ifp, skb);
11611163 }
11621164
drivers/net/wireless/mac80211_hwsim.c+1−0
@@ -2776,6 +2776,7 @@ static int hwsim_tx_info_frame_received_nl(struct sk_buff *skb_2, · 2775 unmodified lines
27762776 if (!info->attrs[HWSIM_ATTR_ADDR_TRANSMITTER] ||
27772777 !info->attrs[HWSIM_ATTR_FLAGS] ||
27782778 !info->attrs[HWSIM_ATTR_COOKIE] ||
2779+ !info->attrs[HWSIM_ATTR_SIGNAL] ||
27792780 !info->attrs[HWSIM_ATTR_TX_INFO])
27802781 goto out;
27812782
drivers/net/wireless/realtek/rtlwifi/core.c+3−3
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(channel5g_80m); · 53 unmodified lines
5454 void rtl_addr_delay(u32 addr)
5555 {
5656 if (addr == 0xfe)
57− msleep(50);
57+ mdelay(50);
5858 else if (addr == 0xfd)
5959 msleep(5);
6060 else if (addr == 0xfc)
@@ -75,7 +75,7 @@ void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr, · 14 unmodified lines
7575 rtl_addr_delay(addr);
7676 } else {
7777 rtl_set_rfreg(hw, rfpath, addr, mask, data);
78− usleep_range(1, 2);
78+ udelay(1);
7979 }
8080 }
8181 EXPORT_SYMBOL(rtl_rfreg_delay);
@@ -86,7 +86,7 @@ void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data) · 4 unmodified lines
8686 rtl_addr_delay(addr);
8787 } else {
8888 rtl_set_bbreg(hw, addr, MASKDWORD, data);
89− usleep_range(1, 2);
89+ udelay(1);
9090 }
9191 }
9292 EXPORT_SYMBOL(rtl_bb_delay);
include/linux/mlx5/device.h+6−2
@@ -1240,8 +1240,6 @@ struct mlx5_destroy_psv_out { · 1239 unmodified lines
12401240 u8 rsvd[8];
12411241 };
12421242
1243−#define MLX5_CMD_OP_MAX 0x920
1244−
12451243 enum {
12461244 VPORT_STATE_DOWN = 0x0,
12471245 VPORT_STATE_UP = 0x1,
@@ -1369,6 +1367,12 @@ enum mlx5_cap_type { · 121 unmodified lines
13691367 #define MLX5_CAP_FLOWTABLE_MAX(mdev, cap) \
13701368 MLX5_GET(flow_table_nic_cap, mdev->hca_caps_max[MLX5_CAP_FLOW_TABLE], cap)
13711369
1370+#define MLX5_CAP_FLOWTABLE_NIC_RX(mdev, cap) \
1371+ MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive.cap)
1372+
1373+#define MLX5_CAP_FLOWTABLE_NIC_RX_MAX(mdev, cap) \
1374+ MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_receive.cap)
1375+
13721376 #define MLX5_CAP_ESW_FLOWTABLE(mdev, cap) \
13731377 MLX5_GET(flow_table_eswitch_cap, \
13741378 mdev->hca_caps_cur[MLX5_CAP_ESWITCH_FLOW_TABLE], cap)
include/linux/mlx5/mlx5_ifc.h+9−3
@@ -205,7 +205,8 @@ enum { · 204 unmodified lines
205205 MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939,
206206 MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a,
207207 MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b,
208− MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c
208+ MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c,
209+ MLX5_CMD_OP_MAX
209210 };
210211
211212 struct mlx5_ifc_flow_table_fields_supported_bits {
@@ -500,7 +501,9 @@ struct mlx5_ifc_e_switch_cap_bits { · 288 unmodified lines
500501 u8 vport_svlan_insert[0x1];
501502 u8 vport_cvlan_insert_if_not_exist[0x1];
502503 u8 vport_cvlan_insert_overwrite[0x1];
503− u8 reserved_at_5[0x1b];
504+ u8 reserved_at_5[0x19];
505+ u8 nic_vport_node_guid_modify[0x1];
506+ u8 nic_vport_port_guid_modify[0x1];
504507
505508 u8 reserved_at_20[0x7e0];
506509 };
@@ -4583,7 +4586,10 @@ struct mlx5_ifc_modify_nic_vport_context_out_bits { · 4076 unmodified lines
45834586 };
45844587
45854588 struct mlx5_ifc_modify_nic_vport_field_select_bits {
4586− u8 reserved_at_0[0x19];
4589+ u8 reserved_at_0[0x16];
4590+ u8 node_guid[0x1];
4591+ u8 port_guid[0x1];
4592+ u8 reserved_at_18[0x1];
45874593 u8 mtu[0x1];
45884594 u8 change_event[0x1];
45894595 u8 promisc[0x1];
include/linux/mlx5/qp.h+1−0
@@ -559,6 +559,7 @@ struct mlx5_modify_qp_mbox_in { · 558 unmodified lines
559559 __be32 optparam;
560560 u8 rsvd0[4];
561561 struct mlx5_qp_context ctx;
562+ u8 rsvd2[16];
562563 };
563564
564565 struct mlx5_modify_qp_mbox_out {
include/linux/mlx5/vport.h+2−0
@@ -50,6 +50,8 @@ int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu); · 49 unmodified lines
5050 int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev,
5151 u64 *system_image_guid);
5252 int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid);
53+int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
54+ u32 vport, u64 node_guid);
5355 int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
5456 u16 *qkey_viol_cntr);
5557 int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport,
include/net/compat.h+1−0
@@ -42,6 +42,7 @@ int compat_sock_get_timestampns(struct sock *, struct timespec __user *); · 41 unmodified lines
4242
4343 int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *,
4444 struct sockaddr __user **, struct iovec **);
45+struct sock_fprog __user *get_compat_bpf_fprog(char __user *optval);
4546 asmlinkage long compat_sys_sendmsg(int, struct compat_msghdr __user *,
4647 unsigned int);
4748 asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *,
include/net/ip_vs.h+1−1
@@ -1232,7 +1232,7 @@ void ip_vs_conn_expire_now(struct ip_vs_conn *cp); · 1231 unmodified lines
12321232 const char *ip_vs_state_name(__u16 proto, int state);
12331233
12341234 void ip_vs_tcp_conn_listen(struct ip_vs_conn *cp);
1235−int ip_vs_check_template(struct ip_vs_conn *ct);
1235+int ip_vs_check_template(struct ip_vs_conn *ct, struct ip_vs_dest *cdest);
12361236 void ip_vs_random_dropentry(struct netns_ipvs *ipvs);
12371237 int ip_vs_conn_init(void);
12381238 void ip_vs_conn_cleanup(void);
include/net/netfilter/nf_queue.h+2−2
@@ -28,8 +28,8 @@ struct nf_queue_handler { · 27 unmodified lines
2828 struct nf_hook_ops *ops);
2929 };
3030
31−void nf_register_queue_handler(const struct nf_queue_handler *qh);
32−void nf_unregister_queue_handler(void);
31+void nf_register_queue_handler(struct net *net, const struct nf_queue_handler *qh);
32+void nf_unregister_queue_handler(struct net *net);
3333 void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
3434
3535 void nf_queue_entry_get_refs(struct nf_queue_entry *entry);
include/net/netns/netfilter.h+2−0
@@ -5,11 +5,13 @@ · 4 unmodified lines
55
66 struct proc_dir_entry;
77 struct nf_logger;
8+struct nf_queue_handler;
89
910 struct netns_nf {
1011 #if defined CONFIG_PROC_FS
1112 struct proc_dir_entry *proc_netfilter;
1213 #endif
14+ const struct nf_queue_handler __rcu *queue_handler;
1315 const struct nf_logger __rcu *nf_loggers[NFPROTO_NUMPROTO];
1416 #ifdef CONFIG_SYSCTL
1517 struct ctl_table_header *nf_log_dir_header;
include/net/pkt_cls.h+7−3
@@ -392,16 +392,20 @@ struct tc_cls_u32_offload { · 391 unmodified lines
392392 };
393393 };
394394
395−static inline bool tc_should_offload(struct net_device *dev, u32 flags)
395+static inline bool tc_should_offload(const struct net_device *dev,
396+ const struct tcf_proto *tp, u32 flags)
396397 {
398+ const struct Qdisc *sch = tp->q;
399+ const struct Qdisc_class_ops *cops = sch->ops->cl_ops;
400+
397401 if (!(dev->features & NETIF_F_HW_TC))
398402 return false;
399−
400403 if (flags & TCA_CLS_FLAGS_SKIP_HW)
401404 return false;
402−
403405 if (!dev->netdev_ops->ndo_setup_tc)
404406 return false;
407+ if (cops && cops->tcf_cl_offload)
408+ return cops->tcf_cl_offload(tp->classid);
405409
406410 return true;
407411 }
include/net/sch_generic.h+5−1
@@ -168,6 +168,7 @@ struct Qdisc_class_ops { · 167 unmodified lines
168168
169169 /* Filter manipulation */
170170 struct tcf_proto __rcu ** (*tcf_chain)(struct Qdisc *, unsigned long);
171+ bool (*tcf_cl_offload)(u32 classid);
171172 unsigned long (*bind_tcf)(struct Qdisc *, unsigned long,
172173 u32 classid);
173174 void (*unbind_tcf)(struct Qdisc *, unsigned long);
@@ -691,9 +692,11 @@ static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch) · 517 unmodified lines
691692 /* we can reuse ->gso_skb because peek isn't called for root qdiscs */
692693 if (!sch->gso_skb) {
693694 sch->gso_skb = sch->dequeue(sch);
694− if (sch->gso_skb)
695+ if (sch->gso_skb) {
695696 /* it's still part of the queue */
697+ qdisc_qstats_backlog_inc(sch, sch->gso_skb);
696698 sch->q.qlen++;
699+ }
697700 }
698701
699702 return sch->gso_skb;
@@ -706,6 +709,7 @@ static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch) · 6 unmodified lines
706709
707710 if (skb) {
708711 sch->gso_skb = NULL;
712+ qdisc_qstats_backlog_dec(sch, skb);
709713 sch->q.qlen--;
710714 } else {
711715 skb = sch->dequeue(sch);
include/uapi/linux/gtp.h+1−1
@@ -1,5 +1,5 @@
11 #ifndef _UAPI_LINUX_GTP_H_
2−#define _UAPI_LINUX_GTP_H__
2+#define _UAPI_LINUX_GTP_H_
33
44 enum gtp_genl_cmds {
55 GTP_CMD_NEWPDP,
kernel/trace/bpf_trace.c+2−2
@@ -198,7 +198,7 @@ static u64 bpf_perf_event_read(u64 r1, u64 index, u64 r3, u64 r4, u64 r5) · 197 unmodified lines
198198 if (unlikely(index >= array->map.max_entries))
199199 return -E2BIG;
200200
201− file = (struct file *)array->ptrs[index];
201+ file = READ_ONCE(array->ptrs[index]);
202202 if (unlikely(!file))
203203 return -ENOENT;
204204
@@ -247,7 +247,7 @@ static u64 bpf_perf_event_output(u64 r1, u64 r2, u64 flags, u64 r4, u64 size) · 42 unmodified lines
247247 if (unlikely(index >= array->map.max_entries))
248248 return -E2BIG;
249249
250− file = (struct file *)array->ptrs[index];
250+ file = READ_ONCE(array->ptrs[index]);
251251 if (unlikely(!file))
252252 return -ENOENT;
253253
net/bridge/br_fdb.c+2−0
@@ -279,6 +279,8 @@ void br_fdb_change_mac_address(struct net_bridge *br, const u8 *newaddr) · 278 unmodified lines
279279 * change from under us.
280280 */
281281 list_for_each_entry(v, &vg->vlan_list, vlist) {
282+ if (!br_vlan_should_use(v))
283+ continue;
282284 f = __br_fdb_get(br, br->dev->dev_addr, v->vid);
283285 if (f && f->is_local && !f->dst)
284286 fdb_delete_local(br, NULL, f);
net/compat.c+17−3
@@ -309,8 +309,8 @@ void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm) · 308 unmodified lines
309309 __scm_destroy(scm);
310310 }
311311
312−static int do_set_attach_filter(struct socket *sock, int level, int optname,
313− char __user *optval, unsigned int optlen)
312+/* allocate a 64-bit sock_fprog on the user stack for duration of syscall. */
313+struct sock_fprog __user *get_compat_bpf_fprog(char __user *optval)
314314 {
315315 struct compat_sock_fprog __user *fprog32 = (struct compat_sock_fprog __user *)optval;
316316 struct sock_fprog __user *kfprog = compat_alloc_user_space(sizeof(struct sock_fprog));
@@ -323,6 +323,19 @@ static int do_set_attach_filter(struct socket *sock, int level, int optname, · 6 unmodified lines
323323 __get_user(ptr, &fprog32->filter) ||
324324 __put_user(len, &kfprog->len) ||
325325 __put_user(compat_ptr(ptr), &kfprog->filter))
326+ return NULL;
327+
328+ return kfprog;
329+}
330+EXPORT_SYMBOL_GPL(get_compat_bpf_fprog);
331+
332+static int do_set_attach_filter(struct socket *sock, int level, int optname,
333+ char __user *optval, unsigned int optlen)
334+{
335+ struct sock_fprog __user *kfprog;
336+
337+ kfprog = get_compat_bpf_fprog(optval);
338+ if (!kfprog)
326339 return -EFAULT;
327340
328341 return sock_setsockopt(sock, level, optname, (char __user *)kfprog,
@@ -354,7 +367,8 @@ static int do_set_sock_timeout(struct socket *sock, int level, · 25 unmodified lines
354367 static int compat_sock_setsockopt(struct socket *sock, int level, int optname,
355368 char __user *optval, unsigned int optlen)
356369 {
357− if (optname == SO_ATTACH_FILTER)
370+ if (optname == SO_ATTACH_FILTER ||
371+ optname == SO_ATTACH_REUSEPORT_CBPF)
358372 return do_set_attach_filter(sock, level, optname,
359373 optval, optlen);
360374 if (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO)
net/core/gen_stats.c+2−0
@@ -47,6 +47,7 @@ nla_put_failure: · 46 unmodified lines
4747 * @xstats_type: TLV type for backward compatibility xstats TLV
4848 * @lock: statistics lock
4949 * @d: dumping handle
50+ * @padattr: padding attribute
5051 *
5152 * Initializes the dumping handle, grabs the statistic lock and appends
5253 * an empty TLV header to the socket buffer for use a container for all
@@ -87,6 +88,7 @@ EXPORT_SYMBOL(gnet_stats_start_copy_compat); · 34 unmodified lines
8788 * @type: TLV type for top level statistic TLV
8889 * @lock: statistics lock
8990 * @d: dumping handle
91+ * @padattr: padding attribute
9092 *
9193 * Initializes the dumping handle, grabs the statistic lock and appends
9294 * an empty TLV header to the socket buffer for use a container for all
net/core/net-sysfs.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/jiffies.h>
2525 #include <linux/pm_runtime.h>
2626 #include <linux/of.h>
27+#include <linux/of_net.h>
2728
2829 #include "net-sysfs.h"
2930
net/ipv4/udp.c+5−5
@@ -1618,12 +1618,12 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) · 1617 unmodified lines
16181618 }
16191619 }
16201620
1621− if (rcu_access_pointer(sk->sk_filter)) {
1622− if (udp_lib_checksum_complete(skb))
1621+ if (rcu_access_pointer(sk->sk_filter) &&
1622+ udp_lib_checksum_complete(skb))
16231623 goto csum_error;
1624− if (sk_filter(sk, skb))
1625− goto drop;
1626− }
1624+
1625+ if (sk_filter(sk, skb))
1626+ goto drop;
16271627
16281628 udp_csum_pull_header(skb);
16291629 if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) {
net/ipv6/ip6_gre.c+3−0
@@ -1256,6 +1256,8 @@ static int ip6gre_tap_init(struct net_device *dev) · 1255 unmodified lines
12561256 if (ret)
12571257 return ret;
12581258
1259+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
1260+
12591261 tunnel = netdev_priv(dev);
12601262
12611263 ip6gre_tnl_link_config(tunnel, 1);
@@ -1289,6 +1291,7 @@ static void ip6gre_tap_setup(struct net_device *dev) · 27 unmodified lines
12891291
12901292 dev->features |= NETIF_F_NETNS_LOCAL;
12911293 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
1294+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
12921295 }
12931296
12941297 static bool ip6gre_netlink_encap_parms(struct nlattr *data[],
net/ipv6/ip6_output.c+3−8
@@ -1071,17 +1071,12 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, · 1070 unmodified lines
10711071 const struct in6_addr *final_dst)
10721072 {
10731073 struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
1074− int err;
10751074
10761075 dst = ip6_sk_dst_check(sk, dst, fl6);
1076+ if (!dst)
1077+ dst = ip6_dst_lookup_flow(sk, fl6, final_dst);
10771078
1078− err = ip6_dst_lookup_tail(sock_net(sk), sk, &dst, fl6);
1079− if (err)
1080− return ERR_PTR(err);
1081− if (final_dst)
1082− fl6->daddr = *final_dst;
1083−
1084− return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0);
1079+ return dst;
10851080 }
10861081 EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup_flow);
10871082
net/ipv6/netfilter/nf_dup_ipv6.c+1−0
@@ -33,6 +33,7 @@ static bool nf_dup_ipv6_route(struct net *net, struct sk_buff *skb, · 32 unmodified lines
3333 fl6.daddr = *gw;
3434 fl6.flowlabel = (__force __be32)(((iph->flow_lbl[0] & 0xF) << 16) |
3535 (iph->flow_lbl[1] << 8) | iph->flow_lbl[2]);
36+ fl6.flowi6_flags = FLOWI_FLAG_KNOWN_NH;
3637 dst = ip6_route_output(net, NULL, &fl6);
3738 if (dst->error) {
3839 dst_release(dst);
net/ipv6/tcp_ipv6.c+3−1
@@ -1721,7 +1721,9 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) · 1720 unmodified lines
17211721 destp = ntohs(inet->inet_dport);
17221722 srcp = ntohs(inet->inet_sport);
17231723
1724− if (icsk->icsk_pending == ICSK_TIME_RETRANS) {
1724+ if (icsk->icsk_pending == ICSK_TIME_RETRANS ||
1725+ icsk->icsk_pending == ICSK_TIME_EARLY_RETRANS ||
1726+ icsk->icsk_pending == ICSK_TIME_LOSS_PROBE) {
17251727 timer_active = 1;
17261728 timer_expires = icsk->icsk_timeout;
17271729 } else if (icsk->icsk_pending == ICSK_TIME_PROBE0) {
net/ipv6/udp.c+6−6
@@ -653,12 +653,12 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) · 652 unmodified lines
653653 }
654654 }
655655
656− if (rcu_access_pointer(sk->sk_filter)) {
657− if (udp_lib_checksum_complete(skb))
658− goto csum_error;
659− if (sk_filter(sk, skb))
660− goto drop;
661− }
656+ if (rcu_access_pointer(sk->sk_filter) &&
657+ udp_lib_checksum_complete(skb))
658+ goto csum_error;
659+
660+ if (sk_filter(sk, skb))
661+ goto drop;
662662
663663 udp_csum_pull_header(skb);
664664 if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) {
net/l2tp/l2tp_core.c+1−1
@@ -1581,7 +1581,7 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 · 1580 unmodified lines
15811581 /* Mark socket as an encapsulation socket. See net/ipv4/udp.c */
15821582 tunnel->encap = encap;
15831583 if (encap == L2TP_ENCAPTYPE_UDP) {
1584− struct udp_tunnel_sock_cfg udp_cfg;
1584+ struct udp_tunnel_sock_cfg udp_cfg = { };
15851585
15861586 udp_cfg.sk_user_data = tunnel;
15871587 udp_cfg.encap_type = UDP_ENCAP_L2TPINUDP;
net/mac80211/mesh.c+4−0
@@ -161,6 +161,10 @@ void mesh_sta_cleanup(struct sta_info *sta) · 160 unmodified lines
161161 del_timer_sync(&sta->mesh->plink_timer);
162162 }
163163
164+ /* make sure no readers can access nexthop sta from here on */
165+ mesh_path_flush_by_nexthop(sta);
166+ synchronize_net();
167+
164168 if (changed)
165169 ieee80211_mbss_info_change_notify(sdata, changed);
166170 }
net/mac80211/sta_info.h+1−1
@@ -280,7 +280,7 @@ struct ieee80211_fast_tx { · 279 unmodified lines
280280 u8 sa_offs, da_offs, pn_offs;
281281 u8 band;
282282 u8 hdr[30 + 2 + IEEE80211_FAST_XMIT_MAX_IV +
283− sizeof(rfc1042_header)];
283+ sizeof(rfc1042_header)] __aligned(2);
284284
285285 struct rcu_head rcu_head;
286286 };
net/netfilter/ipvs/ip_vs_conn.c+3−2
@@ -762,7 +762,7 @@ static int expire_quiescent_template(struct netns_ipvs *ipvs, · 761 unmodified lines
762762 * If available, return 1, otherwise invalidate this connection
763763 * template and return 0.
764764 */
765−int ip_vs_check_template(struct ip_vs_conn *ct)
765+int ip_vs_check_template(struct ip_vs_conn *ct, struct ip_vs_dest *cdest)
766766 {
767767 struct ip_vs_dest *dest = ct->dest;
768768 struct netns_ipvs *ipvs = ct->ipvs;
@@ -772,7 +772,8 @@ int ip_vs_check_template(struct ip_vs_conn *ct) · 3 unmodified lines
772772 */
773773 if ((dest == NULL) ||
774774 !(dest->flags & IP_VS_DEST_F_AVAILABLE) ||
775− expire_quiescent_template(ipvs, dest)) {
775+ expire_quiescent_template(ipvs, dest) ||
776+ (cdest && (dest != cdest))) {
776777 IP_VS_DBG_BUF(9, "check_template: dest not available for "
777778 "protocol %s s:%s:%d v:%s:%d "
778779 "-> d:%s:%d\n",
net/netfilter/ipvs/ip_vs_core.c+3−2
@@ -321,7 +321,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc, · 320 unmodified lines
321321
322322 /* Check if a template already exists */
323323 ct = ip_vs_ct_in_get(&param);
324− if (!ct || !ip_vs_check_template(ct)) {
324+ if (!ct || !ip_vs_check_template(ct, NULL)) {
325325 struct ip_vs_scheduler *sched;
326326
327327 /*
@@ -1154,7 +1154,8 @@ struct ip_vs_conn *ip_vs_new_conn_out(struct ip_vs_service *svc, · 826 unmodified lines
11541154 vport, &param) < 0)
11551155 return NULL;
11561156 ct = ip_vs_ct_in_get(&param);
1157− if (!ct) {
1157+ /* check if template exists and points to the same dest */
1158+ if (!ct || !ip_vs_check_template(ct, dest)) {
11581159 ct = ip_vs_conn_new(&param, dest->af, daddr, dport,
11591160 IP_VS_CONN_F_TEMPLATE, dest, 0);
11601161 if (!ct) {
net/netfilter/nf_conntrack_ftp.c+1−0
@@ -632,6 +632,7 @@ static int __init nf_conntrack_ftp_init(void) · 631 unmodified lines
632632 if (ret) {
633633 pr_err("failed to register helper for pf: %d port: %d\n",
634634 ftp[i][j].tuple.src.l3num, ports[i]);
635+ ports_c = i;
635636 nf_conntrack_ftp_fini();
636637 return ret;
637638 }
net/netfilter/nf_conntrack_helper.c+4−5
@@ -361,9 +361,10 @@ EXPORT_SYMBOL_GPL(nf_ct_helper_log); · 360 unmodified lines
361361
362362 int nf_conntrack_helper_register(struct nf_conntrack_helper *me)
363363 {
364− int ret = 0;
365− struct nf_conntrack_helper *cur;
364+ struct nf_conntrack_tuple_mask mask = { .src.u.all = htons(0xFFFF) };
366365 unsigned int h = helper_hash(&me->tuple);
366+ struct nf_conntrack_helper *cur;
367+ int ret = 0;
367368
368369 BUG_ON(me->expect_policy == NULL);
369370 BUG_ON(me->expect_class_max >= NF_CT_MAX_EXPECT_CLASSES);
@@ -371,9 +372,7 @@ int nf_conntrack_helper_register(struct nf_conntrack_helper *me) · 1 unmodified line
371372
372373 mutex_lock(&nf_ct_helper_mutex);
373374 hlist_for_each_entry(cur, &nf_ct_helper_hash[h], hnode) {
374− if (strncmp(cur->name, me->name, NF_CT_HELPER_NAME_LEN) == 0 &&
375− cur->tuple.src.l3num == me->tuple.src.l3num &&
376− cur->tuple.dst.protonum == me->tuple.dst.protonum) {
375+ if (nf_ct_tuple_src_mask_cmp(&cur->tuple, &me->tuple, &mask)) {
377376 ret = -EEXIST;
378377 goto out;
379378 }
net/netfilter/nf_conntrack_irc.c+1−0
@@ -271,6 +271,7 @@ static int __init nf_conntrack_irc_init(void) · 270 unmodified lines
271271 if (ret) {
272272 pr_err("failed to register helper for pf: %u port: %u\n",
273273 irc[i].tuple.src.l3num, ports[i]);
274+ ports_c = i;
274275 nf_conntrack_irc_fini();
275276 return ret;
276277 }
net/netfilter/nf_conntrack_sane.c+1−0
@@ -223,6 +223,7 @@ static int __init nf_conntrack_sane_init(void) · 222 unmodified lines
223223 if (ret) {
224224 pr_err("failed to register helper for pf: %d port: %d\n",
225225 sane[i][j].tuple.src.l3num, ports[i]);
226+ ports_c = i;
226227 nf_conntrack_sane_fini();
227228 return ret;
228229 }
net/netfilter/nf_conntrack_sip.c+1−0
@@ -1669,6 +1669,7 @@ static int __init nf_conntrack_sip_init(void) · 1668 unmodified lines
16691669 if (ret) {
16701670 pr_err("failed to register helper for pf: %u port: %u\n",
16711671 sip[i][j].tuple.src.l3num, ports[i]);
1672+ ports_c = i;
16721673 nf_conntrack_sip_fini();
16731674 return ret;
16741675 }
net/netfilter/nf_conntrack_standalone.c+0−2
@@ -487,8 +487,6 @@ static struct ctl_table nf_ct_sysctl_table[] = { · 486 unmodified lines
487487 { }
488488 };
489489
490−#define NET_NF_CONNTRACK_MAX 2089
491−
492490 static struct ctl_table nf_ct_netfilter_table[] = {
493491 {
494492 .procname = "nf_conntrack_max",
net/netfilter/nf_conntrack_tftp.c+1−0
@@ -142,6 +142,7 @@ static int __init nf_conntrack_tftp_init(void) · 141 unmodified lines
142142 if (ret) {
143143 pr_err("failed to register helper for pf: %u port: %u\n",
144144 tftp[i][j].tuple.src.l3num, ports[i]);
145+ ports_c = i;
145146 nf_conntrack_tftp_fini();
146147 return ret;
147148 }
net/netfilter/nf_queue.c+8−9
@@ -26,23 +26,21 @@ · 25 unmodified lines
2626 * Once the queue is registered it must reinject all packets it
2727 * receives, no matter what.
2828 */
29−static const struct nf_queue_handler __rcu *queue_handler __read_mostly;
3029
3130 /* return EBUSY when somebody else is registered, return EEXIST if the
3231 * same handler is registered, return 0 in case of success. */
33−void nf_register_queue_handler(const struct nf_queue_handler *qh)
32+void nf_register_queue_handler(struct net *net, const struct nf_queue_handler *qh)
3433 {
3534 /* should never happen, we only have one queueing backend in kernel */
36− WARN_ON(rcu_access_pointer(queue_handler));
37− rcu_assign_pointer(queue_handler, qh);
35+ WARN_ON(rcu_access_pointer(net->nf.queue_handler));
36+ rcu_assign_pointer(net->nf.queue_handler, qh);
3837 }
3938 EXPORT_SYMBOL(nf_register_queue_handler);
4039
4140 /* The caller must flush their queue before this */
42−void nf_unregister_queue_handler(void)
41+void nf_unregister_queue_handler(struct net *net)
4342 {
44− RCU_INIT_POINTER(queue_handler, NULL);
45− synchronize_rcu();
43+ RCU_INIT_POINTER(net->nf.queue_handler, NULL);
4644 }
4745 EXPORT_SYMBOL(nf_unregister_queue_handler);
4846
@@ -103,7 +101,7 @@ void nf_queue_nf_hook_drop(struct net *net, struct nf_hook_ops *ops) · 54 unmodified lines
103101 const struct nf_queue_handler *qh;
104102
105103 rcu_read_lock();
106− qh = rcu_dereference(queue_handler);
104+ qh = rcu_dereference(net->nf.queue_handler);
107105 if (qh)
108106 qh->nf_hook_drop(net, ops);
109107 rcu_read_unlock();
@@ -122,9 +120,10 @@ int nf_queue(struct sk_buff *skb, · 12 unmodified lines
122120 struct nf_queue_entry *entry = NULL;
123121 const struct nf_afinfo *afinfo;
124122 const struct nf_queue_handler *qh;
123+ struct net *net = state->net;
125124
126125 /* QUEUE == DROP if no one is waiting, to be safe. */
127− qh = rcu_dereference(queue_handler);
126+ qh = rcu_dereference(net->nf.queue_handler);
128127 if (!qh) {
129128 status = -ESRCH;
130129 goto err;
net/netfilter/nf_tables_api.c+2−0
@@ -2647,6 +2647,8 @@ static int nf_tables_getset(struct net *net, struct sock *nlsk, · 2646 unmodified lines
26472647 /* Only accept unspec with dump */
26482648 if (nfmsg->nfgen_family == NFPROTO_UNSPEC)
26492649 return -EAFNOSUPPORT;
2650+ if (!nla[NFTA_SET_TABLE])
2651+ return -EINVAL;
26502652
26512653 set = nf_tables_set_lookup(ctx.table, nla[NFTA_SET_NAME]);
26522654 if (IS_ERR(set))
net/netfilter/nfnetlink_queue.c+13−7
@@ -557,7 +557,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue, · 556 unmodified lines
557557
558558 if (entskb->tstamp.tv64) {
559559 struct nfqnl_msg_packet_timestamp ts;
560− struct timespec64 kts = ktime_to_timespec64(skb->tstamp);
560+ struct timespec64 kts = ktime_to_timespec64(entskb->tstamp);
561561
562562 ts.sec = cpu_to_be64(kts.tv_sec);
563563 ts.usec = cpu_to_be64(kts.tv_nsec / NSEC_PER_USEC);
@@ -1482,21 +1482,29 @@ static int __net_init nfnl_queue_net_init(struct net *net) · 918 unmodified lines
14821482 net->nf.proc_netfilter, &nfqnl_file_ops))
14831483 return -ENOMEM;
14841484 #endif
1485+ nf_register_queue_handler(net, &nfqh);
14851486 return 0;
14861487 }
14871488
14881489 static void __net_exit nfnl_queue_net_exit(struct net *net)
14891490 {
1491+ nf_unregister_queue_handler(net);
14901492 #ifdef CONFIG_PROC_FS
14911493 remove_proc_entry("nfnetlink_queue", net->nf.proc_netfilter);
14921494 #endif
14931495 }
14941496
1497+static void nfnl_queue_net_exit_batch(struct list_head *net_exit_list)
1498+{
1499+ synchronize_rcu();
1500+}
1501+
14951502 static struct pernet_operations nfnl_queue_net_ops = {
1496− .init = nfnl_queue_net_init,
1497− .exit = nfnl_queue_net_exit,
1498− .id = &nfnl_queue_net_id,
1499− .size = sizeof(struct nfnl_queue_net),
1503+ .init = nfnl_queue_net_init,
1504+ .exit = nfnl_queue_net_exit,
1505+ .exit_batch = nfnl_queue_net_exit_batch,
1506+ .id = &nfnl_queue_net_id,
1507+ .size = sizeof(struct nfnl_queue_net),
15001508 };
15011509
15021510 static int __init nfnetlink_queue_init(void)
@@ -1517,7 +1525,6 @@ static int __init nfnetlink_queue_init(void) · 14 unmodified lines
15171525 }
15181526
15191527 register_netdevice_notifier(&nfqnl_dev_notifier);
1520− nf_register_queue_handler(&nfqh);
15211528 return status;
15221529
15231530 cleanup_netlink_notifier:
@@ -1529,7 +1536,6 @@ out: · 5 unmodified lines
15291536
15301537 static void __exit nfnetlink_queue_fini(void)
15311538 {
1532− nf_unregister_queue_handler();
15331539 unregister_netdevice_notifier(&nfqnl_dev_notifier);
15341540 nfnetlink_subsys_unregister(&nfqnl_subsys);
15351541 netlink_unregister_notifier(&nfqnl_rtnl_notifier);
net/netfilter/x_tables.c+2−2
@@ -612,7 +612,7 @@ int xt_compat_check_entry_offsets(const void *base, const char *elems, · 611 unmodified lines
612612 return -EINVAL;
613613
614614 if (strcmp(t->u.user.name, XT_STANDARD_TARGET) == 0 &&
615− target_offset + sizeof(struct compat_xt_standard_target) != next_offset)
615+ COMPAT_XT_ALIGN(target_offset + sizeof(struct compat_xt_standard_target)) != next_offset)
616616 return -EINVAL;
617617
618618 /* compat_xt_entry match has less strict aligment requirements,
@@ -694,7 +694,7 @@ int xt_check_entry_offsets(const void *base, · 75 unmodified lines
694694 return -EINVAL;
695695
696696 if (strcmp(t->u.user.name, XT_STANDARD_TARGET) == 0 &&
697− target_offset + sizeof(struct xt_standard_target) != next_offset)
697+ XT_ALIGN(target_offset + sizeof(struct xt_standard_target)) != next_offset)
698698 return -EINVAL;
699699
700700 return xt_check_entry_match(elems, base + target_offset,
net/packet/af_packet.c+25−0
@@ -93,6 +93,7 @@ · 92 unmodified lines
9393 #include <net/inet_common.h>
9494 #endif
9595 #include <linux/bpf.h>
96+#include <net/compat.h>
9697
9798 #include "internal.h"
9899
@@ -3940,6 +3941,27 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, · 3841 unmodified lines
39403941 }
39413942
39423943
3944+#ifdef CONFIG_COMPAT
3945+static int compat_packet_setsockopt(struct socket *sock, int level, int optname,
3946+ char __user *optval, unsigned int optlen)
3947+{
3948+ struct packet_sock *po = pkt_sk(sock->sk);
3949+
3950+ if (level != SOL_PACKET)
3951+ return -ENOPROTOOPT;
3952+
3953+ if (optname == PACKET_FANOUT_DATA &&
3954+ po->fanout && po->fanout->type == PACKET_FANOUT_CBPF) {
3955+ optval = (char __user *)get_compat_bpf_fprog(optval);
3956+ if (!optval)
3957+ return -EFAULT;
3958+ optlen = sizeof(struct sock_fprog);
3959+ }
3960+
3961+ return packet_setsockopt(sock, level, optname, optval, optlen);
3962+}
3963+#endif
3964+
39433965 static int packet_notifier(struct notifier_block *this,
39443966 unsigned long msg, void *ptr)
39453967 {
@@ -4416,6 +4438,9 @@ static const struct proto_ops packet_ops = { · 470 unmodified lines
44164438 .shutdown = sock_no_shutdown,
44174439 .setsockopt = packet_setsockopt,
44184440 .getsockopt = packet_getsockopt,
4441+#ifdef CONFIG_COMPAT
4442+ .compat_setsockopt = compat_packet_setsockopt,
4443+#endif
44194444 .sendmsg = packet_sendmsg,
44204445 .recvmsg = packet_recvmsg,
44214446 .mmap = packet_mmap,
net/rds/rds.h+2−0
@@ -74,6 +74,7 @@ enum { · 73 unmodified lines
7474 RDS_CONN_CONNECTING,
7575 RDS_CONN_DISCONNECTING,
7676 RDS_CONN_UP,
77+ RDS_CONN_RESETTING,
7778 RDS_CONN_ERROR,
7879 };
7980
@@ -813,6 +814,7 @@ void rds_connect_worker(struct work_struct *); · 733 unmodified lines
813814 void rds_shutdown_worker(struct work_struct *);
814815 void rds_send_worker(struct work_struct *);
815816 void rds_recv_worker(struct work_struct *);
817+void rds_connect_path_complete(struct rds_connection *conn, int curr);
816818 void rds_connect_complete(struct rds_connection *conn);
817819
818820 /* transport.c */
net/rds/recv.c+2−0
@@ -561,5 +561,7 @@ void rds_inc_info_copy(struct rds_incoming *inc, · 560 unmodified lines
561561 minfo.fport = inc->i_hdr.h_dport;
562562 }
563563
564+ minfo.flags = 0;
565+
564566 rds_info_copy(iter, &minfo, sizeof(minfo));
565567 }
net/rds/send.c+1−0
@@ -99,6 +99,7 @@ void rds_send_reset(struct rds_connection *conn) · 98 unmodified lines
9999 list_splice_init(&conn->c_retrans, &conn->c_send_queue);
100100 spin_unlock_irqrestore(&conn->c_lock, flags);
101101 }
102+EXPORT_SYMBOL_GPL(rds_send_reset);
102103
103104 static int acquire_in_xmit(struct rds_connection *conn)
104105 {
net/rds/tcp.c+75−3
@@ -126,9 +126,81 @@ void rds_tcp_restore_callbacks(struct socket *sock, · 125 unmodified lines
126126 }
127127
128128 /*
129− * This is the only path that sets tc->t_sock. Send and receive trust that
130− * it is set. The RDS_CONN_UP bit protects those paths from being
131− * called while it isn't set.
129+ * rds_tcp_reset_callbacks() switches the to the new sock and
130+ * returns the existing tc->t_sock.
131+ *
132+ * The only functions that set tc->t_sock are rds_tcp_set_callbacks
133+ * and rds_tcp_reset_callbacks. Send and receive trust that
134+ * it is set. The absence of RDS_CONN_UP bit protects those paths
135+ * from being called while it isn't set.
136+ */
137+void rds_tcp_reset_callbacks(struct socket *sock,
138+ struct rds_connection *conn)
139+{
140+ struct rds_tcp_connection *tc = conn->c_transport_data;
141+ struct socket *osock = tc->t_sock;
142+
143+ if (!osock)
144+ goto newsock;
145+
146+ /* Need to resolve a duelling SYN between peers.
147+ * We have an outstanding SYN to this peer, which may
148+ * potentially have transitioned to the RDS_CONN_UP state,
149+ * so we must quiesce any send threads before resetting
150+ * c_transport_data. We quiesce these threads by setting
151+ * c_state to something other than RDS_CONN_UP, and then
152+ * waiting for any existing threads in rds_send_xmit to
153+ * complete release_in_xmit(). (Subsequent threads entering
154+ * rds_send_xmit() will bail on !rds_conn_up().
155+ *
156+ * However an incoming syn-ack at this point would end up
157+ * marking the conn as RDS_CONN_UP, and would again permit
158+ * rds_send_xmi() threads through, so ideally we would
159+ * synchronize on RDS_CONN_UP after lock_sock(), but cannot
160+ * do that: waiting on !RDS_IN_XMIT after lock_sock() may
161+ * end up deadlocking with tcp_sendmsg(), and the RDS_IN_XMIT
162+ * would not get set. As a result, we set c_state to
163+ * RDS_CONN_RESETTTING, to ensure that rds_tcp_state_change
164+ * cannot mark rds_conn_path_up() in the window before lock_sock()
165+ */
166+ atomic_set(&conn->c_state, RDS_CONN_RESETTING);
167+ wait_event(conn->c_waitq, !test_bit(RDS_IN_XMIT, &conn->c_flags));
168+ lock_sock(osock->sk);
169+ /* reset receive side state for rds_tcp_data_recv() for osock */
170+ if (tc->t_tinc) {
171+ rds_inc_put(&tc->t_tinc->ti_inc);
172+ tc->t_tinc = NULL;
173+ }
174+ tc->t_tinc_hdr_rem = sizeof(struct rds_header);
175+ tc->t_tinc_data_rem = 0;
176+ tc->t_sock = NULL;
177+
178+ write_lock_bh(&osock->sk->sk_callback_lock);
179+
180+ osock->sk->sk_user_data = NULL;
181+ osock->sk->sk_data_ready = tc->t_orig_data_ready;
182+ osock->sk->sk_write_space = tc->t_orig_write_space;
183+ osock->sk->sk_state_change = tc->t_orig_state_change;
184+ write_unlock_bh(&osock->sk->sk_callback_lock);
185+ release_sock(osock->sk);
186+ sock_release(osock);
187+newsock:
188+ rds_send_reset(conn);
189+ lock_sock(sock->sk);
190+ write_lock_bh(&sock->sk->sk_callback_lock);
191+ tc->t_sock = sock;
192+ sock->sk->sk_user_data = conn;
193+ sock->sk->sk_data_ready = rds_tcp_data_ready;
194+ sock->sk->sk_write_space = rds_tcp_write_space;
195+ sock->sk->sk_state_change = rds_tcp_state_change;
196+
197+ write_unlock_bh(&sock->sk->sk_callback_lock);
198+ release_sock(sock->sk);
199+}
200+
201+/* Add tc to rds_tcp_tc_list and set tc->t_sock. See comments
202+ * above rds_tcp_reset_callbacks for notes about synchronization
203+ * with data path
132204 */
133205 void rds_tcp_set_callbacks(struct socket *sock, struct rds_connection *conn)
134206 {
net/rds/tcp.h+1−0
@@ -50,6 +50,7 @@ struct rds_tcp_statistics { · 49 unmodified lines
5050 void rds_tcp_tune(struct socket *sock);
5151 void rds_tcp_nonagle(struct socket *sock);
5252 void rds_tcp_set_callbacks(struct socket *sock, struct rds_connection *conn);
53+void rds_tcp_reset_callbacks(struct socket *sock, struct rds_connection *conn);
5354 void rds_tcp_restore_callbacks(struct socket *sock,
5455 struct rds_tcp_connection *tc);
5556 u32 rds_tcp_snd_nxt(struct rds_tcp_connection *tc);
net/rds/tcp_connect.c+1−1
@@ -60,7 +60,7 @@ void rds_tcp_state_change(struct sock *sk) · 59 unmodified lines
6060 case TCP_SYN_RECV:
6161 break;
6262 case TCP_ESTABLISHED:
63− rds_connect_complete(conn);
63+ rds_connect_path_complete(conn, RDS_CONN_CONNECTING);
6464 break;
6565 case TCP_CLOSE_WAIT:
6666 case TCP_CLOSE:
net/rds/tcp_listen.c+7−13
@@ -78,7 +78,6 @@ int rds_tcp_accept_one(struct socket *sock) · 77 unmodified lines
7878 struct inet_sock *inet;
7979 struct rds_tcp_connection *rs_tcp = NULL;
8080 int conn_state;
81− struct sock *nsk;
8281
8382 if (!sock) /* module unload or netns delete in progress */
8483 return -ENETUNREACH;
@@ -136,26 +135,21 @@ int rds_tcp_accept_one(struct socket *sock) · 51 unmodified lines
136135 !conn->c_outgoing) {
137136 goto rst_nsk;
138137 } else {
139− atomic_set(&conn->c_state, RDS_CONN_CONNECTING);
140− wait_event(conn->c_waitq,
141− !test_bit(RDS_IN_XMIT, &conn->c_flags));
142− rds_tcp_restore_callbacks(rs_tcp->t_sock, rs_tcp);
138+ rds_tcp_reset_callbacks(new_sock, conn);
143139 conn->c_outgoing = 0;
140+ /* rds_connect_path_complete() marks RDS_CONN_UP */
141+ rds_connect_path_complete(conn, RDS_CONN_DISCONNECTING);
144142 }
143+ } else {
144+ rds_tcp_set_callbacks(new_sock, conn);
145+ rds_connect_path_complete(conn, RDS_CONN_CONNECTING);
145146 }
146− rds_tcp_set_callbacks(new_sock, conn);
147− rds_connect_complete(conn); /* marks RDS_CONN_UP */
148147 new_sock = NULL;
149148 ret = 0;
150149 goto out;
151150 rst_nsk:
152151 /* reset the newly returned accept sock and bail */
153− nsk = new_sock->sk;
154− rds_tcp_stats_inc(s_tcp_listen_closed_stale);
155− nsk->sk_user_data = NULL;
156− nsk->sk_prot->disconnect(nsk, 0);
157− tcp_done(nsk);
158− new_sock = NULL;
152+ kernel_sock_shutdown(new_sock, SHUT_RDWR);
159153 ret = 0;
160154 out:
161155 if (rs_tcp)
net/rds/threads.c+8−2
@@ -71,9 +71,9 @@ · 70 unmodified lines
7171 struct workqueue_struct *rds_wq;
7272 EXPORT_SYMBOL_GPL(rds_wq);
7373
74−void rds_connect_complete(struct rds_connection *conn)
74+void rds_connect_path_complete(struct rds_connection *conn, int curr)
7575 {
76− if (!rds_conn_transition(conn, RDS_CONN_CONNECTING, RDS_CONN_UP)) {
76+ if (!rds_conn_transition(conn, curr, RDS_CONN_UP)) {
7777 printk(KERN_WARNING "%s: Cannot transition to state UP, "
7878 "current state is %d\n",
7979 __func__,
@@ -90,6 +90,12 @@ void rds_connect_complete(struct rds_connection *conn) · 10 unmodified lines
9090 queue_delayed_work(rds_wq, &conn->c_send_w, 0);
9191 queue_delayed_work(rds_wq, &conn->c_recv_w, 0);
9292 }
93+EXPORT_SYMBOL_GPL(rds_connect_path_complete);
94+
95+void rds_connect_complete(struct rds_connection *conn)
96+{
97+ rds_connect_path_complete(conn, RDS_CONN_CONNECTING);
98+}
9399 EXPORT_SYMBOL_GPL(rds_connect_complete);
94100
95101 /*
net/rxrpc/rxkad.c+1−3
@@ -1162,9 +1162,7 @@ static int rxkad_init(void) · 1161 unmodified lines
11621162 /* pin the cipher we need so that the crypto layer doesn't invoke
11631163 * keventd to go get it */
11641164 rxkad_ci = crypto_alloc_skcipher("pcbc(fcrypt)", 0, CRYPTO_ALG_ASYNC);
1165− if (IS_ERR(rxkad_ci))
1166− return PTR_ERR(rxkad_ci);
1167− return 0;
1165+ return PTR_ERR_OR_ZERO(rxkad_ci);
11681166 }
11691167
11701168 /*
net/sched/act_police.c+11−22
@@ -38,7 +38,7 @@ struct tcf_police { · 37 unmodified lines
3838 bool peak_present;
3939 };
4040 #define to_police(pc) \
41− container_of(pc, struct tcf_police, common)
41+ container_of(pc->priv, struct tcf_police, common)
4242
4343 #define POL_TAB_MASK 15
4444
@@ -119,14 +119,12 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla, · 74 unmodified lines
119119 struct nlattr *est, struct tc_action *a,
120120 int ovr, int bind)
121121 {
122− unsigned int h;
123122 int ret = 0, err;
124123 struct nlattr *tb[TCA_POLICE_MAX + 1];
125124 struct tc_police *parm;
126125 struct tcf_police *police;
127126 struct qdisc_rate_table *R_tab = NULL, *P_tab = NULL;
128127 struct tc_action_net *tn = net_generic(net, police_net_id);
129− struct tcf_hashinfo *hinfo = tn->hinfo;
130128 int size;
131129
132130 if (nla == NULL)
@@ -145,7 +143,7 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla, · 12 unmodified lines
145143
146144 if (parm->index) {
147145 if (tcf_hash_search(tn, a, parm->index)) {
148− police = to_police(a->priv);
146+ police = to_police(a);
149147 if (bind) {
150148 police->tcf_bindcnt += 1;
151149 police->tcf_refcnt += 1;
@@ -156,16 +154,15 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla, · 4 unmodified lines
156154 /* not replacing */
157155 return -EEXIST;
158156 }
157+ } else {
158+ ret = tcf_hash_create(tn, parm->index, NULL, a,
159+ sizeof(*police), bind, false);
160+ if (ret)
161+ return ret;
162+ ret = ACT_P_CREATED;
159163 }
160164
161− police = kzalloc(sizeof(*police), GFP_KERNEL);
162− if (police == NULL)
163− return -ENOMEM;
164− ret = ACT_P_CREATED;
165− police->tcf_refcnt = 1;
166− spin_lock_init(&police->tcf_lock);
167− if (bind)
168− police->tcf_bindcnt = 1;
165+ police = to_police(a);
169166 override:
170167 if (parm->rate.rate) {
171168 err = -ENOMEM;
@@ -237,16 +234,8 @@ override: · 65 unmodified lines
237234 return ret;
238235
239236 police->tcfp_t_c = ktime_get_ns();
240− police->tcf_index = parm->index ? parm->index :
241− tcf_hash_new_index(tn);
242− police->tcf_tm.install = jiffies;
243− police->tcf_tm.lastuse = jiffies;
244− h = tcf_hash(police->tcf_index, POL_TAB_MASK);
245− spin_lock_bh(&hinfo->lock);
246− hlist_add_head(&police->tcf_head, &hinfo->htab[h]);
247− spin_unlock_bh(&hinfo->lock);
237+ tcf_hash_insert(tn, a);
248238
249− a->priv = police;
250239 return ret;
251240
252241 failure_unlock:
@@ -255,7 +244,7 @@ failure: · 2 unmodified lines
255244 qdisc_put_rtab(P_tab);
256245 qdisc_put_rtab(R_tab);
257246 if (ret == ACT_P_CREATED)
258− kfree(police);
247+ tcf_hash_cleanup(a, est);
259248 return err;
260249 }
261250
net/sched/cls_flower.c+3−3
@@ -171,7 +171,7 @@ static void fl_hw_destroy_filter(struct tcf_proto *tp, unsigned long cookie) · 170 unmodified lines
171171 struct tc_cls_flower_offload offload = {0};
172172 struct tc_to_netdev tc;
173173
174− if (!tc_should_offload(dev, 0))
174+ if (!tc_should_offload(dev, tp, 0))
175175 return;
176176
177177 offload.command = TC_CLSFLOWER_DESTROY;
@@ -194,7 +194,7 @@ static void fl_hw_replace_filter(struct tcf_proto *tp, · 16 unmodified lines
194194 struct tc_cls_flower_offload offload = {0};
195195 struct tc_to_netdev tc;
196196
197− if (!tc_should_offload(dev, flags))
197+ if (!tc_should_offload(dev, tp, flags))
198198 return;
199199
200200 offload.command = TC_CLSFLOWER_REPLACE;
@@ -216,7 +216,7 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f) · 15 unmodified lines
216216 struct tc_cls_flower_offload offload = {0};
217217 struct tc_to_netdev tc;
218218
219− if (!tc_should_offload(dev, 0))
219+ if (!tc_should_offload(dev, tp, 0))
220220 return;
221221
222222 offload.command = TC_CLSFLOWER_STATS;
net/sched/cls_u32.c+40−32
@@ -440,7 +440,7 @@ static void u32_remove_hw_knode(struct tcf_proto *tp, u32 handle) · 439 unmodified lines
440440 offload.type = TC_SETUP_CLSU32;
441441 offload.cls_u32 = &u32_offload;
442442
443− if (tc_should_offload(dev, 0)) {
443+ if (tc_should_offload(dev, tp, 0)) {
444444 offload.cls_u32->command = TC_CLSU32_DELETE_KNODE;
445445 offload.cls_u32->knode.handle = handle;
446446 dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
@@ -457,20 +457,21 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, · 10 unmodified lines
457457 struct tc_to_netdev offload;
458458 int err;
459459
460+ if (!tc_should_offload(dev, tp, flags))
461+ return tc_skip_sw(flags) ? -EINVAL : 0;
462+
460463 offload.type = TC_SETUP_CLSU32;
461464 offload.cls_u32 = &u32_offload;
462465
463− if (tc_should_offload(dev, flags)) {
464− offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
465− offload.cls_u32->hnode.divisor = h->divisor;
466− offload.cls_u32->hnode.handle = h->handle;
467− offload.cls_u32->hnode.prio = h->prio;
466+ offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
467+ offload.cls_u32->hnode.divisor = h->divisor;
468+ offload.cls_u32->hnode.handle = h->handle;
469+ offload.cls_u32->hnode.prio = h->prio;
468470
469− err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
470− tp->protocol, &offload);
471− if (tc_skip_sw(flags))
472− return err;
473− }
471+ err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
472+ tp->protocol, &offload);
473+ if (tc_skip_sw(flags))
474+ return err;
474475
475476 return 0;
476477 }
@@ -484,7 +485,7 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h) · 7 unmodified lines
484485 offload.type = TC_SETUP_CLSU32;
485486 offload.cls_u32 = &u32_offload;
486487
487− if (tc_should_offload(dev, 0)) {
488+ if (tc_should_offload(dev, tp, 0)) {
488489 offload.cls_u32->command = TC_CLSU32_DELETE_HNODE;
489490 offload.cls_u32->hnode.divisor = h->divisor;
490491 offload.cls_u32->hnode.handle = h->handle;
@@ -507,27 +508,28 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, · 16 unmodified lines
507508 offload.type = TC_SETUP_CLSU32;
508509 offload.cls_u32 = &u32_offload;
509510
510− if (tc_should_offload(dev, flags)) {
511− offload.cls_u32->command = TC_CLSU32_REPLACE_KNODE;
512− offload.cls_u32->knode.handle = n->handle;
513− offload.cls_u32->knode.fshift = n->fshift;
511+ if (!tc_should_offload(dev, tp, flags))
512+ return tc_skip_sw(flags) ? -EINVAL : 0;
513+
514+ offload.cls_u32->command = TC_CLSU32_REPLACE_KNODE;
515+ offload.cls_u32->knode.handle = n->handle;
516+ offload.cls_u32->knode.fshift = n->fshift;
514517 #ifdef CONFIG_CLS_U32_MARK
515− offload.cls_u32->knode.val = n->val;
516− offload.cls_u32->knode.mask = n->mask;
518+ offload.cls_u32->knode.val = n->val;
519+ offload.cls_u32->knode.mask = n->mask;
517520 #else
518− offload.cls_u32->knode.val = 0;
519− offload.cls_u32->knode.mask = 0;
521+ offload.cls_u32->knode.val = 0;
522+ offload.cls_u32->knode.mask = 0;
520523 #endif
521− offload.cls_u32->knode.sel = &n->sel;
522− offload.cls_u32->knode.exts = &n->exts;
523− if (n->ht_down)
524− offload.cls_u32->knode.link_handle = n->ht_down->handle;
525−
526− err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
527− tp->protocol, &offload);
528− if (tc_skip_sw(flags))
529− return err;
530− }
524+ offload.cls_u32->knode.sel = &n->sel;
525+ offload.cls_u32->knode.exts = &n->exts;
526+ if (n->ht_down)
527+ offload.cls_u32->knode.link_handle = n->ht_down->handle;
528+
529+ err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
530+ tp->protocol, &offload);
531+ if (tc_skip_sw(flags))
532+ return err;
531533
532534 return 0;
533535 }
@@ -863,7 +865,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, · 329 unmodified lines
863865 if (tb[TCA_U32_FLAGS]) {
864866 flags = nla_get_u32(tb[TCA_U32_FLAGS]);
865867 if (!tc_flags_valid(flags))
866− return err;
868+ return -EINVAL;
867869 }
868870
869871 n = (struct tc_u_knode *)*arg;
@@ -921,11 +923,17 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, · 51 unmodified lines
921923 ht->divisor = divisor;
922924 ht->handle = handle;
923925 ht->prio = tp->prio;
926+
927+ err = u32_replace_hw_hnode(tp, ht, flags);
928+ if (err) {
929+ kfree(ht);
930+ return err;
931+ }
932+
924933 RCU_INIT_POINTER(ht->next, tp_c->hlist);
925934 rcu_assign_pointer(tp_c->hlist, ht);
926935 *arg = (unsigned long)ht;
927936
928− u32_replace_hw_hnode(tp, ht, flags);
929937 return 0;
930938 }
931939
net/sched/sch_drr.c+4−0
@@ -375,6 +375,7 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 374 unmodified lines
375375 cl->deficit = cl->quantum;
376376 }
377377
378+ qdisc_qstats_backlog_inc(sch, skb);
378379 sch->q.qlen++;
379380 return err;
380381 }
@@ -407,6 +408,7 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch) · 26 unmodified lines
407408
408409 bstats_update(&cl->bstats, skb);
409410 qdisc_bstats_update(sch, skb);
411+ qdisc_qstats_backlog_dec(sch, skb);
410412 sch->q.qlen--;
411413 return skb;
412414 }
@@ -428,6 +430,7 @@ static unsigned int drr_drop(struct Qdisc *sch) · 15 unmodified lines
428430 if (cl->qdisc->ops->drop) {
429431 len = cl->qdisc->ops->drop(cl->qdisc);
430432 if (len > 0) {
433+ sch->qstats.backlog -= len;
431434 sch->q.qlen--;
432435 if (cl->qdisc->q.qlen == 0)
433436 list_del(&cl->alist);
@@ -463,6 +466,7 @@ static void drr_reset_qdisc(struct Qdisc *sch) · 29 unmodified lines
463466 qdisc_reset(cl->qdisc);
464467 }
465468 }
469+ sch->qstats.backlog = 0;
466470 sch->q.qlen = 0;
467471 }
468472
net/sched/sch_fq_codel.c+19−7
@@ -199,6 +199,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 198 unmodified lines
199199 unsigned int idx, prev_backlog, prev_qlen;
200200 struct fq_codel_flow *flow;
201201 int uninitialized_var(ret);
202+ unsigned int pkt_len;
202203 bool memory_limited;
203204
204205 idx = fq_codel_classify(skb, sch, &ret);
@@ -230,6 +231,8 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 25 unmodified lines
230231 prev_backlog = sch->qstats.backlog;
231232 prev_qlen = sch->q.qlen;
232233
234+ /* save this packet length as it might be dropped by fq_codel_drop() */
235+ pkt_len = qdisc_pkt_len(skb);
233236 /* fq_codel_drop() is quite expensive, as it performs a linear search
234237 * in q->backlogs[] to find a fat flow.
235238 * So instead of dropping a single packet, drop half of its backlog
@@ -237,14 +240,23 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 1 unmodified line
237240 */
238241 ret = fq_codel_drop(sch, q->drop_batch_size);
239242
240− q->drop_overlimit += prev_qlen - sch->q.qlen;
243+ prev_qlen -= sch->q.qlen;
244+ prev_backlog -= sch->qstats.backlog;
245+ q->drop_overlimit += prev_qlen;
241246 if (memory_limited)
242− q->drop_overmemory += prev_qlen - sch->q.qlen;
243− /* As we dropped packet(s), better let upper stack know this */
244− qdisc_tree_reduce_backlog(sch, prev_qlen - sch->q.qlen,
245− prev_backlog - sch->qstats.backlog);
247+ q->drop_overmemory += prev_qlen;
246248
247− return ret == idx ? NET_XMIT_CN : NET_XMIT_SUCCESS;
249+ /* As we dropped packet(s), better let upper stack know this.
250+ * If we dropped a packet for this flow, return NET_XMIT_CN,
251+ * but in this case, our parents wont increase their backlogs.
252+ */
253+ if (ret == idx) {
254+ qdisc_tree_reduce_backlog(sch, prev_qlen - 1,
255+ prev_backlog - pkt_len);
256+ return NET_XMIT_CN;
257+ }
258+ qdisc_tree_reduce_backlog(sch, prev_qlen, prev_backlog);
259+ return NET_XMIT_SUCCESS;
248260 }
249261
250262 /* This is the specific function called from codel_dequeue()
@@ -649,7 +661,7 @@ static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl, · 398 unmodified lines
649661 qs.backlog = q->backlogs[idx];
650662 qs.drops = flow->dropped;
651663 }
652− if (gnet_stats_copy_queue(d, NULL, &qs, 0) < 0)
664+ if (gnet_stats_copy_queue(d, NULL, &qs, qs.qlen) < 0)
653665 return -1;
654666 if (idx < q->flows_cnt)
655667 return gnet_stats_copy_app(d, &xstats, sizeof(xstats));
net/sched/sch_generic.c+2−0
@@ -49,6 +49,7 @@ static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q) · 48 unmodified lines
4949 {
5050 q->gso_skb = skb;
5151 q->qstats.requeues++;
52+ qdisc_qstats_backlog_inc(q, skb);
5253 q->q.qlen++; /* it's still part of the queue */
5354 __netif_schedule(q);
5455
@@ -92,6 +93,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate, · 37 unmodified lines
9293 txq = skb_get_tx_queue(txq->dev, skb);
9394 if (!netif_xmit_frozen_or_stopped(txq)) {
9495 q->gso_skb = NULL;
96+ qdisc_qstats_backlog_dec(q, skb);
9597 q->q.qlen--;
9698 } else
9799 skb = NULL;
net/sched/sch_hfsc.c+4−8
@@ -1529,6 +1529,7 @@ hfsc_reset_qdisc(struct Qdisc *sch) · 1528 unmodified lines
15291529 q->eligible = RB_ROOT;
15301530 INIT_LIST_HEAD(&q->droplist);
15311531 qdisc_watchdog_cancel(&q->watchdog);
1532+ sch->qstats.backlog = 0;
15321533 sch->q.qlen = 0;
15331534 }
15341535
@@ -1559,14 +1560,6 @@ hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb) · 24 unmodified lines
15591560 struct hfsc_sched *q = qdisc_priv(sch);
15601561 unsigned char *b = skb_tail_pointer(skb);
15611562 struct tc_hfsc_qopt qopt;
1562− struct hfsc_class *cl;
1563− unsigned int i;
1564−
1565− sch->qstats.backlog = 0;
1566− for (i = 0; i < q->clhash.hashsize; i++) {
1567− hlist_for_each_entry(cl, &q->clhash.hash[i], cl_common.hnode)
1568− sch->qstats.backlog += cl->qdisc->qstats.backlog;
1569− }
15701563
15711564 qopt.defcls = q->defcls;
15721565 if (nla_put(skb, TCA_OPTIONS, sizeof(qopt), &qopt))
@@ -1604,6 +1597,7 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 31 unmodified lines
16041597 if (cl->qdisc->q.qlen == 1)
16051598 set_active(cl, qdisc_pkt_len(skb));
16061599
1600+ qdisc_qstats_backlog_inc(sch, skb);
16071601 sch->q.qlen++;
16081602
16091603 return NET_XMIT_SUCCESS;
@@ -1672,6 +1666,7 @@ hfsc_dequeue(struct Qdisc *sch) · 62 unmodified lines
16721666
16731667 qdisc_unthrottled(sch);
16741668 qdisc_bstats_update(sch, skb);
1669+ qdisc_qstats_backlog_dec(sch, skb);
16751670 sch->q.qlen--;
16761671
16771672 return skb;
@@ -1695,6 +1690,7 @@ hfsc_drop(struct Qdisc *sch) · 17 unmodified lines
16951690 }
16961691 cl->qstats.drops++;
16971692 qdisc_qstats_drop(sch);
1693+ sch->qstats.backlog -= len;
16981694 sch->q.qlen--;
16991695 return len;
17001696 }
net/sched/sch_ingress.c+12−0
@@ -27,6 +27,11 @@ static unsigned long ingress_get(struct Qdisc *sch, u32 classid) · 26 unmodified lines
2727 return TC_H_MIN(classid) + 1;
2828 }
2929
30+static bool ingress_cl_offload(u32 classid)
31+{
32+ return true;
33+}
34+
3035 static unsigned long ingress_bind_filter(struct Qdisc *sch,
3136 unsigned long parent, u32 classid)
3237 {
@@ -86,6 +91,7 @@ static const struct Qdisc_class_ops ingress_class_ops = { · 53 unmodified lines
8691 .put = ingress_put,
8792 .walk = ingress_walk,
8893 .tcf_chain = ingress_find_tcf,
94+ .tcf_cl_offload = ingress_cl_offload,
8995 .bind_tcf = ingress_bind_filter,
9096 .unbind_tcf = ingress_put,
9197 };
@@ -110,6 +116,11 @@ static unsigned long clsact_get(struct Qdisc *sch, u32 classid) · 18 unmodified lines
110116 }
111117 }
112118
119+static bool clsact_cl_offload(u32 classid)
120+{
121+ return TC_H_MIN(classid) == TC_H_MIN(TC_H_MIN_INGRESS);
122+}
123+
113124 static unsigned long clsact_bind_filter(struct Qdisc *sch,
114125 unsigned long parent, u32 classid)
115126 {
@@ -158,6 +169,7 @@ static const struct Qdisc_class_ops clsact_class_ops = { · 42 unmodified lines
158169 .put = ingress_put,
159170 .walk = ingress_walk,
160171 .tcf_chain = clsact_find_tcf,
172+ .tcf_cl_offload = clsact_cl_offload,
161173 .bind_tcf = clsact_bind_filter,
162174 .unbind_tcf = ingress_put,
163175 };
net/sched/sch_prio.c+4−0
@@ -85,6 +85,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 84 unmodified lines
8585
8686 ret = qdisc_enqueue(skb, qdisc);
8787 if (ret == NET_XMIT_SUCCESS) {
88+ qdisc_qstats_backlog_inc(sch, skb);
8889 sch->q.qlen++;
8990 return NET_XMIT_SUCCESS;
9091 }
@@ -117,6 +118,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch) · 26 unmodified lines
117118 struct sk_buff *skb = qdisc_dequeue_peeked(qdisc);
118119 if (skb) {
119120 qdisc_bstats_update(sch, skb);
121+ qdisc_qstats_backlog_dec(sch, skb);
120122 sch->q.qlen--;
121123 return skb;
122124 }
@@ -135,6 +137,7 @@ static unsigned int prio_drop(struct Qdisc *sch) · 12 unmodified lines
135137 for (prio = q->bands-1; prio >= 0; prio--) {
136138 qdisc = q->queues[prio];
137139 if (qdisc->ops->drop && (len = qdisc->ops->drop(qdisc)) != 0) {
140+ sch->qstats.backlog -= len;
138141 sch->q.qlen--;
139142 return len;
140143 }
@@ -151,6 +154,7 @@ prio_reset(struct Qdisc *sch) · 10 unmodified lines
151154
152155 for (prio = 0; prio < q->bands; prio++)
153156 qdisc_reset(q->queues[prio]);
157+ sch->qstats.backlog = 0;
154158 sch->q.qlen = 0;
155159 }
156160
net/sched/sch_qfq.c+4−2
@@ -1235,8 +1235,10 @@ static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 1234 unmodified lines
12351235 cl->agg->lmax, qdisc_pkt_len(skb), cl->common.classid);
12361236 err = qfq_change_agg(sch, cl, cl->agg->class_weight,
12371237 qdisc_pkt_len(skb));
1238− if (err)
1239− return err;
1238+ if (err) {
1239+ cl->qstats.drops++;
1240+ return qdisc_drop(skb, sch);
1241+ }
12401242 }
12411243
12421244 err = qdisc_enqueue(skb, cl->qdisc);
net/sched/sch_red.c+4−0
@@ -97,6 +97,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 96 unmodified lines
9797
9898 ret = qdisc_enqueue(skb, child);
9999 if (likely(ret == NET_XMIT_SUCCESS)) {
100+ qdisc_qstats_backlog_inc(sch, skb);
100101 sch->q.qlen++;
101102 } else if (net_xmit_drop_count(ret)) {
102103 q->stats.pdrop++;
@@ -118,6 +119,7 @@ static struct sk_buff *red_dequeue(struct Qdisc *sch) · 15 unmodified lines
118119 skb = child->dequeue(child);
119120 if (skb) {
120121 qdisc_bstats_update(sch, skb);
122+ qdisc_qstats_backlog_dec(sch, skb);
121123 sch->q.qlen--;
122124 } else {
123125 if (!red_is_idling(&q->vars))
@@ -143,6 +145,7 @@ static unsigned int red_drop(struct Qdisc *sch) · 19 unmodified lines
143145 if (child->ops->drop && (len = child->ops->drop(child)) > 0) {
144146 q->stats.other++;
145147 qdisc_qstats_drop(sch);
148+ sch->qstats.backlog -= len;
146149 sch->q.qlen--;
147150 return len;
148151 }
@@ -158,6 +161,7 @@ static void red_reset(struct Qdisc *sch) · 9 unmodified lines
158161 struct red_sched_data *q = qdisc_priv(sch);
159162
160163 qdisc_reset(q->qdisc);
164+ sch->qstats.backlog = 0;
161165 sch->q.qlen = 0;
162166 red_restart(&q->vars);
163167 }
net/sched/sch_tbf.c+4−0
@@ -207,6 +207,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 206 unmodified lines
207207 return ret;
208208 }
209209
210+ qdisc_qstats_backlog_inc(sch, skb);
210211 sch->q.qlen++;
211212 return NET_XMIT_SUCCESS;
212213 }
@@ -217,6 +218,7 @@ static unsigned int tbf_drop(struct Qdisc *sch) · 4 unmodified lines
217218 unsigned int len = 0;
218219
219220 if (q->qdisc->ops->drop && (len = q->qdisc->ops->drop(q->qdisc)) != 0) {
221+ sch->qstats.backlog -= len;
220222 sch->q.qlen--;
221223 qdisc_qstats_drop(sch);
222224 }
@@ -263,6 +265,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc *sch) · 40 unmodified lines
263265 q->t_c = now;
264266 q->tokens = toks;
265267 q->ptokens = ptoks;
268+ qdisc_qstats_backlog_dec(sch, skb);
266269 sch->q.qlen--;
267270 qdisc_unthrottled(sch);
268271 qdisc_bstats_update(sch, skb);
@@ -294,6 +297,7 @@ static void tbf_reset(struct Qdisc *sch) · 25 unmodified lines
294297 struct tbf_sched_data *q = qdisc_priv(sch);
295298
296299 qdisc_reset(q->qdisc);
300+ sch->qstats.backlog = 0;
297301 sch->q.qlen = 0;
298302 q->t_c = ktime_get_ns();
299303 q->tokens = q->buffer;
net/tipc/netlink_compat.c+2−1
@@ -604,7 +604,8 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg, · 603 unmodified lines
604604
605605 link_info.dest = nla_get_flag(link[TIPC_NLA_LINK_DEST]);
606606 link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP]));
607− strcpy(link_info.str, nla_data(link[TIPC_NLA_LINK_NAME]));
607+ nla_strlcpy(link_info.str, nla_data(link[TIPC_NLA_LINK_NAME]),
608+ TIPC_MAX_LINK_NAME);
608609
609610 return tipc_add_tlv(msg->rep, TIPC_TLV_LINK_INFO,
610611 &link_info, sizeof(link_info));
net/wireless/core.c+0−2
@@ -363,8 +363,6 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv, · 362 unmodified lines
363363 WARN_ON(ops->remain_on_channel && !ops->cancel_remain_on_channel);
364364 WARN_ON(ops->tdls_channel_switch && !ops->tdls_cancel_channel_switch);
365365 WARN_ON(ops->add_tx_ts && !ops->del_tx_ts);
366− WARN_ON(ops->set_tx_power && !ops->get_tx_power);
367− WARN_ON(ops->set_antenna && !ops->get_antenna);
368366
369367 alloc_size = sizeof(*rdev) + sizeof_priv;
370368
net/wireless/wext-core.c+23−2
@@ -958,8 +958,29 @@ static int wireless_process_ioctl(struct net *net, struct ifreq *ifr, · 957 unmodified lines
958958 return private(dev, iwr, cmd, info, handler);
959959 }
960960 /* Old driver API : call driver ioctl handler */
961− if (dev->netdev_ops->ndo_do_ioctl)
962− return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
961+ if (dev->netdev_ops->ndo_do_ioctl) {
962+#ifdef CONFIG_COMPAT
963+ if (info->flags & IW_REQUEST_FLAG_COMPAT) {
964+ int ret = 0;
965+ struct iwreq iwr_lcl;
966+ struct compat_iw_point *iwp_compat = (void *) &iwr->u.data;
967+
968+ memcpy(&iwr_lcl, iwr, sizeof(struct iwreq));
969+ iwr_lcl.u.data.pointer = compat_ptr(iwp_compat->pointer);
970+ iwr_lcl.u.data.length = iwp_compat->length;
971+ iwr_lcl.u.data.flags = iwp_compat->flags;
972+
973+ ret = dev->netdev_ops->ndo_do_ioctl(dev, (void *) &iwr_lcl, cmd);
974+
975+ iwp_compat->pointer = ptr_to_compat(iwr_lcl.u.data.pointer);
976+ iwp_compat->length = iwr_lcl.u.data.length;
977+ iwp_compat->flags = iwr_lcl.u.data.flags;
978+
979+ return ret;
980+ } else
981+#endif
982+ return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
983+ }
963984 return -EOPNOTSUPP;
964985 }
965986
tools/testing/selftests/net/reuseport_bpf.c+5−5
@@ -111,9 +111,9 @@ static void attach_ebpf(int fd, uint16_t mod) · 110 unmodified lines
111111 memset(&attr, 0, sizeof(attr));
112112 attr.prog_type = BPF_PROG_TYPE_SOCKET_FILTER;
113113 attr.insn_cnt = ARRAY_SIZE(prog);
114− attr.insns = (uint64_t)prog;
115− attr.license = (uint64_t)bpf_license;
116− attr.log_buf = (uint64_t)bpf_log_buf;
114+ attr.insns = (unsigned long) &prog;
115+ attr.license = (unsigned long) &bpf_license;
116+ attr.log_buf = (unsigned long) &bpf_log_buf;
117117 attr.log_size = sizeof(bpf_log_buf);
118118 attr.log_level = 1;
119119 attr.kern_version = 0;
@@ -351,8 +351,8 @@ static void test_filter_no_reuseport(const struct test_params p) · 231 unmodified lines
351351 memset(&eprog, 0, sizeof(eprog));
352352 eprog.prog_type = BPF_PROG_TYPE_SOCKET_FILTER;
353353 eprog.insn_cnt = ARRAY_SIZE(ecode);
354− eprog.insns = (uint64_t)ecode;
355− eprog.license = (uint64_t)bpf_license;
354+ eprog.insns = (unsigned long) &ecode;
355+ eprog.license = (unsigned long) &bpf_license;
356356 eprog.kern_version = 0;
357357
358358 memset(&cprog, 0, sizeof(cprog));