Merge android11-5.4.55 (53b501f
) into msm-5.4
* refs/heads/tmp-53b501f: Revert "qrtr: orphan socket in qrtr_release()" ANDROID: GKI: fix up abi definition files Revert "ANDROID: GKI: Enable CONFIG_USB_DWC3" ANDROID: GKI: remove symbols from sunxi for uas driver Linux 5.4.55 Revert "dpaa_eth: fix usage as DSA master, try 3" PM: wakeup: Show statistics for deleted wakeup sources again regmap: debugfs: check count when read regmap file udp: Improve load balancing for SO_REUSEPORT. udp: Copy has_conns in reuseport_grow(). sctp: shrink stream outq when fails to do addstream reconf sctp: shrink stream outq only when new outcnt < old outcnt AX.25: Prevent integer overflows in connect and sendmsg tcp: allow at most one TLP probe per flight rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA rtnetlink: Fix memory(net_device) leak when ->newlink fails qrtr: orphan socket in qrtr_release() net: udp: Fix wrong clean up for IS_UDPLITE macro net-sysfs: add a newline when printing 'tx_timeout' by sysfs ip6_gre: fix null-ptr-deref in ip6gre_init_net() drivers/net/wan/x25_asy: Fix to make it work dev: Defer free of skbs in flush_backlog AX.25: Prevent out-of-bounds read in ax25_sendmsg() AX.25: Fix out-of-bounds read in ax25_connect() Revert "Revert "ANDROID: ALSA: jack: Update supported jack switch types"" Revert "Revert "ANDROID: ASoC: compress: fix unsigned integer overflow check"" ANDROID: GKI: enable CONFIG_VIDEO_V4L2_SUBDEV_API FROMLIST: power: add "Wireless" to power_supply_type and power_supply_type_text Revert "ANDROID: ASoC: compress: fix unsigned integer overflow check" Revert "ANDROID: ALSA: jack: Update supported jack switch types" BACKPORT: FROMLIST: cpuidle: change enter_s2idle() prototype Change-Id: I0dfd8e6b5e2a26997f144e542498f18f5f89408a Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
This commit is contained in:
commit
be455bc542
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 54
|
||||
SUBLEVEL = 55
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -39,20 +39,6 @@
|
||||
iommu_group_alloc
|
||||
iommu_group_register_notifier
|
||||
|
||||
# required by uas.ko
|
||||
int_to_scsilun
|
||||
scmd_printk
|
||||
scsi_block_requests
|
||||
scsi_change_queue_depth
|
||||
scsi_print_command
|
||||
scsi_unblock_requests
|
||||
usb_alloc_streams
|
||||
usb_free_streams
|
||||
usb_kill_anchored_urbs
|
||||
usb_unanchor_urb
|
||||
usb_wait_anchor_empty_timeout
|
||||
usb_set_interface
|
||||
|
||||
# required by ums-realtek.ko
|
||||
usb_bulk_msg
|
||||
|
||||
|
@ -51,11 +51,13 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev,
|
||||
return index;
|
||||
}
|
||||
|
||||
static void tegra114_idle_enter_s2idle(struct cpuidle_device *dev,
|
||||
static int tegra114_idle_enter_s2idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
tegra114_idle_power_down(dev, drv, index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -341,6 +341,7 @@ CONFIG_REGULATOR=y
|
||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
CONFIG_VIDEO_V4L2_SUBDEV_API=y
|
||||
CONFIG_V4L_PLATFORM_DRIVERS=y
|
||||
# CONFIG_VGA_ARB is not set
|
||||
CONFIG_DRM=y
|
||||
@ -381,7 +382,6 @@ CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_HCD_PLATFORM=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_UAS=y
|
||||
CONFIG_USB_DWC3=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_DUMMY_HCD=y
|
||||
CONFIG_USB_CONFIGFS=y
|
||||
|
@ -338,7 +338,6 @@ CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_HCD_PLATFORM=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_UAS=y
|
||||
CONFIG_USB_DWC3=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_DUMMY_HCD=y
|
||||
CONFIG_USB_CONFIGFS=y
|
||||
|
@ -791,8 +791,8 @@ static int acpi_idle_enter(struct cpuidle_device *dev,
|
||||
return index;
|
||||
}
|
||||
|
||||
static void acpi_idle_enter_s2idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int index)
|
||||
static int acpi_idle_enter_s2idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int index)
|
||||
{
|
||||
struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
|
||||
|
||||
@ -800,16 +800,18 @@ static void acpi_idle_enter_s2idle(struct cpuidle_device *dev,
|
||||
struct acpi_processor *pr = __this_cpu_read(processors);
|
||||
|
||||
if (unlikely(!pr))
|
||||
return;
|
||||
return 0;
|
||||
|
||||
if (pr->flags.bm_check) {
|
||||
acpi_idle_enter_bm(pr, cx, false);
|
||||
return;
|
||||
return 0;
|
||||
} else {
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
}
|
||||
}
|
||||
acpi_idle_do_entry(cx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
|
||||
|
@ -1130,6 +1130,9 @@ static void *wakeup_sources_stats_seq_next(struct seq_file *m,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!next_ws)
|
||||
print_wakeup_source_stats(m, &deleted_ws);
|
||||
|
||||
return next_ws;
|
||||
}
|
||||
|
||||
|
@ -227,6 +227,9 @@ static ssize_t regmap_read_debugfs(struct regmap *map, unsigned int from,
|
||||
if (*ppos < 0 || !count)
|
||||
return -EINVAL;
|
||||
|
||||
if (count > (PAGE_SIZE << (MAX_ORDER - 1)))
|
||||
count = PAGE_SIZE << (MAX_ORDER - 1);
|
||||
|
||||
buf = kmalloc(count, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
@ -436,6 +439,9 @@ static ssize_t regmap_reg_ranges_read_file(struct file *file,
|
||||
if (*ppos < 0 || !count)
|
||||
return -EINVAL;
|
||||
|
||||
if (count > (PAGE_SIZE << (MAX_ORDER - 1)))
|
||||
count = PAGE_SIZE << (MAX_ORDER - 1);
|
||||
|
||||
buf = kmalloc(count, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
@ -1473,7 +1473,7 @@ exit:
|
||||
return idx;
|
||||
}
|
||||
|
||||
static void lpm_cpuidle_s2idle(struct cpuidle_device *dev,
|
||||
static int lpm_cpuidle_s2idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int idx)
|
||||
{
|
||||
struct lpm_cpu *cpu = per_cpu(cpu_lpm, dev->cpu);
|
||||
@ -1487,7 +1487,7 @@ static void lpm_cpuidle_s2idle(struct cpuidle_device *dev,
|
||||
}
|
||||
if (idx < 0) {
|
||||
pr_err("Failed suspend\n");
|
||||
return;
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
cpu_prepare(cpu, idx, true);
|
||||
@ -1498,6 +1498,7 @@ static void lpm_cpuidle_s2idle(struct cpuidle_device *dev,
|
||||
|
||||
cluster_unprepare(cpu->parent, cpumask, idx, false, 0, success);
|
||||
cpu_unprepare(cpu, idx, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_IDLE_MULTIPLE_DRIVERS
|
||||
|
@ -85,7 +85,7 @@ static const struct idle_cpu *icpu;
|
||||
static struct cpuidle_device __percpu *intel_idle_cpuidle_devices;
|
||||
static int intel_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int index);
|
||||
static void intel_idle_s2idle(struct cpuidle_device *dev,
|
||||
static int intel_idle_s2idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int index);
|
||||
static struct cpuidle_state *cpuidle_state_table;
|
||||
|
||||
@ -935,13 +935,15 @@ static __cpuidle int intel_idle(struct cpuidle_device *dev,
|
||||
* @drv: cpuidle driver
|
||||
* @index: state index
|
||||
*/
|
||||
static void intel_idle_s2idle(struct cpuidle_device *dev,
|
||||
static int intel_idle_s2idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int index)
|
||||
{
|
||||
unsigned long ecx = 1; /* break on interrupt flag */
|
||||
unsigned long eax = flg2MWAIT(drv->states[index].flags);
|
||||
|
||||
mwait_idle_with_hints(eax, ecx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __setup_broadcast_timer(bool on)
|
||||
|
@ -2802,7 +2802,7 @@ static int dpaa_eth_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* Do this here, so we can be verbose early */
|
||||
SET_NETDEV_DEV(net_dev, dev->parent);
|
||||
SET_NETDEV_DEV(net_dev, dev);
|
||||
dev_set_drvdata(dev, net_dev);
|
||||
|
||||
priv = netdev_priv(net_dev);
|
||||
|
@ -183,7 +183,7 @@ static inline void x25_asy_unlock(struct x25_asy *sl)
|
||||
netif_wake_queue(sl->dev);
|
||||
}
|
||||
|
||||
/* Send one completely decapsulated IP datagram to the IP layer. */
|
||||
/* Send an LAPB frame to the LAPB module to process. */
|
||||
|
||||
static void x25_asy_bump(struct x25_asy *sl)
|
||||
{
|
||||
@ -195,13 +195,12 @@ static void x25_asy_bump(struct x25_asy *sl)
|
||||
count = sl->rcount;
|
||||
dev->stats.rx_bytes += count;
|
||||
|
||||
skb = dev_alloc_skb(count+1);
|
||||
skb = dev_alloc_skb(count);
|
||||
if (skb == NULL) {
|
||||
netdev_warn(sl->dev, "memory squeeze, dropping packet\n");
|
||||
dev->stats.rx_dropped++;
|
||||
return;
|
||||
}
|
||||
skb_push(skb, 1); /* LAPB internal control */
|
||||
skb_put_data(skb, sl->rbuff, count);
|
||||
skb->protocol = x25_type_trans(skb, sl->dev);
|
||||
err = lapb_data_received(skb->dev, skb);
|
||||
@ -209,7 +208,6 @@ static void x25_asy_bump(struct x25_asy *sl)
|
||||
kfree_skb(skb);
|
||||
printk(KERN_DEBUG "x25_asy: data received err - %d\n", err);
|
||||
} else {
|
||||
netif_rx(skb);
|
||||
dev->stats.rx_packets++;
|
||||
}
|
||||
}
|
||||
@ -356,12 +354,21 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb,
|
||||
*/
|
||||
|
||||
/*
|
||||
* Called when I frame data arrives. We did the work above - throw it
|
||||
* at the net layer.
|
||||
* Called when I frame data arrive. We add a pseudo header for upper
|
||||
* layers and pass it to upper layers.
|
||||
*/
|
||||
|
||||
static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)
|
||||
{
|
||||
if (skb_cow(skb, 1)) {
|
||||
kfree_skb(skb);
|
||||
return NET_RX_DROP;
|
||||
}
|
||||
skb_push(skb, 1);
|
||||
skb->data[0] = X25_IFACE_DATA;
|
||||
|
||||
skb->protocol = x25_type_trans(skb, dev);
|
||||
|
||||
return netif_rx(skb);
|
||||
}
|
||||
|
||||
@ -657,7 +664,7 @@ static void x25_asy_unesc(struct x25_asy *sl, unsigned char s)
|
||||
switch (s) {
|
||||
case X25_END:
|
||||
if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
|
||||
sl->rcount > 2)
|
||||
sl->rcount >= 2)
|
||||
x25_asy_bump(sl);
|
||||
clear_bit(SLF_ESCAPE, &sl->flags);
|
||||
sl->rcount = 0;
|
||||
|
@ -56,6 +56,7 @@ static const char * const POWER_SUPPLY_TYPE_TEXT[] = {
|
||||
[POWER_SUPPLY_TYPE_USB_PD] = "USB_PD",
|
||||
[POWER_SUPPLY_TYPE_USB_PD_DRP] = "USB_PD_DRP",
|
||||
[POWER_SUPPLY_TYPE_APPLE_BRICK_ID] = "BrickID",
|
||||
[POWER_SUPPLY_TYPE_WIRELESS] = "Wireless",
|
||||
};
|
||||
|
||||
static const char * const POWER_SUPPLY_USB_TYPE_TEXT[] = {
|
||||
|
@ -61,10 +61,13 @@ struct cpuidle_state {
|
||||
* CPUs execute ->enter_s2idle with the local tick or entire timekeeping
|
||||
* suspended, so it must not re-enable interrupts at any point (even
|
||||
* temporarily) or attempt to change states of clock event devices.
|
||||
*
|
||||
* This callback may point to the same function as ->enter if all of
|
||||
* the above requirements are met by it.
|
||||
*/
|
||||
void (*enter_s2idle) (struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv,
|
||||
int index);
|
||||
int (*enter_s2idle)(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv,
|
||||
int index);
|
||||
};
|
||||
|
||||
/* Idle State Flags */
|
||||
|
@ -185,6 +185,7 @@ enum power_supply_type {
|
||||
POWER_SUPPLY_TYPE_USB_PD, /* Power Delivery Port */
|
||||
POWER_SUPPLY_TYPE_USB_PD_DRP, /* PD Dual Role Port */
|
||||
POWER_SUPPLY_TYPE_APPLE_BRICK_ID, /* Apple Charging Method */
|
||||
POWER_SUPPLY_TYPE_WIRELESS, /* Wireless */
|
||||
};
|
||||
|
||||
enum power_supply_usb_type {
|
||||
|
@ -216,6 +216,8 @@ struct tcp_sock {
|
||||
} rack;
|
||||
u16 advmss; /* Advertised MSS */
|
||||
u8 compressed_ack;
|
||||
u8 tlp_retrans:1, /* TLP is a retransmission */
|
||||
unused_1:7;
|
||||
u32 chrono_start; /* Start time in jiffies of a TCP chrono */
|
||||
u32 chrono_stat[3]; /* Time in jiffies for chrono_stat stats */
|
||||
u8 chrono_type:2, /* current chronograph type */
|
||||
@ -238,7 +240,7 @@ struct tcp_sock {
|
||||
save_syn:1, /* Save headers of SYN packet */
|
||||
is_cwnd_limited:1,/* forward progress limited by snd_cwnd? */
|
||||
syn_smc:1; /* SYN includes SMC */
|
||||
u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */
|
||||
u32 tlp_high_seq; /* snd_nxt at the time of TLP */
|
||||
|
||||
u32 tcp_tx_delay; /* delay (in usec) added to TX packets */
|
||||
u64 tcp_wstamp_ns; /* departure time for next sent data packet */
|
||||
|
@ -1187,7 +1187,10 @@ static int __must_check ax25_connect(struct socket *sock,
|
||||
if (addr_len > sizeof(struct sockaddr_ax25) &&
|
||||
fsa->fsa_ax25.sax25_ndigis != 0) {
|
||||
/* Valid number of digipeaters ? */
|
||||
if (fsa->fsa_ax25.sax25_ndigis < 1 || fsa->fsa_ax25.sax25_ndigis > AX25_MAX_DIGIS) {
|
||||
if (fsa->fsa_ax25.sax25_ndigis < 1 ||
|
||||
fsa->fsa_ax25.sax25_ndigis > AX25_MAX_DIGIS ||
|
||||
addr_len < sizeof(struct sockaddr_ax25) +
|
||||
sizeof(ax25_address) * fsa->fsa_ax25.sax25_ndigis) {
|
||||
err = -EINVAL;
|
||||
goto out_release;
|
||||
}
|
||||
@ -1507,7 +1510,10 @@ static int ax25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
|
||||
struct full_sockaddr_ax25 *fsa = (struct full_sockaddr_ax25 *)usax;
|
||||
|
||||
/* Valid number of digipeaters ? */
|
||||
if (usax->sax25_ndigis < 1 || usax->sax25_ndigis > AX25_MAX_DIGIS) {
|
||||
if (usax->sax25_ndigis < 1 ||
|
||||
usax->sax25_ndigis > AX25_MAX_DIGIS ||
|
||||
addr_len < sizeof(struct sockaddr_ax25) +
|
||||
sizeof(ax25_address) * usax->sax25_ndigis) {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -5229,7 +5229,7 @@ static void flush_backlog(struct work_struct *work)
|
||||
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) {
|
||||
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
|
||||
__skb_unlink(skb, &sd->input_pkt_queue);
|
||||
kfree_skb(skb);
|
||||
dev_kfree_skb_irq(skb);
|
||||
input_queue_head_incr(sd);
|
||||
}
|
||||
}
|
||||
|
@ -1036,7 +1036,7 @@ static ssize_t tx_timeout_show(struct netdev_queue *queue, char *buf)
|
||||
trans_timeout = queue->trans_timeout;
|
||||
spin_unlock_irq(&queue->_xmit_lock);
|
||||
|
||||
return sprintf(buf, "%lu", trans_timeout);
|
||||
return sprintf(buf, fmt_ulong, trans_timeout);
|
||||
}
|
||||
|
||||
static unsigned int get_netdev_queue_index(struct netdev_queue *queue)
|
||||
|
@ -3231,7 +3231,8 @@ replay:
|
||||
*/
|
||||
if (err < 0) {
|
||||
/* If device is not registered at all, free it now */
|
||||
if (dev->reg_state == NETREG_UNINITIALIZED)
|
||||
if (dev->reg_state == NETREG_UNINITIALIZED ||
|
||||
dev->reg_state == NETREG_UNREGISTERED)
|
||||
free_netdev(dev);
|
||||
goto out;
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ static struct sock_reuseport *reuseport_grow(struct sock_reuseport *reuse)
|
||||
more_reuse->prog = reuse->prog;
|
||||
more_reuse->reuseport_id = reuse->reuseport_id;
|
||||
more_reuse->bind_inany = reuse->bind_inany;
|
||||
more_reuse->has_conns = reuse->has_conns;
|
||||
|
||||
memcpy(more_reuse->socks, reuse->socks,
|
||||
reuse->num_socks * sizeof(struct sock *));
|
||||
|
@ -3505,10 +3505,8 @@ static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq)
|
||||
}
|
||||
}
|
||||
|
||||
/* This routine deals with acks during a TLP episode.
|
||||
* We mark the end of a TLP episode on receiving TLP dupack or when
|
||||
* ack is after tlp_high_seq.
|
||||
* Ref: loss detection algorithm in draft-dukkipati-tcpm-tcp-loss-probe.
|
||||
/* This routine deals with acks during a TLP episode and ends an episode by
|
||||
* resetting tlp_high_seq. Ref: TLP algorithm in draft-ietf-tcpm-rack
|
||||
*/
|
||||
static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag)
|
||||
{
|
||||
@ -3517,7 +3515,10 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag)
|
||||
if (before(ack, tp->tlp_high_seq))
|
||||
return;
|
||||
|
||||
if (flag & FLAG_DSACKING_ACK) {
|
||||
if (!tp->tlp_retrans) {
|
||||
/* TLP of new data has been acknowledged */
|
||||
tp->tlp_high_seq = 0;
|
||||
} else if (flag & FLAG_DSACKING_ACK) {
|
||||
/* This DSACK means original and TLP probe arrived; no loss */
|
||||
tp->tlp_high_seq = 0;
|
||||
} else if (after(ack, tp->tlp_high_seq)) {
|
||||
|
@ -2564,6 +2564,11 @@ void tcp_send_loss_probe(struct sock *sk)
|
||||
int pcount;
|
||||
int mss = tcp_current_mss(sk);
|
||||
|
||||
/* At most one outstanding TLP */
|
||||
if (tp->tlp_high_seq)
|
||||
goto rearm_timer;
|
||||
|
||||
tp->tlp_retrans = 0;
|
||||
skb = tcp_send_head(sk);
|
||||
if (skb && tcp_snd_wnd_test(tp, skb, mss)) {
|
||||
pcount = tp->packets_out;
|
||||
@ -2581,10 +2586,6 @@ void tcp_send_loss_probe(struct sock *sk)
|
||||
return;
|
||||
}
|
||||
|
||||
/* At most one outstanding TLP retransmission. */
|
||||
if (tp->tlp_high_seq)
|
||||
goto rearm_timer;
|
||||
|
||||
if (skb_still_in_host_queue(sk, skb))
|
||||
goto rearm_timer;
|
||||
|
||||
@ -2606,10 +2607,12 @@ void tcp_send_loss_probe(struct sock *sk)
|
||||
if (__tcp_retransmit_skb(sk, skb, 1))
|
||||
goto rearm_timer;
|
||||
|
||||
tp->tlp_retrans = 1;
|
||||
|
||||
probe_sent:
|
||||
/* Record snd_nxt for loss detection. */
|
||||
tp->tlp_high_seq = tp->snd_nxt;
|
||||
|
||||
probe_sent:
|
||||
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPLOSSPROBES);
|
||||
/* Reset s.t. tcp_rearm_rto will restart timer from now */
|
||||
inet_csk(sk)->icsk_pending = 0;
|
||||
|
@ -413,7 +413,7 @@ static struct sock *udp4_lib_lookup2(struct net *net,
|
||||
struct udp_hslot *hslot2,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct sock *sk, *result;
|
||||
struct sock *sk, *result, *reuseport_result;
|
||||
int score, badness;
|
||||
u32 hash = 0;
|
||||
|
||||
@ -423,17 +423,20 @@ static struct sock *udp4_lib_lookup2(struct net *net,
|
||||
score = compute_score(sk, net, saddr, sport,
|
||||
daddr, hnum, dif, sdif);
|
||||
if (score > badness) {
|
||||
reuseport_result = NULL;
|
||||
|
||||
if (sk->sk_reuseport &&
|
||||
sk->sk_state != TCP_ESTABLISHED) {
|
||||
hash = udp_ehashfn(net, daddr, hnum,
|
||||
saddr, sport);
|
||||
result = reuseport_select_sock(sk, hash, skb,
|
||||
sizeof(struct udphdr));
|
||||
if (result && !reuseport_has_conns(sk, false))
|
||||
return result;
|
||||
reuseport_result = reuseport_select_sock(sk, hash, skb,
|
||||
sizeof(struct udphdr));
|
||||
if (reuseport_result && !reuseport_has_conns(sk, false))
|
||||
return reuseport_result;
|
||||
}
|
||||
|
||||
result = reuseport_result ? : sk;
|
||||
badness = score;
|
||||
result = sk;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -2045,7 +2048,7 @@ static int udp_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb)
|
||||
/*
|
||||
* UDP-Lite specific tests, ignored on UDP sockets
|
||||
*/
|
||||
if ((is_udplite & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) {
|
||||
if ((up->pcflag & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) {
|
||||
|
||||
/*
|
||||
* MIB statistics other than incrementing the error count are
|
||||
|
@ -1560,17 +1560,18 @@ static void ip6gre_destroy_tunnels(struct net *net, struct list_head *head)
|
||||
static int __net_init ip6gre_init_net(struct net *net)
|
||||
{
|
||||
struct ip6gre_net *ign = net_generic(net, ip6gre_net_id);
|
||||
struct net_device *ndev;
|
||||
int err;
|
||||
|
||||
if (!net_has_fallback_tunnels(net))
|
||||
return 0;
|
||||
ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6gre0",
|
||||
NET_NAME_UNKNOWN,
|
||||
ip6gre_tunnel_setup);
|
||||
if (!ign->fb_tunnel_dev) {
|
||||
ndev = alloc_netdev(sizeof(struct ip6_tnl), "ip6gre0",
|
||||
NET_NAME_UNKNOWN, ip6gre_tunnel_setup);
|
||||
if (!ndev) {
|
||||
err = -ENOMEM;
|
||||
goto err_alloc_dev;
|
||||
}
|
||||
ign->fb_tunnel_dev = ndev;
|
||||
dev_net_set(ign->fb_tunnel_dev, net);
|
||||
/* FB netdevice is special: we have one, and only one per netns.
|
||||
* Allowing to move it to another netns is clearly unsafe.
|
||||
@ -1590,7 +1591,7 @@ static int __net_init ip6gre_init_net(struct net *net)
|
||||
return 0;
|
||||
|
||||
err_reg_dev:
|
||||
free_netdev(ign->fb_tunnel_dev);
|
||||
free_netdev(ndev);
|
||||
err_alloc_dev:
|
||||
return err;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ static struct sock *udp6_lib_lookup2(struct net *net,
|
||||
int dif, int sdif, struct udp_hslot *hslot2,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct sock *sk, *result;
|
||||
struct sock *sk, *result, *reuseport_result;
|
||||
int score, badness;
|
||||
u32 hash = 0;
|
||||
|
||||
@ -158,17 +158,20 @@ static struct sock *udp6_lib_lookup2(struct net *net,
|
||||
score = compute_score(sk, net, saddr, sport,
|
||||
daddr, hnum, dif, sdif);
|
||||
if (score > badness) {
|
||||
reuseport_result = NULL;
|
||||
|
||||
if (sk->sk_reuseport &&
|
||||
sk->sk_state != TCP_ESTABLISHED) {
|
||||
hash = udp6_ehashfn(net, daddr, hnum,
|
||||
saddr, sport);
|
||||
|
||||
result = reuseport_select_sock(sk, hash, skb,
|
||||
sizeof(struct udphdr));
|
||||
if (result && !reuseport_has_conns(sk, false))
|
||||
return result;
|
||||
reuseport_result = reuseport_select_sock(sk, hash, skb,
|
||||
sizeof(struct udphdr));
|
||||
if (reuseport_result && !reuseport_has_conns(sk, false))
|
||||
return reuseport_result;
|
||||
}
|
||||
result = sk;
|
||||
|
||||
result = reuseport_result ? : sk;
|
||||
badness = score;
|
||||
}
|
||||
}
|
||||
@ -643,7 +646,7 @@ static int udpv6_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb)
|
||||
/*
|
||||
* UDP-Lite specific tests, ignored on UDP sockets (see net/ipv4/udp.c).
|
||||
*/
|
||||
if ((is_udplite & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) {
|
||||
if ((up->pcflag & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) {
|
||||
|
||||
if (up->pcrlen == 0) { /* full coverage was set */
|
||||
net_dbg_ratelimited("UDPLITE6: partial coverage %d while full coverage %d requested\n",
|
||||
|
@ -464,7 +464,7 @@ try_again:
|
||||
list_empty(&rx->recvmsg_q) &&
|
||||
rx->sk.sk_state != RXRPC_SERVER_LISTENING) {
|
||||
release_sock(&rx->sk);
|
||||
return -ENODATA;
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (list_empty(&rx->recvmsg_q)) {
|
||||
|
@ -306,7 +306,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
|
||||
/* this should be in poll */
|
||||
sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
|
||||
|
||||
if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
|
||||
if (sk->sk_shutdown & SEND_SHUTDOWN)
|
||||
return -EPIPE;
|
||||
|
||||
more = msg->msg_flags & MSG_MORE;
|
||||
|
@ -22,17 +22,11 @@
|
||||
#include <net/sctp/sm.h>
|
||||
#include <net/sctp/stream_sched.h>
|
||||
|
||||
/* Migrates chunks from stream queues to new stream queues if needed,
|
||||
* but not across associations. Also, removes those chunks to streams
|
||||
* higher than the new max.
|
||||
*/
|
||||
static void sctp_stream_outq_migrate(struct sctp_stream *stream,
|
||||
struct sctp_stream *new, __u16 outcnt)
|
||||
static void sctp_stream_shrink_out(struct sctp_stream *stream, __u16 outcnt)
|
||||
{
|
||||
struct sctp_association *asoc;
|
||||
struct sctp_chunk *ch, *temp;
|
||||
struct sctp_outq *outq;
|
||||
int i;
|
||||
|
||||
asoc = container_of(stream, struct sctp_association, stream);
|
||||
outq = &asoc->outqueue;
|
||||
@ -56,6 +50,19 @@ static void sctp_stream_outq_migrate(struct sctp_stream *stream,
|
||||
|
||||
sctp_chunk_free(ch);
|
||||
}
|
||||
}
|
||||
|
||||
/* Migrates chunks from stream queues to new stream queues if needed,
|
||||
* but not across associations. Also, removes those chunks to streams
|
||||
* higher than the new max.
|
||||
*/
|
||||
static void sctp_stream_outq_migrate(struct sctp_stream *stream,
|
||||
struct sctp_stream *new, __u16 outcnt)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (stream->outcnt > outcnt)
|
||||
sctp_stream_shrink_out(stream, outcnt);
|
||||
|
||||
if (new) {
|
||||
/* Here we actually move the old ext stuff into the new
|
||||
@ -1038,11 +1045,13 @@ struct sctp_chunk *sctp_process_strreset_resp(
|
||||
nums = ntohs(addstrm->number_of_streams);
|
||||
number = stream->outcnt - nums;
|
||||
|
||||
if (result == SCTP_STRRESET_PERFORMED)
|
||||
if (result == SCTP_STRRESET_PERFORMED) {
|
||||
for (i = number; i < stream->outcnt; i++)
|
||||
SCTP_SO(stream, i)->state = SCTP_STREAM_OPEN;
|
||||
else
|
||||
} else {
|
||||
sctp_stream_shrink_out(stream, number);
|
||||
stream->outcnt = number;
|
||||
}
|
||||
|
||||
*evp = sctp_ulpevent_make_stream_change_event(asoc, flags,
|
||||
0, nums, GFP_ATOMIC);
|
||||
|
Loading…
Reference in New Issue
Block a user