Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
net: Add a flow_cache_flush_deferred function
ipv4: reintroduce route cache garbage collector
net: have ipconfig not wait if no dev is available
sctp: Do not account for sizeof(struct sk_buff) in estimated rwnd
asix: new device id
davinci-cpdma: fix locking issue in cpdma_chan_stop
sctp: fix incorrect overflow check on autoclose
r8169: fix Config2 MSIEnable bit setting.
llc: llc_cmsg_rcv was getting called after sk_eat_skb.
net: bpf_jit: fix an off-one bug in x86_64 cond jump target
iwlwifi: update SCD BC table for all SCD queues
Revert "Bluetooth: Revert: Fix L2CAP connection establishment"
Bluetooth: Clear RFCOMM session timer when disconnecting last channel
Bluetooth: Prevent uninitialized data access in L2CAP configuration
iwlwifi: allow to switch to HT40 if not associated
iwlwifi: tx_sync only on PAN context
mwifiex: avoid double list_del in command cancel path
ath9k: fix max phy rate at rate control init
nfc: signedness bug in __nci_request()
iwlwifi: do not set the sequence control bit is not needed

+220 -47
+2 -2
arch/x86/net/bpf_jit_comp.c
··· 568 568 break; 569 569 } 570 570 if (filter[i].jt != 0) { 571 - if (filter[i].jf) 572 - t_offset += is_near(f_offset) ? 2 : 6; 571 + if (filter[i].jf && f_offset) 572 + t_offset += is_near(f_offset) ? 2 : 5; 573 573 EMIT_COND_JMP(t_op, t_offset); 574 574 if (filter[i].jf) 575 575 EMIT_JMP(f_offset);
+8 -6
drivers/net/ethernet/realtek/r8169.c
··· 477 477 /* Config1 register p.24 */ 478 478 LEDS1 = (1 << 7), 479 479 LEDS0 = (1 << 6), 480 - MSIEnable = (1 << 5), /* Enable Message Signaled Interrupt */ 481 480 Speed_down = (1 << 4), 482 481 MEMMAP = (1 << 3), 483 482 IOMAP = (1 << 2), ··· 484 485 PMEnable = (1 << 0), /* Power Management Enable */ 485 486 486 487 /* Config2 register p. 25 */ 488 + MSIEnable = (1 << 5), /* 8169 only. Reserved in the 8168. */ 487 489 PCI_Clock_66MHz = 0x01, 488 490 PCI_Clock_33MHz = 0x00, 489 491 ··· 3426 3426 }; 3427 3427 3428 3428 /* Cfg9346_Unlock assumed. */ 3429 - static unsigned rtl_try_msi(struct pci_dev *pdev, void __iomem *ioaddr, 3429 + static unsigned rtl_try_msi(struct rtl8169_private *tp, 3430 3430 const struct rtl_cfg_info *cfg) 3431 3431 { 3432 + void __iomem *ioaddr = tp->mmio_addr; 3432 3433 unsigned msi = 0; 3433 3434 u8 cfg2; 3434 3435 3435 3436 cfg2 = RTL_R8(Config2) & ~MSIEnable; 3436 3437 if (cfg->features & RTL_FEATURE_MSI) { 3437 - if (pci_enable_msi(pdev)) { 3438 - dev_info(&pdev->dev, "no MSI. Back to INTx.\n"); 3438 + if (pci_enable_msi(tp->pci_dev)) { 3439 + netif_info(tp, hw, tp->dev, "no MSI. Back to INTx.\n"); 3439 3440 } else { 3440 3441 cfg2 |= MSIEnable; 3441 3442 msi = RTL_FEATURE_MSI; 3442 3443 } 3443 3444 } 3444 - RTL_W8(Config2, cfg2); 3445 + if (tp->mac_version <= RTL_GIGA_MAC_VER_06) 3446 + RTL_W8(Config2, cfg2); 3445 3447 return msi; 3446 3448 } 3447 3449 ··· 4079 4077 tp->features |= RTL_FEATURE_WOL; 4080 4078 if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0) 4081 4079 tp->features |= RTL_FEATURE_WOL; 4082 - tp->features |= rtl_try_msi(pdev, ioaddr, cfg); 4080 + tp->features |= rtl_try_msi(tp, cfg); 4083 4081 RTL_W8(Cfg9346, Cfg9346_Lock); 4084 4082 4085 4083 if (rtl_tbi_enabled(tp)) {
+2
drivers/net/ethernet/ti/davinci_cpdma.c
··· 836 836 chan_write(chan, cp, CPDMA_TEARDOWN_VALUE); 837 837 838 838 /* handle completed packets */ 839 + spin_unlock_irqrestore(&chan->lock, flags); 839 840 do { 840 841 ret = __cpdma_chan_process(chan); 841 842 if (ret < 0) 842 843 break; 843 844 } while ((ret & CPDMA_DESC_TD_COMPLETE) == 0); 845 + spin_lock_irqsave(&chan->lock, flags); 844 846 845 847 /* remaining packets haven't been tx/rx'ed, clean them up */ 846 848 while (chan->head) {
+4
drivers/net/usb/asix.c
··· 1655 1655 // ASIX 88772a 1656 1656 USB_DEVICE(0x0db0, 0xa877), 1657 1657 .driver_info = (unsigned long) &ax88772_info, 1658 + }, { 1659 + // Asus USB Ethernet Adapter 1660 + USB_DEVICE (0x0b95, 0x7e2b), 1661 + .driver_info = (unsigned long) &ax88772_info, 1658 1662 }, 1659 1663 { }, // END 1660 1664 };
+3 -1
drivers/net/wireless/ath/ath9k/rc.c
··· 1271 1271 1272 1272 ath_rc_priv->max_valid_rate = k; 1273 1273 ath_rc_sort_validrates(rate_table, ath_rc_priv); 1274 - ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4]; 1274 + ath_rc_priv->rate_max_phy = (k > 4) ? 1275 + ath_rc_priv->valid_rate_index[k-4] : 1276 + ath_rc_priv->valid_rate_index[k-1]; 1275 1277 ath_rc_priv->rate_table = rate_table; 1276 1278 1277 1279 ath_dbg(common, ATH_DBG_CONFIG,
+2 -2
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
··· 606 606 if (ctx->ht.enabled) { 607 607 /* if HT40 is used, it should not change 608 608 * after associated except channel switch */ 609 - if (iwl_is_associated_ctx(ctx) && 610 - !ctx->ht.is_40mhz) 609 + if (!ctx->ht.is_40mhz || 610 + !iwl_is_associated_ctx(ctx)) 611 611 iwlagn_config_ht40(conf, ctx); 612 612 } else 613 613 ctx->ht.is_40mhz = false;
+4 -1
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
··· 91 91 tx_cmd->tid_tspec = qc[0] & 0xf; 92 92 tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK; 93 93 } else { 94 - tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 94 + if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) 95 + tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 96 + else 97 + tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK; 95 98 } 96 99 97 100 iwlagn_tx_cmd_protection(priv, info, fc, &tx_flags);
+6
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 2850 2850 int ret; 2851 2851 u8 sta_id; 2852 2852 2853 + if (ctx->ctxid != IWL_RXON_CTX_PAN) 2854 + return 0; 2855 + 2853 2856 IWL_DEBUG_MAC80211(priv, "enter\n"); 2854 2857 mutex_lock(&priv->shrd->mutex); 2855 2858 ··· 2900 2897 struct iwl_priv *priv = hw->priv; 2901 2898 struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; 2902 2899 struct iwl_rxon_context *ctx = vif_priv->ctx; 2900 + 2901 + if (ctx->ctxid != IWL_RXON_CTX_PAN) 2902 + return; 2903 2903 2904 2904 IWL_DEBUG_MAC80211(priv, "enter\n"); 2905 2905 mutex_lock(&priv->shrd->mutex);
+1 -3
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
··· 1197 1197 iwl_print_hex_dump(trans, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); 1198 1198 1199 1199 /* Set up entry for this TFD in Tx byte-count array */ 1200 - if (is_agg) 1201 - iwl_trans_txq_update_byte_cnt_tbl(trans, txq, 1202 - le16_to_cpu(tx_cmd->len)); 1200 + iwl_trans_txq_update_byte_cnt_tbl(trans, txq, le16_to_cpu(tx_cmd->len)); 1203 1201 1204 1202 dma_sync_single_for_device(bus(trans)->dev, txcmd_phys, firstlen, 1205 1203 DMA_BIDIRECTIONAL);
+2 -7
drivers/net/wireless/mwifiex/cmdevt.c
··· 939 939 { 940 940 struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL; 941 941 unsigned long cmd_flags; 942 - unsigned long cmd_pending_q_flags; 943 942 unsigned long scan_pending_q_flags; 944 943 uint16_t cancel_scan_cmd = false; 945 944 ··· 948 949 cmd_node = adapter->curr_cmd; 949 950 cmd_node->wait_q_enabled = false; 950 951 cmd_node->cmd_flag |= CMD_F_CANCELED; 951 - spin_lock_irqsave(&adapter->cmd_pending_q_lock, 952 - cmd_pending_q_flags); 953 - list_del(&cmd_node->list); 954 - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, 955 - cmd_pending_q_flags); 956 952 mwifiex_insert_cmd_to_free_q(adapter, cmd_node); 953 + mwifiex_complete_cmd(adapter, adapter->curr_cmd); 954 + adapter->curr_cmd = NULL; 957 955 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); 958 956 } 959 957 ··· 977 981 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); 978 982 } 979 983 adapter->cmd_wait_q.status = -1; 980 - mwifiex_complete_cmd(adapter, adapter->curr_cmd); 981 984 } 982 985 983 986 /*
+1
include/net/flow.h
··· 207 207 u8 dir, flow_resolve_t resolver, void *ctx); 208 208 209 209 extern void flow_cache_flush(void); 210 + extern void flow_cache_flush_deferred(void); 210 211 extern atomic_t flow_cache_genid; 211 212 212 213 #endif
+4
include/net/sctp/structs.h
··· 241 241 * bits is an indicator of when to send and window update SACK. 242 242 */ 243 243 int rwnd_update_shift; 244 + 245 + /* Threshold for autoclose timeout, in seconds. */ 246 + unsigned long max_autoclose; 244 247 } sctp_globals; 245 248 246 249 #define sctp_rto_initial (sctp_globals.rto_initial) ··· 284 281 #define sctp_auth_enable (sctp_globals.auth_enable) 285 282 #define sctp_checksum_disable (sctp_globals.checksum_disable) 286 283 #define sctp_rwnd_upd_shift (sctp_globals.rwnd_update_shift) 284 + #define sctp_max_autoclose (sctp_globals.max_autoclose) 287 285 288 286 /* SCTP Socket type: UDP or TCP style. */ 289 287 typedef enum {
+1 -1
net/bluetooth/hci_conn.c
··· 673 673 goto encrypt; 674 674 675 675 auth: 676 - if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 676 + if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 677 677 return 0; 678 678 679 679 if (!hci_conn_auth(conn, sec_level, auth_type))
+11 -1
net/bluetooth/l2cap_core.c
··· 2152 2152 void *ptr = req->data; 2153 2153 int type, olen; 2154 2154 unsigned long val; 2155 - struct l2cap_conf_rfc rfc; 2155 + struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC }; 2156 2156 2157 2157 BT_DBG("chan %p, rsp %p, len %d, req %p", chan, rsp, len, data); 2158 2158 ··· 2270 2270 goto done; 2271 2271 } 2272 2272 } 2273 + 2274 + /* Use sane default values in case a misbehaving remote device 2275 + * did not send an RFC option. 2276 + */ 2277 + rfc.mode = chan->mode; 2278 + rfc.retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO); 2279 + rfc.monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO); 2280 + rfc.max_pdu_size = cpu_to_le16(chan->imtu); 2281 + 2282 + BT_ERR("Expected RFC option was not found, using defaults"); 2273 2283 2274 2284 done: 2275 2285 switch (rfc.mode) {
+1
net/bluetooth/rfcomm/core.c
··· 1146 1146 if (list_empty(&s->dlcs)) { 1147 1147 s->state = BT_DISCONN; 1148 1148 rfcomm_send_disc(s, 0); 1149 + rfcomm_session_clear_timer(s); 1149 1150 } 1150 1151 1151 1152 break;
+12
net/core/flow.c
··· 358 358 put_online_cpus(); 359 359 } 360 360 361 + static void flow_cache_flush_task(struct work_struct *work) 362 + { 363 + flow_cache_flush(); 364 + } 365 + 366 + static DECLARE_WORK(flow_cache_flush_work, flow_cache_flush_task); 367 + 368 + void flow_cache_flush_deferred(void) 369 + { 370 + schedule_work(&flow_cache_flush_work); 371 + } 372 + 361 373 static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu) 362 374 { 363 375 struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu);
+4
net/ipv4/ipconfig.c
··· 253 253 } 254 254 } 255 255 256 + /* no point in waiting if we could not bring up at least one device */ 257 + if (!ic_first_dev) 258 + goto have_carrier; 259 + 256 260 /* wait for a carrier on at least one device */ 257 261 start = jiffies; 258 262 while (jiffies - start < msecs_to_jiffies(CONF_CARRIER_TIMEOUT)) {
+107
net/ipv4/route.c
··· 120 120 121 121 static int ip_rt_max_size; 122 122 static int ip_rt_gc_timeout __read_mostly = RT_GC_TIMEOUT; 123 + static int ip_rt_gc_interval __read_mostly = 60 * HZ; 123 124 static int ip_rt_gc_min_interval __read_mostly = HZ / 2; 124 125 static int ip_rt_redirect_number __read_mostly = 9; 125 126 static int ip_rt_redirect_load __read_mostly = HZ / 50; ··· 133 132 static int ip_rt_min_advmss __read_mostly = 256; 134 133 static int rt_chain_length_max __read_mostly = 20; 135 134 static int redirect_genid; 135 + 136 + static struct delayed_work expires_work; 137 + static unsigned long expires_ljiffies; 136 138 137 139 /* 138 140 * Interface to generic destination cache. ··· 832 828 aux = rcu_dereference_protected(aux->dst.rt_next, 1); 833 829 } 834 830 return ONE; 831 + } 832 + 833 + static void rt_check_expire(void) 834 + { 835 + static unsigned int rover; 836 + unsigned int i = rover, goal; 837 + struct rtable *rth; 838 + struct rtable __rcu **rthp; 839 + unsigned long samples = 0; 840 + unsigned long sum = 0, sum2 = 0; 841 + unsigned long delta; 842 + u64 mult; 843 + 844 + delta = jiffies - expires_ljiffies; 845 + expires_ljiffies = jiffies; 846 + mult = ((u64)delta) << rt_hash_log; 847 + if (ip_rt_gc_timeout > 1) 848 + do_div(mult, ip_rt_gc_timeout); 849 + goal = (unsigned int)mult; 850 + if (goal > rt_hash_mask) 851 + goal = rt_hash_mask + 1; 852 + for (; goal > 0; goal--) { 853 + unsigned long tmo = ip_rt_gc_timeout; 854 + unsigned long length; 855 + 856 + i = (i + 1) & rt_hash_mask; 857 + rthp = &rt_hash_table[i].chain; 858 + 859 + if (need_resched()) 860 + cond_resched(); 861 + 862 + samples++; 863 + 864 + if (rcu_dereference_raw(*rthp) == NULL) 865 + continue; 866 + length = 0; 867 + spin_lock_bh(rt_hash_lock_addr(i)); 868 + while ((rth = rcu_dereference_protected(*rthp, 869 + lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) { 870 + prefetch(rth->dst.rt_next); 871 + if (rt_is_expired(rth)) { 872 + *rthp = rth->dst.rt_next; 873 + rt_free(rth); 874 + continue; 875 + } 876 + if (rth->dst.expires) { 877 + /* Entry is expired even if it is in use */ 878 + if (time_before_eq(jiffies, rth->dst.expires)) { 879 + nofree: 880 + tmo >>= 1; 881 + rthp = &rth->dst.rt_next; 882 + /* 883 + * We only count entries on 884 + * a chain with equal hash inputs once 885 + * so that entries for different QOS 886 + * levels, and other non-hash input 887 + * attributes don't unfairly skew 888 + * the length computation 889 + */ 890 + length += has_noalias(rt_hash_table[i].chain, rth); 891 + continue; 892 + } 893 + } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) 894 + goto nofree; 895 + 896 + /* Cleanup aged off entries. */ 897 + *rthp = rth->dst.rt_next; 898 + rt_free(rth); 899 + } 900 + spin_unlock_bh(rt_hash_lock_addr(i)); 901 + sum += length; 902 + sum2 += length*length; 903 + } 904 + if (samples) { 905 + unsigned long avg = sum / samples; 906 + unsigned long sd = int_sqrt(sum2 / samples - avg*avg); 907 + rt_chain_length_max = max_t(unsigned long, 908 + ip_rt_gc_elasticity, 909 + (avg + 4*sd) >> FRACT_BITS); 910 + } 911 + rover = i; 912 + } 913 + 914 + /* 915 + * rt_worker_func() is run in process context. 916 + * we call rt_check_expire() to scan part of the hash table 917 + */ 918 + static void rt_worker_func(struct work_struct *work) 919 + { 920 + rt_check_expire(); 921 + schedule_delayed_work(&expires_work, ip_rt_gc_interval); 835 922 } 836 923 837 924 /* ··· 3274 3179 .proc_handler = proc_dointvec_jiffies, 3275 3180 }, 3276 3181 { 3182 + .procname = "gc_interval", 3183 + .data = &ip_rt_gc_interval, 3184 + .maxlen = sizeof(int), 3185 + .mode = 0644, 3186 + .proc_handler = proc_dointvec_jiffies, 3187 + }, 3188 + { 3277 3189 .procname = "redirect_load", 3278 3190 .data = &ip_rt_redirect_load, 3279 3191 .maxlen = sizeof(int), ··· 3489 3387 3490 3388 devinet_init(); 3491 3389 ip_fib_init(); 3390 + 3391 + INIT_DELAYED_WORK_DEFERRABLE(&expires_work, rt_worker_func); 3392 + expires_ljiffies = jiffies; 3393 + schedule_delayed_work(&expires_work, 3394 + net_random() % ip_rt_gc_interval + ip_rt_gc_interval); 3492 3395 3493 3396 if (ip_rt_proc_init()) 3494 3397 printk(KERN_ERR "Unable to create route proc files\n");
+10 -4
net/llc/af_llc.c
··· 833 833 copied += used; 834 834 len -= used; 835 835 836 + /* For non stream protcols we get one packet per recvmsg call */ 837 + if (sk->sk_type != SOCK_STREAM) 838 + goto copy_uaddr; 839 + 836 840 if (!(flags & MSG_PEEK)) { 837 841 sk_eat_skb(sk, skb, 0); 838 842 *seq = 0; 839 843 } 840 - 841 - /* For non stream protcols we get one packet per recvmsg call */ 842 - if (sk->sk_type != SOCK_STREAM) 843 - goto copy_uaddr; 844 844 845 845 /* Partial read */ 846 846 if (used + offset < skb->len) ··· 857 857 } 858 858 if (llc_sk(sk)->cmsg_flags) 859 859 llc_cmsg_rcv(msg, skb); 860 + 861 + if (!(flags & MSG_PEEK)) { 862 + sk_eat_skb(sk, skb, 0); 863 + *seq = 0; 864 + } 865 + 860 866 goto out; 861 867 } 862 868
+1 -1
net/nfc/nci/core.c
··· 69 69 __u32 timeout) 70 70 { 71 71 int rc = 0; 72 - unsigned long completion_rc; 72 + long completion_rc; 73 73 74 74 ndev->req_status = NCI_REQ_PEND; 75 75
+1 -1
net/sctp/associola.c
··· 173 173 asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0; 174 174 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay; 175 175 asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = 176 - (unsigned long)sp->autoclose * HZ; 176 + min_t(unsigned long, sp->autoclose, sctp_max_autoclose) * HZ; 177 177 178 178 /* Initializes the timers */ 179 179 for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i)
+1 -7
net/sctp/output.c
··· 697 697 /* Keep track of how many bytes are in flight to the receiver. */ 698 698 asoc->outqueue.outstanding_bytes += datasize; 699 699 700 - /* Update our view of the receiver's rwnd. Include sk_buff overhead 701 - * while updating peer.rwnd so that it reduces the chances of a 702 - * receiver running out of receive buffer space even when receive 703 - * window is still open. This can happen when a sender is sending 704 - * sending small messages. 705 - */ 706 - datasize += sizeof(struct sk_buff); 700 + /* Update our view of the receiver's rwnd. */ 707 701 if (datasize < rwnd) 708 702 rwnd -= datasize; 709 703 else
+2 -4
net/sctp/outqueue.c
··· 411 411 chunk->transport->flight_size -= 412 412 sctp_data_size(chunk); 413 413 q->outstanding_bytes -= sctp_data_size(chunk); 414 - q->asoc->peer.rwnd += (sctp_data_size(chunk) + 415 - sizeof(struct sk_buff)); 414 + q->asoc->peer.rwnd += sctp_data_size(chunk); 416 415 } 417 416 continue; 418 417 } ··· 431 432 * (Section 7.2.4)), add the data size of those 432 433 * chunks to the rwnd. 433 434 */ 434 - q->asoc->peer.rwnd += (sctp_data_size(chunk) + 435 - sizeof(struct sk_buff)); 435 + q->asoc->peer.rwnd += sctp_data_size(chunk); 436 436 q->outstanding_bytes -= sctp_data_size(chunk); 437 437 if (chunk->transport) 438 438 transport->flight_size -= sctp_data_size(chunk);
+3
net/sctp/protocol.c
··· 1285 1285 sctp_max_instreams = SCTP_DEFAULT_INSTREAMS; 1286 1286 sctp_max_outstreams = SCTP_DEFAULT_OUTSTREAMS; 1287 1287 1288 + /* Initialize maximum autoclose timeout. */ 1289 + sctp_max_autoclose = INT_MAX / HZ; 1290 + 1288 1291 /* Initialize handle used for association ids. */ 1289 1292 idr_init(&sctp_assocs_id); 1290 1293
-2
net/sctp/socket.c
··· 2200 2200 return -EINVAL; 2201 2201 if (copy_from_user(&sp->autoclose, optval, optlen)) 2202 2202 return -EFAULT; 2203 - /* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */ 2204 - sp->autoclose = min_t(long, sp->autoclose, MAX_SCHEDULE_TIMEOUT / HZ); 2205 2203 2206 2204 return 0; 2207 2205 }
+13
net/sctp/sysctl.c
··· 53 53 static int sack_timer_max = 500; 54 54 static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ 55 55 static int rwnd_scale_max = 16; 56 + static unsigned long max_autoclose_min = 0; 57 + static unsigned long max_autoclose_max = 58 + (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX) 59 + ? UINT_MAX : MAX_SCHEDULE_TIMEOUT / HZ; 56 60 57 61 extern long sysctl_sctp_mem[3]; 58 62 extern int sysctl_sctp_rmem[3]; ··· 261 257 .proc_handler = &proc_dointvec_minmax, 262 258 .extra1 = &one, 263 259 .extra2 = &rwnd_scale_max, 260 + }, 261 + { 262 + .procname = "max_autoclose", 263 + .data = &sctp_max_autoclose, 264 + .maxlen = sizeof(unsigned long), 265 + .mode = 0644, 266 + .proc_handler = &proc_doulongvec_minmax, 267 + .extra1 = &max_autoclose_min, 268 + .extra2 = &max_autoclose_max, 264 269 }, 265 270 266 271 { /* sentinel */ }
+14 -4
net/xfrm/xfrm_policy.c
··· 2276 2276 { 2277 2277 struct dst_entry *head, *next; 2278 2278 2279 - flow_cache_flush(); 2280 - 2281 2279 spin_lock_bh(&xfrm_policy_sk_bundle_lock); 2282 2280 head = xfrm_policy_sk_bundles; 2283 2281 xfrm_policy_sk_bundles = NULL; ··· 2286 2288 dst_free(head); 2287 2289 head = next; 2288 2290 } 2291 + } 2292 + 2293 + static void xfrm_garbage_collect(struct net *net) 2294 + { 2295 + flow_cache_flush(); 2296 + __xfrm_garbage_collect(net); 2297 + } 2298 + 2299 + static void xfrm_garbage_collect_deferred(struct net *net) 2300 + { 2301 + flow_cache_flush_deferred(); 2302 + __xfrm_garbage_collect(net); 2289 2303 } 2290 2304 2291 2305 static void xfrm_init_pmtu(struct dst_entry *dst) ··· 2432 2422 if (likely(dst_ops->neigh_lookup == NULL)) 2433 2423 dst_ops->neigh_lookup = xfrm_neigh_lookup; 2434 2424 if (likely(afinfo->garbage_collect == NULL)) 2435 - afinfo->garbage_collect = __xfrm_garbage_collect; 2425 + afinfo->garbage_collect = xfrm_garbage_collect_deferred; 2436 2426 xfrm_policy_afinfo[afinfo->family] = afinfo; 2437 2427 } 2438 2428 write_unlock_bh(&xfrm_policy_afinfo_lock); ··· 2526 2516 2527 2517 switch (event) { 2528 2518 case NETDEV_DOWN: 2529 - __xfrm_garbage_collect(dev_net(dev)); 2519 + xfrm_garbage_collect(dev_net(dev)); 2530 2520 } 2531 2521 return NOTIFY_DONE; 2532 2522 }