Skip to content

Commit 4a873f5

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David S. Miller: 1) Since we do RCU lookups on ipv4 FIB entries, we have to test if the entry is dead before returning it to our caller. 2) openvswitch locking and packet validation fixes from Ansis Atteka, Jesse Gross, and Pravin B Shelar. 3) Fix PM resume locking in IGB driver, from Benjamin Poirier. 4) Fix VLAN header handling in vhost-net and macvtap, from Basil Gor. 5) Revert a bogus network namespace isolation change that was causing regressions on S390 networking devices. 6) If bonding decides to process and handle a LACPDU frame, we shouldn't bump the rx_dropped counter. From Jiri Bohac. 7) Fix mis-calculation of available TX space in r8169 driver when doing TSO, which can lead to crashes and/or hung device. From Julien Ducourthial. 8) SCTP does not validate cached routes properly in all cases, from Nicolas Dichtel. 9) Link status interrupt needs to be handled in ks8851 driver, from Stephen Boyd. 10) Use capable(), not cap_raised(), in connector/userns netlink code. From Eric W. Biederman via Andrew Morton. 11) Fix pktgen OOPS on module unload, from Eric Dumazet. 12) iwlwifi under-estimates SKB truesizes, also from Eric Dumazet. 13) Cure division by zero in SFC driver, from Ben Hutchings. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits) ks8851: Update link status during link change interrupt macvtap: restore vlan header on user read vhost-net: fix handle_rx buffer size bonding: don't increase rx_dropped after processing LACPDUs connector/userns: replace netlink uses of cap_raised() with capable() sctp: check cached dst before using it pktgen: fix crash at module unload Revert "net: maintain namespace isolation between vlan and real device" ehea: fix losing of NEQ events when one event occurred early igb: fix rtnl race in PM resume path ipv4: Do not use dead fib_info entries. r8169: fix unsigned int wraparound with TSO sfc: Fix division by zero when using one RX channel and no SR-IOV openvswitch: Validation of IPv6 set port action uses IPv4 header net: compare_ether_addr[_64bits]() has no ordering cdc_ether: Ignore bogus union descriptor for RNDIS devices bnx2x: bug fix when loading after SAN boot e1000: Silence sparse warnings by correcting type igb, ixgbe: netdev_tx_reset_queue incorrectly called from tx init path openvswitch: Release rtnl_lock if ovs_vport_cmd_build_info() failed. ...
2 parents 2eb4296 + 062e55e commit 4a873f5

File tree

37 files changed

+236
-172
lines changed

37 files changed

+236
-172
lines changed

drivers/block/drbd/drbd_nl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2297,7 +2297,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms
22972297
return;
22982298
}
22992299

2300-
if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) {
2300+
if (!capable(CAP_SYS_ADMIN)) {
23012301
retcode = ERR_PERM;
23022302
goto fail;
23032303
}

drivers/md/dm-log-userspace-transfer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
134134
{
135135
struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1);
136136

137-
if (!cap_raised(current_cap(), CAP_SYS_ADMIN))
137+
if (!capable(CAP_SYS_ADMIN))
138138
return;
139139

140140
spin_lock(&receiving_list_lock);

drivers/net/bonding/bond_3ad.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,9 +2173,10 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
21732173
* received frames (loopback). Since only the payload is given to this
21742174
* function, it check for loopback.
21752175
*/
2176-
static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length)
2176+
static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length)
21772177
{
21782178
struct port *port;
2179+
int ret = RX_HANDLER_ANOTHER;
21792180

21802181
if (length >= sizeof(struct lacpdu)) {
21812182

@@ -2184,11 +2185,12 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
21842185
if (!port->slave) {
21852186
pr_warning("%s: Warning: port of slave %s is uninitialized\n",
21862187
slave->dev->name, slave->dev->master->name);
2187-
return;
2188+
return ret;
21882189
}
21892190

21902191
switch (lacpdu->subtype) {
21912192
case AD_TYPE_LACPDU:
2193+
ret = RX_HANDLER_CONSUMED;
21922194
pr_debug("Received LACPDU on port %d\n",
21932195
port->actor_port_number);
21942196
/* Protect against concurrent state machines */
@@ -2198,6 +2200,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
21982200
break;
21992201

22002202
case AD_TYPE_MARKER:
2203+
ret = RX_HANDLER_CONSUMED;
22012204
// No need to convert fields to Little Endian since we don't use the marker's fields.
22022205

22032206
switch (((struct bond_marker *)lacpdu)->tlv_type) {
@@ -2219,6 +2222,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
22192222
}
22202223
}
22212224
}
2225+
return ret;
22222226
}
22232227

22242228
/**
@@ -2456,18 +2460,20 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
24562460
return NETDEV_TX_OK;
24572461
}
24582462

2459-
void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
2463+
int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
24602464
struct slave *slave)
24612465
{
2466+
int ret = RX_HANDLER_ANOTHER;
24622467
if (skb->protocol != PKT_TYPE_LACPDU)
2463-
return;
2468+
return ret;
24642469

24652470
if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
2466-
return;
2471+
return ret;
24672472

24682473
read_lock(&bond->lock);
2469-
bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
2474+
ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
24702475
read_unlock(&bond->lock);
2476+
return ret;
24712477
}
24722478

24732479
/*

drivers/net/bonding/bond_3ad.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave);
274274
void bond_3ad_handle_link_change(struct slave *slave, char link);
275275
int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
276276
int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
277-
void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
277+
int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
278278
struct slave *slave);
279279
int bond_3ad_set_carrier(struct bonding *bond);
280280
void bond_3ad_update_lacp_rate(struct bonding *bond);

drivers/net/bonding/bond_main.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
14441444
struct sk_buff *skb = *pskb;
14451445
struct slave *slave;
14461446
struct bonding *bond;
1447-
void (*recv_probe)(struct sk_buff *, struct bonding *,
1447+
int (*recv_probe)(struct sk_buff *, struct bonding *,
14481448
struct slave *);
1449+
int ret = RX_HANDLER_ANOTHER;
14491450

14501451
skb = skb_share_check(skb, GFP_ATOMIC);
14511452
if (unlikely(!skb))
@@ -1464,8 +1465,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
14641465
struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
14651466

14661467
if (likely(nskb)) {
1467-
recv_probe(nskb, bond, slave);
1468+
ret = recv_probe(nskb, bond, slave);
14681469
dev_kfree_skb(nskb);
1470+
if (ret == RX_HANDLER_CONSUMED) {
1471+
consume_skb(skb);
1472+
return ret;
1473+
}
14691474
}
14701475
}
14711476

@@ -1487,7 +1492,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
14871492
memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN);
14881493
}
14891494

1490-
return RX_HANDLER_ANOTHER;
1495+
return ret;
14911496
}
14921497

14931498
/* enslave device <slave> to bond device <master> */
@@ -2723,15 +2728,15 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
27232728
}
27242729
}
27252730

2726-
static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2731+
static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
27272732
struct slave *slave)
27282733
{
27292734
struct arphdr *arp;
27302735
unsigned char *arp_ptr;
27312736
__be32 sip, tip;
27322737

27332738
if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
2734-
return;
2739+
return RX_HANDLER_ANOTHER;
27352740

27362741
read_lock(&bond->lock);
27372742

@@ -2776,6 +2781,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
27762781

27772782
out_unlock:
27782783
read_unlock(&bond->lock);
2784+
return RX_HANDLER_ANOTHER;
27792785
}
27802786

27812787
/*

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9122,13 +9122,34 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp)
91229122
return bnx2x_prev_mcp_done(bp);
91239123
}
91249124

9125+
/* previous driver DMAE transaction may have occurred when pre-boot stage ended
9126+
* and boot began, or when kdump kernel was loaded. Either case would invalidate
9127+
* the addresses of the transaction, resulting in was-error bit set in the pci
9128+
* causing all hw-to-host pcie transactions to timeout. If this happened we want
9129+
* to clear the interrupt which detected this from the pglueb and the was done
9130+
* bit
9131+
*/
9132+
static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
9133+
{
9134+
u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
9135+
if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
9136+
BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing");
9137+
REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp));
9138+
}
9139+
}
9140+
91259141
static int __devinit bnx2x_prev_unload(struct bnx2x *bp)
91269142
{
91279143
int time_counter = 10;
91289144
u32 rc, fw, hw_lock_reg, hw_lock_val;
91299145
BNX2X_DEV_INFO("Entering Previous Unload Flow\n");
91309146

9131-
/* Release previously held locks */
9147+
/* clear hw from errors which may have resulted from an interrupted
9148+
* dmae transaction.
9149+
*/
9150+
bnx2x_prev_interrupted_dmae(bp);
9151+
9152+
/* Release previously held locks */
91329153
hw_lock_reg = (BP_FUNC(bp) <= 5) ?
91339154
(MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) :
91349155
(MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8);

drivers/net/ethernet/ibm/ehea/ehea_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3335,6 +3335,8 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
33353335
goto out_shutdown_ports;
33363336
}
33373337

3338+
/* Handle any events that might be pending. */
3339+
tasklet_hi_schedule(&adapter->neq_tasklet);
33383340

33393341
ret = 0;
33403342
goto out;

drivers/net/ethernet/intel/e1000/e1000_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3380,7 +3380,7 @@ static void e1000_dump(struct e1000_adapter *adapter)
33803380
for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
33813381
struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i);
33823382
struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i];
3383-
struct my_u { u64 a; u64 b; };
3383+
struct my_u { __le64 a; __le64 b; };
33843384
struct my_u *u = (struct my_u *)tx_desc;
33853385
const char *type;
33863386

@@ -3424,7 +3424,7 @@ static void e1000_dump(struct e1000_adapter *adapter)
34243424
for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) {
34253425
struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i);
34263426
struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i];
3427-
struct my_u { u64 a; u64 b; };
3427+
struct my_u { __le64 a; __le64 b; };
34283428
struct my_u *u = (struct my_u *)rx_desc;
34293429
const char *type;
34303430

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,9 +1111,12 @@ static int igb_set_interrupt_capability(struct igb_adapter *adapter)
11111111
adapter->flags |= IGB_FLAG_HAS_MSI;
11121112
out:
11131113
/* Notify the stack of the (possibly) reduced queue counts. */
1114+
rtnl_lock();
11141115
netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
1115-
return netif_set_real_num_rx_queues(adapter->netdev,
1116-
adapter->num_rx_queues);
1116+
err = netif_set_real_num_rx_queues(adapter->netdev,
1117+
adapter->num_rx_queues);
1118+
rtnl_unlock();
1119+
return err;
11171120
}
11181121

11191122
/**
@@ -2771,8 +2774,6 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
27712774

27722775
txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
27732776
wr32(E1000_TXDCTL(reg_idx), txdctl);
2774-
2775-
netdev_tx_reset_queue(txring_txq(ring));
27762777
}
27772778

27782779
/**
@@ -3282,6 +3283,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
32823283
igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
32833284
}
32843285

3286+
netdev_tx_reset_queue(txring_txq(tx_ring));
3287+
32853288
size = sizeof(struct igb_tx_buffer) * tx_ring->count;
32863289
memset(tx_ring->tx_buffer_info, 0, size);
32873290

@@ -6796,18 +6799,7 @@ static int igb_resume(struct device *dev)
67966799
pci_enable_wake(pdev, PCI_D3hot, 0);
67976800
pci_enable_wake(pdev, PCI_D3cold, 0);
67986801

6799-
if (!rtnl_is_locked()) {
6800-
/*
6801-
* shut up ASSERT_RTNL() warning in
6802-
* netif_set_real_num_tx/rx_queues.
6803-
*/
6804-
rtnl_lock();
6805-
err = igb_init_interrupt_scheme(adapter);
6806-
rtnl_unlock();
6807-
} else {
6808-
err = igb_init_interrupt_scheme(adapter);
6809-
}
6810-
if (err) {
6802+
if (igb_init_interrupt_scheme(adapter)) {
68116803
dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
68126804
return -ENOMEM;
68136805
}

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,6 @@ extern struct ixgbe_info ixgbe_82599_info;
574574
extern struct ixgbe_info ixgbe_X540_info;
575575
#ifdef CONFIG_IXGBE_DCB
576576
extern const struct dcbnl_rtnl_ops dcbnl_ops;
577-
extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
578-
struct ixgbe_dcb_config *dst_dcb_cfg,
579-
int tc_max);
580577
#endif
581578

582579
extern char ixgbe_driver_name[];

drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,26 @@
4444
#define DCB_NO_HW_CHG 1 /* DCB configuration did not change */
4545
#define DCB_HW_CHG 2 /* DCB configuration changed, no reset */
4646

47-
int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *scfg,
48-
struct ixgbe_dcb_config *dcfg, int tc_max)
47+
static int ixgbe_copy_dcb_cfg(struct ixgbe_adapter *adapter, int tc_max)
4948
{
49+
struct ixgbe_dcb_config *scfg = &adapter->temp_dcb_cfg;
50+
struct ixgbe_dcb_config *dcfg = &adapter->dcb_cfg;
5051
struct tc_configuration *src = NULL;
5152
struct tc_configuration *dst = NULL;
5253
int i, j;
5354
int tx = DCB_TX_CONFIG;
5455
int rx = DCB_RX_CONFIG;
5556
int changes = 0;
57+
#ifdef IXGBE_FCOE
58+
struct dcb_app app = {
59+
.selector = DCB_APP_IDTYPE_ETHTYPE,
60+
.protocol = ETH_P_FCOE,
61+
};
62+
u8 up = dcb_getapp(adapter->netdev, &app);
5663

57-
if (!scfg || !dcfg)
58-
return changes;
64+
if (up && !(up & (1 << adapter->fcoe.up)))
65+
changes |= BIT_APP_UPCHG;
66+
#endif
5967

6068
for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) {
6169
src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0];
@@ -332,28 +340,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
332340
struct ixgbe_adapter *adapter = netdev_priv(netdev);
333341
int ret = DCB_NO_HW_CHG;
334342
int i;
335-
#ifdef IXGBE_FCOE
336-
struct dcb_app app = {
337-
.selector = DCB_APP_IDTYPE_ETHTYPE,
338-
.protocol = ETH_P_FCOE,
339-
};
340-
u8 up;
341-
342-
/* In IEEE mode, use the IEEE Ethertype selector value */
343-
if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) {
344-
app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE;
345-
up = dcb_ieee_getapp_mask(netdev, &app);
346-
} else {
347-
up = dcb_getapp(netdev, &app);
348-
}
349-
#endif
350343

351344
/* Fail command if not in CEE mode */
352345
if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
353346
return ret;
354347

355-
adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg,
356-
&adapter->dcb_cfg,
348+
adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(adapter,
357349
MAX_TRAFFIC_CLASS);
358350
if (!adapter->dcb_set_bitmap)
359351
return ret;
@@ -440,8 +432,13 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
440432
* FCoE is using changes. This happens if the APP info
441433
* changes or the up2tc mapping is updated.
442434
*/
443-
if ((up && !(up & (1 << adapter->fcoe.up))) ||
444-
(adapter->dcb_set_bitmap & BIT_APP_UPCHG)) {
435+
if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
436+
struct dcb_app app = {
437+
.selector = DCB_APP_IDTYPE_ETHTYPE,
438+
.protocol = ETH_P_FCOE,
439+
};
440+
u8 up = dcb_getapp(netdev, &app);
441+
445442
adapter->fcoe.up = ffs(up) - 1;
446443
ixgbe_dcbnl_devreset(netdev);
447444
ret = DCB_HW_CHG_RST;

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,8 @@ static u16 ixgbe_clean_test_rings(struct ixgbe_ring *rx_ring,
17801780
rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc);
17811781
}
17821782

1783+
netdev_tx_reset_queue(txring_txq(tx_ring));
1784+
17831785
/* re-map buffers to ring, store next to clean values */
17841786
ixgbe_alloc_rx_buffers(rx_ring, count);
17851787
rx_ring->next_to_clean = rx_ntc;

0 commit comments

Comments
 (0)