Skip to content

Commit c93d921

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix refcount leak in act_ipt during replace, from Davide Caratti. 2) Set task state properly in tun during blocking reads, from Timur Celik. 3) Leaked reference in DSA, from Wen Yang. 4) NULL deref in act_tunnel_key, from Vlad Buslov. 5) cipso_v4_erro can reference the skb IPCB in inappropriate contexts thus referencing garbage, from Nazarov Sergey. 6) Don't accept RTA_VIA and RTA_GATEWAY in contexts where those attributes make no sense. 7) Fix hung sendto in tipc, from Tung Nguyen. 8) Out-of-bounds access in netlabel, from Paul Moore. 9) Grant reference leak in xen-netback, from Igor Druzhinin. 10) Fix tx stalls with lan743x, from Bryan Whitehead. 11) Fix interrupt storm with mv88e6xxx, from Hein Kallweit. 12) Memory leak in sit on device registry failure, from Mao Wenan. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits) net: sit: fix memory leak in sit_init_net() net: dsa: mv88e6xxx: Fix statistics on mv88e6161 geneve: correctly handle ipv6.disable module parameter net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode bpf: fix sanitation rewrite in case of non-pointers ipv4: Add ICMPv6 support when parse route ipproto MIPS: eBPF: Fix icache flush end address lan743x: Fix TX Stall Issue net: phy: phylink: fix uninitialized variable in phylink_get_mac_state net: aquantia: regression on cpus with high cores: set mode with 8 queues selftests: fixes for UDP GRO bpf: drop refcount if bpf_map_new_fd() fails in map_create() net: dsa: mv88e6xxx: power serdes on/off for 10G interfaces on 6390X net: dsa: mv88e6xxx: Fix u64 statistics xen-netback: don't populate the hash cache on XenBus disconnect xen-netback: fix occasional leak of grant ref mappings under memory pressure sctp: chunk.c: correct format string for size_t in printk net: netem: fix skb length BUG_ON in __skb_to_sgvec netlabel: fix out-of-bounds memory accesses ipv4: Pass original device to ip_rcv_finish_core ...
2 parents fa3294c + 07f12b2 commit c93d921

Some content is hidden

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

51 files changed

+408
-106
lines changed

arch/mips/net/ebpf_jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
18191819

18201820
/* Update the icache */
18211821
flush_icache_range((unsigned long)ctx.target,
1822-
(unsigned long)(ctx.target + ctx.idx * sizeof(u32)));
1822+
(unsigned long)&ctx.target[ctx.idx]);
18231823

18241824
if (bpf_jit_enable > 1)
18251825
/* Dump JIT code */

drivers/net/dsa/lantiq_gswip.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,12 @@ static struct platform_driver gswip_driver = {
11621162

11631163
module_platform_driver(gswip_driver);
11641164

1165+
MODULE_FIRMWARE("lantiq/xrx300_phy11g_a21.bin");
1166+
MODULE_FIRMWARE("lantiq/xrx300_phy22f_a21.bin");
1167+
MODULE_FIRMWARE("lantiq/xrx200_phy11g_a14.bin");
1168+
MODULE_FIRMWARE("lantiq/xrx200_phy11g_a22.bin");
1169+
MODULE_FIRMWARE("lantiq/xrx200_phy22f_a14.bin");
1170+
MODULE_FIRMWARE("lantiq/xrx200_phy22f_a22.bin");
11651171
MODULE_AUTHOR("Hauke Mehrtens <hauke@hauke-m.de>");
11661172
MODULE_DESCRIPTION("Lantiq / Intel GSWIP driver");
11671173
MODULE_LICENSE("GPL v2");

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,
896896
default:
897897
return U64_MAX;
898898
}
899-
value = (((u64)high) << 16) | low;
899+
value = (((u64)high) << 32) | low;
900900
return value;
901901
}
902902

@@ -3093,7 +3093,7 @@ static const struct mv88e6xxx_ops mv88e6161_ops = {
30933093
.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
30943094
.port_link_state = mv88e6352_port_link_state,
30953095
.port_get_cmode = mv88e6185_port_get_cmode,
3096-
.stats_snapshot = mv88e6320_g1_stats_snapshot,
3096+
.stats_snapshot = mv88e6xxx_g1_stats_snapshot,
30973097
.stats_set_histogram = mv88e6095_g1_stats_set_histogram,
30983098
.stats_get_sset_count = mv88e6095_stats_get_sset_count,
30993099
.stats_get_strings = mv88e6095_stats_get_strings,
@@ -4595,6 +4595,14 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip,
45954595
return 0;
45964596
}
45974597

4598+
static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
4599+
{
4600+
int i;
4601+
4602+
for (i = 0; i < mv88e6xxx_num_ports(chip); i++)
4603+
chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID;
4604+
}
4605+
45984606
static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
45994607
int port)
46004608
{
@@ -4631,6 +4639,8 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
46314639
if (err)
46324640
goto free;
46334641

4642+
mv88e6xxx_ports_cmode_init(chip);
4643+
46344644
mutex_lock(&chip->reg_lock);
46354645
err = mv88e6xxx_switch_reset(chip);
46364646
mutex_unlock(&chip->reg_lock);

drivers/net/dsa/mv88e6xxx/port.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
398398
cmode = 0;
399399
}
400400

401+
/* cmode doesn't change, nothing to do for us */
402+
if (cmode == chip->ports[port].cmode)
403+
return 0;
404+
401405
lane = mv88e6390x_serdes_get_lane(chip, port);
402406
if (lane < 0)
403407
return lane;
@@ -408,7 +412,7 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
408412
return err;
409413
}
410414

411-
err = mv88e6390_serdes_power(chip, port, false);
415+
err = mv88e6390x_serdes_power(chip, port, false);
412416
if (err)
413417
return err;
414418

@@ -424,7 +428,7 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
424428
if (err)
425429
return err;
426430

427-
err = mv88e6390_serdes_power(chip, port, true);
431+
err = mv88e6390x_serdes_power(chip, port, true);
428432
if (err)
429433
return err;
430434

drivers/net/dsa/mv88e6xxx/port.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define MV88E6185_PORT_STS_CMODE_1000BASE_X 0x0005
5353
#define MV88E6185_PORT_STS_CMODE_PHY 0x0006
5454
#define MV88E6185_PORT_STS_CMODE_DISABLED 0x0007
55+
#define MV88E6XXX_PORT_STS_CMODE_INVALID 0xff
5556

5657
/* Offset 0x01: MAC (or PCS or Physical) Control Register */
5758
#define MV88E6XXX_PORT_MAC_CTL 0x01

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ static int hw_atl_b0_hw_offload_set(struct aq_hw_s *self,
275275

276276
static int hw_atl_b0_hw_init_tx_path(struct aq_hw_s *self)
277277
{
278+
/* Tx TC/Queue number config */
279+
hw_atl_rpb_tps_tx_tc_mode_set(self, 1U);
280+
278281
hw_atl_thm_lso_tcp_flag_of_first_pkt_set(self, 0x0FF6U);
279282
hw_atl_thm_lso_tcp_flag_of_middle_pkt_set(self, 0x0FF6U);
280283
hw_atl_thm_lso_tcp_flag_of_last_pkt_set(self, 0x0F7FU);

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,15 @@ void hw_atl_tpb_tx_buff_en_set(struct aq_hw_s *aq_hw, u32 tx_buff_en)
12741274
HW_ATL_TPB_TX_BUF_EN_SHIFT, tx_buff_en);
12751275
}
12761276

1277+
void hw_atl_rpb_tps_tx_tc_mode_set(struct aq_hw_s *aq_hw,
1278+
u32 tx_traf_class_mode)
1279+
{
1280+
aq_hw_write_reg_bit(aq_hw, HW_ATL_TPB_TX_TC_MODE_ADDR,
1281+
HW_ATL_TPB_TX_TC_MODE_MSK,
1282+
HW_ATL_TPB_TX_TC_MODE_SHIFT,
1283+
tx_traf_class_mode);
1284+
}
1285+
12771286
void hw_atl_tpb_tx_buff_hi_threshold_per_tc_set(struct aq_hw_s *aq_hw,
12781287
u32 tx_buff_hi_threshold_per_tc,
12791288
u32 buffer)

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ void hw_atl_thm_lso_tcp_flag_of_middle_pkt_set(struct aq_hw_s *aq_hw,
605605

606606
/* tpb */
607607

608+
/* set TX Traffic Class Mode */
609+
void hw_atl_rpb_tps_tx_tc_mode_set(struct aq_hw_s *aq_hw,
610+
u32 tx_traf_class_mode);
611+
608612
/* set tx buffer enable */
609613
void hw_atl_tpb_tx_buff_en_set(struct aq_hw_s *aq_hw, u32 tx_buff_en);
610614

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,19 @@
19481948
/* default value of bitfield tx_buf_en */
19491949
#define HW_ATL_TPB_TX_BUF_EN_DEFAULT 0x0
19501950

1951+
/* register address for bitfield tx_tc_mode */
1952+
#define HW_ATL_TPB_TX_TC_MODE_ADDR 0x00007900
1953+
/* bitmask for bitfield tx_tc_mode */
1954+
#define HW_ATL_TPB_TX_TC_MODE_MSK 0x00000100
1955+
/* inverted bitmask for bitfield tx_tc_mode */
1956+
#define HW_ATL_TPB_TX_TC_MODE_MSKN 0xFFFFFEFF
1957+
/* lower bit position of bitfield tx_tc_mode */
1958+
#define HW_ATL_TPB_TX_TC_MODE_SHIFT 8
1959+
/* width of bitfield tx_tc_mode */
1960+
#define HW_ATL_TPB_TX_TC_MODE_WIDTH 1
1961+
/* default value of bitfield tx_tc_mode */
1962+
#define HW_ATL_TPB_TX_TC_MODE_DEFAULT 0x0
1963+
19511964
/* tx tx{b}_hi_thresh[c:0] bitfield definitions
19521965
* preprocessor definitions for the bitfield "tx{b}_hi_thresh[c:0]".
19531966
* parameter: buffer {b} | stride size 0x10 | range [0, 7]

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,12 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
500500
}
501501

502502
length >>= 9;
503+
if (unlikely(length >= ARRAY_SIZE(bnxt_lhint_arr))) {
504+
dev_warn_ratelimited(&pdev->dev, "Dropped oversize %d bytes TX packet.\n",
505+
skb->len);
506+
i = 0;
507+
goto tx_dma_error;
508+
}
503509
flags |= bnxt_lhint_arr[length];
504510
txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
505511

0 commit comments

Comments
 (0)