Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH rdma-next v3 10/14] IB/uverbs: Add support for flow counters
From: Leon Romanovsky @ 2018-05-31 17:23 UTC (permalink / raw)
  To: Ruhl, Michael J
  Cc: Doug Ledford, Jason Gunthorpe, RDMA mailing list, Boris Pismenny,
	Matan Barak, Or Gerlitz, Raed Salem, Yishai Hadas, Saeed Mahameed,
	linux-netdev
In-Reply-To: <14063C7AD467DE4B82DEDB5C278E8663B38F0661@FMSMSX108.amr.corp.intel.com>

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

On Thu, May 31, 2018 at 02:49:44PM +0000, Ruhl, Michael J wrote:
> >-----Original Message-----
> >From: Leon Romanovsky [mailto:leon@kernel.org]
> >Sent: Thursday, May 31, 2018 9:44 AM
> >To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
> ><jgg@mellanox.com>
> >Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
> >rdma@vger.kernel.org>; Boris Pismenny <borisp@mellanox.com>; Matan
> >Barak <matanb@mellanox.com>; Ruhl, Michael J <michael.j.ruhl@intel.com>;
> >Or Gerlitz <ogerlitz@mellanox.com>; Raed Salem <raeds@mellanox.com>;
> >Yishai Hadas <yishaih@mellanox.com>; Saeed Mahameed
> ><saeedm@mellanox.com>; linux-netdev <netdev@vger.kernel.org>
> >Subject: [PATCH rdma-next v3 10/14] IB/uverbs: Add support for flow
> >counters
> >
> >From: Raed Salem <raeds@mellanox.com>
> >
> >The struct ib_uverbs_flow_spec_action_count associates
> >a counters object with the flow.
> >
> >Post this association the flow counters can be read via
> >the counters object.
> >
> >Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> >Signed-off-by: Raed Salem <raeds@mellanox.com>
> >Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >---
> > drivers/infiniband/core/uverbs.h     |  1 +
> > drivers/infiniband/core/uverbs_cmd.c | 81
> >+++++++++++++++++++++++++++++++-----
> > include/uapi/rdma/ib_user_verbs.h    | 13 ++++++
> > 3 files changed, 84 insertions(+), 11 deletions(-)
> >
> >diff --git a/drivers/infiniband/core/uverbs.h
> >b/drivers/infiniband/core/uverbs.h
> >index 5b2461fa634d..c0d40fc3a53a 100644
> >--- a/drivers/infiniband/core/uverbs.h
> >+++ b/drivers/infiniband/core/uverbs.h
> >@@ -263,6 +263,7 @@ struct ib_uverbs_flow_spec {
> > 		struct ib_uverbs_flow_spec_action_tag	flow_tag;
> > 		struct ib_uverbs_flow_spec_action_drop	drop;
> > 		struct ib_uverbs_flow_spec_action_handle action;
> >+		struct ib_uverbs_flow_spec_action_count flow_count;
> > 	};
> > };
> >
> >diff --git a/drivers/infiniband/core/uverbs_cmd.c
> >b/drivers/infiniband/core/uverbs_cmd.c
> >index ddb9d79691be..3179a95c6f5e 100644
> >--- a/drivers/infiniband/core/uverbs_cmd.c
> >+++ b/drivers/infiniband/core/uverbs_cmd.c
> >@@ -2748,43 +2748,82 @@ ssize_t ib_uverbs_detach_mcast(struct
> >ib_uverbs_file *file,
> > struct ib_uflow_resources {
> > 	size_t			max;
> > 	size_t			num;
> >-	struct ib_flow_action	*collection[0];
> >+	size_t			collection_num;
> >+	size_t			counters_num;
> >+	struct ib_counters	**counters;
> >+	struct ib_flow_action	**collection;
> > };
> >
> > static struct ib_uflow_resources *flow_resources_alloc(size_t num_specs)
> > {
> > 	struct ib_uflow_resources *resources;
> >
> >-	resources =
> >-		kmalloc(sizeof(*resources) +
> >-			num_specs * sizeof(*resources->collection),
> >GFP_KERNEL);
> >+	resources = kzalloc(sizeof(*resources), GFP_KERNEL);
> >
> > 	if (!resources)
> >-		return NULL;
> >+		goto err_res;
>
> Why the new goto?

No real reason :)

>
> >+
> >+	resources->counters =
> >+		kcalloc(num_specs, sizeof(*resources->counters),
> >GFP_KERNEL);
> >+
> >+	if (!resources->counters)
> >+		goto err_cnt;
>
> kcalloc() zeros stuff.  Could you just have a single common goto for the
> cleanup?

I have mixed feelings regarding such approach, technically you are
right, but I think that it will hurt readability.

I can send followup patch, will it work for you?

Thanks for review.

>
> Mike
>
> >+
> >+	resources->collection =
> >+		kcalloc(num_specs, sizeof(*resources->collection),
> >GFP_KERNEL);
> >+
> >+	if (!resources->collection)
> >+		goto err_collection;
> >
> >-	resources->num = 0;
> > 	resources->max = num_specs;
> >
> > 	return resources;
> >+
> >+err_collection:
> >+	kfree(resources->counters);
> >+err_cnt:
> >+	kfree(resources);
> >+err_res:
> >+	return NULL;
> > }
> >
> > void ib_uverbs_flow_resources_free(struct ib_uflow_resources *uflow_res)
> > {
> > 	unsigned int i;
> >
> >-	for (i = 0; i < uflow_res->num; i++)
> >+	for (i = 0; i < uflow_res->collection_num; i++)
> > 		atomic_dec(&uflow_res->collection[i]->usecnt);
> >
> >+	for (i = 0; i < uflow_res->counters_num; i++)
> >+		atomic_dec(&uflow_res->counters[i]->usecnt);
> >+
> >+	kfree(uflow_res->collection);
> >+	kfree(uflow_res->counters);
> > 	kfree(uflow_res);
> > }
> >
> > static void flow_resources_add(struct ib_uflow_resources *uflow_res,
> >-			       struct ib_flow_action *action)
> >+			       enum ib_flow_spec_type type,
> >+			       void *ibobj)
> > {
> > 	WARN_ON(uflow_res->num >= uflow_res->max);
> >
> >-	atomic_inc(&action->usecnt);
> >-	uflow_res->collection[uflow_res->num++] = action;
> >+	switch (type) {
> >+	case IB_FLOW_SPEC_ACTION_HANDLE:
> >+		atomic_inc(&((struct ib_flow_action *)ibobj)->usecnt);
> >+		uflow_res->collection[uflow_res->collection_num++] =
> >+			(struct ib_flow_action *)ibobj;
> >+		break;
> >+	case IB_FLOW_SPEC_ACTION_COUNT:
> >+		atomic_inc(&((struct ib_counters *)ibobj)->usecnt);
> >+		uflow_res->counters[uflow_res->counters_num++] =
> >+			(struct ib_counters *)ibobj;
> >+		break;
> >+	default:
> >+		WARN_ON(1);
> >+	}
> >+
> >+	uflow_res->num++;
> > }
> >
> > static int kern_spec_to_ib_spec_action(struct ib_ucontext *ucontext,
> >@@ -2821,9 +2860,29 @@ static int kern_spec_to_ib_spec_action(struct
> >ib_ucontext *ucontext,
> > 			return -EINVAL;
> > 		ib_spec->action.size =
> > 			sizeof(struct ib_flow_spec_action_handle);
> >-		flow_resources_add(uflow_res, ib_spec->action.act);
> >+		flow_resources_add(uflow_res,
> >+				   IB_FLOW_SPEC_ACTION_HANDLE,
> >+				   ib_spec->action.act);
> > 		uobj_put_obj_read(ib_spec->action.act);
> > 		break;
> >+	case IB_FLOW_SPEC_ACTION_COUNT:
> >+		if (kern_spec->flow_count.size !=
> >+			sizeof(struct ib_uverbs_flow_spec_action_count))
> >+			return -EINVAL;
> >+		ib_spec->flow_count.counters =
> >+			uobj_get_obj_read(counters,
> >+					  UVERBS_OBJECT_COUNTERS,
> >+					  kern_spec->flow_count.handle,
> >+					  ucontext);
> >+		if (!ib_spec->flow_count.counters)
> >+			return -EINVAL;
> >+		ib_spec->flow_count.size =
> >+				sizeof(struct ib_flow_spec_action_count);
> >+		flow_resources_add(uflow_res,
> >+				   IB_FLOW_SPEC_ACTION_COUNT,
> >+				   ib_spec->flow_count.counters);
> >+		uobj_put_obj_read(ib_spec->flow_count.counters);
> >+		break;
> > 	default:
> > 		return -EINVAL;
> > 	}
> >diff --git a/include/uapi/rdma/ib_user_verbs.h
> >b/include/uapi/rdma/ib_user_verbs.h
> >index 409507f83b91..4f9991de8e3a 100644
> >--- a/include/uapi/rdma/ib_user_verbs.h
> >+++ b/include/uapi/rdma/ib_user_verbs.h
> >@@ -998,6 +998,19 @@ struct ib_uverbs_flow_spec_action_handle {
> > 	__u32			      reserved1;
> > };
> >
> >+struct ib_uverbs_flow_spec_action_count {
> >+	union {
> >+		struct ib_uverbs_flow_spec_hdr hdr;
> >+		struct {
> >+			__u32 type;
> >+			__u16 size;
> >+			__u16 reserved;
> >+		};
> >+	};
> >+	__u32			      handle;
> >+	__u32			      reserved1;
> >+};
> >+
> > struct ib_uverbs_flow_tunnel_filter {
> > 	__be32 tunnel_id;
> > };
> >--
> >2.14.3
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [PATCH net-next] tcp: minor optimization around tcp_hdr() usage in receive path
From: David Miller @ 2018-05-31 17:23 UTC (permalink / raw)
  To: laoar.shao; +Cc: edumazet, netdev, linux-kernel
In-Reply-To: <1527607651-28262-1-git-send-email-laoar.shao@gmail.com>

From: Yafang Shao <laoar.shao@gmail.com>
Date: Tue, 29 May 2018 23:27:31 +0800

> This is additional to the
> commit ea1627c20c34 ("tcp: minor optimizations around tcp_hdr() usage").
> At this point, skb->data is same with tcp_hdr() as tcp header has not
> been pulled yet. So use the less expensive one to get the tcp header.
> 
> Remove the third parameter of tcp_rcv_established() and put it into
> the function body.
> 
> Furthermore, the local variables are listed as a reverse christmas tree :)
> 
> Cc: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v2 net-next] net: remove bypassed check in sch_direct_xmit()
From: David Miller @ 2018-05-31 17:26 UTC (permalink / raw)
  To: songliubraving; +Cc: netdev, sergei.shtylyov, kernel-team, john.fastabend, ast
In-Reply-To: <20180529170321.1817618-1-songliubraving@fb.com>

From: Song Liu <songliubraving@fb.com>
Date: Tue, 29 May 2018 10:03:21 -0700

> Checking netif_xmit_frozen_or_stopped() at the end of sch_direct_xmit()
> is being bypassed. This is because "ret" from sch_direct_xmit() will be
> either NETDEV_TX_OK or NETDEV_TX_BUSY, and only ret == NETDEV_TX_OK == 0
> will reach the condition:
> 
>     if (ret && netif_xmit_frozen_or_stopped(txq))
>         return false;
> 
> This patch cleans up the code by removing the whole condition.
> 
> For more discussion about this, please refer to
>    https://marc.info/?t=152727195700008
> 
> Signed-off-by: Song Liu <songliubraving@fb.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 2/2 net-next] net_failover: fix error code in net_failover_create()
From: Samudrala, Sridhar @ 2018-05-31 17:26 UTC (permalink / raw)
  To: Dan Carpenter, David S. Miller; +Cc: netdev, kernel-janitors
In-Reply-To: <20180531120425.tqwhhfxqawjuvtws@kili.mountain>



On 5/31/2018 5:04 AM, Dan Carpenter wrote:
> We forgot to set the error code on this path.  This function is supposed
> to return error pointers, so with this bug it accidentally returns NULL
> and the caller doesn't check for that.
>
> Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>

>
> diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
> index ef50158e90a9..881f3fa13e6b 100644
> --- a/drivers/net/net_failover.c
> +++ b/drivers/net/net_failover.c
> @@ -761,8 +761,10 @@ struct failover *net_failover_create(struct net_device *standby_dev)
>   	netif_carrier_off(failover_dev);
>   
>   	failover = failover_register(failover_dev, &net_failover_ops);
> -	if (IS_ERR(failover))
> +	if (IS_ERR(failover)) {
> +		err = PTR_ERR(failover);
>   		goto err_failover_register;
> +	}
>   
>   	return failover;
>   

^ permalink raw reply

* Re: [PATCH 1/2 net-next] net_failover: fix net_failover_compute_features()
From: Samudrala, Sridhar @ 2018-05-31 17:30 UTC (permalink / raw)
  To: Dan Carpenter, David S. Miller
  Cc: netdev, kernel-janitors, Jiri Pirko, Jay Vosburgh
In-Reply-To: <20180531120124.pc4txiifxnrslbei@kili.mountain>


On 5/31/2018 5:01 AM, Dan Carpenter wrote:
> This has an '&' vs '|' typo so it starts with vlan_features set to none.
> Also a u32 type isn't large enough to hold all the feature bits, it
> should be netdev_features_t.
>
> Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

The patch looks correct, but this code is based on team/bonding drivers.
So would like to get a confirmation from Jiri/Jay and if a similar fix is
needed in those drivers too.


>
> diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
> index 8b508e2cf29b..ef50158e90a9 100644
> --- a/drivers/net/net_failover.c
> +++ b/drivers/net/net_failover.c
> @@ -380,7 +380,8 @@ static rx_handler_result_t net_failover_handle_frame(struct sk_buff **pskb)
>   
>   static void net_failover_compute_features(struct net_device *dev)
>   {
> -	u32 vlan_features = FAILOVER_VLAN_FEATURES & NETIF_F_ALL_FOR_ALL;
> +	netdev_features_t vlan_features = FAILOVER_VLAN_FEATURES |
> +					  NETIF_F_ALL_FOR_ALL;
>   	netdev_features_t enc_features  = FAILOVER_ENC_FEATURES;
>   	unsigned short max_hard_header_len = ETH_HLEN;
>   	unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |

^ permalink raw reply

* Re: [PATCH net-next] qed: Add srq core support for RoCE and iWARP
From: Leon Romanovsky @ 2018-05-31 17:33 UTC (permalink / raw)
  To: Yuval Bason
  Cc: davem, netdev, jgg, dledford, linux-rdma, Michal Kalderon,
	Ariel Elior
In-Reply-To: <20180530131137.4653-1-yuval.bason@cavium.com>

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

On Wed, May 30, 2018 at 04:11:37PM +0300, Yuval Bason wrote:
> This patch adds support for configuring SRQ and provides the necessary
> APIs for rdma upper layer driver (qedr) to enable the SRQ feature.
>
> Signed-off-by: Michal Kalderon <michal.kalderon@cavium.com>
> Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
> Signed-off-by: Yuval Bason <yuval.bason@cavium.com>
> ---
>  drivers/net/ethernet/qlogic/qed/qed_cxt.c   |   5 +-
>  drivers/net/ethernet/qlogic/qed/qed_cxt.h   |   1 +
>  drivers/net/ethernet/qlogic/qed/qed_hsi.h   |   2 +
>  drivers/net/ethernet/qlogic/qed/qed_iwarp.c |  23 ++++
>  drivers/net/ethernet/qlogic/qed/qed_main.c  |   2 +
>  drivers/net/ethernet/qlogic/qed/qed_rdma.c  | 179 +++++++++++++++++++++++++++-
>  drivers/net/ethernet/qlogic/qed/qed_rdma.h  |   2 +
>  drivers/net/ethernet/qlogic/qed/qed_roce.c  |  17 ++-
>  include/linux/qed/qed_rdma_if.h             |  12 +-
>  9 files changed, 235 insertions(+), 8 deletions(-)
>

...

> +	struct qed_sp_init_data init_data;

...

> +	memset(&init_data, 0, sizeof(init_data));

This patter is so common in this patch, why?

"struct qed_sp_init_data init_data = {};" will do the trick.

Thanks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [PATCH net-next v12 2/5] netvsc: refactor notifier/event handling code to use the failover framework
From: Michael S. Tsirkin @ 2018-05-31 17:34 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Samudrala, Sridhar, davem, netdev, virtualization, virtio-dev,
	jesse.brandeburg, alexander.h.duyck, kubakici, jasowang,
	loseweigh, jiri, aaron.f.brown, anjali.singhai
In-Reply-To: <20180531085812.0b13afef@shemminger-XPS-13-9360>

On Thu, May 31, 2018 at 08:58:12AM -0400, Stephen Hemminger wrote:
> On Wed, 30 May 2018 20:03:11 -0700
> "Samudrala, Sridhar" <sridhar.samudrala@intel.com> wrote:
> 
> > On 5/30/2018 7:06 PM, Stephen Hemminger wrote:
> > > On Thu, 24 May 2018 09:55:14 -0700
> > > Sridhar Samudrala <sridhar.samudrala@intel.com> wrote:
> > >  
> > >> Use the registration/notification framework supported by the generic
> > >> failover infrastructure.
> > >>
> > >> Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>  
> > > Why was this merged? It was never signed off by any of the netvsc maintainers,
> > > and there were still issues unresolved.
> > >
> > > There are also namespaces issues I am fixing and this breaks them.
> > > Will start my patch set with a revert for this. Sorry  
> > 
> > I would appreciate if you can make the fixes on top of this patch series. I tried hard
> > to make sure that netvsc functionality and behavior doesn't change.
> > 
> > It is possible that there could be some bugs introduced, but they can be fixed.
> > Looks like Wei already found a bug and submitted a fix for that.
> > 
> 
> Ok, but several of these may clash with what you want for virtio.
> Like:
> 	- VF should be moved to namespace of virt device
> 	- VF should be associated based on message from host with serial # not
> 	  registration notifier and MAC address.
> 	- control operations should use master device reference rather than
> 	  searching based on MAC.
> 
> As you can see these are structural changes.

We might want to do these for virtio as well, at least as
an option.

-- 
MST

^ permalink raw reply

* Re: [PATCH net-next] virtio_net: fix error return code in virtnet_probe()
From: Michael S. Tsirkin @ 2018-05-31 17:37 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Jason Wang, Sridhar Samudrala, virtualization, netdev,
	kernel-janitors
In-Reply-To: <1527732307-145609-1-git-send-email-weiyongjun1@huawei.com>

On Thu, May 31, 2018 at 02:05:07AM +0000, Wei Yongjun wrote:
> Fix to return a negative error code from the failover create fail error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: ba5e4426e80e ("virtio_net: Extend virtio to use VF datapath when available")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  drivers/net/virtio_net.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 8f08a3e..2d55e2a 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2935,8 +2935,10 @@ static int virtnet_probe(struct virtio_device *vdev)
>  
>  	if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY)) {
>  		vi->failover = net_failover_create(vi->dev);
> -		if (IS_ERR(vi->failover))
> +		if (IS_ERR(vi->failover)) {
> +			err = PTR_ERR(vi->failover);
>  			goto free_vqs;
> +		}
>  	}
>  
>  	err = register_netdev(dev);

^ permalink raw reply

* [PATCH net-next 0/9] Test mirror-to-gretap with bridge in UL
From: Petr Machata @ 2018-05-31 17:51 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch

This patchset adds more tests to the mirror-to-gretap suite where bridge
is present in the underlay. Specifically it adds tests for bridge VLAN
handling, FDB, and bridge port STP status.

In patches #1-#3, the codebase is refactored to support the new tests.

In patch #4, an STP test is added to the mirroring library, that will
later be called from bridge tests.

In patches #5-#8, the test for mirror-to-gretap with an 802.1q bridge in
underlay is adapted and more tests are added.

In patch #9, an STP test is added to the test suite for mirror-to-gretap
with an 802.1d bridge in underlay.

Petr Machata (9):
  selftests: forwarding: lib: Move here vlan_capture_{,un}install()
  selftests: forwarding: mirror_lib: Move here
    do_test_span_vlan_dir_ips()
  selftests: forwarding: mirror_lib: skip_hw the VLAN capture
  selftests: forwarding: mirror_gre_lib: Add STP test
  selftests: forwarding: mirror_gre_vlan_bridge_1q: Fix tunnel name
  selftests: forwarding: mirror_gre_vlan_bridge_1q: Test final config
  selftests: forwarding: mirror_gre_vlan_bridge_1q: Rename two tests
  selftests: forwarding: mirror_gre_vlan_bridge_1q: Add more tests
  selftests: forwarding: mirror_gre_bridge_1d_vlan: Add STP test

 tools/testing/selftests/net/forwarding/lib.sh      |  23 ++++
 .../net/forwarding/mirror_gre_bridge_1d_vlan.sh    |  12 ++
 .../selftests/net/forwarding/mirror_gre_lib.sh     |  32 +++++
 .../net/forwarding/mirror_gre_vlan_bridge_1q.sh    | 148 +++++++++++++++++++--
 .../testing/selftests/net/forwarding/mirror_lib.sh |  38 ++++++
 .../selftests/net/forwarding/mirror_vlan.sh        |  38 ------
 6 files changed, 244 insertions(+), 47 deletions(-)

-- 
2.4.11

^ permalink raw reply

* [PATCH net-next 1/9] selftests: forwarding: lib: Move here vlan_capture_{,un}install()
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

Move vlan_capture_install() and vlan_capture_uninstall() from
mirror_vlan.sh test to lib.sh so that it can be reused in other tests.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 tools/testing/selftests/net/forwarding/lib.sh      | 23 ++++++++++++++++++++++
 .../selftests/net/forwarding/mirror_vlan.sh        | 23 ----------------------
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 89ba4cd..7b18a53 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -514,6 +514,29 @@ icmp6_capture_uninstall()
 	__icmp_capture_add_del del 100 v6 "$@"
 }
 
+__vlan_capture_add_del()
+{
+	local add_del=$1; shift
+	local pref=$1; shift
+	local dev=$1; shift
+	local filter=$1; shift
+
+	tc filter $add_del dev "$dev" ingress \
+	   proto 802.1q pref $pref \
+	   flower $filter \
+	   action pass
+}
+
+vlan_capture_install()
+{
+	__vlan_capture_add_del add 100 "$@"
+}
+
+vlan_capture_uninstall()
+{
+	__vlan_capture_add_del del 100 "$@"
+}
+
 matchall_sink_create()
 {
 	local dev=$1; shift
diff --git a/tools/testing/selftests/net/forwarding/mirror_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_vlan.sh
index 1e10520..758b6d0 100755
--- a/tools/testing/selftests/net/forwarding/mirror_vlan.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_vlan.sh
@@ -76,29 +76,6 @@ test_vlan()
 	test_vlan_dir egress 0 8
 }
 
-vlan_capture_add_del()
-{
-	local add_del=$1; shift
-	local pref=$1; shift
-	local dev=$1; shift
-	local filter=$1; shift
-
-	tc filter $add_del dev "$dev" ingress \
-	   proto 802.1q pref $pref \
-	   flower $filter \
-	   action pass
-}
-
-vlan_capture_install()
-{
-	vlan_capture_add_del add 100 "$@"
-}
-
-vlan_capture_uninstall()
-{
-	vlan_capture_add_del del 100 "$@"
-}
-
 do_test_span_vlan_dir_ips()
 {
 	local expect=$1; shift
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 2/9] selftests: forwarding: mirror_lib: Move here do_test_span_vlan_dir_ips()
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

Move the function do_test_span_vlan_dir_ips() from mirror_vlan.sh test
to a library file mirror_lib.sh to allow reuse. Fill in other entry
points similar to other testing functions in mirror_lib.sh, they will be
useful in following patches.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 .../testing/selftests/net/forwarding/mirror_lib.sh | 35 ++++++++++++++++++++++
 .../selftests/net/forwarding/mirror_vlan.sh        | 15 ----------
 2 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh
index 04cbc38..67efe25 100644
--- a/tools/testing/selftests/net/forwarding/mirror_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh
@@ -92,3 +92,38 @@ test_span_dir()
 {
 	test_span_dir_ips "$@" 192.0.2.1 192.0.2.2
 }
+
+do_test_span_vlan_dir_ips()
+{
+	local expect=$1; shift
+	local dev=$1; shift
+	local vid=$1; shift
+	local direction=$1; shift
+	local ip1=$1; shift
+	local ip2=$1; shift
+
+	vlan_capture_install $dev "vlan_id $vid"
+	mirror_test v$h1 $ip1 $ip2 $dev 100 $expect
+	mirror_test v$h2 $ip2 $ip1 $dev 100 $expect
+	vlan_capture_uninstall $dev
+}
+
+quick_test_span_vlan_dir_ips()
+{
+	do_test_span_vlan_dir_ips 10 "$@"
+}
+
+fail_test_span_vlan_dir_ips()
+{
+	do_test_span_vlan_dir_ips 0 "$@"
+}
+
+quick_test_span_vlan_dir()
+{
+	quick_test_span_vlan_dir_ips "$@" 192.0.2.1 192.0.2.2
+}
+
+fail_test_span_vlan_dir()
+{
+	fail_test_span_vlan_dir_ips "$@" 192.0.2.1 192.0.2.2
+}
diff --git a/tools/testing/selftests/net/forwarding/mirror_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_vlan.sh
index 758b6d0..20b37a5 100755
--- a/tools/testing/selftests/net/forwarding/mirror_vlan.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_vlan.sh
@@ -76,21 +76,6 @@ test_vlan()
 	test_vlan_dir egress 0 8
 }
 
-do_test_span_vlan_dir_ips()
-{
-	local expect=$1; shift
-	local dev=$1; shift
-	local vid=$1; shift
-	local direction=$1; shift
-	local ip1=$1; shift
-	local ip2=$1; shift
-
-	vlan_capture_install $dev "vlan_id $vid"
-	mirror_test v$h1 $ip1 $ip2 $dev 100 $expect
-	mirror_test v$h2 $ip2 $ip1 $dev 100 $expect
-	vlan_capture_uninstall $dev
-}
-
 test_tagged_vlan_dir()
 {
 	local direction=$1; shift
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 3/9] selftests: forwarding: mirror_lib: skip_hw the VLAN capture
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

When the VLAN capture is installed on a front panel device and not a
soft device, the packets are counted twice: once in fast path, and once
after they are trapped to the kernel. Resolve the problem by passing
skip_hw flag to vlan_capture_install().

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 tools/testing/selftests/net/forwarding/mirror_lib.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh
index 67efe25..d36dc26 100644
--- a/tools/testing/selftests/net/forwarding/mirror_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh
@@ -102,7 +102,10 @@ do_test_span_vlan_dir_ips()
 	local ip1=$1; shift
 	local ip2=$1; shift
 
-	vlan_capture_install $dev "vlan_id $vid"
+	# Install the capture as skip_hw to avoid double-counting of packets.
+	# The traffic is meant for local box anyway, so will be trapped to
+	# kernel.
+	vlan_capture_install $dev "skip_hw vlan_id $vid"
 	mirror_test v$h1 $ip1 $ip2 $dev 100 $expect
 	mirror_test v$h2 $ip2 $ip1 $dev 100 $expect
 	vlan_capture_uninstall $dev
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 4/9] selftests: forwarding: mirror_gre_lib: Add STP test
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

Add a reusable full test that toggles STP state of a given bridge port
and checks that the mirroring reacts appropriately. The test will be
used by bridge tests in follow-up patches.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 .../selftests/net/forwarding/mirror_gre_lib.sh     | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
index 92ef6dd..619b469 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
@@ -96,3 +96,35 @@ full_test_span_gre_dir_vlan()
 {
 	full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2
 }
+
+full_test_span_gre_stp_ips()
+{
+	local tundev=$1; shift
+	local nbpdev=$1; shift
+	local what=$1; shift
+	local ip1=$1; shift
+	local ip2=$1; shift
+	local h3mac=$(mac_get $h3)
+
+	RET=0
+
+	mirror_install $swp1 ingress $tundev "matchall $tcflags"
+	quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
+
+	bridge link set dev $nbpdev state disabled
+	sleep 1
+	fail_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
+
+	bridge link set dev $nbpdev state forwarding
+	sleep 1
+	quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
+
+	mirror_uninstall $swp1 ingress
+
+	log_test "$what: STP state ($tcflags)"
+}
+
+full_test_span_gre_stp()
+{
+	full_test_span_gre_stp_ips "$@" 192.0.2.1 192.0.2.2
+}
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 5/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Fix tunnel name
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

The "ip6gretap" in the test name refers to the tunnel device type that
the test is supposed to be testing. However test_ip6gretap_forbidden()
tests, due to a typo, a gretap tunnel. Fix the typo.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
index 01ec28a..29fde73 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
@@ -108,7 +108,7 @@ test_gretap_forbidden()
 
 test_ip6gretap_forbidden()
 {
-	test_span_gre_forbidden gt4 "mirror to ip6gretap"
+	test_span_gre_forbidden gt6 "mirror to ip6gretap"
 }
 
 test_all()
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 6/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Test final config
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

After the final change reestablishes the original configuration, make
sure the traffic flows again as it should.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
index 29fde73..0a3bac9 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
@@ -91,12 +91,13 @@ test_span_gre_forbidden()
 	# Now forbid the VLAN at the bridge and see it fail.
 	bridge vlan del dev br1 vid 555 self
 	sleep 1
-
 	fail_test_span_gre_dir $tundev ingress
-	mirror_uninstall $swp1 ingress
 
 	bridge vlan add dev br1 vid 555 self
 	sleep 1
+	quick_test_span_gre_dir $tundev ingress
+
+	mirror_uninstall $swp1 ingress
 
 	log_test "$what: vlan forbidden at a bridge ($tcflags)"
 }
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 7/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Rename two tests
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

Rename test_gretap_forbidden() and test_ip6gretap_forbidden() to a more
specific test_gretap_forbidden_cpu() and test_ip6gretap_forbidden_cpu().
This will make it clearer which is which when further down a patch is
introduced that forbids a VLAN on regular bridge port.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 .../selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
index 0a3bac9..d91b347 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
@@ -10,8 +10,8 @@
 ALL_TESTS="
 	test_gretap
 	test_ip6gretap
-	test_gretap_forbidden
-	test_ip6gretap_forbidden
+	test_gretap_forbidden_cpu
+	test_ip6gretap_forbidden_cpu
 "
 
 NUM_NETIFS=6
@@ -77,7 +77,7 @@ test_ip6gretap()
 	test_vlan_match gt6 'vlan_id 555 vlan_ethtype ipv6' "mirror to ip6gretap"
 }
 
-test_span_gre_forbidden()
+test_span_gre_forbidden_cpu()
 {
 	local tundev=$1; shift
 	local what=$1; shift
@@ -102,14 +102,14 @@ test_span_gre_forbidden()
 	log_test "$what: vlan forbidden at a bridge ($tcflags)"
 }
 
-test_gretap_forbidden()
+test_gretap_forbidden_cpu()
 {
-	test_span_gre_forbidden gt4 "mirror to gretap"
+	test_span_gre_forbidden_cpu gt4 "mirror to gretap"
 }
 
-test_ip6gretap_forbidden()
+test_ip6gretap_forbidden_cpu()
 {
-	test_span_gre_forbidden gt6 "mirror to ip6gretap"
+	test_span_gre_forbidden_cpu gt6 "mirror to ip6gretap"
 }
 
 test_all()
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 8/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Add more tests
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

Offloading of mirror-to-gretap in mlxsw is tricky especially in cases
when the gretap underlay involves bridges. Add more tests that exercise
the bridge handling code:

- forbidden_egress tests that check vlan removal on bridge port in the
  underlay packet path
- untagged_egress tests that similarly check "egress untagged"
- fdb_roaming tests that check whether learning FDB on a different port
  is reflected
- stp tests for handling port STP status of bridge egress port

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 .../net/forwarding/mirror_gre_vlan_bridge_1q.sh    | 129 +++++++++++++++++++++
 1 file changed, 129 insertions(+)

diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
index d91b347..5dbc7a0 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
@@ -12,6 +12,14 @@ ALL_TESTS="
 	test_ip6gretap
 	test_gretap_forbidden_cpu
 	test_ip6gretap_forbidden_cpu
+	test_gretap_forbidden_egress
+	test_ip6gretap_forbidden_egress
+	test_gretap_untagged_egress
+	test_ip6gretap_untagged_egress
+	test_gretap_fdb_roaming
+	test_ip6gretap_fdb_roaming
+	test_gretap_stp
+	test_ip6gretap_stp
 "
 
 NUM_NETIFS=6
@@ -43,12 +51,14 @@ setup_prepare()
 
 	ip link set dev $swp3 master br1
 	bridge vlan add dev $swp3 vid 555
+	bridge vlan add dev $swp2 vid 555
 }
 
 cleanup()
 {
 	pre_cleanup
 
+	ip link set dev $swp2 nomaster
 	ip link set dev $swp3 nomaster
 	vlan_destroy $h3 555
 	vlan_destroy br1 555
@@ -112,6 +122,125 @@ test_ip6gretap_forbidden_cpu()
 	test_span_gre_forbidden_cpu gt6 "mirror to ip6gretap"
 }
 
+test_span_gre_forbidden_egress()
+{
+	local tundev=$1; shift
+	local what=$1; shift
+
+	RET=0
+
+	mirror_install $swp1 ingress $tundev "matchall $tcflags"
+	quick_test_span_gre_dir $tundev ingress
+
+	bridge vlan del dev $swp3 vid 555
+	sleep 1
+	fail_test_span_gre_dir $tundev ingress
+
+	bridge vlan add dev $swp3 vid 555
+	# Re-prime FDB
+	arping -I br1.555 192.0.2.130 -fqc 1
+	sleep 1
+	quick_test_span_gre_dir $tundev ingress
+
+	mirror_uninstall $swp1 ingress
+
+	log_test "$what: vlan forbidden at a bridge egress ($tcflags)"
+}
+
+test_gretap_forbidden_egress()
+{
+	test_span_gre_forbidden_egress gt4 "mirror to gretap"
+}
+
+test_ip6gretap_forbidden_egress()
+{
+	test_span_gre_forbidden_egress gt6 "mirror to ip6gretap"
+}
+
+test_span_gre_untagged_egress()
+{
+	local tundev=$1; shift
+	local what=$1; shift
+
+	RET=0
+
+	mirror_install $swp1 ingress $tundev "matchall $tcflags"
+
+	quick_test_span_gre_dir $tundev ingress
+	quick_test_span_vlan_dir $h3 555 ingress
+
+	bridge vlan add dev $swp3 vid 555 pvid untagged
+	sleep 1
+	quick_test_span_gre_dir $tundev ingress
+	fail_test_span_vlan_dir $h3 555 ingress
+
+	bridge vlan add dev $swp3 vid 555
+	sleep 1
+	quick_test_span_gre_dir $tundev ingress
+	quick_test_span_vlan_dir $h3 555 ingress
+
+	mirror_uninstall $swp1 ingress
+
+	log_test "$what: vlan untagged at a bridge egress ($tcflags)"
+}
+
+test_gretap_untagged_egress()
+{
+	test_span_gre_untagged_egress gt4 "mirror to gretap"
+}
+
+test_ip6gretap_untagged_egress()
+{
+	test_span_gre_untagged_egress gt6 "mirror to ip6gretap"
+}
+
+test_span_gre_fdb_roaming()
+{
+	local tundev=$1; shift
+	local what=$1; shift
+	local h3mac=$(mac_get $h3)
+
+	RET=0
+
+	mirror_install $swp1 ingress $tundev "matchall $tcflags"
+	quick_test_span_gre_dir $tundev ingress
+
+	bridge fdb del dev $swp3 $h3mac vlan 555 master
+	bridge fdb add dev $swp2 $h3mac vlan 555 master
+	sleep 1
+	fail_test_span_gre_dir $tundev ingress
+
+	bridge fdb del dev $swp2 $h3mac vlan 555 master
+	# Re-prime FDB
+	arping -I br1.555 192.0.2.130 -fqc 1
+	sleep 1
+	quick_test_span_gre_dir $tundev ingress
+
+	mirror_uninstall $swp1 ingress
+
+	log_test "$what: MAC roaming ($tcflags)"
+}
+
+test_gretap_fdb_roaming()
+{
+	test_span_gre_fdb_roaming gt4 "mirror to gretap"
+}
+
+test_ip6gretap_fdb_roaming()
+{
+	test_span_gre_fdb_roaming gt6 "mirror to ip6gretap"
+}
+
+test_gretap_stp()
+{
+	full_test_span_gre_stp gt4 $swp3 "mirror to gretap"
+}
+
+test_ip6gretap_stp()
+{
+	full_test_span_gre_stp gt6 $swp3 "mirror to ip6gretap"
+}
+
 test_all()
 {
 	slow_path_trap_install $swp1 ingress
-- 
2.4.11

^ permalink raw reply related

* [PATCH net-next 9/9] selftests: forwarding: mirror_gre_bridge_1d_vlan: Add STP test
From: Petr Machata @ 2018-05-31 17:52 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

To test offloading of mirror-to-gretap in mlxsw for cases that a
VLAN-unaware bridge is in underlay packet path, test that the STP status
of bridge egress port is reflected.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 .../selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh    | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh
index 3d47afc..3bb4c2b 100755
--- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh
@@ -11,6 +11,8 @@
 ALL_TESTS="
 	test_gretap
 	test_ip6gretap
+	test_gretap_stp
+	test_ip6gretap_stp
 "
 
 NUM_NETIFS=6
@@ -80,6 +82,16 @@ test_ip6gretap()
 	test_vlan_match gt6 'vlan_id 555 vlan_ethtype ipv6' "mirror to ip6gretap"
 }
 
+test_gretap_stp()
+{
+	full_test_span_gre_stp gt4 $swp3.555 "mirror to gretap"
+}
+
+test_ip6gretap_stp()
+{
+	full_test_span_gre_stp gt6 $swp3.555 "mirror to ip6gretap"
+}
+
 test_all()
 {
 	slow_path_trap_install $swp1 ingress
-- 
2.4.11

^ permalink raw reply related

* Re: [pull request][net-next 0/7] Mellanox, mlx5e & FPGA updates 2018-05-29
From: David Miller @ 2018-05-31 17:53 UTC (permalink / raw)
  To: saeedm; +Cc: netdev
In-Reply-To: <20180530004650.15029-1-saeedm@mellanox.com>

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Tue, 29 May 2018 17:46:43 -0700

> The following series includes some minor FPGA and mlx5e netdev updates,
> for more information please see tag log below.
> 
> Please pull and let me know if there's any problem.
> 
> Note: This series doesn't include nor require any mlx5-next shared code
> and can be applied as is to net-next tree.

Pulled, thanks Saeed.

^ permalink raw reply

* Re: [PATCH ethtool] ethtool: fix stack clash in do_get_phy_tunable and do_set_phy_tunable
From: John W. Linville @ 2018-05-31 17:51 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: netdev, Raju Lakkaraju, Allan W. Nielsen
In-Reply-To: <20180509120146.C7408A0C6F@unicorn.suse.cz>

On Wed, May 09, 2018 at 02:01:46PM +0200, Michal Kubecek wrote:
> Users reported stack clash detected when using --get-phy-tunable on
> ppc64le. Problem is caused by local variable ds of type struct
> ethtool_tunable which has last member "void *data[0]". Accessing data[0]
> (as do_get_phy_tunable() does) or adding requested value at the end (which
> is what kernel ioctl does) writes past allocated space for the variable.
> 
> Make ds part of an anonymous structure to make sure there is enough space
> for tunable value and drop the (pointless) access to ds.data[0]. The same
> problem also exists in do_set_phy_tunable().
> 
> Fixes: b0fe96dec90f ("Ethtool: Implements ETHTOOL_PHY_GTUNABLE/ETHTOOL_PHY_STUNABLE and PHY downshift")
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

LGTM -- queued for next release...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: suspicius csum initialization in vmxnet3_rx_csum
From: Ronak Doshi @ 2018-05-31 18:02 UTC (permalink / raw)
  To: Paolo Abeni; +Cc: Guolin Yang, Neil Horman, Boon Ang, Louis Luo, netdev
In-Reply-To: <4aab239242c841b8cbff08eea5f340f89f368a42.camel@redhat.com>


On Wed, 30 May 2018, Paolo Abeni wrote:

> Hi,
> 
> On Thu, 2018-05-24 at 21:48 +0000, Guolin Yang wrote:
> > Yes, that code  is not correct, we should fix that code
> 
> Did you have any chance to address the issue and/or to give a more in-
> deepth look to the change proposed in my initial email?
>  
Hi Paolo,

Can you provide the esx build you are using? It can be found using 
"vmware -vl" on ESX host.

Did you try your proposed fix and did it work? Are you sure the packet
hits the below if block and not the else block? I still don't think the
ICMP packet will go through the below if block.

   if (gdesc->rcd.csum) {
	skb->csum = htons(gdesc->rcd.csum);
	skb->ip_summed = CHECKSUM_PARTIAL;
   } else {
	skb_checksum_none_assert(skb);
   }

The vmxnet3 emulation does not calculate rcd.csum for ICMP packet and
hence should go through the else block i.e. checksum none.

Thanks,
Ronak

^ permalink raw reply

* Re: [PATCH net-next 1/1] qed*: Add link change count value to ethtool statistics display.
From: David Miller @ 2018-05-31 18:02 UTC (permalink / raw)
  To: sudarsana.kalluru; +Cc: netdev, ariel.elior
In-Reply-To: <20180529093124.22950-1-sudarsana.kalluru@cavium.com>

From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Date: Tue, 29 May 2018 02:31:24 -0700

> This patch adds driver changes for capturing the link change count in
> ethtool statistics display.
> 
> Please consider applying this to "net-next".
> 
> Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
> Signed-off-by: Ariel Elior <ariel.elior@cavium.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net-next 0/5] net: aquantia: various ethtool ops implementation
From: David Miller @ 2018-05-31 18:09 UTC (permalink / raw)
  To: igor.russkikh; +Cc: netdev, darcari, pavel.belous
In-Reply-To: <cover.1527596210.git.igor.russkikh@aquantia.com>

From: Igor Russkikh <igor.russkikh@aquantia.com>
Date: Tue, 29 May 2018 15:56:57 +0300

> In this patchset Anton Mikaev and I added some useful ethtool operations:
> - ring size changes
> - link renegotioation
> - flow control management
> 
> The patch also improves init/deinit sequence.

As noted the locking in patch #1 needs to be resolved.

^ permalink raw reply

* Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events
From: Doug Ledford @ 2018-05-31 18:08 UTC (permalink / raw)
  To: Saeed Mahameed, netdev, linux-rdma; +Cc: Leon Romanovsky, Jason Gunthorpe
In-Reply-To: <20180530175950.9488-1-saeedm@mellanox.com>

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

On Wed, 2018-05-30 at 10:59 -0700, Saeed Mahameed wrote:
> Hi, 
> 
> The following series is for mlx5-next tree [1], it adds the support of two
> new device events, from Ilan Tayari:
> 
> 1. High temperature warnings.
> 2. FPGA QP error event.
> 
> In case of no objection this series will be applied to mlx5-next tree
> and will be sent later as a pull request to both rdma and net trees.
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git/log/?h=mlx5-next
> 
> v1->v2:
>   - improve commit message of the FPGA QP error event patch.
> 
> Thanks,
> Saeed.
> 
> Ilan Tayari (2):
>   net/mlx5: Add temperature warning event to log
>   net/mlx5: Add FPGA QP error event
> 
>  drivers/net/ethernet/mellanox/mlx5/core/eq.c | 28 +++++++++++++++++++-
>  include/linux/mlx5/device.h                  |  8 ++++++
>  include/linux/mlx5/mlx5_ifc.h                |  3 ++-
>  include/linux/mlx5/mlx5_ifc_fpga.h           | 16 +++++++++++
>  4 files changed, 53 insertions(+), 2 deletions(-)
> 

For the RDMA community, series ack:

Acked-by: Doug Ledford <dledford@redhat.com>

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH net-next v4 0/8] net: bridge: Notify about bridge VLANs
From: David Miller @ 2018-05-31 18:14 UTC (permalink / raw)
  To: petrm
  Cc: netdev, devel, bridge, jiri, idosch, razvan.stefanescu, gregkh,
	stephen, andrew, vivien.didelot, f.fainelli, nikolay,
	dan.carpenter
In-Reply-To: <cover.1527641426.git.petrm@mellanox.com>

From: Petr Machata <petrm@mellanox.com>
Date: Wed, 30 May 2018 02:55:34 +0200

> In commit 946a11e7408e ("mlxsw: spectrum_span: Allow bridge for gretap
> mirror"), mlxsw got support for offloading mirror-to-gretap such that
> the underlay packet path involves a bridge. In that case, the offload is
> also influenced by PVID setting of said bridge. However, changes to VLAN
> configuration of the bridge itself do not generate switchdev
> notifications, so there's no mechanism to prod mlxsw to update the
> offload when these settings change.
> 
> In this patchset, the problem is resolved by distributing the switchdev
> notification SWITCHDEV_OBJ_ID_PORT_VLAN also for configuration changes
> on bridge VLANs. Since stacked devices distribute the notification to
> lower devices, such event eventually reaches the driver, which can
> determine whether it's a bridge or port VLAN by inspecting orig_dev.
> 
> To keep things consistent, the newly-distributed notifications observe
> the same protocol as the existing ones: dual prepare/commit, with
> -EOPNOTSUPP indicating lack of support, even though there's currently
> nothing to prepare for and nothing to support. Correspondingly, all
> switchdev drivers have been updated to return -EOPNOTSUPP for bridge
> VLAN notifications.
> 
> In patches #1 and #2, the code base is changed to support the following
> additions: functions br_switchdev_port_vlan_add() and
> br_switchdev_port_vlan_del() are introduced to simplify sending
> notifications; and br_vlan_add_existing() is introduced to later make it
> simpler to add error-handling code for the case of configuring a
> preexisting VLAN on bridge CPU port.
> 
> In patches #3-#6, respectively for mlxsw, rocker, DSA and DPAA2 ethsw,
> the new notifications (which are not enabled yet) are ignored to
> maintain the current behavior.
> 
> In patch #7, the notification is actually enabled.
> 
> In patch #8, mlxsw is changed to update offloads of mirror-to-gre also
> for bridge-related notifications.
 ...

Series applied, thanks.

^ 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