Skip to content

Commit c8d17b4

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix uninitialized struct station_info in cfg80211_wireless_stats(), from Johannes Berg. 2) Revert commit attempt to fix ipv6 protocol resubmission, it adds regressions. 3) Endless loops can be created in bridge port lists, fix from Nikolay Aleksandrov. 4) Don't WARN_ON() if sk->sk_forward_alloc is non-zero in sk_clear_memalloc, it is a legal situation during swap deactivation. Fix from Mel Gorman. 5) Fix order of disabling interrupts and unlocking NAPI in enic driver to avoid a race. From Govindarajulu Varadarajan. 6) High and low register writes are swapped when programming the start of periodic output in igb driver. From Richard Cochran. 7) Fix device rename handling in mpls stack, from Robert Shearman. 8) Do not trigger compaction synchronously when optimistically trying to allocate an order 3 page in alloc_skb_with_frags() and skb_page_frag_refill(). From Shaohua Li. 9) Authentication with COOKIE_ECHO is not handled properly in SCTP, fix from Marcelo Ricardo Leitner. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: Doc: networking: Fix URL for wiki.wireshark.org in udplite.txt sctp: allow authenticating DATA chunks that are bundled with COOKIE_ECHO net: don't wait for order-3 page allocation mpls: handle device renames for per-device sysctls net: igb: fix the start time for periodic output signals enic: fix memory leak in rq_clean enic: check return value for stat dump enic: unlock napi busy poll before unmasking intr net, swap: Remove a warning and clarify why sk_mem_reclaim is required when deactivating swap bridge: fix multicast router rlist endless loop tipc: disconnect socket directly after probe failure Revert "ipv6: Fix protocol resubmission" cfg80211: wext: clear sinfo struct before calling driver
2 parents b85dfd3 + b07d496 commit c8d17b4

File tree

13 files changed

+80
-38
lines changed

13 files changed

+80
-38
lines changed

Documentation/networking/udplite.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
files/UDP-Lite-HOWTO.txt
2121

2222
o The Wireshark UDP-Lite WiKi (with capture files):
23-
http://wiki.wireshark.org/Lightweight_User_Datagram_Protocol
23+
https://wiki.wireshark.org/Lightweight_User_Datagram_Protocol
2424

2525
o The Protocol Spec, RFC 3828, http://www.ietf.org/rfc/rfc3828.txt
2626

drivers/net/ethernet/cisco/enic/enic_ethtool.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,15 @@ static void enic_get_drvinfo(struct net_device *netdev,
131131
{
132132
struct enic *enic = netdev_priv(netdev);
133133
struct vnic_devcmd_fw_info *fw_info;
134+
int err;
134135

135-
enic_dev_fw_info(enic, &fw_info);
136+
err = enic_dev_fw_info(enic, &fw_info);
137+
/* return only when pci_zalloc_consistent fails in vnic_dev_fw_info
138+
* For other failures, like devcmd failure, we return previously
139+
* recorded info.
140+
*/
141+
if (err == -ENOMEM)
142+
return;
136143

137144
strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
138145
strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version));
@@ -181,8 +188,15 @@ static void enic_get_ethtool_stats(struct net_device *netdev,
181188
struct enic *enic = netdev_priv(netdev);
182189
struct vnic_stats *vstats;
183190
unsigned int i;
184-
185-
enic_dev_stats_dump(enic, &vstats);
191+
int err;
192+
193+
err = enic_dev_stats_dump(enic, &vstats);
194+
/* return only when pci_zalloc_consistent fails in vnic_dev_stats_dump
195+
* For other failures, like devcmd failure, we return previously
196+
* recorded stats.
197+
*/
198+
if (err == -ENOMEM)
199+
return;
186200

187201
for (i = 0; i < enic_n_tx_stats; i++)
188202
*(data++) = ((u64 *)&vstats->tx)[enic_tx_stats[i].index];

drivers/net/ethernet/cisco/enic/enic_main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,15 @@ static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev,
615615
{
616616
struct enic *enic = netdev_priv(netdev);
617617
struct vnic_stats *stats;
618+
int err;
618619

619-
enic_dev_stats_dump(enic, &stats);
620+
err = enic_dev_stats_dump(enic, &stats);
621+
/* return only when pci_zalloc_consistent fails in vnic_dev_stats_dump
622+
* For other failures, like devcmd failure, we return previously
623+
* recorded stats.
624+
*/
625+
if (err == -ENOMEM)
626+
return net_stats;
620627

621628
net_stats->tx_packets = stats->tx.tx_frames_ok;
622629
net_stats->tx_bytes = stats->tx.tx_bytes_ok;
@@ -1407,6 +1414,7 @@ static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
14071414
*/
14081415
enic_calc_int_moderation(enic, &enic->rq[rq]);
14091416

1417+
enic_poll_unlock_napi(&enic->rq[rq]);
14101418
if (work_done < work_to_do) {
14111419

14121420
/* Some work done, but not enough to stay in polling,
@@ -1418,7 +1426,6 @@ static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
14181426
enic_set_int_moderation(enic, &enic->rq[rq]);
14191427
vnic_intr_unmask(&enic->intr[intr]);
14201428
}
1421-
enic_poll_unlock_napi(&enic->rq[rq]);
14221429

14231430
return work_done;
14241431
}

drivers/net/ethernet/cisco/enic/vnic_rq.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,15 @@ void vnic_rq_clean(struct vnic_rq *rq,
188188
struct vnic_rq_buf *buf;
189189
u32 fetch_index;
190190
unsigned int count = rq->ring.desc_count;
191+
int i;
191192

192193
buf = rq->to_clean;
193194

194-
while (vnic_rq_desc_used(rq) > 0) {
195-
195+
for (i = 0; i < rq->ring.desc_count; i++) {
196196
(*buf_clean)(rq, buf);
197-
198-
buf = rq->to_clean = buf->next;
199-
rq->ring.desc_avail++;
197+
buf = buf->next;
200198
}
199+
rq->ring.desc_avail = rq->ring.desc_count - 1;
201200

202201
/* Use current fetch_index as the ring starting point */
203202
fetch_index = ioread32(&rq->ctrl->fetch_index);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
538538
igb->perout[i].start.tv_nsec = rq->perout.start.nsec;
539539
igb->perout[i].period.tv_sec = ts.tv_sec;
540540
igb->perout[i].period.tv_nsec = ts.tv_nsec;
541-
wr32(trgttiml, rq->perout.start.sec);
542-
wr32(trgttimh, rq->perout.start.nsec);
541+
wr32(trgttimh, rq->perout.start.sec);
542+
wr32(trgttiml, rq->perout.start.nsec);
543543
tsauxc |= tsauxc_mask;
544544
tsim |= tsim_mask;
545545
} else {

net/bridge/br_multicast.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,9 @@ static void br_multicast_add_router(struct net_bridge *br,
11671167
struct net_bridge_port *p;
11681168
struct hlist_node *slot = NULL;
11691169

1170+
if (!hlist_unhashed(&port->rlist))
1171+
return;
1172+
11701173
hlist_for_each_entry(p, &br->router_list, rlist) {
11711174
if ((unsigned long) port >= (unsigned long) p)
11721175
break;
@@ -1194,12 +1197,8 @@ static void br_multicast_mark_router(struct net_bridge *br,
11941197
if (port->multicast_router != 1)
11951198
return;
11961199

1197-
if (!hlist_unhashed(&port->rlist))
1198-
goto timer;
1199-
12001200
br_multicast_add_router(br, port);
12011201

1202-
timer:
12031202
mod_timer(&port->multicast_router_timer,
12041203
now + br->multicast_querier_interval);
12051204
}

net/core/skbuff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4398,7 +4398,7 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len,
43984398

43994399
while (order) {
44004400
if (npages >= 1 << order) {
4401-
page = alloc_pages(gfp_mask |
4401+
page = alloc_pages((gfp_mask & ~__GFP_WAIT) |
44024402
__GFP_COMP |
44034403
__GFP_NOWARN |
44044404
__GFP_NORETRY,

net/core/sock.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,12 @@ void sk_clear_memalloc(struct sock *sk)
354354

355355
/*
356356
* SOCK_MEMALLOC is allowed to ignore rmem limits to ensure forward
357-
* progress of swapping. However, if SOCK_MEMALLOC is cleared while
358-
* it has rmem allocations there is a risk that the user of the
359-
* socket cannot make forward progress due to exceeding the rmem
360-
* limits. By rights, sk_clear_memalloc() should only be called
361-
* on sockets being torn down but warn and reset the accounting if
362-
* that assumption breaks.
357+
* progress of swapping. SOCK_MEMALLOC may be cleared while
358+
* it has rmem allocations due to the last swapfile being deactivated
359+
* but there is a risk that the socket is unusable due to exceeding
360+
* the rmem limits. Reclaim the reserves and obey rmem limits again.
363361
*/
364-
if (WARN_ON(sk->sk_forward_alloc))
365-
sk_mem_reclaim(sk);
362+
sk_mem_reclaim(sk);
366363
}
367364
EXPORT_SYMBOL_GPL(sk_clear_memalloc);
368365

@@ -1883,7 +1880,7 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t gfp)
18831880

18841881
pfrag->offset = 0;
18851882
if (SKB_FRAG_PAGE_ORDER) {
1886-
pfrag->page = alloc_pages(gfp | __GFP_COMP |
1883+
pfrag->page = alloc_pages((gfp & ~__GFP_WAIT) | __GFP_COMP |
18871884
__GFP_NOWARN | __GFP_NORETRY,
18881885
SKB_FRAG_PAGE_ORDER);
18891886
if (likely(pfrag->page)) {

net/ipv6/ip6_input.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ static int ip6_input_finish(struct sock *sk, struct sk_buff *skb)
212212
*/
213213

214214
rcu_read_lock();
215+
resubmit:
215216
idev = ip6_dst_idev(skb_dst(skb));
216217
if (!pskb_pull(skb, skb_transport_offset(skb)))
217218
goto discard;
218219
nhoff = IP6CB(skb)->nhoff;
219220
nexthdr = skb_network_header(skb)[nhoff];
220221

221-
resubmit:
222222
raw = raw6_local_deliver(skb, nexthdr);
223223
ipprot = rcu_dereference(inet6_protos[nexthdr]);
224224
if (ipprot) {
@@ -246,12 +246,10 @@ static int ip6_input_finish(struct sock *sk, struct sk_buff *skb)
246246
goto discard;
247247

248248
ret = ipprot->handler(skb);
249-
if (ret < 0) {
250-
nexthdr = -ret;
249+
if (ret > 0)
251250
goto resubmit;
252-
} else if (ret == 0) {
251+
else if (ret == 0)
253252
IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INDELIVERS);
254-
}
255253
} else {
256254
if (!raw) {
257255
if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {

net/mpls/af_mpls.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,17 @@ static int mpls_dev_notify(struct notifier_block *this, unsigned long event,
564564
case NETDEV_UNREGISTER:
565565
mpls_ifdown(dev);
566566
break;
567+
case NETDEV_CHANGENAME:
568+
mdev = mpls_dev_get(dev);
569+
if (mdev) {
570+
int err;
571+
572+
mpls_dev_sysctl_unregister(mdev);
573+
err = mpls_dev_sysctl_register(dev, mdev);
574+
if (err)
575+
return notifier_from_errno(err);
576+
}
577+
break;
567578
}
568579
return NOTIFY_OK;
569580
}

net/sctp/auth.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,14 @@ int sctp_auth_asoc_copy_shkeys(const struct sctp_endpoint *ep,
381381
}
382382

383383

384-
/* Public interface to creat the association shared key.
384+
/* Public interface to create the association shared key.
385385
* See code above for the algorithm.
386386
*/
387387
int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp)
388388
{
389389
struct sctp_auth_bytes *secret;
390390
struct sctp_shared_key *ep_key;
391+
struct sctp_chunk *chunk;
391392

392393
/* If we don't support AUTH, or peer is not capable
393394
* we don't need to do anything.
@@ -410,6 +411,14 @@ int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp)
410411
sctp_auth_key_put(asoc->asoc_shared_key);
411412
asoc->asoc_shared_key = secret;
412413

414+
/* Update send queue in case any chunk already in there now
415+
* needs authenticating
416+
*/
417+
list_for_each_entry(chunk, &asoc->outqueue.out_chunk_list, list) {
418+
if (sctp_auth_send_cid(chunk->chunk_hdr->type, asoc))
419+
chunk->auth = 1;
420+
}
421+
413422
return 0;
414423
}
415424

net/tipc/socket.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,11 +2142,17 @@ static void tipc_sk_timeout(unsigned long data)
21422142
peer_node = tsk_peer_node(tsk);
21432143

21442144
if (tsk->probing_state == TIPC_CONN_PROBING) {
2145-
/* Previous probe not answered -> self abort */
2146-
skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE,
2147-
TIPC_CONN_MSG, SHORT_H_SIZE, 0,
2148-
own_node, peer_node, tsk->portid,
2149-
peer_port, TIPC_ERR_NO_PORT);
2145+
if (!sock_owned_by_user(sk)) {
2146+
sk->sk_socket->state = SS_DISCONNECTING;
2147+
tsk->connected = 0;
2148+
tipc_node_remove_conn(sock_net(sk), tsk_peer_node(tsk),
2149+
tsk_peer_port(tsk));
2150+
sk->sk_state_change(sk);
2151+
} else {
2152+
/* Try again later */
2153+
sk_reset_timer(sk, &sk->sk_timer, (HZ / 20));
2154+
}
2155+
21502156
} else {
21512157
skb = tipc_msg_create(CONN_MANAGER, CONN_PROBE,
21522158
INT_H_SIZE, 0, peer_node, own_node,

net/wireless/wext-compat.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,8 @@ static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
13331333
memcpy(bssid, wdev->current_bss->pub.bssid, ETH_ALEN);
13341334
wdev_unlock(wdev);
13351335

1336+
memset(&sinfo, 0, sizeof(sinfo));
1337+
13361338
if (rdev_get_station(rdev, dev, bssid, &sinfo))
13371339
return NULL;
13381340

0 commit comments

Comments
 (0)