From: David S. Miller Date: Tue, 15 Nov 2016 15:54:36 +0000 (-0500) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net X-Git-Tag: v4.10-rc1~202^2~272 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bb598c1b8c9bf56981927dcb8c0dc34b8ff95342;p=karo-tx-linux.git Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Several cases of bug fixes in 'net' overlapping other changes in 'net-next-. Signed-off-by: David S. Miller --- bb598c1b8c9bf56981927dcb8c0dc34b8ff95342 diff --cc drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 50fe8e8861bb,d239f5d0ea36..731f28625cc3 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@@ -58,14 -57,14 +58,15 @@@ mlx5_eswitch_add_offloaded_rule(struct if (esw->mode != SRIOV_OFFLOADS) return ERR_PTR(-EOPNOTSUPP); - flow_act.action = attr->action; + /* per flow vlan pop/push is emulated, don't set that into the firmware */ - action = attr->action & ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | MLX5_FLOW_CONTEXT_ACTION_VLAN_POP); ++ flow_act.action = attr->action & ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | MLX5_FLOW_CONTEXT_ACTION_VLAN_POP); - if (action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) { - dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT; - dest.vport_num = attr->out_rep->vport; - action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; - } else if (action & MLX5_FLOW_CONTEXT_ACTION_COUNT) { + if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) { + dest[i].type = MLX5_FLOW_DESTINATION_TYPE_VPORT; + dest[i].vport_num = attr->out_rep->vport; + i++; + } + if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_COUNT) { counter = mlx5_fc_create(esw->dev, true); if (IS_ERR(counter)) return ERR_CAST(counter); diff --cc drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index df31f3861c4f,e83072da6272..164bd309e92b --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@@ -1869,19 -1870,18 +1865,19 @@@ static int mlxsw_sp_router_set_abort_tr return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl); } - static void mlxsw_sp_router_fib4_abort(struct mlxsw_sp *mlxsw_sp) + static void mlxsw_sp_router_fib_flush(struct mlxsw_sp *mlxsw_sp) { - struct mlxsw_resources *resources; struct mlxsw_sp_fib_entry *fib_entry; struct mlxsw_sp_fib_entry *tmp; struct mlxsw_sp_vr *vr; int i; - int err; - resources = mlxsw_core_resources_get(mlxsw_sp->core); - for (i = 0; i < resources->max_virtual_routers; i++) { + if (mlxsw_sp->router.aborted) + return; + dev_warn(mlxsw_sp->bus_info->dev, "FIB abort triggered. Note that FIB entries are no longer being offloaded to this device.\n"); + for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); i++) { vr = &mlxsw_sp->router.vrs[i]; + if (!vr->used) continue; diff --cc net/ipv4/netfilter/nft_dup_ipv4.c index 7ab544fbc382,0c01a270bf9f..0af3d8df70dd --- a/net/ipv4/netfilter/nft_dup_ipv4.c +++ b/net/ipv4/netfilter/nft_dup_ipv4.c @@@ -28,9 -28,9 +28,9 @@@ static void nft_dup_ipv4_eval(const str struct in_addr gw = { .s_addr = (__force __be32)regs->data[priv->sreg_addr], }; - int oif = regs->data[priv->sreg_dev]; + int oif = priv->sreg_dev ? regs->data[priv->sreg_dev] : -1; - nf_dup_ipv4(pkt->net, pkt->skb, pkt->hook, &gw, oif); + nf_dup_ipv4(nft_net(pkt), pkt->skb, nft_hook(pkt), &gw, oif); } static int nft_dup_ipv4_init(const struct nft_ctx *ctx, diff --cc net/ipv6/netfilter/nft_dup_ipv6.c index 26074a8bada7,831f86e1ec08..d8b5b60b7d53 --- a/net/ipv6/netfilter/nft_dup_ipv6.c +++ b/net/ipv6/netfilter/nft_dup_ipv6.c @@@ -26,9 -26,9 +26,9 @@@ static void nft_dup_ipv6_eval(const str { struct nft_dup_ipv6 *priv = nft_expr_priv(expr); struct in6_addr *gw = (struct in6_addr *)®s->data[priv->sreg_addr]; - int oif = regs->data[priv->sreg_dev]; + int oif = priv->sreg_dev ? regs->data[priv->sreg_dev] : -1; - nf_dup_ipv6(pkt->net, pkt->skb, pkt->hook, gw, oif); + nf_dup_ipv6(nft_net(pkt), pkt->skb, nft_hook(pkt), gw, oif); } static int nft_dup_ipv6_init(const struct nft_ctx *ctx, diff --cc net/netfilter/ipvs/ip_vs_ctl.c index 6b85ded4f91d,a6e44ef2ec9a..038c2ba0ae0f --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@@ -3865,20 -3872,10 +3865,20 @@@ static const struct genl_ops ip_vs_genl }, }; +static struct genl_family ip_vs_genl_family __ro_after_init = { + .hdrsize = 0, + .name = IPVS_GENL_NAME, + .version = IPVS_GENL_VERSION, - .maxattr = IPVS_CMD_MAX, ++ .maxattr = IPVS_CMD_ATTR_MAX, + .netnsok = true, /* Make ipvsadm to work on netns */ + .module = THIS_MODULE, + .ops = ip_vs_genl_ops, + .n_ops = ARRAY_SIZE(ip_vs_genl_ops), +}; + static int __init ip_vs_genl_register(void) { - return genl_register_family_with_ops(&ip_vs_genl_family, - ip_vs_genl_ops); + return genl_register_family(&ip_vs_genl_family); } static void ip_vs_genl_unregister(void) diff --cc net/netlink/genetlink.c index bbd3bff885a1,49c28e8ef01b..fb6e10fdb217 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@@ -381,13 -417,14 +381,14 @@@ int genl_register_family(struct genl_fa return 0; -errout_free: +errout_remove: + idr_remove(&genl_fam_idr, family->id); + kfree(family->attrbuf); errout_locked: genl_unlock_all(); -errout: return err; } -EXPORT_SYMBOL(__genl_register_family); +EXPORT_SYMBOL(genl_register_family); /** * genl_unregister_family - unregister generic netlink family diff --cc samples/bpf/Makefile index 5c53fdb67ca7,72c58675973e..ac87f9c068ae --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@@ -26,7 -27,10 +26,8 @@@ hostprogs-y += xdp hostprogs-y += test_current_task_under_cgroup hostprogs-y += trace_event hostprogs-y += sampleip + hostprogs-y += tc_l2_redirect -test_verifier-objs := test_verifier.o libbpf.o -test_maps-objs := test_maps.o libbpf.o sock_example-objs := sock_example.o libbpf.o fds_example-objs := bpf_load.o libbpf.o fds_example.o sockex1-objs := bpf_load.o libbpf.o sockex1_user.o