Skip to content

Commit 2dd68cc

Browse files
committed
Merge gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net
Dave writes: "Networking fixes: 1) Fix multiqueue handling of coalesce timer in stmmac, from Jose Abreu. 2) Fix memory corruption in NFC, from Suren Baghdasaryan. 3) Don't write reserved bits in ravb driver, from Kazuya Mizuguchi. 4) SMC bug fixes from Karsten Graul, YueHaibing, and Ursula Braun. 5) Fix TX done race in mvpp2, from Antoine Tenart. 6) ipv6 metrics leak, from Wei Wang. 7) Adjust firmware version requirements in mlxsw, from Petr Machata. 8) Fix autonegotiation on resume in r8169, from Heiner Kallweit. 9) Fixed missing entries when dumping /proc/net/if_inet6, from Jeff Barnhill. 10) Fix double free in devlink, from Dan Carpenter. 11) Fix ethtool regression from UFO feature removal, from Maciej Żenczykowski. 12) Fix drivers that have a ndo_poll_controller() that captures the cpu entirely on loaded hosts by trying to drain all rx and tx queues, from Eric Dumazet. 13) Fix memory corruption with jumbo frames in aquantia driver, from Friedemann Gerold." * gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net: (79 commits) net: mvneta: fix the remaining Rx descriptor unmapping issues ip_tunnel: be careful when accessing the inner header mpls: allow routes on ip6gre devices net: aquantia: memory corruption on jumbo frames tun: remove ndo_poll_controller nfp: remove ndo_poll_controller bnxt: remove ndo_poll_controller bnx2x: remove ndo_poll_controller mlx5: remove ndo_poll_controller mlx4: remove ndo_poll_controller i40evf: remove ndo_poll_controller ice: remove ndo_poll_controller igb: remove ndo_poll_controller ixgb: remove ndo_poll_controller fm10k: remove ndo_poll_controller ixgbevf: remove ndo_poll_controller ixgbe: remove ndo_poll_controller bonding: use netpoll_poll_dev() helper netpoll: make ndo_poll_controller() optional rds: Fix build regression. ...
2 parents 02214bf + f4a5187 commit 2dd68cc

Some content is hidden

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

89 files changed

+621
-653
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -971,16 +971,13 @@ static void bond_poll_controller(struct net_device *bond_dev)
971971
struct slave *slave = NULL;
972972
struct list_head *iter;
973973
struct ad_info ad_info;
974-
struct netpoll_info *ni;
975-
const struct net_device_ops *ops;
976974

977975
if (BOND_MODE(bond) == BOND_MODE_8023AD)
978976
if (bond_3ad_get_active_agg_info(bond, &ad_info))
979977
return;
980978

981979
bond_for_each_slave_rcu(bond, slave, iter) {
982-
ops = slave->dev->netdev_ops;
983-
if (!bond_slave_is_up(slave) || !ops->ndo_poll_controller)
980+
if (!bond_slave_is_up(slave))
984981
continue;
985982

986983
if (BOND_MODE(bond) == BOND_MODE_8023AD) {
@@ -992,11 +989,7 @@ static void bond_poll_controller(struct net_device *bond_dev)
992989
continue;
993990
}
994991

995-
ni = rcu_dereference_bh(slave->dev->npinfo);
996-
if (down_trylock(&ni->dev_lock))
997-
continue;
998-
ops->ndo_poll_controller(slave->dev);
999-
up(&ni->dev_lock);
992+
netpoll_poll_dev(slave->dev);
1000993
}
1001994
}
1002995

drivers/net/ethernet/apple/bmac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static irqreturn_t bmac_txdma_intr(int irq, void *dev_id);
154154
static irqreturn_t bmac_rxdma_intr(int irq, void *dev_id);
155155
static void bmac_set_timeout(struct net_device *dev);
156156
static void bmac_tx_timeout(struct timer_list *t);
157-
static int bmac_output(struct sk_buff *skb, struct net_device *dev);
157+
static netdev_tx_t bmac_output(struct sk_buff *skb, struct net_device *dev);
158158
static void bmac_start(struct net_device *dev);
159159

160160
#define DBDMA_SET(x) ( ((x) | (x) << 16) )
@@ -1456,7 +1456,7 @@ bmac_start(struct net_device *dev)
14561456
spin_unlock_irqrestore(&bp->lock, flags);
14571457
}
14581458

1459-
static int
1459+
static netdev_tx_t
14601460
bmac_output(struct sk_buff *skb, struct net_device *dev)
14611461
{
14621462
struct bmac_data *bp = netdev_priv(dev);

drivers/net/ethernet/apple/mace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct mace_data {
7878

7979
static int mace_open(struct net_device *dev);
8080
static int mace_close(struct net_device *dev);
81-
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev);
81+
static netdev_tx_t mace_xmit_start(struct sk_buff *skb, struct net_device *dev);
8282
static void mace_set_multicast(struct net_device *dev);
8383
static void mace_reset(struct net_device *dev);
8484
static int mace_set_address(struct net_device *dev, void *addr);
@@ -525,7 +525,7 @@ static inline void mace_set_timeout(struct net_device *dev)
525525
mp->timeout_active = 1;
526526
}
527527

528-
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
528+
static netdev_tx_t mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
529529
{
530530
struct mace_data *mp = netdev_priv(dev);
531531
volatile struct dbdma_regs __iomem *td = mp->tx_dma;

drivers/net/ethernet/apple/macmace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct mace_frame {
8989

9090
static int mace_open(struct net_device *dev);
9191
static int mace_close(struct net_device *dev);
92-
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev);
92+
static netdev_tx_t mace_xmit_start(struct sk_buff *skb, struct net_device *dev);
9393
static void mace_set_multicast(struct net_device *dev);
9494
static int mace_set_address(struct net_device *dev, void *addr);
9595
static void mace_reset(struct net_device *dev);
@@ -444,7 +444,7 @@ static int mace_close(struct net_device *dev)
444444
* Transmit a frame
445445
*/
446446

447-
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
447+
static netdev_tx_t mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
448448
{
449449
struct mace_data *mp = netdev_priv(dev);
450450
unsigned long flags;

drivers/net/ethernet/aquantia/atlantic/aq_ring.c

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,10 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
225225
}
226226

227227
/* for single fragment packets use build_skb() */
228-
if (buff->is_eop) {
228+
if (buff->is_eop &&
229+
buff->len <= AQ_CFG_RX_FRAME_MAX - AQ_SKB_ALIGN) {
229230
skb = build_skb(page_address(buff->page),
230-
buff->len + AQ_SKB_ALIGN);
231+
AQ_CFG_RX_FRAME_MAX);
231232
if (unlikely(!skb)) {
232233
err = -ENOMEM;
233234
goto err_exit;
@@ -247,18 +248,21 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
247248
buff->len - ETH_HLEN,
248249
SKB_TRUESIZE(buff->len - ETH_HLEN));
249250

250-
for (i = 1U, next_ = buff->next,
251-
buff_ = &self->buff_ring[next_]; true;
252-
next_ = buff_->next,
253-
buff_ = &self->buff_ring[next_], ++i) {
254-
skb_add_rx_frag(skb, i, buff_->page, 0,
255-
buff_->len,
256-
SKB_TRUESIZE(buff->len -
257-
ETH_HLEN));
258-
buff_->is_cleaned = 1;
259-
260-
if (buff_->is_eop)
261-
break;
251+
if (!buff->is_eop) {
252+
for (i = 1U, next_ = buff->next,
253+
buff_ = &self->buff_ring[next_];
254+
true; next_ = buff_->next,
255+
buff_ = &self->buff_ring[next_], ++i) {
256+
skb_add_rx_frag(skb, i,
257+
buff_->page, 0,
258+
buff_->len,
259+
SKB_TRUESIZE(buff->len -
260+
ETH_HLEN));
261+
buff_->is_cleaned = 1;
262+
263+
if (buff_->is_eop)
264+
break;
265+
}
262266
}
263267
}
264268

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12894,19 +12894,6 @@ static int bnx2x_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1289412894
}
1289512895
}
1289612896

12897-
#ifdef CONFIG_NET_POLL_CONTROLLER
12898-
static void poll_bnx2x(struct net_device *dev)
12899-
{
12900-
struct bnx2x *bp = netdev_priv(dev);
12901-
int i;
12902-
12903-
for_each_eth_queue(bp, i) {
12904-
struct bnx2x_fastpath *fp = &bp->fp[i];
12905-
napi_schedule(&bnx2x_fp(bp, fp->index, napi));
12906-
}
12907-
}
12908-
#endif
12909-
1291012897
static int bnx2x_validate_addr(struct net_device *dev)
1291112898
{
1291212899
struct bnx2x *bp = netdev_priv(dev);
@@ -13113,9 +13100,6 @@ static const struct net_device_ops bnx2x_netdev_ops = {
1311313100
.ndo_tx_timeout = bnx2x_tx_timeout,
1311413101
.ndo_vlan_rx_add_vid = bnx2x_vlan_rx_add_vid,
1311513102
.ndo_vlan_rx_kill_vid = bnx2x_vlan_rx_kill_vid,
13116-
#ifdef CONFIG_NET_POLL_CONTROLLER
13117-
.ndo_poll_controller = poll_bnx2x,
13118-
#endif
1311913103
.ndo_setup_tc = __bnx2x_setup_tc,
1312013104
#ifdef CONFIG_BNX2X_SRIOV
1312113105
.ndo_set_vf_mac = bnx2x_set_vf_mac,

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7672,21 +7672,6 @@ static void bnxt_tx_timeout(struct net_device *dev)
76727672
bnxt_queue_sp_work(bp);
76737673
}
76747674

7675-
#ifdef CONFIG_NET_POLL_CONTROLLER
7676-
static void bnxt_poll_controller(struct net_device *dev)
7677-
{
7678-
struct bnxt *bp = netdev_priv(dev);
7679-
int i;
7680-
7681-
/* Only process tx rings/combined rings in netpoll mode. */
7682-
for (i = 0; i < bp->tx_nr_rings; i++) {
7683-
struct bnxt_tx_ring_info *txr = &bp->tx_ring[i];
7684-
7685-
napi_schedule(&txr->bnapi->napi);
7686-
}
7687-
}
7688-
#endif
7689-
76907675
static void bnxt_timer(struct timer_list *t)
76917676
{
76927677
struct bnxt *bp = from_timer(bp, t, timer);
@@ -8519,9 +8504,6 @@ static const struct net_device_ops bnxt_netdev_ops = {
85198504
.ndo_set_vf_link_state = bnxt_set_vf_link_state,
85208505
.ndo_set_vf_spoofchk = bnxt_set_vf_spoofchk,
85218506
.ndo_set_vf_trust = bnxt_set_vf_trust,
8522-
#endif
8523-
#ifdef CONFIG_NET_POLL_CONTROLLER
8524-
.ndo_poll_controller = bnxt_poll_controller,
85258507
#endif
85268508
.ndo_setup_tc = bnxt_setup_tc,
85278509
#ifdef CONFIG_RFS_ACCEL

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
4646
}
4747
}
4848

49+
if (i == ARRAY_SIZE(nvm_params))
50+
return -EOPNOTSUPP;
51+
4952
if (nvm_param.dir_type == BNXT_NVM_PORT_CFG)
5053
idx = bp->pf.port_id;
5154
else if (nvm_param.dir_type == BNXT_NVM_FUNC_CFG)

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,23 @@ static int bnxt_tc_parse_redir(struct bnxt *bp,
7575
return 0;
7676
}
7777

78-
static void bnxt_tc_parse_vlan(struct bnxt *bp,
79-
struct bnxt_tc_actions *actions,
80-
const struct tc_action *tc_act)
78+
static int bnxt_tc_parse_vlan(struct bnxt *bp,
79+
struct bnxt_tc_actions *actions,
80+
const struct tc_action *tc_act)
8181
{
82-
if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_POP) {
82+
switch (tcf_vlan_action(tc_act)) {
83+
case TCA_VLAN_ACT_POP:
8384
actions->flags |= BNXT_TC_ACTION_FLAG_POP_VLAN;
84-
} else if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_PUSH) {
85+
break;
86+
case TCA_VLAN_ACT_PUSH:
8587
actions->flags |= BNXT_TC_ACTION_FLAG_PUSH_VLAN;
8688
actions->push_vlan_tci = htons(tcf_vlan_push_vid(tc_act));
8789
actions->push_vlan_tpid = tcf_vlan_push_proto(tc_act);
90+
break;
91+
default:
92+
return -EOPNOTSUPP;
8893
}
94+
return 0;
8995
}
9096

9197
static int bnxt_tc_parse_tunnel_set(struct bnxt *bp,
@@ -134,7 +140,9 @@ static int bnxt_tc_parse_actions(struct bnxt *bp,
134140

135141
/* Push/pop VLAN */
136142
if (is_tcf_vlan(tc_act)) {
137-
bnxt_tc_parse_vlan(bp, actions, tc_act);
143+
rc = bnxt_tc_parse_vlan(bp, actions, tc_act);
144+
if (rc)
145+
return rc;
138146
continue;
139147
}
140148

drivers/net/ethernet/cirrus/ep93xx_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static int ep93xx_poll(struct napi_struct *napi, int budget)
332332
return rx;
333333
}
334334

335-
static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev)
335+
static netdev_tx_t ep93xx_xmit(struct sk_buff *skb, struct net_device *dev)
336336
{
337337
struct ep93xx_priv *ep = netdev_priv(dev);
338338
struct ep93xx_tdesc *txd;

drivers/net/ethernet/cirrus/mac89x0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct net_local {
113113

114114
/* Index to functions, as function prototypes. */
115115
static int net_open(struct net_device *dev);
116-
static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
116+
static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev);
117117
static irqreturn_t net_interrupt(int irq, void *dev_id);
118118
static void set_multicast_list(struct net_device *dev);
119119
static void net_rx(struct net_device *dev);
@@ -324,7 +324,7 @@ net_open(struct net_device *dev)
324324
return 0;
325325
}
326326

327-
static int
327+
static netdev_tx_t
328328
net_send_packet(struct sk_buff *skb, struct net_device *dev)
329329
{
330330
struct net_local *lp = netdev_priv(dev);

drivers/net/ethernet/i825xx/ether1.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ static unsigned int net_debug = NET_DEBUG;
6464
#define RX_AREA_END 0x0fc00
6565

6666
static int ether1_open(struct net_device *dev);
67-
static int ether1_sendpacket(struct sk_buff *skb, struct net_device *dev);
67+
static netdev_tx_t ether1_sendpacket(struct sk_buff *skb,
68+
struct net_device *dev);
6869
static irqreturn_t ether1_interrupt(int irq, void *dev_id);
6970
static int ether1_close(struct net_device *dev);
7071
static void ether1_setmulticastlist(struct net_device *dev);
@@ -667,7 +668,7 @@ ether1_timeout(struct net_device *dev)
667668
netif_wake_queue(dev);
668669
}
669670

670-
static int
671+
static netdev_tx_t
671672
ether1_sendpacket (struct sk_buff *skb, struct net_device *dev)
672673
{
673674
int tmp, tst, nopaddr, txaddr, tbdaddr, dataddr;

drivers/net/ethernet/i825xx/lib82596.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static const char init_setup[] =
347347
0x7f /* *multi IA */ };
348348

349349
static int i596_open(struct net_device *dev);
350-
static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev);
350+
static netdev_tx_t i596_start_xmit(struct sk_buff *skb, struct net_device *dev);
351351
static irqreturn_t i596_interrupt(int irq, void *dev_id);
352352
static int i596_close(struct net_device *dev);
353353
static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd);
@@ -966,7 +966,7 @@ static void i596_tx_timeout (struct net_device *dev)
966966
}
967967

968968

969-
static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
969+
static netdev_tx_t i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
970970
{
971971
struct i596_private *lp = netdev_priv(dev);
972972
struct tx_cmd *tx_cmd;

drivers/net/ethernet/i825xx/sun3_82586.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ static int sun3_82586_probe1(struct net_device *dev,int ioaddr);
121121
static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id);
122122
static int sun3_82586_open(struct net_device *dev);
123123
static int sun3_82586_close(struct net_device *dev);
124-
static int sun3_82586_send_packet(struct sk_buff *,struct net_device *);
124+
static netdev_tx_t sun3_82586_send_packet(struct sk_buff *,
125+
struct net_device *);
125126
static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev);
126127
static void set_multicast_list(struct net_device *dev);
127128
static void sun3_82586_timeout(struct net_device *dev);
@@ -1002,7 +1003,8 @@ static void sun3_82586_timeout(struct net_device *dev)
10021003
* send frame
10031004
*/
10041005

1005-
static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
1006+
static netdev_tx_t
1007+
sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
10061008
{
10071009
int len,i;
10081010
#ifndef NO_NOPCOMMANDS

drivers/net/ethernet/ibm/emac/core.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,12 +2677,17 @@ static int emac_init_phy(struct emac_instance *dev)
26772677
if (of_phy_is_fixed_link(np)) {
26782678
int res = emac_dt_mdio_probe(dev);
26792679

2680-
if (!res) {
2681-
res = of_phy_register_fixed_link(np);
2682-
if (res)
2683-
mdiobus_unregister(dev->mii_bus);
2680+
if (res)
2681+
return res;
2682+
2683+
res = of_phy_register_fixed_link(np);
2684+
dev->phy_dev = of_phy_find_device(np);
2685+
if (res || !dev->phy_dev) {
2686+
mdiobus_unregister(dev->mii_bus);
2687+
return res ? res : -EINVAL;
26842688
}
2685-
return res;
2689+
emac_adjust_link(dev->ndev);
2690+
put_device(&dev->phy_dev->mdio.dev);
26862691
}
26872692
return 0;
26882693
}

drivers/net/ethernet/intel/fm10k/fm10k.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,6 @@ void fm10k_update_stats(struct fm10k_intfc *interface);
504504
void fm10k_service_event_schedule(struct fm10k_intfc *interface);
505505
void fm10k_macvlan_schedule(struct fm10k_intfc *interface);
506506
void fm10k_update_rx_drop_en(struct fm10k_intfc *interface);
507-
#ifdef CONFIG_NET_POLL_CONTROLLER
508-
void fm10k_netpoll(struct net_device *netdev);
509-
#endif
510507

511508
/* Netdev */
512509
struct net_device *fm10k_alloc_netdev(const struct fm10k_info *info);

drivers/net/ethernet/intel/fm10k/fm10k_netdev.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,9 +1648,6 @@ static const struct net_device_ops fm10k_netdev_ops = {
16481648
.ndo_udp_tunnel_del = fm10k_udp_tunnel_del,
16491649
.ndo_dfwd_add_station = fm10k_dfwd_add_station,
16501650
.ndo_dfwd_del_station = fm10k_dfwd_del_station,
1651-
#ifdef CONFIG_NET_POLL_CONTROLLER
1652-
.ndo_poll_controller = fm10k_netpoll,
1653-
#endif
16541651
.ndo_features_check = fm10k_features_check,
16551652
};
16561653

drivers/net/ethernet/intel/fm10k/fm10k_pci.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,28 +1210,6 @@ static irqreturn_t fm10k_msix_mbx_vf(int __always_unused irq, void *data)
12101210
return IRQ_HANDLED;
12111211
}
12121212

1213-
#ifdef CONFIG_NET_POLL_CONTROLLER
1214-
/**
1215-
* fm10k_netpoll - A Polling 'interrupt' handler
1216-
* @netdev: network interface device structure
1217-
*
1218-
* This is used by netconsole to send skbs without having to re-enable
1219-
* interrupts. It's not called while the normal interrupt routine is executing.
1220-
**/
1221-
void fm10k_netpoll(struct net_device *netdev)
1222-
{
1223-
struct fm10k_intfc *interface = netdev_priv(netdev);
1224-
int i;
1225-
1226-
/* if interface is down do nothing */
1227-
if (test_bit(__FM10K_DOWN, interface->state))
1228-
return;
1229-
1230-
for (i = 0; i < interface->num_q_vectors; i++)
1231-
fm10k_msix_clean_rings(0, interface->q_vector[i]);
1232-
}
1233-
1234-
#endif
12351213
#define FM10K_ERR_MSG(type) case (type): error = #type; break
12361214
static void fm10k_handle_fault(struct fm10k_intfc *interface, int type,
12371215
struct fm10k_fault *fault)

0 commit comments

Comments
 (0)