Skip to content

Commit f887c21

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Mostly small bits scattered all over the place, which is usually how things go this late in the -rc series. 1) Proper driver init device resets in bnx2, from Baoquan He. 2) Fix accounting overflow in __tcp_retransmit_skb(), sk_forward_alloc, and ip_idents_reserve, from Eric Dumazet. 3) Fix crash in bna driver ethtool stats handling, from Ivan Vecera. 4) Missing check of skb_linearize() return value in mac80211, from Johannes Berg. 5) Endianness fix in nf_table_trace dumps, from Liping Zhang. 6) SSN comparison fix in SCTP, from Marcelo Ricardo Leitner. 7) Update DSA and b44 MAINTAINERS entries. 8) Make input path of vti6 driver work again, from Nicolas Dichtel. 9) Off-by-one in mlx4, from Sebastian Ott. 10) Fix fallback route lookup handling in ipv6, from Vincent Bernat. 11) Fix stack corruption on probe in qed driver, from Yuval Mintz. 12) PHY init fixes in r8152 from Hayes Wang. 13) Missing SKB free in irda_accept error path, from Phil Turnbull" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (61 commits) tcp: properly account Fast Open SYN-ACK retrans tcp: fix under-accounting retransmit SNMP counters MAINTAINERS: Update b44 maintainer. net: get rid of an signed integer overflow in ip_idents_reserve() net/mlx4_core: Fix to clean devlink resources net: can: ifi: Configure transmitter delay vti6: fix input path ipmr, ip6mr: return lastuse relative to now r8152: disable ALDPS and EEE before setting PHY r8152: remove r8153_enable_eee r8152: move PHY settings to hw_phy_cfg r8152: move enabling PHY r8152: move some functions cxgb4/cxgb4vf: Allocate more queues for 25G and 100G adapter qed: Fix stack corruption on probe MAINTAINERS: Add an entry for the core network DSA code net: ipv6: fallback to full lookup if table lookup is unsuitable net/mlx5: E-Switch, Handle mode change failures net/mlx5: E-Switch, Fix error flow in the SRIOV e-switch init code net/mlx5: Fix flow counter bulk command out mailbox allocation ...
2 parents 7d1e042 + 7e32b44 commit f887c21

Some content is hidden

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

65 files changed

+658
-343
lines changed

MAINTAINERS

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2501,7 +2501,7 @@ S: Supported
25012501
F: kernel/bpf/
25022502

25032503
BROADCOM B44 10/100 ETHERNET DRIVER
2504-
M: Gary Zambrano <zambrano@broadcom.com>
2504+
M: Michael Chan <michael.chan@broadcom.com>
25052505
25062506
S: Supported
25072507
F: drivers/net/ethernet/broadcom/b44.*
@@ -8161,6 +8161,15 @@ S: Maintained
81618161
W: https://fedorahosted.org/dropwatch/
81628162
F: net/core/drop_monitor.c
81638163

8164+
NETWORKING [DSA]
8165+
M: Andrew Lunn <[email protected]>
8166+
M: Vivien Didelot <[email protected]>
8167+
M: Florian Fainelli <[email protected]>
8168+
S: Maintained
8169+
F: net/dsa/
8170+
F: include/net/dsa.h
8171+
F: drivers/net/dsa/
8172+
81648173
NETWORKING [GENERAL]
81658174
M: "David S. Miller" <[email protected]>
81668175

drivers/net/can/flexcan.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,11 +1268,10 @@ static int __maybe_unused flexcan_suspend(struct device *device)
12681268
struct flexcan_priv *priv = netdev_priv(dev);
12691269
int err;
12701270

1271-
err = flexcan_chip_disable(priv);
1272-
if (err)
1273-
return err;
1274-
12751271
if (netif_running(dev)) {
1272+
err = flexcan_chip_disable(priv);
1273+
if (err)
1274+
return err;
12761275
netif_stop_queue(dev);
12771276
netif_device_detach(dev);
12781277
}
@@ -1285,13 +1284,17 @@ static int __maybe_unused flexcan_resume(struct device *device)
12851284
{
12861285
struct net_device *dev = dev_get_drvdata(device);
12871286
struct flexcan_priv *priv = netdev_priv(dev);
1287+
int err;
12881288

12891289
priv->can.state = CAN_STATE_ERROR_ACTIVE;
12901290
if (netif_running(dev)) {
12911291
netif_device_attach(dev);
12921292
netif_start_queue(dev);
1293+
err = flexcan_chip_enable(priv);
1294+
if (err)
1295+
return err;
12931296
}
1294-
return flexcan_chip_enable(priv);
1297+
return 0;
12951298
}
12961299

12971300
static SIMPLE_DEV_PM_OPS(flexcan_pm_ops, flexcan_suspend, flexcan_resume);

drivers/net/can/ifi_canfd/ifi_canfd.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
#define IFI_CANFD_TIME_SET_TIMEA_4_12_6_6 BIT(15)
8282

8383
#define IFI_CANFD_TDELAY 0x1c
84+
#define IFI_CANFD_TDELAY_DEFAULT 0xb
85+
#define IFI_CANFD_TDELAY_MASK 0x3fff
86+
#define IFI_CANFD_TDELAY_ABS BIT(14)
87+
#define IFI_CANFD_TDELAY_EN BIT(15)
8488

8589
#define IFI_CANFD_ERROR 0x20
8690
#define IFI_CANFD_ERROR_TX_OFFSET 0
@@ -641,7 +645,7 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev)
641645
struct ifi_canfd_priv *priv = netdev_priv(ndev);
642646
const struct can_bittiming *bt = &priv->can.bittiming;
643647
const struct can_bittiming *dbt = &priv->can.data_bittiming;
644-
u16 brp, sjw, tseg1, tseg2;
648+
u16 brp, sjw, tseg1, tseg2, tdc;
645649

646650
/* Configure bit timing */
647651
brp = bt->brp - 2;
@@ -664,6 +668,11 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev)
664668
(brp << IFI_CANFD_TIME_PRESCALE_OFF) |
665669
(sjw << IFI_CANFD_TIME_SJW_OFF_7_9_8_8),
666670
priv->base + IFI_CANFD_FTIME);
671+
672+
/* Configure transmitter delay */
673+
tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK;
674+
writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc,
675+
priv->base + IFI_CANFD_TDELAY);
667676
}
668677

669678
static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id,

drivers/net/ethernet/broadcom/bnx2.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6356,10 +6356,6 @@ bnx2_open(struct net_device *dev)
63566356
struct bnx2 *bp = netdev_priv(dev);
63576357
int rc;
63586358

6359-
rc = bnx2_request_firmware(bp);
6360-
if (rc < 0)
6361-
goto out;
6362-
63636359
netif_carrier_off(dev);
63646360

63656361
bnx2_disable_int(bp);
@@ -6428,7 +6424,6 @@ bnx2_open(struct net_device *dev)
64286424
bnx2_free_irq(bp);
64296425
bnx2_free_mem(bp);
64306426
bnx2_del_napi(bp);
6431-
bnx2_release_firmware(bp);
64326427
goto out;
64336428
}
64346429

@@ -8575,6 +8570,12 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
85758570

85768571
pci_set_drvdata(pdev, dev);
85778572

8573+
rc = bnx2_request_firmware(bp);
8574+
if (rc < 0)
8575+
goto error;
8576+
8577+
8578+
bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
85788579
memcpy(dev->dev_addr, bp->mac_addr, ETH_ALEN);
85798580

85808581
dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
@@ -8607,6 +8608,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
86078608
return 0;
86088609

86098610
error:
8611+
bnx2_release_firmware(bp);
86108612
pci_iounmap(pdev, bp->regview);
86118613
pci_release_regions(pdev);
86128614
pci_disable_device(pdev);

drivers/net/ethernet/brocade/bna/bnad_ethtool.c

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,10 @@
3131
#define BNAD_NUM_TXF_COUNTERS 12
3232
#define BNAD_NUM_RXF_COUNTERS 10
3333
#define BNAD_NUM_CQ_COUNTERS (3 + 5)
34-
#define BNAD_NUM_RXQ_COUNTERS 6
34+
#define BNAD_NUM_RXQ_COUNTERS 7
3535
#define BNAD_NUM_TXQ_COUNTERS 5
3636

37-
#define BNAD_ETHTOOL_STATS_NUM \
38-
(sizeof(struct rtnl_link_stats64) / sizeof(u64) + \
39-
sizeof(struct bnad_drv_stats) / sizeof(u64) + \
40-
offsetof(struct bfi_enet_stats, rxf_stats[0]) / sizeof(u64))
41-
42-
static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = {
37+
static const char *bnad_net_stats_strings[] = {
4338
"rx_packets",
4439
"tx_packets",
4540
"rx_bytes",
@@ -50,22 +45,10 @@ static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = {
5045
"tx_dropped",
5146
"multicast",
5247
"collisions",
53-
5448
"rx_length_errors",
55-
"rx_over_errors",
5649
"rx_crc_errors",
5750
"rx_frame_errors",
58-
"rx_fifo_errors",
59-
"rx_missed_errors",
60-
61-
"tx_aborted_errors",
62-
"tx_carrier_errors",
6351
"tx_fifo_errors",
64-
"tx_heartbeat_errors",
65-
"tx_window_errors",
66-
67-
"rx_compressed",
68-
"tx_compressed",
6952

7053
"netif_queue_stop",
7154
"netif_queue_wakeup",
@@ -254,6 +237,8 @@ static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = {
254237
"fc_tx_fid_parity_errors",
255238
};
256239

240+
#define BNAD_ETHTOOL_STATS_NUM ARRAY_SIZE(bnad_net_stats_strings)
241+
257242
static int
258243
bnad_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
259244
{
@@ -658,6 +643,8 @@ bnad_get_strings(struct net_device *netdev, u32 stringset, u8 *string)
658643
string += ETH_GSTRING_LEN;
659644
sprintf(string, "rxq%d_allocbuf_failed", q_num);
660645
string += ETH_GSTRING_LEN;
646+
sprintf(string, "rxq%d_mapbuf_failed", q_num);
647+
string += ETH_GSTRING_LEN;
661648
sprintf(string, "rxq%d_producer_index", q_num);
662649
string += ETH_GSTRING_LEN;
663650
sprintf(string, "rxq%d_consumer_index", q_num);
@@ -678,6 +665,9 @@ bnad_get_strings(struct net_device *netdev, u32 stringset, u8 *string)
678665
sprintf(string, "rxq%d_allocbuf_failed",
679666
q_num);
680667
string += ETH_GSTRING_LEN;
668+
sprintf(string, "rxq%d_mapbuf_failed",
669+
q_num);
670+
string += ETH_GSTRING_LEN;
681671
sprintf(string, "rxq%d_producer_index",
682672
q_num);
683673
string += ETH_GSTRING_LEN;
@@ -854,9 +844,9 @@ bnad_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats,
854844
u64 *buf)
855845
{
856846
struct bnad *bnad = netdev_priv(netdev);
857-
int i, j, bi;
847+
int i, j, bi = 0;
858848
unsigned long flags;
859-
struct rtnl_link_stats64 *net_stats64;
849+
struct rtnl_link_stats64 net_stats64;
860850
u64 *stats64;
861851
u32 bmap;
862852

@@ -871,14 +861,25 @@ bnad_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats,
871861
* under the same lock
872862
*/
873863
spin_lock_irqsave(&bnad->bna_lock, flags);
874-
bi = 0;
875-
memset(buf, 0, stats->n_stats * sizeof(u64));
876-
877-
net_stats64 = (struct rtnl_link_stats64 *)buf;
878-
bnad_netdev_qstats_fill(bnad, net_stats64);
879-
bnad_netdev_hwstats_fill(bnad, net_stats64);
880864

881-
bi = sizeof(*net_stats64) / sizeof(u64);
865+
memset(&net_stats64, 0, sizeof(net_stats64));
866+
bnad_netdev_qstats_fill(bnad, &net_stats64);
867+
bnad_netdev_hwstats_fill(bnad, &net_stats64);
868+
869+
buf[bi++] = net_stats64.rx_packets;
870+
buf[bi++] = net_stats64.tx_packets;
871+
buf[bi++] = net_stats64.rx_bytes;
872+
buf[bi++] = net_stats64.tx_bytes;
873+
buf[bi++] = net_stats64.rx_errors;
874+
buf[bi++] = net_stats64.tx_errors;
875+
buf[bi++] = net_stats64.rx_dropped;
876+
buf[bi++] = net_stats64.tx_dropped;
877+
buf[bi++] = net_stats64.multicast;
878+
buf[bi++] = net_stats64.collisions;
879+
buf[bi++] = net_stats64.rx_length_errors;
880+
buf[bi++] = net_stats64.rx_crc_errors;
881+
buf[bi++] = net_stats64.rx_frame_errors;
882+
buf[bi++] = net_stats64.tx_fifo_errors;
882883

883884
/* Get netif_queue_stopped from stack */
884885
bnad->stats.drv_stats.netif_queue_stopped = netif_queue_stopped(netdev);

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ struct link_config {
419419
unsigned short supported; /* link capabilities */
420420
unsigned short advertising; /* advertised capabilities */
421421
unsigned short lp_advertising; /* peer advertised capabilities */
422-
unsigned short requested_speed; /* speed user has requested */
423-
unsigned short speed; /* actual link speed */
422+
unsigned int requested_speed; /* speed user has requested */
423+
unsigned int speed; /* actual link speed */
424424
unsigned char requested_fc; /* flow control user has requested */
425425
unsigned char fc; /* actual link flow control */
426426
unsigned char autoneg; /* autonegotiating? */

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4305,10 +4305,17 @@ static const struct pci_error_handlers cxgb4_eeh = {
43054305
.resume = eeh_resume,
43064306
};
43074307

4308+
/* Return true if the Link Configuration supports "High Speeds" (those greater
4309+
* than 1Gb/s).
4310+
*/
43084311
static inline bool is_x_10g_port(const struct link_config *lc)
43094312
{
4310-
return (lc->supported & FW_PORT_CAP_SPEED_10G) != 0 ||
4311-
(lc->supported & FW_PORT_CAP_SPEED_40G) != 0;
4313+
unsigned int speeds, high_speeds;
4314+
4315+
speeds = FW_PORT_CAP_SPEED_V(FW_PORT_CAP_SPEED_G(lc->supported));
4316+
high_speeds = speeds & ~(FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G);
4317+
4318+
return high_speeds != 0;
43124319
}
43134320

43144321
static inline void init_rspq(struct adapter *adap, struct sge_rspq *q,
@@ -4756,8 +4763,12 @@ static void print_port_info(const struct net_device *dev)
47564763
bufp += sprintf(bufp, "1000/");
47574764
if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G)
47584765
bufp += sprintf(bufp, "10G/");
4766+
if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G)
4767+
bufp += sprintf(bufp, "25G/");
47594768
if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G)
47604769
bufp += sprintf(bufp, "40G/");
4770+
if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G)
4771+
bufp += sprintf(bufp, "100G/");
47614772
if (bufp != buf)
47624773
--bufp;
47634774
sprintf(bufp, "BASE-%s", t4_get_port_type_description(pi->port_type));

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,8 @@ void t4_ulprx_read_la(struct adapter *adap, u32 *la_buf)
36273627
}
36283628

36293629
#define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\
3630-
FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \
3630+
FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_25G | \
3631+
FW_PORT_CAP_SPEED_40G | FW_PORT_CAP_SPEED_100G | \
36313632
FW_PORT_CAP_ANEG)
36323633

36333634
/**
@@ -7196,8 +7197,12 @@ void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl)
71967197
speed = 1000;
71977198
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_10G))
71987199
speed = 10000;
7200+
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_25G))
7201+
speed = 25000;
71997202
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_40G))
72007203
speed = 40000;
7204+
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_100G))
7205+
speed = 100000;
72017206

72027207
lc = &pi->link_cfg;
72037208

drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,12 @@ enum fw_port_cap {
22652265
FW_PORT_CAP_802_3_ASM_DIR = 0x8000,
22662266
};
22672267

2268+
#define FW_PORT_CAP_SPEED_S 0
2269+
#define FW_PORT_CAP_SPEED_M 0x3f
2270+
#define FW_PORT_CAP_SPEED_V(x) ((x) << FW_PORT_CAP_SPEED_S)
2271+
#define FW_PORT_CAP_SPEED_G(x) \
2272+
(((x) >> FW_PORT_CAP_SPEED_S) & FW_PORT_CAP_SPEED_M)
2273+
22682274
enum fw_port_mdi {
22692275
FW_PORT_CAP_MDI_UNCHANGED,
22702276
FW_PORT_CAP_MDI_AUTO,

drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ struct link_config {
108108
unsigned int supported; /* link capabilities */
109109
unsigned int advertising; /* advertised capabilities */
110110
unsigned short lp_advertising; /* peer advertised capabilities */
111-
unsigned short requested_speed; /* speed user has requested */
112-
unsigned short speed; /* actual link speed */
111+
unsigned int requested_speed; /* speed user has requested */
112+
unsigned int speed; /* actual link speed */
113113
unsigned char requested_fc; /* flow control user has requested */
114114
unsigned char fc; /* actual link flow control */
115115
unsigned char autoneg; /* autonegotiating? */
@@ -271,10 +271,17 @@ static inline bool is_10g_port(const struct link_config *lc)
271271
return (lc->supported & FW_PORT_CAP_SPEED_10G) != 0;
272272
}
273273

274+
/* Return true if the Link Configuration supports "High Speeds" (those greater
275+
* than 1Gb/s).
276+
*/
274277
static inline bool is_x_10g_port(const struct link_config *lc)
275278
{
276-
return (lc->supported & FW_PORT_CAP_SPEED_10G) != 0 ||
277-
(lc->supported & FW_PORT_CAP_SPEED_40G) != 0;
279+
unsigned int speeds, high_speeds;
280+
281+
speeds = FW_PORT_CAP_SPEED_V(FW_PORT_CAP_SPEED_G(lc->supported));
282+
high_speeds = speeds & ~(FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G);
283+
284+
return high_speeds != 0;
278285
}
279286

280287
static inline unsigned int core_ticks_per_usec(const struct adapter *adapter)

drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
314314
}
315315

316316
#define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\
317-
FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \
318-
FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG)
317+
FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_25G | \
318+
FW_PORT_CAP_SPEED_40G | FW_PORT_CAP_SPEED_100G | \
319+
FW_PORT_CAP_ANEG)
319320

320321
/**
321322
* init_link_config - initialize a link's SW state
@@ -1712,8 +1713,12 @@ int t4vf_handle_fw_rpl(struct adapter *adapter, const __be64 *rpl)
17121713
speed = 1000;
17131714
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_10G))
17141715
speed = 10000;
1716+
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_25G))
1717+
speed = 25000;
17151718
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_40G))
17161719
speed = 40000;
1720+
else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_100G))
1721+
speed = 100000;
17171722

17181723
/*
17191724
* Scan all of our "ports" (Virtual Interfaces) looking for

0 commit comments

Comments
 (0)