Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] act_mirred: Ingress actions support
From: Shmulik Ladkani @ 2016-09-22 13:21 UTC (permalink / raw)
  To: David S. Miller
  Cc: Jamal Hadi Salim, WANG Cong, Eric Dumazet, netdev,
	Shmulik Ladkani

This patch series implements action mirred 'ingress' actions
TCA_INGRESS_REDIR and TCA_INGRESS_MIRROR.

This allows attaching filters whose target is to hand matching skbs into
the rx processing of a specified device.

Shmulik Ladkani (4):
  net/sched: act_mirred: Rename tcfm_ok_push to tcfm_mac_header_xmit
  net/sched: act_mirred: Refactor detection whether dev needs xmit at
    mac header
  net/sched: tc_mirred: Rename public predicates
    'is_tcf_mirred_redirect' and 'is_tcf_mirred_mirror'
  net/sched: act_mirred: Implement ingress actions

 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c  |  2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    |  2 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |  4 +-
 .../net/ethernet/netronome/nfp/nfp_net_offload.c   |  2 +-
 include/net/tc_act/tc_mirred.h                     |  6 +-
 net/sched/act_mirred.c                             | 80 ++++++++++++++++------
 7 files changed, 69 insertions(+), 29 deletions(-)

-- 
1.9.1

^ permalink raw reply

* Re: [PATCH RFC 1/3] xdp: Infrastructure to generalize XDP
From: Jesper Dangaard Brouer @ 2016-09-22 13:14 UTC (permalink / raw)
  To: Tom Herbert
  Cc: Thomas Graf, David S. Miller, Linux Kernel Network Developers,
	Kernel Team, Tariq Toukan, Brenden Blanco, Alexei Starovoitov,
	Eric Dumazet, brouer
In-Reply-To: <20160921215658.2c61ed5e@redhat.com>

On Wed, 21 Sep 2016 21:56:58 +0200
Jesper Dangaard Brouer <brouer@redhat.com> wrote:

> > > I'm not opposed to running non-BPF code at XDP. I'm against adding
> > > a linked list of hook consumers.  
> 
> I also worry about the performance impact of a linked list.  We should
> simple benchmark it instead of discussing it! ;-)

(Note, there are some stability issue with this RFC patchset, when
removing the xdp program, that I had to workaround/patch)


I've started benchmarking this and I only see added cost of 2.89ns from
these patches, at these crazy speeds it does correspond to -485Kpps.

 I was really expecting to see a higher cost of this approach.

I tested this on two different machines. One was suppose to work with
DDIO, but I could not get DDIO working on that machine (result in max
12.7Mpps drop).  Even-though the mlx5 card does work with DDIO.  Even
removed the mlx5 and used same slot but no luck.   (A side-note: Also
measured a 16ns performance difference between which PCIe slot I'm
using).

The reason I wanted to benchmark this on a DDIO machine is, that I'm
suspecting that the added cost, could be hiding behind the cache miss.

Well, I'm running out-of-time benchmarking this stuff, I must prepare
for my Network Performance Workshop ;-)


(A side-note: my skylake motherboard also had a PCI slot, so I found an
old e1000 NIC in my garage, and it worked!)
-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply

* Re: [PATCH 0/2] BQL support and fix for a regression issue
From: Eric Dumazet @ 2016-09-22 13:12 UTC (permalink / raw)
  To: David Miller
  Cc: sunil.kovvuri, netdev, linux-kernel, linux-arm-kernel, sgoutham
In-Reply-To: <20160922.082540.992436214283504080.davem@davemloft.net>

On Thu, 2016-09-22 at 08:25 -0400, David Miller wrote:
> From: sunil.kovvuri@gmail.com
> Date: Thu, 22 Sep 2016 14:35:19 +0530
> 
> > From: Sunil Goutham <sgoutham@cavium.com>
> > 
> > These patches add byte queue limit support and also fixes a regression
> > issue introduced by commit
> > 'net: thunderx: Use netdev's name for naming VF's interrupts'
> 
> The correct way to refer to commits when you fix a bug is
> to use the "Fixes: " tag right before the signoffs and ACKs.
> 
> The correct form is:
> 
> Fixes: $SHA1_ID ("Commit header line.")
> 
> You'll see this in many other netdev commits.

Thanks a lot David for this enforcement, it really helps bug tracking
and backports

Note that the $SHA1_ID should be truncated to 12 first chars.

Refer to Documentation/SubmittingPatches around line 191 for more
details.

^ permalink raw reply

* [PATCH net 1/2] act_ife: Fix external mac header on encode
From: Yotam Gigi @ 2016-09-22 12:55 UTC (permalink / raw)
  To: jhs, davem, netdev; +Cc: Yotam Gigi
In-Reply-To: <1474548926-22815-1-git-send-email-yotamg@mellanox.com>

On ife encode side, external mac header is copied from the original packet
and may be overridden if the user requests. Before, the mac header copy
was done from memory region that might not be accessible anymore, as
skb_cow_head might free it and copy the packet. This led to random values
in the external mac header once the values were not set by user.

This fix takes the internal mac header from the packet, after the call to
skb_cow_head.

Fixes: ef6980b6becb ("net sched: introduce IFE action")
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
---
 net/sched/act_ife.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
index 27b19ca..7f71a3d 100644
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -758,8 +758,6 @@ static int tcf_ife_encode(struct sk_buff *skb, const struct tc_action *a,
 		return TC_ACT_SHOT;
 	}
 
-	iethh = eth_hdr(skb);
-
 	err = skb_cow_head(skb, reserve);
 	if (unlikely(err)) {
 		ife->tcf_qstats.drops++;
@@ -768,6 +766,7 @@ static int tcf_ife_encode(struct sk_buff *skb, const struct tc_action *a,
 	}
 
 	__skb_push(skb, total_push);
+	iethh = (struct ethhdr *)(skb->data + hdrm);
 	memcpy(skb->data, iethh, skb->mac_len);
 	skb_reset_mac_header(skb);
 	skboff += skb->mac_len;
-- 
2.4.11

^ permalink raw reply related

* [PATCH net] i40e: disable MSI-X interrupts if we cannot reserve enough vectors
From: Guilherme G. Piccoli @ 2016-09-22 13:03 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: jeffrey.t.kirsher, netdev, gpiccoli

If we fail on allocating enough MSI-X interrupts, we should disable
them since they were previously enabled in this point of code.

Not disabling them can lead to WARN_ON() being triggered and subsequent
failure in enabling MSI as a fallback; the below message was shown without
this patch while we played with interrupt allocation in i40e driver:

[ 21.461346] sysfs: cannot create duplicate filename '/devices/pci0007:00/0007:00:00.0/0007:01:00.3/msi_irqs'
[ 21.461459] ------------[ cut here ]------------
[ 21.461514] WARNING: CPU: 64 PID: 1155 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x88/0xc0

Also, we noticed that without this patch, if we modprobe the module without
enough MSI-X interrupts (triggering the above warning), unload the module
and re-load it again, we got a crash on the system.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d0b3a1b..f8ebe78 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7721,6 +7721,7 @@ static int i40e_init_msix(struct i40e_pf *pf)
 		pf->flags &= ~I40E_FLAG_MSIX_ENABLED;
 		kfree(pf->msix_entries);
 		pf->msix_entries = NULL;
+		pci_disable_msix(pf->pdev);
 		return -ENODEV;
 
 	} else if (v_actual == I40E_MIN_MSIX) {
-- 
2.1.0

^ permalink raw reply related

* Re: [PATCH net] net: rtnl_register in net_ns_init need rtnl_lock
From: Eric Dumazet @ 2016-09-22 13:03 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: netdev
In-Reply-To: <1474542209-28409-1-git-send-email-hannes@stressinduktion.org>

On Thu, 2016-09-22 at 13:03 +0200, Hannes Frederic Sowa wrote:
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>  net/core/net_namespace.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index 2c2eb1b629b11d..a2ace299f28355 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -758,9 +758,11 @@ static int __init net_ns_init(void)
>  
>  	register_pernet_subsys(&net_ns_ops);
>  
> +	rtnl_lock();
>  	rtnl_register(PF_UNSPEC, RTM_NEWNSID, rtnl_net_newid, NULL, NULL);
>  	rtnl_register(PF_UNSPEC, RTM_GETNSID, rtnl_net_getid, rtnl_net_dumpid,
>  		      NULL);
> +	rtnl_unlock();
>  
>  	return 0;
>  }

Hi Hannes

Why is this needed here, and not in other places ?

Hint : A changelog always help reviewers and future bug hunting.

Thanks.

^ permalink raw reply

* Re: [PATCH] ipvlan: fix building without netfilter
From: Arnd Bergmann @ 2016-09-22 12:58 UTC (permalink / raw)
  To: David Miller; +Cc: maheshb, dsa, edumazet, netdev, linux-kernel
In-Reply-To: <20160922.083205.2034005377472668654.davem@davemloft.net>

On Thursday, September 22, 2016 8:32:05 AM CEST David Miller wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Thu, 22 Sep 2016 11:40:52 +0200
> 
> > The new l3s mode in ipvlan relies on netfilter interfaces, but
> > the ipvlan driver can be configured when CONFIG_NETFILTER is disabled,
> > leading to a build error:
> > 
> > drivers/net/ipvlan/ipvlan.h:132:22: error: 'struct nf_hook_state' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
> > drivers/net/ipvlan/ipvlan_main.c:14:27: error: array type has incomplete element type 'struct nf_hook_ops'
> > ...
> > 
> > This adds a forward declaration for struct nf_hook_state, and hides
> > the newly added l3s code in an #ifdef.
> > 
> > Fixes: 4fbae7d83c98 ("ipvlan: Introduce l3s mode")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> I'm pretty sure I applied a Kconfig patch that added the
> necessary dependency.

Yes, I see the fix cf714ac147e0 ("ipvlan: Fix dependency issue") now, and
can confirm that today's linux-next works without my patch, thanks!

	Arnd

^ permalink raw reply

* Re: [patch net-next 5/6] switchdev: remove FIB offload infrastructure
From: Jiri Pirko @ 2016-09-22 12:49 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: netdev, davem, idosch, eladr, yotamg, nogahf, ogerlitz, roopa,
	nikolay, linville, andy, f.fainelli, dsa, jhs, vivien.didelot,
	andrew, ivecera, kaber, john
In-Reply-To: <20160922072519.GB13287@splinter>

Thu, Sep 22, 2016 at 09:25:19AM CEST, idosch@idosch.org wrote:
>On Wed, Sep 21, 2016 at 01:53:13PM +0200, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>> 
>> Since this is now taken care of by FIB notifier, remove the code, with
>> all unused dependencies.
>> 
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>
>[...]
>
>> -static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi)
>> -{
>> -	struct switchdev_attr attr = {
>> -		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
>> -	};
>> -	struct switchdev_attr prev_attr;
>> -	struct net_device *dev = NULL;
>> -	int nhsel;
>> -
>> -	ASSERT_RTNL();
>> -
>> -	/* For this route, all nexthop devs must be on the same switch. */
>> -
>> -	for (nhsel = 0; nhsel < fi->fib_nhs; nhsel++) {
>> -		const struct fib_nh *nh = &fi->fib_nh[nhsel];
>> -
>> -		if (!nh->nh_dev)
>> -			return NULL;
>> -
>> -		dev = switchdev_get_lowest_dev(nh->nh_dev);
>> -		if (!dev)
>> -			return NULL;
>> -
>> -		attr.orig_dev = dev;
>> -		if (switchdev_port_attr_get(dev, &attr))
>> -			return NULL;
>> -
>> -		if (nhsel > 0 &&
>> -		    !netdev_phys_item_id_same(&prev_attr.u.ppid, &attr.u.ppid))
>> -				return NULL;
>> -
>> -		prev_attr = attr;
>> -	}
>> -
>> -	return dev;
>> -}
>
>[...]
>
>> -int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>> -			   u8 tos, u8 type, u32 nlflags, u32 tb_id)
>> -{
>> -	struct switchdev_obj_ipv4_fib ipv4_fib = {
>> -		.obj.id = SWITCHDEV_OBJ_ID_IPV4_FIB,
>> -		.dst = dst,
>> -		.dst_len = dst_len,
>> -		.fi = fi,
>> -		.tos = tos,
>> -		.type = type,
>> -		.nlflags = nlflags,
>> -		.tb_id = tb_id,
>> -	};
>> -	struct net_device *dev;
>> -	int err = 0;
>> -
>> -	/* Don't offload route if using custom ip rules or if
>> -	 * IPv4 FIB offloading has been disabled completely.
>> -	 */
>> -
>> -#ifdef CONFIG_IP_MULTIPLE_TABLES
>> -	if (fi->fib_net->ipv4.fib_has_custom_rules)
>> -		return 0;
>> -#endif
>> -
>> -	if (fi->fib_net->ipv4.fib_offload_disabled)
>> -		return 0;
>> -
>> -	dev = switchdev_get_dev_by_nhs(fi);
>
>Since this is now removed I believe we should perform this check inside
>the drivers. For mlxsw we can simply iterate over the nexthops and make
>sure each has a RIF.

rocker does not support multiple nexthops. For mlxsw, we can you what
you suggest. Will add it.


>
>> -	if (!dev)
>> -		return 0;
>> -
>> -	ipv4_fib.obj.orig_dev = dev;
>> -	err = switchdev_port_obj_add(dev, &ipv4_fib.obj);
>> -	if (!err)
>> -		fib_info_offload_inc(fi);
>> -
>> -	return err == -EOPNOTSUPP ? 0 : err;
>> -}

^ permalink raw reply

* [PATCH] can: dev: fix deadlock reported after bus-off
From: Marc Kleine-Budde @ 2016-09-22 12:42 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Sergei Miroshnichenko, linux-stable,
	Marc Kleine-Budde
In-Reply-To: <20160922124222.31598-1-mkl@pengutronix.de>

From: Sergei Miroshnichenko <sergeimir@emcraft.com>

A timer was used to restart after the bus-off state, leading to a
relatively large can_restart() executed in an interrupt context,
which in turn sets up pinctrl. When this happens during system boot,
there is a high probability of grabbing the pinctrl_list_mutex,
which is locked already by the probe() of other device, making the
kernel suspect a deadlock condition [1].

To resolve this issue, the restart_timer is replaced by a delayed
work.

[1] https://github.com/victronenergy/venus/issues/24

Signed-off-by: Sergei Miroshnichenko <sergeimir@emcraft.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/dev.c   | 27 +++++++++++++++++----------
 include/linux/can/dev.h |  3 ++-
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index e21f7cc5ae4d..8d6208c0b400 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -21,6 +21,7 @@
 #include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/if_arp.h>
+#include <linux/workqueue.h>
 #include <linux/can.h>
 #include <linux/can/dev.h>
 #include <linux/can/skb.h>
@@ -501,9 +502,8 @@ EXPORT_SYMBOL_GPL(can_free_echo_skb);
 /*
  * CAN device restart for bus-off recovery
  */
-static void can_restart(unsigned long data)
+static void can_restart(struct net_device *dev)
 {
-	struct net_device *dev = (struct net_device *)data;
 	struct can_priv *priv = netdev_priv(dev);
 	struct net_device_stats *stats = &dev->stats;
 	struct sk_buff *skb;
@@ -543,6 +543,14 @@ restart:
 		netdev_err(dev, "Error %d during restart", err);
 }
 
+static void can_restart_work(struct work_struct *work)
+{
+	struct delayed_work *dwork = to_delayed_work(work);
+	struct can_priv *priv = container_of(dwork, struct can_priv, restart_work);
+
+	can_restart(priv->dev);
+}
+
 int can_restart_now(struct net_device *dev)
 {
 	struct can_priv *priv = netdev_priv(dev);
@@ -556,8 +564,8 @@ int can_restart_now(struct net_device *dev)
 	if (priv->state != CAN_STATE_BUS_OFF)
 		return -EBUSY;
 
-	/* Runs as soon as possible in the timer context */
-	mod_timer(&priv->restart_timer, jiffies);
+	cancel_delayed_work_sync(&priv->restart_work);
+	can_restart(dev);
 
 	return 0;
 }
@@ -578,8 +586,8 @@ void can_bus_off(struct net_device *dev)
 	netif_carrier_off(dev);
 
 	if (priv->restart_ms)
-		mod_timer(&priv->restart_timer,
-			  jiffies + (priv->restart_ms * HZ) / 1000);
+		schedule_delayed_work(&priv->restart_work,
+				      msecs_to_jiffies(priv->restart_ms));
 }
 EXPORT_SYMBOL_GPL(can_bus_off);
 
@@ -688,6 +696,7 @@ struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max)
 		return NULL;
 
 	priv = netdev_priv(dev);
+	priv->dev = dev;
 
 	if (echo_skb_max) {
 		priv->echo_skb_max = echo_skb_max;
@@ -697,7 +706,7 @@ struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max)
 
 	priv->state = CAN_STATE_STOPPED;
 
-	init_timer(&priv->restart_timer);
+	INIT_DELAYED_WORK(&priv->restart_work, can_restart_work);
 
 	return dev;
 }
@@ -778,8 +787,6 @@ int open_candev(struct net_device *dev)
 	if (!netif_carrier_ok(dev))
 		netif_carrier_on(dev);
 
-	setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
-
 	return 0;
 }
 EXPORT_SYMBOL_GPL(open_candev);
@@ -794,7 +801,7 @@ void close_candev(struct net_device *dev)
 {
 	struct can_priv *priv = netdev_priv(dev);
 
-	del_timer_sync(&priv->restart_timer);
+	cancel_delayed_work_sync(&priv->restart_work);
 	can_flush_echo_skb(dev);
 }
 EXPORT_SYMBOL_GPL(close_candev);
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 5261751f6bd4..5f5270941ba0 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -32,6 +32,7 @@ enum can_mode {
  * CAN common private data
  */
 struct can_priv {
+	struct net_device *dev;
 	struct can_device_stats can_stats;
 
 	struct can_bittiming bittiming, data_bittiming;
@@ -47,7 +48,7 @@ struct can_priv {
 	u32 ctrlmode_static;	/* static enabled options for driver/hardware */
 
 	int restart_ms;
-	struct timer_list restart_timer;
+	struct delayed_work restart_work;
 
 	int (*do_set_bittiming)(struct net_device *dev);
 	int (*do_set_data_bittiming)(struct net_device *dev);
-- 
2.9.3


^ permalink raw reply related

* pull-request: can 2016-09-22
From: Marc Kleine-Budde @ 2016-09-22 12:42 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel

Hello David,

this is a pull request of one patch for the upcoming linux-4.8 release.

The patch by Sergei Miroshnichenko fixes a potential deadlock in the generic
CAN device code that cann occour after a bus-off.

regards,
Marc

---

The following changes since commit 7e32b44361abc77fbc01f2b97b045c405b2583e5:

  tcp: properly account Fast Open SYN-ACK retrans (2016-09-22 03:33:01 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.8-20160922

for you to fetch changes up to 9abefcb1aaa58b9d5aa40a8bb12c87d02415e4c8:

  can: dev: fix deadlock reported after bus-off (2016-09-22 10:01:21 +0200)

----------------------------------------------------------------
linux-can-fixes-for-4.8-20160922

----------------------------------------------------------------
Sergei Miroshnichenko (1):
      can: dev: fix deadlock reported after bus-off

 drivers/net/can/dev.c   | 27 +++++++++++++++++----------
 include/linux/can/dev.h |  3 ++-
 2 files changed, 19 insertions(+), 11 deletions(-)


^ permalink raw reply

* Re: [PATCH] ipvlan: fix building without netfilter
From: David Miller @ 2016-09-22 12:32 UTC (permalink / raw)
  To: arnd; +Cc: maheshb, dsa, edumazet, netdev, linux-kernel
In-Reply-To: <20160922094130.2154824-1-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 22 Sep 2016 11:40:52 +0200

> The new l3s mode in ipvlan relies on netfilter interfaces, but
> the ipvlan driver can be configured when CONFIG_NETFILTER is disabled,
> leading to a build error:
> 
> drivers/net/ipvlan/ipvlan.h:132:22: error: 'struct nf_hook_state' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
> drivers/net/ipvlan/ipvlan_main.c:14:27: error: array type has incomplete element type 'struct nf_hook_ops'
> ...
> 
> This adds a forward declaration for struct nf_hook_state, and hides
> the newly added l3s code in an #ifdef.
> 
> Fixes: 4fbae7d83c98 ("ipvlan: Introduce l3s mode")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I'm pretty sure I applied a Kconfig patch that added the
necessary dependency.

^ permalink raw reply

* Re: [PATCH resend 2] xen-netback: switch to threaded irq for control ring
From: David Miller @ 2016-09-22 12:26 UTC (permalink / raw)
  To: jgross; +Cc: xen-devel, netdev, linux-kernel, wei.liu2
In-Reply-To: <1474535185-15734-1-git-send-email-jgross@suse.com>

From: Juergen Gross <jgross@suse.com>
Date: Thu, 22 Sep 2016 11:06:25 +0200

> Instead of open coding it use the threaded irq mechanism in
> xen-netback.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH 0/2] BQL support and fix for a regression issue
From: David Miller @ 2016-09-22 12:25 UTC (permalink / raw)
  To: sunil.kovvuri; +Cc: netdev, linux-kernel, linux-arm-kernel, sgoutham
In-Reply-To: <1474535121-13958-1-git-send-email-sunil.kovvuri@gmail.com>

From: sunil.kovvuri@gmail.com
Date: Thu, 22 Sep 2016 14:35:19 +0530

> From: Sunil Goutham <sgoutham@cavium.com>
> 
> These patches add byte queue limit support and also fixes a regression
> issue introduced by commit
> 'net: thunderx: Use netdev's name for naming VF's interrupts'

The correct way to refer to commits when you fix a bug is
to use the "Fixes: " tag right before the signoffs and ACKs.

The correct form is:

Fixes: $SHA1_ID ("Commit header line.")

You'll see this in many other netdev commits.

^ permalink raw reply

* Re: [PATCH net-next] net: ethernet: mediatek: get out of potential invalid pointer access
From: David Miller @ 2016-09-22 12:23 UTC (permalink / raw)
  To: sean.wang
  Cc: john, nbd, netdev, linux-kernel, linux-mediatek, keyhaede, objelf
In-Reply-To: <1474533856-22753-1-git-send-email-sean.wang@mediatek.com>

From: <sean.wang@mediatek.com>
Date: Thu, 22 Sep 2016 16:44:16 +0800

> From: Sean Wang <sean.wang@mediatek.com>
> 
> Potential dangerous invalid pointer might be accessed if
> the error happens when couple phy_device to net_device so
> cleanup the error path.
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: ethernet: mediatek: use [get|set]_link_ksettings
From: David Miller @ 2016-09-22 12:23 UTC (permalink / raw)
  To: sean.wang
  Cc: john, nbd, netdev, linux-kernel, linux-mediatek, keyhaede, objelf
In-Reply-To: <1474533723-22629-1-git-send-email-sean.wang@mediatek.com>

From: <sean.wang@mediatek.com>
Date: Thu, 22 Sep 2016 16:42:03 +0800

> From: Sean Wang <sean.wang@mediatek.com>
> 
> 1) use new api [get|set]_link_ksettings instead
> of [get|set]_settings old ones.
> 
> 2) dev->phydev is sure being ready before calling
> these callbacks, so removing all the sanity check
> if it is existing.
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: ethernet: mediatek: remove superfluous local variable for phy address
From: David Miller @ 2016-09-22 12:23 UTC (permalink / raw)
  To: sean.wang
  Cc: john, nbd, netdev, linux-kernel, linux-mediatek, keyhaede, objelf
In-Reply-To: <1474533375-22423-1-git-send-email-sean.wang@mediatek.com>

From: <sean.wang@mediatek.com>
Date: Thu, 22 Sep 2016 16:36:15 +0800

> From: Sean Wang <sean.wang@mediatek.com>
> 
> remove the unused variable for parsing PHY address
> and the related logic for sanity test which would
> be all already handled done when of_mdiobus_register
> was called
> 
> Reported-by: Nelson Chang <nelson.chang@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: ethernet: mediatek: use phydev from struct net_device
From: David Miller @ 2016-09-22 12:23 UTC (permalink / raw)
  To: sean.wang
  Cc: john, nbd, netdev, linux-kernel, linux-mediatek, keyhaede, objelf
In-Reply-To: <1474533215-22273-1-git-send-email-sean.wang@mediatek.com>

From: <sean.wang@mediatek.com>
Date: Thu, 22 Sep 2016 16:33:35 +0800

> From: Sean Wang <sean.wang@mediatek.com>
> 
> reuse phydev already in struct net_device instead of creating
> another new one in private structure.
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next v2 0/3] add support for RGMII on GMAC0 through TRGMII hardware module
From: David Miller @ 2016-09-22 12:22 UTC (permalink / raw)
  To: sean.wang
  Cc: john, nbd, netdev, linux-kernel, linux-mediatek, andrew,
	f.fainelli, keyhaede, objelf
In-Reply-To: <1474511636-11644-1-git-send-email-sean.wang@mediatek.com>

From: <sean.wang@mediatek.com>
Date: Thu, 22 Sep 2016 10:33:53 +0800

> By default, GMAC0 is connected to built-in switch called
> MT7530 through the proprietary interface called Turbo RGMII
> (TRGMII). TRGMII also supports well for RGMII as generic external
> PHY uses but requires some slight changes to the setup of TRGMII 
> and doesn't have well support on current driver.
> 
> So this patchset
> 1) provides the slight changes of the setup for RGMII can work
>    through TRGMII
> 2) adds additional setting "trgmii" as PHY_INTERFACE_MODE_TRGMII 
>    about phy-mode on device tree to make GMAC0 distinguish which
>    mode it runs
> 3) changes dynamically source clock, TX/RX delay and interface
>    mode on TRGMII for adapting various link
> 
> Changes since v1:
> - fixed the style of comment which doesn't have a space at 
>    the beginning and end of comment lines
> - add support for phy-mode "trgmii" as PHY_INTERFACE_MODE_TRGMII 
>    into linux/phy.h
> - enhance the Documentation about device tree binding for trgmii
>   which is applicable only for GMAC0 which uses fixed-link

Series applied.

^ permalink raw reply

* Re: [PATCH net-next 0/9] rxrpc: Preparation for slow-start algorithm [ver #2]
From: David Miller @ 2016-09-22 12:15 UTC (permalink / raw)
  To: dhowells; +Cc: netdev, linux-afs, linux-kernel
In-Reply-To: <147453251987.14579.17230566511204847506.stgit@warthog.procyon.org.uk>

From: David Howells <dhowells@redhat.com>
Date: Thu, 22 Sep 2016 09:22:00 +0100

> Tagged thusly:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
> 	rxrpc-rewrite-20160922-v2

Pulled, thanks David.

^ permalink raw reply

* Re: [PATCH v6 5/6] net: ipv4, ipv6: run cgroup eBPF egress programs
From: Pablo Neira Ayuso @ 2016-09-22 12:05 UTC (permalink / raw)
  To: Thomas Graf
  Cc: Daniel Mack, htejun-b10kYP2dOMg, daniel-FeC+5ew28dpmcu3hnIyYJQ,
	ast-b10kYP2dOMg, davem-fT/PcQaiUtIeIZ0/mPfg9Q, kafai-b10kYP2dOMg,
	fw-HFFVJYpyMKqzQB+pC5nmwQ, harald-H+wXaHxf7aLQT0dZR+AlfA,
	netdev-u79uwXL29TY76Z2rM5mHXA, sargun-GaZTRHToo+CzQB+pC5nmwQ,
	cgroups-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20160922095411.GA5654-4EA/1caXOu0mYvmMESoHnA@public.gmane.org>

On Thu, Sep 22, 2016 at 11:54:11AM +0200, Thomas Graf wrote:
> On 09/22/16 at 11:21am, Pablo Neira Ayuso wrote:
> > I have a hard time to buy this new specific hook, I think we should
> > shift focus of this debate, this is my proposal to untangle this:
> >
> > You add a net/netfilter/nft_bpf.c expression that allows you to run
> > bpf programs from nf_tables. This expression can either run bpf
> > programs in a similar fashion to tc+bpf or run the bpf program that
> > you have attached to the cgroup.
>
> So for every packet processed, you want to require the user to load
> and run a (unJITed) nft program acting as a wrapper to run a JITed
> BPF program? What it the benefit of this model compared to what Daniel
> is proposing? The hooking point is the same. This only introduces
> additional per packet overhead in the fast path. Am I missing
> something?

Have a look at net/ipv4/netfilter/nft_chain_route_ipv4.c for instance.
In your case, you have to add a new chain type:

static const struct nf_chain_type nft_chain_bpf = {
        .name           = "bpf",
        .type           = NFT_CHAIN_T_BPF,
        ...
        .hooks          = {
                [NF_INET_LOCAL_IN]      = nft_do_bpf,
                [NF_INET_LOCAL_OUT]     = nft_do_bpf,
                [NF_INET_FORWARD]       = nft_do_bpf,
                [NF_INET_PRE_ROUTING]   = nft_do_bpf,
                [NF_INET_POST_ROUTING]  = nft_do_bpf,
        },
};

nft_do_bpf() is the raw netfilter hook that you register, this hook
will just execute to iterate over the list of bpf filters and run
them.

This new chain is created on demand, so no overhead if not needed, eg.

nft add table bpf
nft add chain bpf input { type bpf hook output priority 0\; }

Then, you add a rule for each bpf program you want to run, just like
tc+bpf.

Benefits are, rewording previous email:

* You get access to all of the existing netfilter hooks in one go
  to run bpf programs. No need for specific redundant hooks. This
  provides raw access to the netfilter hook, you define the little
  code that your hook runs before you bpf run invocation. So there
  is *no need to bloat the stack with more hooks, we use what we
  have.*

* This is consistent to what we offer via tc+bpf, similar design idea.
  Users are already familiar with this approach.

* It becomes easily visible to the user that a bpf program is running
  from whenever in the packet path, so from a sysadmin perspective is
  is easy to dump the configuration via netlink interface using the
  existing tooling in case that troubleshooting is required.

^ permalink raw reply

* Re: [PATCH net-next v2 1/3] net: ethernet: mediatek: add extension of phy-mode for TRGMII
From: Sergei Shtylyov @ 2016-09-22 11:30 UTC (permalink / raw)
  To: sean.wang, john, davem
  Cc: nbd, netdev, linux-kernel, linux-mediatek, andrew, f.fainelli,
	keyhaede, objelf
In-Reply-To: <1474511636-11644-2-git-send-email-sean.wang@mediatek.com>

Hello.

On 9/22/2016 5:33 AM, sean.wang@mediatek.com wrote:

> From: Sean Wang <sean.wang@mediatek.com>
>
> adds PHY-mode "trgmii" as an extension for the operation
> mode of the PHY interface for PHY_INTERFACE_MODE_TRGMII.
> and adds a variable trgmii inside mtk_mac as the indication
> to make the difference between the MAC connected to internal
> switch or connected to external PHY by the given configuration
> on the board and then to perform the corresponding setup on
> TRGMII hardware module.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++
>  drivers/net/ethernet/mediatek/mtk_eth_soc.h | 3 +++
>  include/linux/phy.h                         | 3 +++
>  3 files changed, 8 insertions(+)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index ca6b501..827f4bd 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -244,6 +244,8 @@ static int mtk_phy_connect(struct mtk_mac *mac)
>  		return -ENODEV;
>
>  	switch (of_get_phy_mode(np)) {
> +	case PHY_INTERFACE_MODE_TRGMII:
> +		mac->trgmii = true;
>  	case PHY_INTERFACE_MODE_RGMII_TXID:
>  	case PHY_INTERFACE_MODE_RGMII_RXID:
>  	case PHY_INTERFACE_MODE_RGMII_ID:
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
> index 7c5e534..e3b9525 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
> @@ -529,6 +529,8 @@ struct mtk_eth {
>   * @hw:			Backpointer to our main datastruture
>   * @hw_stats:		Packet statistics counter
>   * @phy_dev:		The attached PHY if available
> + * @trgmii		Indicate if the MAC uses TRGMII connected to internal
> +			switch
>   */
>  struct mtk_mac {
>  	int				id;
> @@ -539,6 +541,7 @@ struct mtk_mac {
>  	struct phy_device		*phy_dev;
>  	__be32				hwlro_ip[MTK_MAX_LRO_IP_CNT];
>  	int				hwlro_ip_cnt;
> +	bool				trgmii;

     I don't see where this is used.

[...]
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 2d24b28..e25f183 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -80,6 +80,7 @@ typedef enum {
>  	PHY_INTERFACE_MODE_XGMII,
>  	PHY_INTERFACE_MODE_MOCA,
>  	PHY_INTERFACE_MODE_QSGMII,
> +	PHY_INTERFACE_MODE_TRGMII,
>  	PHY_INTERFACE_MODE_MAX,
>  } phy_interface_t;
>
> @@ -123,6 +124,8 @@ static inline const char *phy_modes(phy_interface_t interface)
>  		return "moca";
>  	case PHY_INTERFACE_MODE_QSGMII:
>  		return "qsgmii";
> +	case PHY_INTERFACE_MODE_TRGMII:
> +		return "trgmii";
>  	default:
>  		return "unknown";
>  	}

    I think this should be done in a separate phylib patch.

MBR, Sergei

^ permalink raw reply

* Re: [PATCH net-next v2 3/3] net: ethernet: mediatek: add the dts property to set if TRGMII supported on GMAC0
From: Sergei Shtylyov @ 2016-09-22 11:28 UTC (permalink / raw)
  To: sean.wang, john, davem
  Cc: nbd, netdev, linux-kernel, linux-mediatek, andrew, f.fainelli,
	keyhaede, objelf
In-Reply-To: <1474511636-11644-4-git-send-email-sean.wang@mediatek.com>

Hello.

On 9/22/2016 5:33 AM, sean.wang@mediatek.com wrote:

> From: Sean Wang <sean.wang@mediatek.com>
>
> Add the dts property for the capability if TRGMII supported on GAMC0
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  Documentation/devicetree/bindings/net/mediatek-net.txt | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
> index 6103e55..7111278 100644
> --- a/Documentation/devicetree/bindings/net/mediatek-net.txt
> +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
> @@ -31,7 +31,10 @@ Optional properties:
>  Required properties:
>  - compatible: Should be "mediatek,eth-mac"
>  - reg: The number of the MAC
> -- phy-handle: see ethernet.txt file in the same directory.
> +- phy-handle: see ethernet.txt file in the same directory and
> +	the phy-mode "trgmii" required being provided when reg

   Since you've modified the generic parser of the "phy-mode" to add your 
"trgmii", you also need to update ethernet.txt...

> +	is equal to 0 and the MAC uses fixed-link to connect
> +	with inernal switch such as MT7530.

   Internal.

[...]

MBR, Sergei

^ permalink raw reply

* Re: [PATCH v2] tcp: fix wrong checksum calculation on MTU probing
From: Sergei Shtylyov @ 2016-09-22 11:12 UTC (permalink / raw)
  To: Douglas Caetano dos Santos, David Miller
  Cc: kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <2923a9bc-c433-7546-cd4a-9f834bd43181@taghos.com.br>

Hello.

On 9/21/2016 9:26 PM, Douglas Caetano dos Santos wrote:

> With TCP MTU probing enabled and offload TX checksumming disabled,
> tcp_mtu_probe() calculated the wrong checksum when a fragment being copied
> into the probe's SKB had an odd length. This was caused by the direct use
> of skb_copy_and_csum_bits() to calculate the checksum, as it pads the
> fragment being copied, if needed. When this fragment was not the last, a
> subsequent call used the previous checksum without considering this
> padding.
>
> The effect was a stale connection in one way, as even retransmissions
> wouldn't solve the problem, because the checksum was never recalculated for
> the full SKB length.
>
> Signed-off-by: Douglas Caetano dos Santos <douglascs@taghos.com.br>
> ---
>  net/ipv4/tcp_output.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index f53d0cc..767135e 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1968,10 +1968,12 @@ static int tcp_mtu_probe(struct sock *sk)
>  		copy = min_t(int, skb->len, probe_size - len);
>  		if (nskb->ip_summed)
>  			skb_copy_bits(skb, 0, skb_put(nskb, copy), copy);
> -		else
> -			nskb->csum = skb_copy_and_csum_bits(skb, 0,
> -							    skb_put(nskb, copy),
> -							    copy, nskb->csum);
> +		else {

    CodingStyle: now the first branch needs {} too.

[...]

MBR, Sergei

^ permalink raw reply

* [PATCH net] net: rtnl_register in net_ns_init need rtnl_lock
From: Hannes Frederic Sowa @ 2016-09-22 11:03 UTC (permalink / raw)
  To: netdev

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/core/net_namespace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 2c2eb1b629b11d..a2ace299f28355 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -758,9 +758,11 @@ static int __init net_ns_init(void)
 
 	register_pernet_subsys(&net_ns_ops);
 
+	rtnl_lock();
 	rtnl_register(PF_UNSPEC, RTM_NEWNSID, rtnl_net_newid, NULL, NULL);
 	rtnl_register(PF_UNSPEC, RTM_GETNSID, rtnl_net_getid, rtnl_net_dumpid,
 		      NULL);
+	rtnl_unlock();
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH resend 2] xen-netback: switch to threaded irq for control ring
From: Wei Liu @ 2016-09-22 10:55 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, netdev, linux-kernel, wei.liu2
In-Reply-To: <1474535185-15734-1-git-send-email-jgross@suse.com>

On Thu, Sep 22, 2016 at 11:06:25AM +0200, Juergen Gross wrote:
> Instead of open coding it use the threaded irq mechanism in
> xen-netback.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

^ 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