Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net,stable v2] vhost: fix skb leak in handle_rx()
From: Jason Wang @ 2017-11-29 14:43 UTC (permalink / raw)
  To: wexu, virtualization, netdev, linux-kernel; +Cc: mjrosato, mst
In-Reply-To: <1511965404-23289-1-git-send-email-wexu@redhat.com>



On 2017年11月29日 22:23, wexu@redhat.com wrote:
> From: Wei Xu <wexu@redhat.com>
>
> Matthew found a roughly 40% tcp throughput regression with commit
> c67df11f(vhost_net: try batch dequing from skb array) as discussed
> in the following thread:
> https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html
>
> Eventually we figured out that it was a skb leak in handle_rx()
> when sending packets to the VM. This usually happens when a guest
> can not drain out vq as fast as vhost fills in, afterwards it sets
> off the traffic jam and leaks skb(s) which occurs as no headcount
> to send on the vq from vhost side.
>
> This can be avoided by making sure we have got enough headcount
> before actually consuming a skb from the batched rx array while
> transmitting, which is simply done by moving checking the zero
> headcount a bit ahead.
>
> Also strengthen the small possibility of leak in case of recvmsg()
> fails by freeing the skb.
>
> Signed-off-by: Wei Xu <wexu@redhat.com>
> Reported-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
> ---
>   drivers/vhost/net.c | 23 +++++++++++++----------
>   1 file changed, 13 insertions(+), 10 deletions(-)
>
> v2:
> - add Matthew as the reporter, thanks matthew.
> - moving zero headcount check ahead instead of defer consuming skb
>    due to jason and mst's comment.
> - add freeing skb in favor of recvmsg() fails.
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 8d626d7..e302e08 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net)
>   		/* On error, stop handling until the next kick. */
>   		if (unlikely(headcount < 0))
>   			goto out;
> -		if (nvq->rx_array)
> -			msg.msg_control = vhost_net_buf_consume(&nvq->rxq);
> -		/* On overrun, truncate and discard */
> -		if (unlikely(headcount > UIO_MAXIOV)) {
> -			iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
> -			err = sock->ops->recvmsg(sock, &msg,
> -						 1, MSG_DONTWAIT | MSG_TRUNC);
> -			pr_debug("Discarded rx packet: len %zd\n", sock_len);
> -			continue;
> -		}
>   		/* OK, now we need to know about added descriptors. */
>   		if (!headcount) {
>   			if (unlikely(vhost_enable_notify(&net->dev, vq))) {
> @@ -800,6 +790,18 @@ static void handle_rx(struct vhost_net *net)
>   			 * they refilled. */
>   			goto out;
>   		}
> +		if (nvq->rx_array)
> +			msg.msg_control = vhost_net_buf_consume(&nvq->rxq);
> +		/* On overrun, truncate and discard */
> +		if (unlikely(headcount > UIO_MAXIOV)) {
> +			iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
> +			err = sock->ops->recvmsg(sock, &msg,
> +						 1, MSG_DONTWAIT | MSG_TRUNC);
> +			if (unlikely(err != 1))
> +				kfree_skb((struct sk_buff *)msg.msg_control);

I think we'd better fix this in tun/tap (better in another patch) 
otherwise it lead to an odd API: some case skb were freed in recvmsg() 
but caller still need to deal with the rest case.

Thanks

> +			pr_debug("Discarded rx packet: len %zd\n", sock_len);
> +			continue;
> +		}
>   		/* We don't need to be notified again. */
>   		iov_iter_init(&msg.msg_iter, READ, vq->iov, in, vhost_len);
>   		fixup = msg.msg_iter;
> @@ -818,6 +820,7 @@ static void handle_rx(struct vhost_net *net)
>   			pr_debug("Discarded rx packet: "
>   				 " len %d, expected %zd\n", err, sock_len);
>   			vhost_discard_vq_desc(vq, headcount);
> +			kfree_skb((struct sk_buff *)msg.msg_control);
>   			continue;
>   		}
>   		/* Supply virtio_net_hdr if VHOST_NET_F_VIRTIO_NET_HDR */

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH] net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit
From: David Miller @ 2017-11-29 14:44 UTC (permalink / raw)
  To: geert+renesas
  Cc: michal.simek, arnd, netdev, linuxppc-dev, linux-arm-kernel,
	linux-kernel
In-Reply-To: <1511949669-30379-1-git-send-email-geert+renesas@glider.be>

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Wed, 29 Nov 2017 11:01:09 +0100

> On 64-bit (e.g. powerpc64/allmodconfig):
> 
>     drivers/net/ethernet/xilinx/ll_temac_main.c: In function 'temac_start_xmit_done':
>     drivers/net/ethernet/xilinx/ll_temac_main.c:633:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 	dev_kfree_skb_irq((struct sk_buff *)cur_p->app4);
> 			  ^
> 
> cdmac_bd.app4 is u32, so it is too small to hold a kernel pointer.
> 
> Note that several other fields in struct cdmac_bd are also too small to
> hold physical addresses on 64-bit platforms.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Yeah, I can't see much value in implementing a hash table converting between
32-bit cookies and 64-bit points just for this if it'll never be actually
used.

Applied, thanks Geert.

^ permalink raw reply

* Re: [PATCH v5 next 1/5] modules:capabilities: add request_module_cap()
From: David Miller @ 2017-11-29 14:50 UTC (permalink / raw)
  To: gnomes
  Cc: keescook, mcgrof, tixxdz, luto, akpm, james.l.morris,
	ben.hutchings, solar, serge, jeyu, rusty, linux-kernel,
	linux-security-module, kernel-hardening, corbet, mingo, netdev,
	peterz, torvalds
In-Reply-To: <20171129134612.72ccb53d@alans-desktop>

From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Date: Wed, 29 Nov 2017 13:46:12 +0000

> I really don't care what the module loading rules end up with and
> whether we add CAP_SYS_YET_ANOTHER_MEANINGLESS_FLAG but what is
> actually needed is to properly incorporate it into securiy ruiles
> for whatever LSM you are using.

I'm surprised we're not using the SHA1 hashes or whatever we compute
for the modules to make sure we are loading the foo.ko that we expect
to be.

Then even if someone can rename every file on the system they cannot
force a rogue module to load unless they build one with a proper hash
collision.

Ie. transform module load strings at build time:

	ppp.ko	--> ppp.ko:SHA1

Or something like that.  And the kernel refuses to load a ppp.ko
with a mismatching SHA1.

All of this capability stuff seems to dance a circle around the
problem rather than fix it.

^ permalink raw reply

* Re: [PATCH] net: via: via-rhine: use %p to format void * address instead of %x
From: David Miller @ 2017-11-29 14:58 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
In-Reply-To: <20171129141149.21705-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Wed, 29 Nov 2017 14:11:49 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't use %x and casting to print out an address, instead use %p
> and remove the casting.  Cleans up smatch warnings:
> 
> drivers/net/ethernet/via/via-rhine.c:998 rhine_init_one_common()
> warn: argument 4 to %lx specifier is cast from pointer
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply

* Re: [PATCH] ethernet: dwmac-stm32: Fix copyright
From: Alexandre Torgue @ 2017-11-29 15:06 UTC (permalink / raw)
  To: Benjamin Gaignard, peppe.cavallaro, mcoquelin.stm32
  Cc: netdev, linux-arm-kernel, linux-kernel, Benjamin Gaignard
In-Reply-To: <20171129142000.22969-1-benjamin.gaignard@st.com>



On 11/29/2017 03:20 PM, Benjamin Gaignard wrote:
> Uniformize STMicroelectronics copyrights header
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> CC: Alexandre Torgue <alexandre.torgue@st.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> index 61cb24810d10..9e6db16af663 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
> @@ -1,8 +1,8 @@
>   /*
>    * dwmac-stm32.c - DWMAC Specific Glue layer for STM32 MCU
>    *
> - * Copyright (C) Alexandre Torgue 2015
> - * Author:  Alexandre Torgue <alexandre.torgue@gmail.com>
> + * Copyright (C) STMicroelectronics SA 2017
> + * Author:  Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
>    * License terms:  GNU General Public License (GPL), version 2
>    *
>    */
> 
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

^ permalink raw reply

* Re: [PATCH] ethernet: dwmac-stm32: Fix copyright
From: David Miller @ 2017-11-29 15:08 UTC (permalink / raw)
  To: benjamin.gaignard
  Cc: peppe.cavallaro, alexandre.torgue, mcoquelin.stm32, netdev,
	linux-arm-kernel, linux-kernel, benjamin.gaignard
In-Reply-To: <20171129142000.22969-1-benjamin.gaignard@st.com>

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Date: Wed, 29 Nov 2017 15:20:00 +0100

> Uniformize STMicroelectronics copyrights header
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>

Applied.

^ permalink raw reply

* Re: [PATCH v2 27/35] irqchip: Andestech Internal Vector Interrupt Controller driver
From: Greentime Hu @ 2017-11-29 15:23 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Greentime, Linux Kernel Mailing List, Arnd Bergmann, linux-arch,
	Thomas Gleixner, Jason Cooper, Rob Herring, netdev, Vincent Chen,
	DTML, Al Viro, David Howells, Will Deacon, Daniel Lezcano,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Rick Chen
In-Reply-To: <c7447c93-9905-2840-e2d8-01837b9fdecd-5wv7dgnIgG8@public.gmane.org>

Hi, Marc:

2017-11-28 17:37 GMT+08:00 Marc Zyngier <marc.zyngier-5wv7dgnIgG8@public.gmane.org>:
> On 27/11/17 12:28, Greentime Hu wrote:
>> +static void ativic32_ack_irq(struct irq_data *data)
>> +{
>> +     __nds32__mtsr_dsb(1 << data->hwirq, NDS32_SR_INT_PEND2);
>
> Consider writing (1 << data->hwirq) as BIT(data->hwirq).

Thanks for this suggestion. I will modify it in the next version patch.

>> +}
>> +
>> +static void ativic32_mask_irq(struct irq_data *data)
>> +{
>> +     unsigned long int_mask2 = __nds32__mfsr(NDS32_SR_INT_MASK2);
>> +     __nds32__mtsr_dsb(int_mask2 & (~(1 << data->hwirq)), NDS32_SR_INT_MASK2);
>
> Same here.

Thanks for this suggestion. I will modify it in the next version patch.

>> +}
>> +
>> +static void ativic32_mask_ack_irq(struct irq_data *data)
>> +{
>> +     unsigned long int_mask2 = __nds32__mfsr(NDS32_SR_INT_MASK2);
>> +     __nds32__mtsr_dsb(int_mask2 & (~(1 << data->hwirq)), NDS32_SR_INT_MASK2);
>> +     __nds32__mtsr_dsb((1 << data->hwirq), NDS32_SR_INT_PEND2);
>
> This is effectively MASK+ACK, so you're better off just writing it as
> such. And since there is no advantage in your implementation in having
> MASK_ACK over MASK+ACK, I suggest you remove this function completely,
> and rely on the core code which will call them in sequence.

I think mask_ack is still better than mask + ack because we don't need
to do two function call.
We can save a prologue and a epilogue. It will benefit interrupt latency.

>> +
>> +}
>> +
>> +static void ativic32_unmask_irq(struct irq_data *data)
>> +{
>> +     unsigned long int_mask2 = __nds32__mfsr(NDS32_SR_INT_MASK2);
>> +     __nds32__mtsr_dsb(int_mask2 | (1 << data->hwirq), NDS32_SR_INT_MASK2);
>
> Same BIT() here.
>
Thanks for this suggestion. I will modify it in the next version patch.

>> +}
>> +
>> +static struct irq_chip ativic32_chip = {
>> +     .name = "ativic32",
>> +     .irq_ack = ativic32_ack_irq,
>> +     .irq_mask = ativic32_mask_irq,
>> +     .irq_mask_ack = ativic32_mask_ack_irq,
>> +     .irq_unmask = ativic32_unmask_irq,
>> +};
>> +
>> +static unsigned int __initdata nivic_map[6] = { 6, 2, 10, 16, 24, 32 };
>> +
>> +static struct irq_domain *root_domain;
>> +static int ativic32_irq_domain_map(struct irq_domain *id, unsigned int virq,
>> +                               irq_hw_number_t hw)
>> +{
>> +
>> +     unsigned long int_trigger_type;
>> +     int_trigger_type = __nds32__mfsr(NDS32_SR_INT_TRIGGER);
>> +     if (int_trigger_type & (1 << hw))
>
> And here.
>
Thanks for this suggestion. I will modify it in the next version patch.

>> +             irq_set_chip_and_handler(virq, &ativic32_chip, handle_edge_irq);
>> +     else
>> +             irq_set_chip_and_handler(virq, &ativic32_chip, handle_level_irq);
>
> Since you do not express the trigger in DT, you need to tell the core
> about it by calling irqd_set_trigger_type() with the right setting.
>

Since the comments say so, I will add ativic32_set_type() for irq_set_type()
in the next version patch.

/*
 * Must only be called inside irq_chip.irq_set_type() functions.
 */
static inline void irqd_set_trigger_type(struct irq_data *d, u32 type)
{
        __irqd_to_state(d) &= ~IRQD_TRIGGER_MASK;
        __irqd_to_state(d) |= type & IRQD_TRIGGER_MASK;
}

It will be like this.
static int ativic32_set_type(struct irq_data *data, unsigned int flow_type)
{
        irqd_set_trigger_type(data, flow_type);
        return IRQ_SET_MASK_OK;
}

>> +
>> +     return 0;
>> +}
>> +
>> +static struct irq_domain_ops ativic32_ops = {
>> +     .map = ativic32_irq_domain_map,
>> +     .xlate = irq_domain_xlate_onecell
>> +};
>> +
>> +static int get_intr_src(void)
>
> I'm not sure "int" is the best return type here. I suspect something
> unsigned would be preferable, or even the irq_hw_number_t type.

Thanks for this suggestion. I will modify it in the next version patch.

>> +{
>> +     return ((__nds32__mfsr(NDS32_SR_ITYPE)&ITYPE_mskVECTOR) >> ITYPE_offVECTOR)
>
> Spaces around '&'.
>
Thanks for this suggestion. I will modify it in the next version patch.

>> +             - NDS32_VECTOR_offINTERRUPT;
>> +}
>> +
>> +asmlinkage void asm_do_IRQ(struct pt_regs *regs)
>> +{
>> +     int hwirq = get_intr_src();
>
> irq_hw_number_t.
>
Thanks for this suggestion. I will modify it in the next version patch.

>> +     handle_domain_irq(root_domain, hwirq, regs);
>> +}
>> +
>> +int __init ativic32_init_irq(struct device_node *node, struct device_node *parent)
>> +{
>> +     unsigned long int_vec_base, nivic;
>> +
>> +     if (WARN(parent, "non-root ativic32 are not supported"))
>> +             return -EINVAL;
>> +
>> +     int_vec_base = __nds32__mfsr(NDS32_SR_IVB);
>> +
>> +     if (((int_vec_base & IVB_mskIVIC_VER) >> IVB_offIVIC_VER) == 0)
>> +             panic("Unable to use atcivic32 for this cpu.\n");
>> +
>> +     nivic = (int_vec_base & IVB_mskNIVIC) >> IVB_offNIVIC;
>> +     if (nivic >= (sizeof nivic_map / sizeof nivic_map[0]))
>
> This should be:
>         if (nivic >= ARRAY_SIZE(NIVIC_MAP))
>
Thanks for this suggestion. I will modify it in the next version patch.

>> +             panic("The number of input for ativic32 is not supported.\n");
>> +
>> +     nivic = nivic_map[nivic];
>
> I'd rather you use another variable (nr_ints?).
>
Thanks for this suggestion. I will modify it in the next version patch.

>> +
>> +     root_domain = irq_domain_add_linear(node, nivic,
>> +                     &ativic32_ops, NULL);
>> +
>> +     if (!root_domain)
>> +             panic("%s: unable to create IRQ domain\n", node->full_name);
>> +
>> +     return 0;
>> +}
>> +IRQCHIP_DECLARE(ativic32, "andestech,ativic32", ativic32_init_irq);
>>
>
> Thanks,
>
>         M.
> --
> Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH v3 36/36] net/mvpp2: Replace tasklet with softirq hrtimer
From: Anna-Maria Gleixner @ 2017-11-29 15:31 UTC (permalink / raw)
  To: LKML
  Cc: Thomas Gleixner, Peter Zijlstra, Ingo Molnar, keescook,
	Christoph Hellwig, John Stultz, Anna-Maria Gleixner,
	Thomas Petazzoni, netdev, David S. Miller
In-Reply-To: <20171129153101.27297-1-anna-maria@linutronix.de>

From: Thomas Gleixner <tglx@linutronix.de>

The tx_done_tasklet tasklet is used in invoke the hrtimer
(mvpp2_hr_timer_cb) in softirq context. This can be also achieved without
the tasklet but with HRTIMER_MODE_SOFT as hrtimer mode.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
---
 drivers/net/ethernet/marvell/mvpp2.c | 62 +++++++++++++++---------------------
 1 file changed, 25 insertions(+), 37 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 6c20e811f973..ab77f68c7fba 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -901,9 +901,8 @@ struct mvpp2_pcpu_stats {
 /* Per-CPU port control */
 struct mvpp2_port_pcpu {
 	struct hrtimer tx_done_timer;
+	struct net_device *dev;
 	bool timer_scheduled;
-	/* Tasklet for egress finalization */
-	struct tasklet_struct tx_done_tasklet;
 };
 
 struct mvpp2_queue_vector {
@@ -6181,46 +6180,34 @@ static void mvpp2_link_event(struct net_device *dev)
 	}
 }
 
-static void mvpp2_timer_set(struct mvpp2_port_pcpu *port_pcpu)
-{
-	ktime_t interval;
-
-	if (!port_pcpu->timer_scheduled) {
-		port_pcpu->timer_scheduled = true;
-		interval = MVPP2_TXDONE_HRTIMER_PERIOD_NS;
-		hrtimer_start(&port_pcpu->tx_done_timer, interval,
-			      HRTIMER_MODE_REL_PINNED);
-	}
-}
-
-static void mvpp2_tx_proc_cb(unsigned long data)
+static enum hrtimer_restart mvpp2_hr_timer_cb(struct hrtimer *timer)
 {
-	struct net_device *dev = (struct net_device *)data;
-	struct mvpp2_port *port = netdev_priv(dev);
-	struct mvpp2_port_pcpu *port_pcpu = this_cpu_ptr(port->pcpu);
+	struct net_device *dev;
+	struct mvpp2_port *port;
+	struct mvpp2_port_pcpu *port_pcpu;
 	unsigned int tx_todo, cause;
 
+	port_pcpu = container_of(timer, struct mvpp2_port_pcpu, tx_done_timer);
+	dev = port_pcpu->dev;
+
 	if (!netif_running(dev))
-		return;
+		return HRTIMER_NORESTART;
+
 	port_pcpu->timer_scheduled = false;
+	port = netdev_priv(dev);
 
 	/* Process all the Tx queues */
 	cause = (1 << port->ntxqs) - 1;
 	tx_todo = mvpp2_tx_done(port, cause, smp_processor_id());
 
 	/* Set the timer in case not all the packets were processed */
-	if (tx_todo)
-		mvpp2_timer_set(port_pcpu);
-}
-
-static enum hrtimer_restart mvpp2_hr_timer_cb(struct hrtimer *timer)
-{
-	struct mvpp2_port_pcpu *port_pcpu = container_of(timer,
-							 struct mvpp2_port_pcpu,
-							 tx_done_timer);
-
-	tasklet_schedule(&port_pcpu->tx_done_tasklet);
+	if (tx_todo && !port_pcpu->timer_scheduled) {
+		port_pcpu->timer_scheduled = true;
+		hrtimer_forward_now(&port_pcpu->tx_done_timer,
+				    MVPP2_TXDONE_HRTIMER_PERIOD_NS);
 
+		return HRTIMER_RESTART;
+	}
 	return HRTIMER_NORESTART;
 }
 
@@ -6698,7 +6685,12 @@ static int mvpp2_tx(struct sk_buff *skb, struct net_device *dev)
 	    txq_pcpu->count > 0) {
 		struct mvpp2_port_pcpu *port_pcpu = this_cpu_ptr(port->pcpu);
 
-		mvpp2_timer_set(port_pcpu);
+		if (!port_pcpu->timer_scheduled) {
+			port_pcpu->timer_scheduled = true;
+			hrtimer_start(&port_pcpu->tx_done_timer,
+				      MVPP2_TXDONE_HRTIMER_PERIOD_NS,
+				      HRTIMER_MODE_REL_PINNED_SOFT);
+		}
 	}
 
 	return NETDEV_TX_OK;
@@ -7127,7 +7119,6 @@ static int mvpp2_stop(struct net_device *dev)
 
 			hrtimer_cancel(&port_pcpu->tx_done_timer);
 			port_pcpu->timer_scheduled = false;
-			tasklet_kill(&port_pcpu->tx_done_tasklet);
 		}
 	}
 	mvpp2_cleanup_rxqs(port);
@@ -7918,13 +7909,10 @@ static int mvpp2_port_probe(struct platform_device *pdev,
 			port_pcpu = per_cpu_ptr(port->pcpu, cpu);
 
 			hrtimer_init(&port_pcpu->tx_done_timer, CLOCK_MONOTONIC,
-				     HRTIMER_MODE_REL_PINNED);
+				     HRTIMER_MODE_REL_PINNED_SOFT);
 			port_pcpu->tx_done_timer.function = mvpp2_hr_timer_cb;
 			port_pcpu->timer_scheduled = false;
-
-			tasklet_init(&port_pcpu->tx_done_tasklet,
-				     mvpp2_tx_proc_cb,
-				     (unsigned long)dev);
+			port_pcpu->dev = dev;
 		}
 	}
 
-- 
2.11.0

^ permalink raw reply related

* Re: [PATCH net,stable v2] vhost: fix skb leak in handle_rx()
From: Michael S. Tsirkin @ 2017-11-29 15:31 UTC (permalink / raw)
  To: wexu; +Cc: virtualization, netdev, linux-kernel, jasowang, mjrosato
In-Reply-To: <1511965404-23289-1-git-send-email-wexu@redhat.com>

On Wed, Nov 29, 2017 at 09:23:24AM -0500, wexu@redhat.com wrote:
> From: Wei Xu <wexu@redhat.com>
> 
> Matthew found a roughly 40% tcp throughput regression with commit
> c67df11f(vhost_net: try batch dequing from skb array) as discussed
> in the following thread:
> https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html
> 
> Eventually we figured out that it was a skb leak in handle_rx()
> when sending packets to the VM. This usually happens when a guest
> can not drain out vq as fast as vhost fills in, afterwards it sets
> off the traffic jam and leaks skb(s) which occurs as no headcount
> to send on the vq from vhost side.
> 
> This can be avoided by making sure we have got enough headcount
> before actually consuming a skb from the batched rx array while
> transmitting, which is simply done by moving checking the zero
> headcount a bit ahead.
> 
> Also strengthen the small possibility of leak in case of recvmsg()
> fails by freeing the skb.
> 
> Signed-off-by: Wei Xu <wexu@redhat.com>
> Reported-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
> ---
>  drivers/vhost/net.c | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)
> 
> v2:
> - add Matthew as the reporter, thanks matthew.
> - moving zero headcount check ahead instead of defer consuming skb
>   due to jason and mst's comment.
> - add freeing skb in favor of recvmsg() fails.
> 
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 8d626d7..e302e08 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net)
>  		/* On error, stop handling until the next kick. */
>  		if (unlikely(headcount < 0))
>  			goto out;
> -		if (nvq->rx_array)
> -			msg.msg_control = vhost_net_buf_consume(&nvq->rxq);
> -		/* On overrun, truncate and discard */
> -		if (unlikely(headcount > UIO_MAXIOV)) {
> -			iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
> -			err = sock->ops->recvmsg(sock, &msg,
> -						 1, MSG_DONTWAIT | MSG_TRUNC);
> -			pr_debug("Discarded rx packet: len %zd\n", sock_len);
> -			continue;
> -		}
>  		/* OK, now we need to know about added descriptors. */
>  		if (!headcount) {
>  			if (unlikely(vhost_enable_notify(&net->dev, vq))) {
> @@ -800,6 +790,18 @@ static void handle_rx(struct vhost_net *net)
>  			 * they refilled. */
>  			goto out;
>  		}
> +		if (nvq->rx_array)
> +			msg.msg_control = vhost_net_buf_consume(&nvq->rxq);
> +		/* On overrun, truncate and discard */
> +		if (unlikely(headcount > UIO_MAXIOV)) {
> +			iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
> +			err = sock->ops->recvmsg(sock, &msg,
> +						 1, MSG_DONTWAIT | MSG_TRUNC);
> +			if (unlikely(err != 1))

Why 1? How is receiving 1 byte special or even possible?
Also, I wouldn't put an unlikely here. It's all error handling code anyway.

> +				kfree_skb((struct sk_buff *)msg.msg_control);

You do not need a cast here.
Also, is it really safe to refer to msg_control here?
I'd rather keep a copy of the skb pointer and use it than assume
caller did not change it. But also see below.

> +			pr_debug("Discarded rx packet: len %zd\n", sock_len);
> +			continue;
> +		}
>  		/* We don't need to be notified again. */
>  		iov_iter_init(&msg.msg_iter, READ, vq->iov, in, vhost_len);
>  		fixup = msg.msg_iter;
> @@ -818,6 +820,7 @@ static void handle_rx(struct vhost_net *net)
>  			pr_debug("Discarded rx packet: "
>  				 " len %d, expected %zd\n", err, sock_len);
>  			vhost_discard_vq_desc(vq, headcount);
> +			kfree_skb((struct sk_buff *)msg.msg_control);

You do not need a cast here.

Also, we have

        ret = tun_put_user(tun, tfile, skb, to);
        if (unlikely(ret < 0))
                kfree_skb(skb);
        else
                consume_skb(skb);

        return ret;

So it looks like recvmsg actually always consumes the skb.
So I was wrong when I said you need to kfree it after
recv msg, and your original patch was good.

Jason, what do you think?

>  			continue;
>  		}
>  		/* Supply virtio_net_hdr if VHOST_NET_F_VIRTIO_NET_HDR */
> -- 
> 1.8.3.1

^ permalink raw reply

* [PATCH v3 32/36] xfrm: Replace hrtimer tasklet with softirq hrtimer
From: Anna-Maria Gleixner @ 2017-11-29 15:30 UTC (permalink / raw)
  To: LKML
  Cc: Thomas Gleixner, Peter Zijlstra, Ingo Molnar, keescook,
	Christoph Hellwig, John Stultz, Anna-Maria Gleixner,
	Steffen Klassert, netdev, Herbert Xu, David S. Miller
In-Reply-To: <20171129153101.27297-1-anna-maria@linutronix.de>

From: Thomas Gleixner <tglx@linutronix.de>

Switch the timer to HRTIMER_MODE_SOFT, which executed the timer
callback in softirq context and remove the hrtimer_tasklet.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: netdev@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
---
 include/net/xfrm.h    |  2 +-
 net/xfrm/xfrm_state.c | 30 ++++++++++++++++++------------
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index dc28a98ce97c..e706ec81bd14 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -217,7 +217,7 @@ struct xfrm_state {
 	struct xfrm_stats	stats;
 
 	struct xfrm_lifetime_cur curlft;
-	struct tasklet_hrtimer	mtimer;
+	struct hrtimer		mtimer;
 
 	struct xfrm_state_offload xso;
 
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 065d89606888..4be5fc7038af 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -426,7 +426,7 @@ static void xfrm_put_mode(struct xfrm_mode *mode)
 
 static void xfrm_state_gc_destroy(struct xfrm_state *x)
 {
-	tasklet_hrtimer_cancel(&x->mtimer);
+	hrtimer_cancel(&x->mtimer);
 	del_timer_sync(&x->rtimer);
 	kfree(x->aead);
 	kfree(x->aalg);
@@ -471,8 +471,8 @@ static void xfrm_state_gc_task(struct work_struct *work)
 
 static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me)
 {
-	struct tasklet_hrtimer *thr = container_of(me, struct tasklet_hrtimer, timer);
-	struct xfrm_state *x = container_of(thr, struct xfrm_state, mtimer);
+	struct xfrm_state *x = container_of(me, struct xfrm_state, mtimer);
+	enum hrtimer_restart ret = HRTIMER_NORESTART;
 	unsigned long now = get_seconds();
 	long next = LONG_MAX;
 	int warn = 0;
@@ -536,7 +536,8 @@ static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me)
 		km_state_expired(x, 0, 0);
 resched:
 	if (next != LONG_MAX) {
-		tasklet_hrtimer_start(&x->mtimer, ktime_set(next, 0), HRTIMER_MODE_REL);
+		hrtimer_forward_now(&x->mtimer, ktime_set(next, 0));
+		ret = HRTIMER_RESTART;
 	}
 
 	goto out;
@@ -553,7 +554,7 @@ static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me)
 
 out:
 	spin_unlock(&x->lock);
-	return HRTIMER_NORESTART;
+	return ret;
 }
 
 static void xfrm_replay_timer_handler(struct timer_list *t);
@@ -572,8 +573,8 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
 		INIT_HLIST_NODE(&x->bydst);
 		INIT_HLIST_NODE(&x->bysrc);
 		INIT_HLIST_NODE(&x->byspi);
-		tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler,
-					CLOCK_BOOTTIME, HRTIMER_MODE_ABS);
+		hrtimer_init(&x->mtimer, CLOCK_BOOTTIME, HRTIMER_MODE_ABS_SOFT);
+		x->mtimer.function = xfrm_timer_handler;
 		timer_setup(&x->rtimer, xfrm_replay_timer_handler, 0);
 		x->curlft.add_time = get_seconds();
 		x->lft.soft_byte_limit = XFRM_INF;
@@ -1029,7 +1030,9 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
 				hlist_add_head_rcu(&x->byspi, net->xfrm.state_byspi + h);
 			}
 			x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
-			tasklet_hrtimer_start(&x->mtimer, ktime_set(net->xfrm.sysctl_acq_expires, 0), HRTIMER_MODE_REL);
+			hrtimer_start(&x->mtimer,
+				      ktime_set(net->xfrm.sysctl_acq_expires, 0),
+				      HRTIMER_MODE_REL_SOFT);
 			net->xfrm.state_num++;
 			xfrm_hash_grow_check(net, x->bydst.next != NULL);
 			spin_unlock_bh(&net->xfrm.xfrm_state_lock);
@@ -1140,7 +1143,7 @@ static void __xfrm_state_insert(struct xfrm_state *x)
 		hlist_add_head_rcu(&x->byspi, net->xfrm.state_byspi + h);
 	}
 
-	tasklet_hrtimer_start(&x->mtimer, ktime_set(1, 0), HRTIMER_MODE_REL);
+	hrtimer_start(&x->mtimer, ktime_set(1, 0), HRTIMER_MODE_REL_SOFT);
 	if (x->replay_maxage)
 		mod_timer(&x->rtimer, jiffies + x->replay_maxage);
 
@@ -1244,7 +1247,9 @@ static struct xfrm_state *__find_acq_core(struct net *net,
 		x->mark.m = m->m;
 		x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
 		xfrm_state_hold(x);
-		tasklet_hrtimer_start(&x->mtimer, ktime_set(net->xfrm.sysctl_acq_expires, 0), HRTIMER_MODE_REL);
+		hrtimer_start(&x->mtimer,
+			      ktime_set(net->xfrm.sysctl_acq_expires, 0),
+			      HRTIMER_MODE_REL_SOFT);
 		list_add(&x->km.all, &net->xfrm.state_all);
 		hlist_add_head_rcu(&x->bydst, net->xfrm.state_bydst + h);
 		h = xfrm_src_hash(net, daddr, saddr, family);
@@ -1543,7 +1548,8 @@ int xfrm_state_update(struct xfrm_state *x)
 		memcpy(&x1->lft, &x->lft, sizeof(x1->lft));
 		x1->km.dying = 0;
 
-		tasklet_hrtimer_start(&x1->mtimer, ktime_set(1, 0), HRTIMER_MODE_REL);
+		hrtimer_start(&x1->mtimer, ktime_set(1, 0),
+			      HRTIMER_MODE_REL_SOFT);
 		if (x1->curlft.use_time)
 			xfrm_state_check_expire(x1);
 
@@ -1567,7 +1573,7 @@ int xfrm_state_check_expire(struct xfrm_state *x)
 	if (x->curlft.bytes >= x->lft.hard_byte_limit ||
 	    x->curlft.packets >= x->lft.hard_packet_limit) {
 		x->km.state = XFRM_STATE_EXPIRED;
-		tasklet_hrtimer_start(&x->mtimer, 0, HRTIMER_MODE_REL);
+		hrtimer_start(&x->mtimer, 0, HRTIMER_MODE_REL_SOFT);
 		return -EINVAL;
 	}
 
-- 
2.11.0

^ permalink raw reply related

* [PATCH net-next 0/3] rxrpc: Fixes
From: David Howells @ 2017-11-29 15:33 UTC (permalink / raw)
  To: netdev; +Cc: dhowells, linux-afs, linux-kernel


Here are three patches for AF_RXRPC.  One removes some whitespace, one
fixes terminal ACK generation and the third makes a couple of places
actually use the timeout value just determined rather than ignoring it.

The patches can be found here also:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes

Tagged thusly:

	git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
	rxrpc-fixes-20171129

David
---
David Howells (2):
      rxrpc: Clean up whitespace
      rxrpc: Fix ACK generation from the connection event processor

Gustavo A. R. Silva (1):
      rxrpc: Fix variable overwrite


 net/rxrpc/call_event.c  |    4 ++--
 net/rxrpc/conn_event.c  |   50 +++++++++++++++++++++++++++--------------------
 net/rxrpc/conn_object.c |    2 +-
 net/rxrpc/input.c       |    4 ++--
 net/rxrpc/sendmsg.c     |    2 +-
 5 files changed, 35 insertions(+), 27 deletions(-)

^ permalink raw reply

* [PATCH net 1/3] rxrpc: Clean up whitespace
From: David Howells @ 2017-11-29 15:33 UTC (permalink / raw)
  To: netdev; +Cc: dhowells, linux-afs, linux-kernel
In-Reply-To: <151196962346.18702.5358430553616328740.stgit@warthog.procyon.org.uk>

Clean up some whitespace from rxrpc.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/call_event.c  |    2 +-
 net/rxrpc/conn_object.c |    2 +-
 net/rxrpc/input.c       |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index bda952ffe6a6..555274ddc514 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -426,7 +426,7 @@ void rxrpc_process_call(struct work_struct *work)
 	next = call->expect_rx_by;
 
 #define set(T) { t = READ_ONCE(T); if (time_before(t, next)) next = t; }
-	
+
 	set(call->expect_req_by);
 	set(call->expect_term_by);
 	set(call->ack_at);
diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c
index 1aad04a32d5e..c628351eb900 100644
--- a/net/rxrpc/conn_object.c
+++ b/net/rxrpc/conn_object.c
@@ -424,7 +424,7 @@ void rxrpc_service_connection_reaper(struct work_struct *work)
 	if (earliest != now + MAX_JIFFY_OFFSET) {
 		_debug("reschedule reaper %ld", (long)earliest - (long)now);
 		ASSERT(time_after(earliest, now));
-		rxrpc_set_service_reap_timer(rxnet, earliest);		
+		rxrpc_set_service_reap_timer(rxnet, earliest);
 	}
 
 	while (!list_empty(&graveyard)) {
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 23a5e61d8f79..6fc61400337f 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -976,7 +976,7 @@ static void rxrpc_input_call_packet(struct rxrpc_call *call,
 		rxrpc_reduce_call_timer(call, expect_rx_by, now,
 					rxrpc_timer_set_for_normal);
 	}
-	
+
 	switch (sp->hdr.type) {
 	case RXRPC_PACKET_TYPE_DATA:
 		rxrpc_input_data(call, skb, skew);
@@ -1213,7 +1213,7 @@ void rxrpc_data_ready(struct sock *udp_sk)
 				goto reupgrade;
 			conn->service_id = sp->hdr.serviceId;
 		}
-		
+
 		if (sp->hdr.callNumber == 0) {
 			/* Connection-level packet */
 			_debug("CONN %p {%d}", conn, conn->debug_id);

^ permalink raw reply related

* [PATCH net 2/3] rxrpc: Fix ACK generation from the connection event processor
From: David Howells @ 2017-11-29 15:33 UTC (permalink / raw)
  To: netdev; +Cc: dhowells, linux-kernel, Jeffrey Altman, linux-afs
In-Reply-To: <151196962346.18702.5358430553616328740.stgit@warthog.procyon.org.uk>

Repeat terminal ACKs and now terminal ACKs are now generated from the
connection event processor rather from call handling as this allows us to
discard client call structures as soon as possible and free up the channel
for a follow on call.

However, in ACKs so generated, the additional information trailer is
malformed because the padding that's meant to be in the middle isn't
included in what's transmitted.

Fix it so that the 3 bytes of padding are included in the transmission.

Further, the trailer is misaligned because of the padding, so assigment to
the u16 and u32 fields inside it might cause problems on some arches, so
fix this by breaking the padding and the trailer out of the packed struct.

(This also deals with potential compiler weirdies where some of the nested
structs are packed and some aren't).

The symptoms can be seen in wireshark as terminal DUPLICATE or IDLE ACK
packets in which the Max MTU, Interface MTU and rwind fields have weird
values and the Max Packets field is apparently missing.

Reported-by: Jeffrey Altman <jaltman@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/conn_event.c |   50 ++++++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c
index 9e9a8db1bc9c..4ca11be6be3c 100644
--- a/net/rxrpc/conn_event.c
+++ b/net/rxrpc/conn_event.c
@@ -30,22 +30,18 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
 	struct rxrpc_skb_priv *sp = skb ? rxrpc_skb(skb) : NULL;
 	struct rxrpc_channel *chan;
 	struct msghdr msg;
-	struct kvec iov;
+	struct kvec iov[3];
 	struct {
 		struct rxrpc_wire_header whdr;
 		union {
-			struct {
-				__be32 code;
-			} abort;
-			struct {
-				struct rxrpc_ackpacket ack;
-				u8 padding[3];
-				struct rxrpc_ackinfo info;
-			};
+			__be32 abort_code;
+			struct rxrpc_ackpacket ack;
 		};
 	} __attribute__((packed)) pkt;
+	struct rxrpc_ackinfo ack_info;
 	size_t len;
-	u32 serial, mtu, call_id;
+	int ioc;
+	u32 serial, mtu, call_id, padding;
 
 	_enter("%d", conn->debug_id);
 
@@ -66,6 +62,13 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
 	msg.msg_controllen = 0;
 	msg.msg_flags	= 0;
 
+	iov[0].iov_base	= &pkt;
+	iov[0].iov_len	= sizeof(pkt.whdr);
+	iov[1].iov_base	= &padding;
+	iov[1].iov_len	= 3;
+	iov[2].iov_base	= &ack_info;
+	iov[2].iov_len	= sizeof(ack_info);
+
 	pkt.whdr.epoch		= htonl(conn->proto.epoch);
 	pkt.whdr.cid		= htonl(conn->proto.cid);
 	pkt.whdr.callNumber	= htonl(call_id);
@@ -80,8 +83,10 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
 	len = sizeof(pkt.whdr);
 	switch (chan->last_type) {
 	case RXRPC_PACKET_TYPE_ABORT:
-		pkt.abort.code	= htonl(chan->last_abort);
-		len += sizeof(pkt.abort);
+		pkt.abort_code	= htonl(chan->last_abort);
+		iov[0].iov_len += sizeof(pkt.abort_code);
+		len += sizeof(pkt.abort_code);
+		ioc = 1;
 		break;
 
 	case RXRPC_PACKET_TYPE_ACK:
@@ -94,13 +99,19 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
 		pkt.ack.serial		= htonl(skb ? sp->hdr.serial : 0);
 		pkt.ack.reason		= skb ? RXRPC_ACK_DUPLICATE : RXRPC_ACK_IDLE;
 		pkt.ack.nAcks		= 0;
-		pkt.info.rxMTU		= htonl(rxrpc_rx_mtu);
-		pkt.info.maxMTU		= htonl(mtu);
-		pkt.info.rwind		= htonl(rxrpc_rx_window_size);
-		pkt.info.jumbo_max	= htonl(rxrpc_rx_jumbo_max);
+		ack_info.rxMTU		= htonl(rxrpc_rx_mtu);
+		ack_info.maxMTU		= htonl(mtu);
+		ack_info.rwind		= htonl(rxrpc_rx_window_size);
+		ack_info.jumbo_max	= htonl(rxrpc_rx_jumbo_max);
 		pkt.whdr.flags		|= RXRPC_SLOW_START_OK;
-		len += sizeof(pkt.ack) + sizeof(pkt.info);
+		padding			= 0;
+		iov[0].iov_len += sizeof(pkt.ack);
+		len += sizeof(pkt.ack) + 3 + sizeof(ack_info);
+		ioc = 3;
 		break;
+
+	default:
+		return;
 	}
 
 	/* Resync with __rxrpc_disconnect_call() and check that the last call
@@ -110,9 +121,6 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
 	if (READ_ONCE(chan->last_call) != call_id)
 		return;
 
-	iov.iov_base	= &pkt;
-	iov.iov_len	= len;
-
 	serial = atomic_inc_return(&conn->serial);
 	pkt.whdr.serial = htonl(serial);
 
@@ -127,7 +135,7 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
 		break;
 	}
 
-	kernel_sendmsg(conn->params.local->socket, &msg, &iov, 1, len);
+	kernel_sendmsg(conn->params.local->socket, &msg, iov, ioc, len);
 	_leave("");
 	return;
 }

^ permalink raw reply related

* [PATCH net 3/3] rxrpc: Fix variable overwrite
From: David Howells @ 2017-11-29 15:34 UTC (permalink / raw)
  To: netdev; +Cc: dhowells, Gustavo A. R. Silva, linux-afs, linux-kernel
In-Reply-To: <151196962346.18702.5358430553616328740.stgit@warthog.procyon.org.uk>

From: Gustavo A. R. Silva <garsilva@embeddedor.com>

Values assigned to both variable resend_at and ack_at are overwritten
before they can be used.

The correct fix here is to add 'now' to the previously computed value in
resend_at and ack_at.

Addresses-Coverity-ID: 1462262
Addresses-Coverity-ID: 1462263
Addresses-Coverity-ID: 1462264
Fixes: beb8e5e4f38c ("rxrpc: Express protocol timeouts in terms of RTT")
Link: https://marc.info/?i=17004.1511808959%40warthog.procyon.org.uk
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/call_event.c |    2 +-
 net/rxrpc/sendmsg.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index 555274ddc514..ad2ab1103189 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -123,7 +123,7 @@ static void __rxrpc_propose_ACK(struct rxrpc_call *call, u8 ack_reason,
 		else
 			ack_at = expiry;
 
-		ack_at = jiffies + expiry;
+		ack_at += now;
 		if (time_before(ack_at, call->ack_at)) {
 			WRITE_ONCE(call->ack_at, ack_at);
 			rxrpc_reduce_call_timer(call, ack_at, now,
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index a1c53ac066a1..09f2a3e05221 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -233,7 +233,7 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call,
 		if (resend_at < 1)
 			resend_at = 1;
 
-		resend_at = now + rxrpc_resend_timeout;
+		resend_at += now;
 		WRITE_ONCE(call->resend_at, resend_at);
 		rxrpc_reduce_call_timer(call, resend_at, now,
 					rxrpc_timer_set_for_send);

^ permalink raw reply related

* [PATCH] Documentation: net: dsa: Cut set_addr() documentation
From: Linus Walleij @ 2017-11-29 15:34 UTC (permalink / raw)
  To: Andrew Lunn, Vivien Didelot, Florian Fainelli; +Cc: netdev, Linus Walleij

This is not supported anymore, devices needing a MAC address
just assign one at random, it's just a driver pecularity.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 Documentation/networking/dsa/dsa.txt | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/Documentation/networking/dsa/dsa.txt b/Documentation/networking/dsa/dsa.txt
index b8b40753133e..25170ad7d25b 100644
--- a/Documentation/networking/dsa/dsa.txt
+++ b/Documentation/networking/dsa/dsa.txt
@@ -385,11 +385,6 @@ Switch configuration
   avoid relying on what a previous software agent such as a bootloader/firmware
   may have previously configured.
 
-- set_addr: Some switches require the programming of the management interface's
-  Ethernet MAC address, switch drivers can also disable ageing of MAC addresses
-  on the management interface and "hardcode"/"force" this MAC address for the
-  CPU/management interface as an optimization
-
 PHY devices and link management
 -------------------------------
 
-- 
2.14.3

^ permalink raw reply related

* Re: [PATCH] net: stmmac: dwmac-sun8i: fix allwinner,leds-active-low handling
From: Andrew Lunn @ 2017-11-29 15:37 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: alexandre.torgue-qxv4g6HH51o, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, wens-jdAy2FN1RRM,
	peppe.cavallaro-qxv4g6HH51o,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20171129090240.GA3699@Red>

On Wed, Nov 29, 2017 at 10:02:40AM +0100, Corentin Labbe wrote:
> On Tue, Nov 28, 2017 at 06:38:26PM +0100, Andrew Lunn wrote:
> > On Tue, Nov 28, 2017 at 05:48:22PM +0100, Corentin Labbe wrote:
> > > The driver expect "allwinner,leds-active-low" to be in PHY node, but
> > > the binding doc expect it to be in MAC node.
> > > 
> > > Since all board DT use it also in MAC node, the driver need to search
> > > allwinner,leds-active-low in MAC node.
> > 
> > Hi Corentin
> > 
> > I'm having trouble working out how this worked before. This is code
> > you moved around, when adding external/internal MDIOs. But the very
> > first version of this driver code used priv->plat->phy_node. Did that
> > somehow point to the MAC node when the internal PHY is used? Or has it
> > been broken all the time?
> > 
> 
> Hello
> 

> Since this feature control only when the activity LED need to blink,
> nobody see that it was broken.

Hi Corentin

So it never worked?

If it never worked, moving the DT properties into the PHY node, where
they belong, won't introduce a regression :-)

     Andrew

^ permalink raw reply

* Re: [PATCH net-next 0/3] rxrpc: Fixes
From: David Miller @ 2017-11-29 15:39 UTC (permalink / raw)
  To: dhowells; +Cc: netdev, linux-afs, linux-kernel
In-Reply-To: <151196962346.18702.5358430553616328740.stgit@warthog.procyon.org.uk>

From: David Howells <dhowells@redhat.com>
Date: Wed, 29 Nov 2017 15:33:43 +0000

> 
> Here are three patches for AF_RXRPC.  One removes some whitespace, one
> fixes terminal ACK generation and the third makes a couple of places
> actually use the timeout value just determined rather than ignoring it.
> 
> The patches can be found here also:
> 
> 	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
> 
> Tagged thusly:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
> 	rxrpc-fixes-20171129

This email says "net-next", yet your patches say "net".

net-next is closed, but if these are real fixes they should go to 'net'.

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2017-11-29 15:40 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


There is a small overlapping conflict to net/rxrpc/call_object.c, it should
be easy to resolve.  In your tree there was a setup_timer() --> timer_setup()
conversion, and in my tree there are new lines adding a lockdep_set_class()
call right beforehand.

1) The forcedeth conversion from pci_*() DMA interfaces to dma_*() ones
   missed one spot.  From Zhu Yanjun.

2) Missing CRYPTO_SHA256 Kconfig dep in cfg80211, from Johannes Berg.

3) Fix checksum offloading in thunderx driver, from Sunil Goutham.

4) Add SPDX to vm_sockets_diag.h, from Stephen Hemminger.

5) Fix use after free of packet headers in TIPC, from Jon Maloy.

6) "sizeof(ptr)" vs "sizeof(*ptr)" bug in i40e, from Gustavo A R
   Silva.

7) Tunneling fixes in mlxsw driver, from Petr Machata.

8) Fix crash in fanout_demux_rollover() of AF_PACKET, from Mike
   Maloney.

9) Fix race in AF_PACKET bind() vs. NETDEV_UP notifier, from Eric
   Dumazet.

10) Fix regression in sch_sfq.c due to one of the timer_setup()
    conversions.  From Paolo Abeni.

11) SCTP does list_for_each_entry() using wrong struct member,
    fix from Xin Long.

12) Don't use big endian netlink attribute read for
    IFLA_BOND_AD_ACTOR_SYSTEM, it is in cpu endianness.
    Also from Xin Long.

13) Fix mis-initialization of q->link.clock in CBQ scheduler, preventing
    adding filters there.  From Jiri Pirko.

Please pull, thanks a lot!

The following changes since commit 1d3b78bbc6e983fabb3fbf91b76339bf66e4a12c:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2017-11-23 21:18:46 -1000)

are available in the git repository at:

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

for you to fetch changes up to f6454f80e8a965fca203dab28723f68ec78db608:

  ethernet: dwmac-stm32: Fix copyright (2017-11-29 10:08:09 -0500)

----------------------------------------------------------------
Ahmad Fatoum (1):
      e1000: Fix off-by-one in debug message

Amritha Nambiar (1):
      i40e: Fix reporting incorrect error codes

Antoine Tenart (4):
      net: mvpp2: fix the txq_init error path
      net: mvpp2: cleanup probed ports in the probe error path
      net: mvpp2: check ethtool sets the Tx ring size is to a valid min value
      net: phy: marvell10g: fix the PHY id mask

Benjamin Gaignard (1):
      ethernet: dwmac-stm32: Fix copyright

Christophe JAILLET (1):
      bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()'

Chun-Yeow Yeoh (1):
      mac80211: fix the update of path metric for RANN frame

Colin Ian King (5):
      ambassador: fix incorrect indentation of assignment statement
      atm: fore200e: use %pK to format kernel addresses instead of %x
      atm: lanai: use %p to format kernel addresses instead of %x
      atm: suni: remove extraneous space to fix indentation
      net: via: via-rhine: use %p to format void * address instead of %x

David Howells (12):
      rxrpc: The mutex lock returned by rxrpc_accept_call() needs releasing
      rxrpc: Don't set upgrade by default in sendmsg()
      rxrpc: Provide a different lockdep key for call->user_mutex for kernel calls
      rxrpc: Delay terminal ACK transmission on a client call
      rxrpc: Split the call params from the operation params
      rxrpc: Fix call timeouts
      rxrpc: Don't transmit DELAY ACKs immediately on proposal
      rxrpc: Express protocol timeouts in terms of RTT
      rxrpc: Add a timeout for detecting lost ACKs/lost DATA
      rxrpc: Add keepalive for a call
      rxrpc: Fix service endpoint expiry
      rxrpc: Fix conn expiry timers

David S. Miller (7):
      Merge tag 'rxrpc-fixes-20171124' of git://git.kernel.org/.../dhowells/linux-fs
      Merge branch 'sctp-stream-reconfig-fixes'
      Merge tag 'mac80211-for-davem-2017-11-27' of git://git.kernel.org/.../jberg/mac80211
      Merge branch '40GbE' of git://git.kernel.org/.../jkirsher/net-queue
      Merge branch 'mlxsw-GRE-offloading-fixes'
      Merge branch 'mvpp2-fixes'
      Merge branch 'sctp-fix-sparse-errors'

Eduardo Otubo (1):
      xen-netfront: remove warning when unloading module

Eric Dumazet (1):
      net/packet: fix a race in packet_bind() and packet_notifier()

Geert Uytterhoeven (1):
      net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit

Gustavo A R Silva (1):
      i40e/virtchnl: fix application of sizeof to pointer

Gustavo A. R. Silva (1):
      net: openvswitch: datapath: fix data type in queue_gso_packets

Hyong-Youb Kim (1):
      myri10ge: Update MAINTAINERS

Jakub Kicinski (1):
      cls_bpf: don't decrement net's refcount when offload fails

Jiri Pirko (1):
      net: sched: cbq: create block for q->link.block

Johannes Berg (2):
      cfg80211: select CRYPTO_SHA256 if needed
      mac80211: use QoS NDP for AP probing

Jon Maloy (1):
      tipc: eliminate access after delete in group_filter_msg()

Jorgen Hansen (2):
      VSOCK: Don't call vsock_stream_has_data in atomic context
      VSOCK: Don't set sk_state to TCP_CLOSE before testing it

Mika Westerberg (1):
      net: thunderbolt: Stop using zero to mean no valid DMA mapping

Mike Maloney (1):
      packet: fix crash in fanout_demux_rollover()

Paolo Abeni (1):
      sch_sfq: fix null pointer dereference at timer expiration

Petr Machata (4):
      mlxsw: spectrum_router: Offload decap only for up tunnels
      mlxsw: spectrum_router: Demote tunnels on VRF migration
      mlxsw: spectrum_router: Handle encap to demoted tunnels
      mlxsw: spectrum_router: Update nexthop RIF on update

Roman Kapl (1):
      net: sched: crash on blocks with goto chain action

Sara Sharon (1):
      mac80211: tear down RX aggregations first

Sasha Neftin (1):
      e1000e: fix the use of magic numbers for buffer overrun issue

Stephen Hemminger (1):
      uapi: add SPDX identifier to vm_sockets_diag.h

Sunil Goutham (1):
      net: thunderx: Fix TCP/UDP checksum offload for IPv6 pkts

Vasyl Gomonovych (1):
      lmc: Use memdup_user() as a cleanup

Vivien Didelot (1):
      net: dsa: fix 'increment on 0' warning

Xin Long (11):
      sctp: use sizeof(__u16) for each stream number length instead of magic number
      sctp: only allow the out stream reset when the stream outq is empty
      sctp: only allow the asoc reset when the asoc outq is empty
      sctp: avoid flushing unsent queue when doing asoc reset
      sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1
      sctp: force SCTP_ERROR_INV_STRM with __u32 when calling sctp_chunk_fail
      sctp: force the params with right types for sctp csum apis
      sctp: remove extern from stream sched
      sctp: use right member as the param of list_for_each_entry
      bonding: use nla_get_u64 to extract the value for IFLA_BOND_AD_ACTOR_SYSTEM
      vxlan: use __be32 type for the param vni in __vxlan_fdb_delete

Yan Markman (1):
      net: mvpp2: do not disable GMAC padding

Zhu Yanjun (1):
      forcedeth: replace pci_unmap_page with dma_unmap_page

zhangliping (1):
      openvswitch: fix the incorrect flow action alloc size

 MAINTAINERS                                           |   4 +-
 drivers/atm/ambassador.c                              |   2 +-
 drivers/atm/fore200e.c                                |   4 +-
 drivers/atm/lanai.c                                   |   8 ++--
 drivers/atm/suni.c                                    |   2 +-
 drivers/net/bonding/bond_netlink.c                    |   2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c     |   4 +-
 drivers/net/ethernet/cavium/thunder/nicvf_queues.c    |   1 -
 drivers/net/ethernet/intel/e1000/e1000_hw.c           |   6 ++-
 drivers/net/ethernet/intel/e1000e/ich8lan.h           |   3 +-
 drivers/net/ethernet/intel/e1000e/netdev.c            |   9 +++--
 drivers/net/ethernet/intel/i40e/i40e_main.c           |   1 -
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c    |   2 +-
 drivers/net/ethernet/marvell/mvpp2.c                  |  46 +++++++++--------------
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 109 +++++++++++++++++++++++++++++++++--------------------
 drivers/net/ethernet/nvidia/forcedeth.c               |   4 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c     |   4 +-
 drivers/net/ethernet/via/via-rhine.c                  |   4 +-
 drivers/net/ethernet/xilinx/Kconfig                   |   1 +
 drivers/net/phy/marvell10g.c                          |   5 ++-
 drivers/net/thunderbolt.c                             |  57 ++++++++++++----------------
 drivers/net/vxlan.c                                   |   4 +-
 drivers/net/wan/lmc/lmc_main.c                        |  13 ++-----
 drivers/net/wireless/ath/ath9k/channel.c              |   2 +-
 drivers/net/wireless/st/cw1200/sta.c                  |   4 +-
 drivers/net/wireless/ti/wl1251/main.c                 |   2 +-
 drivers/net/wireless/ti/wlcore/cmd.c                  |   5 ++-
 drivers/net/xen-netfront.c                            |  18 +++++++++
 include/net/mac80211.h                                |   8 +++-
 include/net/sctp/checksum.h                           |  13 ++++---
 include/net/sctp/sctp.h                               |   5 +++
 include/net/sctp/stream_sched.h                       |   5 +++
 include/trace/events/rxrpc.h                          |  86 ++++++++++++++++++++++++++++++------------
 include/uapi/linux/rxrpc.h                            |   1 +
 include/uapi/linux/vm_sockets_diag.h                  |   1 +
 net/dsa/dsa2.c                                        |  25 +++++++------
 net/mac80211/ht.c                                     |   4 +-
 net/mac80211/mesh_hwmp.c                              |  15 +++++---
 net/mac80211/mlme.c                                   |   2 +-
 net/mac80211/tx.c                                     |  29 ++++++++++++++-
 net/openvswitch/datapath.c                            |   2 +-
 net/openvswitch/flow_netlink.c                        |  16 ++++----
 net/packet/af_packet.c                                |  37 ++++++++----------
 net/packet/internal.h                                 |   1 -
 net/rxrpc/af_rxrpc.c                                  |  23 +++++++++++-
 net/rxrpc/ar-internal.h                               | 103 +++++++++++++++++++++++++++++++++++++++++---------
 net/rxrpc/call_accept.c                               |   2 +-
 net/rxrpc/call_event.c                                | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------
 net/rxrpc/call_object.c                               |  62 +++++++++++++++++++------------
 net/rxrpc/conn_client.c                               |  54 ++++++++++++++++++++-------
 net/rxrpc/conn_event.c                                |  74 +++++++++++++++++++++++++++++-------
 net/rxrpc/conn_object.c                               |  76 +++++++++++++++++++++++--------------
 net/rxrpc/input.c                                     |  74 ++++++++++++++++++++++++++++++++++--
 net/rxrpc/misc.c                                      |  19 ++++------
 net/rxrpc/net_ns.c                                    |  33 ++++++++++++++--
 net/rxrpc/output.c                                    |  43 ++++++++++++++++++++-
 net/rxrpc/recvmsg.c                                   |  12 +++---
 net/rxrpc/sendmsg.c                                   | 126 ++++++++++++++++++++++++++++++++++++++------------------------
 net/rxrpc/sysctl.c                                    |  60 +++++++++++++++---------------
 net/sched/cls_api.c                                   |  17 ++++++---
 net/sched/cls_bpf.c                                   |  23 +++++++-----
 net/sched/sch_cbq.c                                   |   9 ++++-
 net/sched/sch_sfq.c                                   |   1 +
 net/sctp/protocol.c                                   |   1 +
 net/sctp/socket.c                                     |   6 +--
 net/sctp/stream.c                                     |  79 ++++++++++++++++++++++++++++++++-------
 net/sctp/stream_sched.c                               |  25 +++++++++----
 net/sctp/stream_sched_prio.c                          |   7 +++-
 net/sctp/stream_sched_rr.c                            |   7 +++-
 net/tipc/group.c                                      |   2 +-
 net/vmw_vsock/vmci_transport.c                        |  14 ++++---
 net/wireless/Kconfig                                  |   7 ++++
 72 files changed, 1182 insertions(+), 582 deletions(-)

^ permalink raw reply

* Re: [PATCH] net: stmmac: dwmac-sun8i: fix allwinner,leds-active-low handling
From: Chen-Yu Tsai @ 2017-11-29 15:41 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Corentin Labbe, Alexandre Torgue, netdev, linux-sunxi,
	linux-kernel, Chen-Yu Tsai, Giuseppe Cavallaro, Maxime Ripard,
	linux-arm-kernel
In-Reply-To: <20171129153712.GA24881-g2DYL2Zd6BY@public.gmane.org>

On Wed, Nov 29, 2017 at 11:37 PM, Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org> wrote:
> On Wed, Nov 29, 2017 at 10:02:40AM +0100, Corentin Labbe wrote:
>> On Tue, Nov 28, 2017 at 06:38:26PM +0100, Andrew Lunn wrote:
>> > On Tue, Nov 28, 2017 at 05:48:22PM +0100, Corentin Labbe wrote:
>> > > The driver expect "allwinner,leds-active-low" to be in PHY node, but
>> > > the binding doc expect it to be in MAC node.
>> > >
>> > > Since all board DT use it also in MAC node, the driver need to search
>> > > allwinner,leds-active-low in MAC node.
>> >
>> > Hi Corentin
>> >
>> > I'm having trouble working out how this worked before. This is code
>> > you moved around, when adding external/internal MDIOs. But the very
>> > first version of this driver code used priv->plat->phy_node. Did that
>> > somehow point to the MAC node when the internal PHY is used? Or has it
>> > been broken all the time?
>> >
>>
>> Hello
>>
>
>> Since this feature control only when the activity LED need to blink,
>> nobody see that it was broken.
>
> Hi Corentin
>
> So it never worked?
>
> If it never worked, moving the DT properties into the PHY node, where
> they belong, won't introduce a regression :-)

It worked at one point. During some previous iteration, they lit up as
they were supposed to.

ChenYu

^ permalink raw reply

* Re: [PATCH] Documentation: net: dsa: Cut set_addr() documentation
From: Andrew Lunn @ 2017-11-29 15:44 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Vivien Didelot, Florian Fainelli, netdev
In-Reply-To: <20171129153438.8320-1-linus.walleij@linaro.org>

On Wed, Nov 29, 2017 at 04:34:38PM +0100, Linus Walleij wrote:
> This is not supported anymore, devices needing a MAC address
> just assign one at random, it's just a driver pecularity.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Hi Linus

It is normal to put the tree, net-next in this case, inside the [] of
the subject line, so David knows which tree the patch is for.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply

* Re: [PATCH] net: stmmac: dwmac-sun8i: fix allwinner,leds-active-low handling
From: Andrew Lunn @ 2017-11-29 15:46 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Corentin Labbe, Alexandre Torgue, netdev, linux-sunxi,
	linux-kernel, Giuseppe Cavallaro, Maxime Ripard, linux-arm-kernel
In-Reply-To: <CAGb2v67hv7ayH=F-MBG-PCCeVt43PH-O-6b3KOyGXSpr2s4DGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi ChenYu
 
> It worked at one point. During some previous iteration, they lit up as
> they were supposed to.

For a released version of the kernel? Or during development work?  If
they did work, but broken, it would be good to know which commit broke
it. We can then add a fixes: tag to the patch as proposed.

    Andrew

^ permalink raw reply

* Re: [PATCH] net: stmmac: dwmac-sun8i: fix allwinner,leds-active-low handling
From: Maxime Ripard @ 2017-11-29 15:47 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Corentin Labbe, alexandre.torgue-qxv4g6HH51o,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, wens-jdAy2FN1RRM,
	peppe.cavallaro-qxv4g6HH51o,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20171129153712.GA24881-g2DYL2Zd6BY@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

On Wed, Nov 29, 2017 at 04:37:12PM +0100, Andrew Lunn wrote:
> On Wed, Nov 29, 2017 at 10:02:40AM +0100, Corentin Labbe wrote:
> > On Tue, Nov 28, 2017 at 06:38:26PM +0100, Andrew Lunn wrote:
> > > On Tue, Nov 28, 2017 at 05:48:22PM +0100, Corentin Labbe wrote:
> > > > The driver expect "allwinner,leds-active-low" to be in PHY node, but
> > > > the binding doc expect it to be in MAC node.
> > > > 
> > > > Since all board DT use it also in MAC node, the driver need to search
> > > > allwinner,leds-active-low in MAC node.
> > > 
> > > Hi Corentin
> > > 
> > > I'm having trouble working out how this worked before. This is code
> > > you moved around, when adding external/internal MDIOs. But the very
> > > first version of this driver code used priv->plat->phy_node. Did that
> > > somehow point to the MAC node when the internal PHY is used? Or has it
> > > been broken all the time?
> > > 
> > 
> > Hello
> > 
> 
> > Since this feature control only when the activity LED need to blink,
> > nobody see that it was broken.
> 
> Hi Corentin
> 
> So it never worked?
> 
> If it never worked, moving the DT properties into the PHY node, where
> they belong, won't introduce a regression :-)

That's even truer since it's been queued for 4.15 which hasn't been
released yet.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply

* Re: [PATCH] net: stmmac: dwmac-sun8i: fix allwinner,leds-active-low handling
From: Chen-Yu Tsai @ 2017-11-29 15:50 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Chen-Yu Tsai, Corentin Labbe, Alexandre Torgue, netdev,
	linux-sunxi, linux-kernel, Giuseppe Cavallaro, Maxime Ripard,
	linux-arm-kernel
In-Reply-To: <20171129154649.GC24881-g2DYL2Zd6BY@public.gmane.org>

On Wed, Nov 29, 2017 at 11:46 PM, Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org> wrote:
> Hi ChenYu
>
>> It worked at one point. During some previous iteration, they lit up as
>> they were supposed to.
>
> For a released version of the kernel? Or during development work?  If
> they did work, but broken, it would be good to know which commit broke
> it. We can then add a fixes: tag to the patch as proposed.

During development work. The bindings / driver was never released.

ChenYu

^ permalink raw reply

* Re: [PATCH v5 next 1/5] modules:capabilities: add request_module_cap()
From: Theodore Ts'o @ 2017-11-29 15:54 UTC (permalink / raw)
  To: David Miller
  Cc: gnomes, keescook, mcgrof, tixxdz, luto, akpm, james.l.morris,
	ben.hutchings, solar, serge, jeyu, rusty, linux-kernel,
	linux-security-module, kernel-hardening, corbet, mingo, netdev,
	peterz, torvalds
In-Reply-To: <20171129.095014.1909386937628805919.davem@davemloft.net>

On Wed, Nov 29, 2017 at 09:50:14AM -0500, David Miller wrote:
> From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
> Date: Wed, 29 Nov 2017 13:46:12 +0000
> 
> > I really don't care what the module loading rules end up with and
> > whether we add CAP_SYS_YET_ANOTHER_MEANINGLESS_FLAG but what is
> > actually needed is to properly incorporate it into securiy ruiles
> > for whatever LSM you are using.
> 
> I'm surprised we're not using the SHA1 hashes or whatever we compute
> for the modules to make sure we are loading the foo.ko that we expect
> to be.

We do have signed modules.  But this won't help us if the user is
using a distro kernel which has compiled some module which is known to
be unmaintained which everyone in the know *expects* to have 0-day
bugs, such as DCCP.  That's because the DCCP module is signed.

We could fix this by adding to the signature used for module signing
to include the module name, so that the bad guy can't rename dccp.ko
to be ppp.ko, I suppose....

> All of this capability stuff seems to dance a circle around the
> problem rather than fix it.

Half the problem here is that with containers, people are changing the
security model, because they want to let untrusted users have "root",
without really having "root".  Part of the fundamental problem is that
there are some well-meaning, but fundamentally misguided people, who
have been asserting: "Containers are just as secure as VM's".

Well, they are not.  And the sooner people get past this, the better
off they'll be....

						- Ted

^ permalink raw reply

* Re: [PATCH 3/4] RFC: net: dsa: Add bindings for Realtek SMI DSAs
From: Andrew Lunn @ 2017-11-29 15:56 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Vivien Didelot, Florian Fainelli, netdev, Antti Seppälä,
	Roman Yeryomin, Colin Leitner, Gabor Juhos, devicetree
In-Reply-To: <CACRpkdbzqnbF49yN-SAqLkhufk=R2C=jpdLo-QWmL0zR_+Vj=w@mail.gmail.com>

> I have the phy-handle in the ethernet controller. This RTL8366RB
> thing is just one big PHY as far as I know.

Hi Linus

We don't model switches as PHYs. They are their own device type.  And
the internal or external PHYs are just normal PHYs in the linux
model. Meaning their interrupt properties goes in the PHY node in
device tree, as documented in the phy.txt binding documentation.

       Andrew

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox