aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-15 18:15:17 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-15 18:15:17 -0400
commitc337ffb68e1e71bad069b14d2246fa1e0c31699c (patch)
tree7861a59b196adfd63758cc0921e4fb56030fbaf3
parent30df754dedebf27ef90452944a723ba058d23396 (diff)
parent84c0c6933cb0303fa006992a6659c2b46de4eb17 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
-rw-r--r--Documentation/networking/bonding.txt26
-rw-r--r--drivers/net/ariadne.c5
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c2
-rw-r--r--drivers/net/can/usb/esd_usb2.c6
-rw-r--r--drivers/net/davinci_emac.c2
-rw-r--r--drivers/net/macvlan.c3
-rw-r--r--drivers/net/smsc911x.c4
-rw-r--r--drivers/net/usb/cdc-phonet.c10
-rw-r--r--drivers/net/xen-netfront.c4
-rw-r--r--net/bridge/br_stp.c4
-rw-r--r--net/ipv4/tcp_cubic.c45
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/unix/af_unix.c2
13 files changed, 70 insertions, 45 deletions
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 25d2f4141d27..b36e741e94db 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -2558,18 +2558,15 @@ enslaved.
255816. Resources and Links 255816. Resources and Links
2559======================= 2559=======================
2560 2560
2561The latest version of the bonding driver can be found in the latest 2561 The latest version of the bonding driver can be found in the latest
2562version of the linux kernel, found on http://kernel.org 2562version of the linux kernel, found on http://kernel.org
2563 2563
2564The latest version of this document can be found in either the latest 2564 The latest version of this document can be found in the latest kernel
2565kernel source (named Documentation/networking/bonding.txt), or on the 2565source (named Documentation/networking/bonding.txt).
2566bonding sourceforge site:
2567 2566
2568http://www.sourceforge.net/projects/bonding 2567 Discussions regarding the usage of the bonding driver take place on the
2569 2568bonding-devel mailing list, hosted at sourceforge.net. If you have questions or
2570Discussions regarding the bonding driver take place primarily on the 2569problems, post them to the list. The list address is:
2571bonding-devel mailing list, hosted at sourceforge.net. If you have
2572questions or problems, post them to the list. The list address is:
2573 2570
2574bonding-devel@lists.sourceforge.net 2571bonding-devel@lists.sourceforge.net
2575 2572
@@ -2578,6 +2575,17 @@ be found at:
2578 2575
2579https://lists.sourceforge.net/lists/listinfo/bonding-devel 2576https://lists.sourceforge.net/lists/listinfo/bonding-devel
2580 2577
2578 Discussions regarding the developpement of the bonding driver take place
2579on the main Linux network mailing list, hosted at vger.kernel.org. The list
2580address is:
2581
2582netdev@vger.kernel.org
2583
2584 The administrative interface (to subscribe or unsubscribe) can
2585be found at:
2586
2587http://vger.kernel.org/vger-lists.html#netdev
2588
2581Donald Becker's Ethernet Drivers and diag programs may be found at : 2589Donald Becker's Ethernet Drivers and diag programs may be found at :
2582 - http://web.archive.org/web/*/http://www.scyld.com/network/ 2590 - http://web.archive.org/web/*/http://www.scyld.com/network/
2583 2591
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c
index 39214e512452..7ca0eded2561 100644
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -425,11 +425,6 @@ static irqreturn_t ariadne_interrupt(int irq, void *data)
425 int csr0, boguscnt; 425 int csr0, boguscnt;
426 int handled = 0; 426 int handled = 0;
427 427
428 if (dev == NULL) {
429 printk(KERN_WARNING "ariadne_interrupt(): irq for unknown device.\n");
430 return IRQ_NONE;
431 }
432
433 lance->RAP = CSR0; /* PCnet-ISA Controller Status */ 428 lance->RAP = CSR0; /* PCnet-ISA Controller Status */
434 429
435 if (!(lance->RDP & INTR)) /* Check if any interrupt has been */ 430 if (!(lance->RDP & INTR)) /* Check if any interrupt has been */
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index bba21d5f708b..9d48659e3b28 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -4229,7 +4229,7 @@ void bnx2x_update_coalesce(struct bnx2x *bp)
4229 4229
4230 for_each_eth_queue(bp, i) 4230 for_each_eth_queue(bp, i)
4231 bnx2x_update_coalesce_sb(bp, bp->fp[i].fw_sb_id, 4231 bnx2x_update_coalesce_sb(bp, bp->fp[i].fw_sb_id,
4232 bp->rx_ticks, bp->tx_ticks); 4232 bp->tx_ticks, bp->rx_ticks);
4233} 4233}
4234 4234
4235static void bnx2x_init_sp_ring(struct bnx2x *bp) 4235static void bnx2x_init_sp_ring(struct bnx2x *bp)
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index 05a52754f486..dc53c831ea95 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -659,7 +659,7 @@ failed:
659static void unlink_all_urbs(struct esd_usb2 *dev) 659static void unlink_all_urbs(struct esd_usb2 *dev)
660{ 660{
661 struct esd_usb2_net_priv *priv; 661 struct esd_usb2_net_priv *priv;
662 int i; 662 int i, j;
663 663
664 usb_kill_anchored_urbs(&dev->rx_submitted); 664 usb_kill_anchored_urbs(&dev->rx_submitted);
665 for (i = 0; i < dev->net_count; i++) { 665 for (i = 0; i < dev->net_count; i++) {
@@ -668,8 +668,8 @@ static void unlink_all_urbs(struct esd_usb2 *dev)
668 usb_kill_anchored_urbs(&priv->tx_submitted); 668 usb_kill_anchored_urbs(&priv->tx_submitted);
669 atomic_set(&priv->active_tx_jobs, 0); 669 atomic_set(&priv->active_tx_jobs, 0);
670 670
671 for (i = 0; i < MAX_TX_URBS; i++) 671 for (j = 0; j < MAX_TX_URBS; j++)
672 priv->tx_contexts[i].echo_index = MAX_TX_URBS; 672 priv->tx_contexts[j].echo_index = MAX_TX_URBS;
673 } 673 }
674 } 674 }
675} 675}
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 7018bfe408a4..082d6ea69920 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -1730,7 +1730,7 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
1730 emac_read(EMAC_TXCARRIERSENSE); 1730 emac_read(EMAC_TXCARRIERSENSE);
1731 emac_write(EMAC_TXCARRIERSENSE, stats_clear_mask); 1731 emac_write(EMAC_TXCARRIERSENSE, stats_clear_mask);
1732 1732
1733 ndev->stats.tx_fifo_errors = emac_read(EMAC_TXUNDERRUN); 1733 ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
1734 emac_write(EMAC_TXUNDERRUN, stats_clear_mask); 1734 emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
1735 1735
1736 return &ndev->stats; 1736 return &ndev->stats;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 6ed577b065df..497991bd3b64 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -219,9 +219,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
219 const struct macvlan_dev *vlan = netdev_priv(dev); 219 const struct macvlan_dev *vlan = netdev_priv(dev);
220 const struct macvlan_port *port = vlan->port; 220 const struct macvlan_port *port = vlan->port;
221 const struct macvlan_dev *dest; 221 const struct macvlan_dev *dest;
222 __u8 ip_summed = skb->ip_summed;
222 223
223 if (vlan->mode == MACVLAN_MODE_BRIDGE) { 224 if (vlan->mode == MACVLAN_MODE_BRIDGE) {
224 const struct ethhdr *eth = (void *)skb->data; 225 const struct ethhdr *eth = (void *)skb->data;
226 skb->ip_summed = CHECKSUM_UNNECESSARY;
225 227
226 /* send to other bridge ports directly */ 228 /* send to other bridge ports directly */
227 if (is_multicast_ether_addr(eth->h_dest)) { 229 if (is_multicast_ether_addr(eth->h_dest)) {
@@ -241,6 +243,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
241 } 243 }
242 244
243xmit_world: 245xmit_world:
246 skb->ip_summed = ip_summed;
244 skb_set_dev(skb, vlan->lowerdev); 247 skb_set_dev(skb, vlan->lowerdev);
245 return dev_queue_xmit(skb); 248 return dev_queue_xmit(skb);
246} 249}
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index d70bde95460b..1566259c1f27 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -791,8 +791,8 @@ static int smsc911x_mii_probe(struct net_device *dev)
791 return -ENODEV; 791 return -ENODEV;
792 } 792 }
793 793
794 SMSC_TRACE(PROBE, "PHY %d: addr %d, phy_id 0x%08X", 794 SMSC_TRACE(PROBE, "PHY: addr %d, phy_id 0x%08X",
795 phy_addr, phydev->addr, phydev->phy_id); 795 phydev->addr, phydev->phy_id);
796 796
797 ret = phy_connect_direct(dev, phydev, 797 ret = phy_connect_direct(dev, phydev,
798 &smsc911x_phy_adjust_link, 0, 798 &smsc911x_phy_adjust_link, 0,
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 109751bad3bb..f967913e11bc 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -328,13 +328,13 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
328{ 328{
329 static const char ifname[] = "usbpn%d"; 329 static const char ifname[] = "usbpn%d";
330 const struct usb_cdc_union_desc *union_header = NULL; 330 const struct usb_cdc_union_desc *union_header = NULL;
331 const struct usb_cdc_header_desc *phonet_header = NULL;
332 const struct usb_host_interface *data_desc; 331 const struct usb_host_interface *data_desc;
333 struct usb_interface *data_intf; 332 struct usb_interface *data_intf;
334 struct usb_device *usbdev = interface_to_usbdev(intf); 333 struct usb_device *usbdev = interface_to_usbdev(intf);
335 struct net_device *dev; 334 struct net_device *dev;
336 struct usbpn_dev *pnd; 335 struct usbpn_dev *pnd;
337 u8 *data; 336 u8 *data;
337 int phonet = 0;
338 int len, err; 338 int len, err;
339 339
340 data = intf->altsetting->extra; 340 data = intf->altsetting->extra;
@@ -355,10 +355,7 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
355 (struct usb_cdc_union_desc *)data; 355 (struct usb_cdc_union_desc *)data;
356 break; 356 break;
357 case 0xAB: 357 case 0xAB:
358 if (phonet_header || dlen < 5) 358 phonet = 1;
359 break;
360 phonet_header =
361 (struct usb_cdc_header_desc *)data;
362 break; 359 break;
363 } 360 }
364 } 361 }
@@ -366,7 +363,7 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
366 len -= dlen; 363 len -= dlen;
367 } 364 }
368 365
369 if (!union_header || !phonet_header) 366 if (!union_header || !phonet)
370 return -EINVAL; 367 return -EINVAL;
371 368
372 data_intf = usb_ifnum_to_if(usbdev, union_header->bSlaveInterface0); 369 data_intf = usb_ifnum_to_if(usbdev, union_header->bSlaveInterface0);
@@ -392,7 +389,6 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
392 389
393 pnd = netdev_priv(dev); 390 pnd = netdev_priv(dev);
394 SET_NETDEV_DEV(dev, &intf->dev); 391 SET_NETDEV_DEV(dev, &intf->dev);
395 netif_stop_queue(dev);
396 392
397 pnd->dev = dev; 393 pnd->dev = dev;
398 pnd->usb = usb_get_dev(usbdev); 394 pnd->usb = usb_get_dev(usbdev);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index da1f12120346..5b399b54fef7 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -122,7 +122,7 @@ struct netfront_info {
122 struct mmu_update rx_mmu[NET_RX_RING_SIZE]; 122 struct mmu_update rx_mmu[NET_RX_RING_SIZE];
123 123
124 /* Statistics */ 124 /* Statistics */
125 int rx_gso_checksum_fixup; 125 unsigned long rx_gso_checksum_fixup;
126}; 126};
127 127
128struct netfront_rx_info { 128struct netfront_rx_info {
@@ -1692,7 +1692,7 @@ static void xennet_get_ethtool_stats(struct net_device *dev,
1692 int i; 1692 int i;
1693 1693
1694 for (i = 0; i < ARRAY_SIZE(xennet_stats); i++) 1694 for (i = 0; i < ARRAY_SIZE(xennet_stats); i++)
1695 data[i] = *(int *)(np + xennet_stats[i].offset); 1695 data[i] = *(unsigned long *)(np + xennet_stats[i].offset);
1696} 1696}
1697 1697
1698static void xennet_get_strings(struct net_device *dev, u32 stringset, u8 * data) 1698static void xennet_get_strings(struct net_device *dev, u32 stringset, u8 * data)
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index a5badd0f8226..7370d14f634d 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -375,12 +375,12 @@ static void br_make_forwarding(struct net_bridge_port *p)
375 if (p->state != BR_STATE_BLOCKING) 375 if (p->state != BR_STATE_BLOCKING)
376 return; 376 return;
377 377
378 if (br->forward_delay == 0) { 378 if (br->stp_enabled == BR_NO_STP || br->forward_delay == 0) {
379 p->state = BR_STATE_FORWARDING; 379 p->state = BR_STATE_FORWARDING;
380 br_topology_change_detection(br); 380 br_topology_change_detection(br);
381 del_timer(&p->forward_delay_timer); 381 del_timer(&p->forward_delay_timer);
382 } 382 }
383 else if (p->br->stp_enabled == BR_KERNEL_STP) 383 else if (br->stp_enabled == BR_KERNEL_STP)
384 p->state = BR_STATE_LISTENING; 384 p->state = BR_STATE_LISTENING;
385 else 385 else
386 p->state = BR_STATE_LEARNING; 386 p->state = BR_STATE_LEARNING;
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 62f775cb0863..34340c9c95fa 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -39,7 +39,7 @@
39 39
40/* Number of delay samples for detecting the increase of delay */ 40/* Number of delay samples for detecting the increase of delay */
41#define HYSTART_MIN_SAMPLES 8 41#define HYSTART_MIN_SAMPLES 8
42#define HYSTART_DELAY_MIN (2U<<3) 42#define HYSTART_DELAY_MIN (4U<<3)
43#define HYSTART_DELAY_MAX (16U<<3) 43#define HYSTART_DELAY_MAX (16U<<3)
44#define HYSTART_DELAY_THRESH(x) clamp(x, HYSTART_DELAY_MIN, HYSTART_DELAY_MAX) 44#define HYSTART_DELAY_THRESH(x) clamp(x, HYSTART_DELAY_MIN, HYSTART_DELAY_MAX)
45 45
@@ -52,6 +52,7 @@ static int tcp_friendliness __read_mostly = 1;
52static int hystart __read_mostly = 1; 52static int hystart __read_mostly = 1;
53static int hystart_detect __read_mostly = HYSTART_ACK_TRAIN | HYSTART_DELAY; 53static int hystart_detect __read_mostly = HYSTART_ACK_TRAIN | HYSTART_DELAY;
54static int hystart_low_window __read_mostly = 16; 54static int hystart_low_window __read_mostly = 16;
55static int hystart_ack_delta __read_mostly = 2;
55 56
56static u32 cube_rtt_scale __read_mostly; 57static u32 cube_rtt_scale __read_mostly;
57static u32 beta_scale __read_mostly; 58static u32 beta_scale __read_mostly;
@@ -75,6 +76,8 @@ MODULE_PARM_DESC(hystart_detect, "hyrbrid slow start detection mechanisms"
75 " 1: packet-train 2: delay 3: both packet-train and delay"); 76 " 1: packet-train 2: delay 3: both packet-train and delay");
76module_param(hystart_low_window, int, 0644); 77module_param(hystart_low_window, int, 0644);
77MODULE_PARM_DESC(hystart_low_window, "lower bound cwnd for hybrid slow start"); 78MODULE_PARM_DESC(hystart_low_window, "lower bound cwnd for hybrid slow start");
79module_param(hystart_ack_delta, int, 0644);
80MODULE_PARM_DESC(hystart_ack_delta, "spacing between ack's indicating train (msecs)");
78 81
79/* BIC TCP Parameters */ 82/* BIC TCP Parameters */
80struct bictcp { 83struct bictcp {
@@ -85,7 +88,7 @@ struct bictcp {
85 u32 last_time; /* time when updated last_cwnd */ 88 u32 last_time; /* time when updated last_cwnd */
86 u32 bic_origin_point;/* origin point of bic function */ 89 u32 bic_origin_point;/* origin point of bic function */
87 u32 bic_K; /* time to origin point from the beginning of the current epoch */ 90 u32 bic_K; /* time to origin point from the beginning of the current epoch */
88 u32 delay_min; /* min delay */ 91 u32 delay_min; /* min delay (msec << 3) */
89 u32 epoch_start; /* beginning of an epoch */ 92 u32 epoch_start; /* beginning of an epoch */
90 u32 ack_cnt; /* number of acks */ 93 u32 ack_cnt; /* number of acks */
91 u32 tcp_cwnd; /* estimated tcp cwnd */ 94 u32 tcp_cwnd; /* estimated tcp cwnd */
@@ -95,7 +98,7 @@ struct bictcp {
95 u8 found; /* the exit point is found? */ 98 u8 found; /* the exit point is found? */
96 u32 round_start; /* beginning of each round */ 99 u32 round_start; /* beginning of each round */
97 u32 end_seq; /* end_seq of the round */ 100 u32 end_seq; /* end_seq of the round */
98 u32 last_jiffies; /* last time when the ACK spacing is close */ 101 u32 last_ack; /* last time when the ACK spacing is close */
99 u32 curr_rtt; /* the minimum rtt of current round */ 102 u32 curr_rtt; /* the minimum rtt of current round */
100}; 103};
101 104
@@ -116,12 +119,21 @@ static inline void bictcp_reset(struct bictcp *ca)
116 ca->found = 0; 119 ca->found = 0;
117} 120}
118 121
122static inline u32 bictcp_clock(void)
123{
124#if HZ < 1000
125 return ktime_to_ms(ktime_get_real());
126#else
127 return jiffies_to_msecs(jiffies);
128#endif
129}
130
119static inline void bictcp_hystart_reset(struct sock *sk) 131static inline void bictcp_hystart_reset(struct sock *sk)
120{ 132{
121 struct tcp_sock *tp = tcp_sk(sk); 133 struct tcp_sock *tp = tcp_sk(sk);
122 struct bictcp *ca = inet_csk_ca(sk); 134 struct bictcp *ca = inet_csk_ca(sk);
123 135
124 ca->round_start = ca->last_jiffies = jiffies; 136 ca->round_start = ca->last_ack = bictcp_clock();
125 ca->end_seq = tp->snd_nxt; 137 ca->end_seq = tp->snd_nxt;
126 ca->curr_rtt = 0; 138 ca->curr_rtt = 0;
127 ca->sample_cnt = 0; 139 ca->sample_cnt = 0;
@@ -236,8 +248,8 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
236 */ 248 */
237 249
238 /* change the unit from HZ to bictcp_HZ */ 250 /* change the unit from HZ to bictcp_HZ */
239 t = ((tcp_time_stamp + (ca->delay_min>>3) - ca->epoch_start) 251 t = ((tcp_time_stamp + msecs_to_jiffies(ca->delay_min>>3)
240 << BICTCP_HZ) / HZ; 252 - ca->epoch_start) << BICTCP_HZ) / HZ;
241 253
242 if (t < ca->bic_K) /* t - K */ 254 if (t < ca->bic_K) /* t - K */
243 offs = ca->bic_K - t; 255 offs = ca->bic_K - t;
@@ -258,6 +270,13 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
258 ca->cnt = 100 * cwnd; /* very small increment*/ 270 ca->cnt = 100 * cwnd; /* very small increment*/
259 } 271 }
260 272
273 /*
274 * The initial growth of cubic function may be too conservative
275 * when the available bandwidth is still unknown.
276 */
277 if (ca->loss_cwnd == 0 && ca->cnt > 20)
278 ca->cnt = 20; /* increase cwnd 5% per RTT */
279
261 /* TCP Friendly */ 280 /* TCP Friendly */
262 if (tcp_friendliness) { 281 if (tcp_friendliness) {
263 u32 scale = beta_scale; 282 u32 scale = beta_scale;
@@ -339,12 +358,12 @@ static void hystart_update(struct sock *sk, u32 delay)
339 struct bictcp *ca = inet_csk_ca(sk); 358 struct bictcp *ca = inet_csk_ca(sk);
340 359
341 if (!(ca->found & hystart_detect)) { 360 if (!(ca->found & hystart_detect)) {
342 u32 curr_jiffies = jiffies; 361 u32 now = bictcp_clock();
343 362
344 /* first detection parameter - ack-train detection */ 363 /* first detection parameter - ack-train detection */
345 if (curr_jiffies - ca->last_jiffies <= msecs_to_jiffies(2)) { 364 if ((s32)(now - ca->last_ack) <= hystart_ack_delta) {
346 ca->last_jiffies = curr_jiffies; 365 ca->last_ack = now;
347 if (curr_jiffies - ca->round_start >= ca->delay_min>>4) 366 if ((s32)(now - ca->round_start) > ca->delay_min >> 4)
348 ca->found |= HYSTART_ACK_TRAIN; 367 ca->found |= HYSTART_ACK_TRAIN;
349 } 368 }
350 369
@@ -391,7 +410,7 @@ static void bictcp_acked(struct sock *sk, u32 cnt, s32 rtt_us)
391 if ((s32)(tcp_time_stamp - ca->epoch_start) < HZ) 410 if ((s32)(tcp_time_stamp - ca->epoch_start) < HZ)
392 return; 411 return;
393 412
394 delay = usecs_to_jiffies(rtt_us) << 3; 413 delay = (rtt_us << 3) / USEC_PER_MSEC;
395 if (delay == 0) 414 if (delay == 0)
396 delay = 1; 415 delay = 1;
397 416
@@ -447,6 +466,10 @@ static int __init cubictcp_register(void)
447 /* divide by bic_scale and by constant Srtt (100ms) */ 466 /* divide by bic_scale and by constant Srtt (100ms) */
448 do_div(cube_factor, bic_scale * 10); 467 do_div(cube_factor, bic_scale * 10);
449 468
469 /* hystart needs ms clock resolution */
470 if (hystart && HZ < 1000)
471 cubictcp.flags |= TCP_CONG_RTT_STAMP;
472
450 return tcp_register_congestion_control(&cubictcp); 473 return tcp_register_congestion_control(&cubictcp);
451} 474}
452 475
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 08ea735b9d72..da782e7ab16d 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3350,7 +3350,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
3350 net_invalid_timestamp())) 3350 net_invalid_timestamp()))
3351 rtt_us = ktime_us_delta(ktime_get_real(), 3351 rtt_us = ktime_us_delta(ktime_get_real(),
3352 last_ackt); 3352 last_ackt);
3353 else if (ca_seq_rtt > 0) 3353 else if (ca_seq_rtt >= 0)
3354 rtt_us = jiffies_to_usecs(ca_seq_rtt); 3354 rtt_us = jiffies_to_usecs(ca_seq_rtt);
3355 } 3355 }
3356 3356
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index de870184e457..ef70615d41a1 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1124,7 +1124,7 @@ restart:
1124 1124
1125 /* Latch our state. 1125 /* Latch our state.
1126 1126
1127 It is tricky place. We need to grab write lock and cannot 1127 It is tricky place. We need to grab our state lock and cannot
1128 drop lock on peer. It is dangerous because deadlock is 1128 drop lock on peer. It is dangerous because deadlock is
1129 possible. Connect to self case and simultaneous 1129 possible. Connect to self case and simultaneous
1130 attempt to connect are eliminated by checking socket 1130 attempt to connect are eliminated by checking socket