Skip to content

Commit 9eb3591

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2 parents cf29576 + 07f12b2 commit 9eb3591

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
@@ -1163,6 +1163,12 @@ static struct platform_driver gswip_driver = {
11631163

11641164
module_platform_driver(gswip_driver);
11651165

1166+
MODULE_FIRMWARE("lantiq/xrx300_phy11g_a21.bin");
1167+
MODULE_FIRMWARE("lantiq/xrx300_phy22f_a21.bin");
1168+
MODULE_FIRMWARE("lantiq/xrx200_phy11g_a14.bin");
1169+
MODULE_FIRMWARE("lantiq/xrx200_phy11g_a22.bin");
1170+
MODULE_FIRMWARE("lantiq/xrx200_phy22f_a14.bin");
1171+
MODULE_FIRMWARE("lantiq/xrx200_phy22f_a22.bin");
11661172
MODULE_AUTHOR("Hauke Mehrtens <[email protected]>");
11671173
MODULE_DESCRIPTION("Lantiq / Intel GSWIP driver");
11681174
MODULE_LICENSE("GPL v2");

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,
922922
default:
923923
return U64_MAX;
924924
}
925-
value = (((u64)high) << 16) | low;
925+
value = (((u64)high) << 32) | low;
926926
return value;
927927
}
928928

@@ -3118,7 +3118,7 @@ static const struct mv88e6xxx_ops mv88e6161_ops = {
31183118
.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
31193119
.port_link_state = mv88e6352_port_link_state,
31203120
.port_get_cmode = mv88e6185_port_get_cmode,
3121-
.stats_snapshot = mv88e6320_g1_stats_snapshot,
3121+
.stats_snapshot = mv88e6xxx_g1_stats_snapshot,
31223122
.stats_set_histogram = mv88e6095_g1_stats_set_histogram,
31233123
.stats_get_sset_count = mv88e6095_stats_get_sset_count,
31243124
.stats_get_strings = mv88e6095_stats_get_strings,
@@ -4620,6 +4620,14 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip,
46204620
return 0;
46214621
}
46224622

4623+
static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
4624+
{
4625+
int i;
4626+
4627+
for (i = 0; i < mv88e6xxx_num_ports(chip); i++)
4628+
chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID;
4629+
}
4630+
46234631
static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
46244632
int port)
46254633
{
@@ -4656,6 +4664,8 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
46564664
if (err)
46574665
goto free;
46584666

4667+
mv88e6xxx_ports_cmode_init(chip);
4668+
46594669
mutex_lock(&chip->reg_lock);
46604670
err = mv88e6xxx_switch_reset(chip);
46614671
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
@@ -279,6 +279,9 @@ static int hw_atl_b0_hw_offload_set(struct aq_hw_s *self,
279279

280280
static int hw_atl_b0_hw_init_tx_path(struct aq_hw_s *self)
281281
{
282+
/* Tx TC/Queue number config */
283+
hw_atl_rpb_tps_tx_tc_mode_set(self, 1U);
284+
282285
hw_atl_thm_lso_tcp_flag_of_first_pkt_set(self, 0x0FF6U);
283286
hw_atl_thm_lso_tcp_flag_of_middle_pkt_set(self, 0x0FF6U);
284287
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
@@ -504,6 +504,12 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
504504
}
505505

506506
length >>= 9;
507+
if (unlikely(length >= ARRAY_SIZE(bnxt_lhint_arr))) {
508+
dev_warn_ratelimited(&pdev->dev, "Dropped oversize %d bytes TX packet.\n",
509+
skb->len);
510+
i = 0;
511+
goto tx_dma_error;
512+
}
507513
flags |= bnxt_lhint_arr[length];
508514
txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
509515

drivers/net/ethernet/microchip/enc28j60.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,5 +1681,5 @@ MODULE_DESCRIPTION(DRV_NAME " ethernet driver");
16811681
MODULE_AUTHOR("Claudio Lanconelli <[email protected]>");
16821682
MODULE_LICENSE("GPL");
16831683
module_param_named(debug, debug.msg_enable, int, 0);
1684-
MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., ffff=all)");
1684+
MODULE_PARM_DESC(debug, "Debug verbosity level in amount of bits set (0=none, ..., 31=all)");
16851685
MODULE_ALIAS("spi:" DRV_NAME);

drivers/net/ethernet/microchip/lan743x_main.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,8 @@ static int lan743x_tx_frame_start(struct lan743x_tx *tx,
14001400
}
14011401

14021402
static void lan743x_tx_frame_add_lso(struct lan743x_tx *tx,
1403-
unsigned int frame_length)
1403+
unsigned int frame_length,
1404+
int nr_frags)
14041405
{
14051406
/* called only from within lan743x_tx_xmit_frame.
14061407
* assuming tx->ring_lock has already been acquired.
@@ -1410,6 +1411,10 @@ static void lan743x_tx_frame_add_lso(struct lan743x_tx *tx,
14101411

14111412
/* wrap up previous descriptor */
14121413
tx->frame_data0 |= TX_DESC_DATA0_EXT_;
1414+
if (nr_frags <= 0) {
1415+
tx->frame_data0 |= TX_DESC_DATA0_LS_;
1416+
tx->frame_data0 |= TX_DESC_DATA0_IOC_;
1417+
}
14131418
tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail];
14141419
tx_descriptor->data0 = tx->frame_data0;
14151420

@@ -1514,8 +1519,11 @@ static void lan743x_tx_frame_end(struct lan743x_tx *tx,
15141519
u32 tx_tail_flags = 0;
15151520

15161521
/* wrap up previous descriptor */
1517-
tx->frame_data0 |= TX_DESC_DATA0_LS_;
1518-
tx->frame_data0 |= TX_DESC_DATA0_IOC_;
1522+
if ((tx->frame_data0 & TX_DESC_DATA0_DTYPE_MASK_) ==
1523+
TX_DESC_DATA0_DTYPE_DATA_) {
1524+
tx->frame_data0 |= TX_DESC_DATA0_LS_;
1525+
tx->frame_data0 |= TX_DESC_DATA0_IOC_;
1526+
}
15191527

15201528
tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail];
15211529
buffer_info = &tx->buffer_info[tx->frame_tail];
@@ -1600,7 +1608,7 @@ static netdev_tx_t lan743x_tx_xmit_frame(struct lan743x_tx *tx,
16001608
}
16011609

16021610
if (gso)
1603-
lan743x_tx_frame_add_lso(tx, frame_length);
1611+
lan743x_tx_frame_add_lso(tx, frame_length, nr_frags);
16041612

16051613
if (nr_frags <= 0)
16061614
goto finish;

drivers/net/geneve.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,15 +692,20 @@ static int geneve_sock_add(struct geneve_dev *geneve, bool ipv6)
692692
static int geneve_open(struct net_device *dev)
693693
{
694694
struct geneve_dev *geneve = netdev_priv(dev);
695-
bool ipv6 = !!(geneve->info.mode & IP_TUNNEL_INFO_IPV6);
696695
bool metadata = geneve->collect_md;
696+
bool ipv4, ipv6;
697697
int ret = 0;
698698

699+
ipv6 = geneve->info.mode & IP_TUNNEL_INFO_IPV6 || metadata;
700+
ipv4 = !ipv6 || metadata;
699701
#if IS_ENABLED(CONFIG_IPV6)
700-
if (ipv6 || metadata)
702+
if (ipv6) {
701703
ret = geneve_sock_add(geneve, true);
704+
if (ret < 0 && ret != -EAFNOSUPPORT)
705+
ipv4 = false;
706+
}
702707
#endif
703-
if (!ret && (!ipv6 || metadata))
708+
if (ipv4)
704709
ret = geneve_sock_add(geneve, false);
705710
if (ret < 0)
706711
geneve_sock_release(geneve);

drivers/net/hyperv/netvsc_drv.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,14 @@ void netvsc_linkstatus_callback(struct net_device *net,
744744
schedule_delayed_work(&ndev_ctx->dwork, 0);
745745
}
746746

747+
static void netvsc_comp_ipcsum(struct sk_buff *skb)
748+
{
749+
struct iphdr *iph = (struct iphdr *)skb->data;
750+
751+
iph->check = 0;
752+
iph->check = ip_fast_csum(iph, iph->ihl);
753+
}
754+
747755
static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
748756
struct netvsc_channel *nvchan)
749757
{
@@ -770,9 +778,17 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
770778
/* skb is already created with CHECKSUM_NONE */
771779
skb_checksum_none_assert(skb);
772780

773-
/*
774-
* In Linux, the IP checksum is always checked.
775-
* Do L4 checksum offload if enabled and present.
781+
/* Incoming packets may have IP header checksum verified by the host.
782+
* They may not have IP header checksum computed after coalescing.
783+
* We compute it here if the flags are set, because on Linux, the IP
784+
* checksum is always checked.
785+
*/
786+
if (csum_info && csum_info->receive.ip_checksum_value_invalid &&
787+
csum_info->receive.ip_checksum_succeeded &&
788+
skb->protocol == htons(ETH_P_IP))
789+
netvsc_comp_ipcsum(skb);
790+
791+
/* Do L4 checksum offload if enabled and present.
776792
*/
777793
if (csum_info && (net->features & NETIF_F_RXCSUM)) {
778794
if (csum_info->receive.tcp_checksum_succeeded ||

drivers/net/phy/dp83867.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/module.h>
1212
#include <linux/of.h>
1313
#include <linux/phy.h>
14+
#include <linux/delay.h>
1415

1516
#include <dt-bindings/net/ti-dp83867.h>
1617

@@ -304,6 +305,8 @@ static int dp83867_phy_reset(struct phy_device *phydev)
304305
if (err < 0)
305306
return err;
306307

308+
usleep_range(10, 20);
309+
307310
return dp83867_config_init(phydev);
308311
}
309312

drivers/net/phy/micrel.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ static int ksz8041_config_aneg(struct phy_device *phydev)
340340
return genphy_config_aneg(phydev);
341341
}
342342

343+
static int ksz8061_config_init(struct phy_device *phydev)
344+
{
345+
int ret;
346+
347+
ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_DEVID1, 0xB61A);
348+
if (ret)
349+
return ret;
350+
351+
return kszphy_config_init(phydev);
352+
}
353+
343354
static int ksz9021_load_values_from_of(struct phy_device *phydev,
344355
const struct device_node *of_node,
345356
u16 reg,
@@ -1015,7 +1026,7 @@ static struct phy_driver ksphy_driver[] = {
10151026
.name = "Micrel KSZ8061",
10161027
.phy_id_mask = MICREL_PHY_ID_MASK,
10171028
.features = PHY_BASIC_FEATURES,
1018-
.config_init = kszphy_config_init,
1029+
.config_init = ksz8061_config_init,
10191030
.ack_interrupt = kszphy_ack_interrupt,
10201031
.config_intr = kszphy_config_intr,
10211032
.suspend = genphy_suspend,

drivers/net/phy/phylink.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ static int phylink_get_mac_state(struct phylink *pl, struct phylink_link_state *
324324
linkmode_zero(state->lp_advertising);
325325
state->interface = pl->link_config.interface;
326326
state->an_enabled = pl->link_config.an_enabled;
327+
state->speed = SPEED_UNKNOWN;
328+
state->duplex = DUPLEX_UNKNOWN;
329+
state->pause = MLO_PAUSE_NONE;
330+
state->an_complete = 0;
327331
state->link = 1;
328332

329333
return pl->ops->mac_link_state(ndev, state);

drivers/net/tun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,9 +2167,9 @@ static void *tun_ring_recv(struct tun_file *tfile, int noblock, int *err)
21672167
}
21682168

21692169
add_wait_queue(&tfile->wq.wait, &wait);
2170-
current->state = TASK_INTERRUPTIBLE;
21712170

21722171
while (1) {
2172+
set_current_state(TASK_INTERRUPTIBLE);
21732173
ptr = ptr_ring_consume(&tfile->tx_ring);
21742174
if (ptr)
21752175
break;
@@ -2185,7 +2185,7 @@ static void *tun_ring_recv(struct tun_file *tfile, int noblock, int *err)
21852185
schedule();
21862186
}
21872187

2188-
current->state = TASK_RUNNING;
2188+
__set_current_state(TASK_RUNNING);
21892189
remove_wait_queue(&tfile->wq.wait, &wait);
21902190

21912191
out:

drivers/net/xen-netback/hash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ void xenvif_init_hash(struct xenvif *vif)
454454
if (xenvif_hash_cache_size == 0)
455455
return;
456456

457+
BUG_ON(vif->hash.cache.count);
458+
457459
spin_lock_init(&vif->hash.cache.lock);
458460
INIT_LIST_HEAD(&vif->hash.cache.list);
459461
}

drivers/net/xen-netback/interface.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ static u16 xenvif_select_queue(struct net_device *dev, struct sk_buff *skb,
153153
{
154154
struct xenvif *vif = netdev_priv(dev);
155155
unsigned int size = vif->hash.size;
156+
unsigned int num_queues;
157+
158+
/* If queues are not set up internally - always return 0
159+
* as the packet going to be dropped anyway */
160+
num_queues = READ_ONCE(vif->num_queues);
161+
if (num_queues < 1)
162+
return 0;
156163

157164
if (vif->hash.alg == XEN_NETIF_CTRL_HASH_ALGORITHM_NONE)
158165
return fallback(dev, skb, NULL) % dev->real_num_tx_queues;

0 commit comments

Comments
 (0)