Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2235998ybi; Thu, 20 Jun 2019 11:21:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqztOikS9gB8xgcEd2nxRe2K9y6SeHk6+P4IKgb+tfIdHC5VB+F0/KmYpK1osBA+zko4Y/sl X-Received: by 2002:a63:6f47:: with SMTP id k68mr13808267pgc.327.1561054875304; Thu, 20 Jun 2019 11:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054875; cv=none; d=google.com; s=arc-20160816; b=Ov6FW7YvxAXQ/4qY8nlk29v4VTKZsiYxyI5gypNnl1NCynrmbefL0jplFIapgbjXcA NcyFycMuNw9OIJN6twG6hzI+iuokZrgwFlUhhNWwWGq/73Ma0wVDCGYfxFpdN9bvfdV1 mdExqHHIcf1nnilLS2GAuJlM8IIUa08KYCJH7pG6ym7PGPkiZj/WbCkH0hUfExdqY2db t03SB769lQnY4jJHM2iLT1ETdK1lu+gE9uQ7G8MSkj0n5iUZa8q/RPTlzsUildnUjp5F W0Vz2JQI5IMyAZ7+KAMyajIqJafq9+IXoDv79C7T3N2ryoeYrMxWyYfT5P2HvEsmxqBS DcbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ColwRUTH1f8gn7XgK6Q++C64cxlAXXMY5cTBeXdgNd8=; b=LrGrQ+KqgwHlBCpXoKuOqBrtSBipJyc4bDuSessVGQGqaL51rwecqA5YYyLZ43b7oW kobFUbBFChxhBjVmEqBWdwCi6MEIniYdoyV9W7jfLiuz3FrfWi7SnjJblT4MHeb+Qsnb ElRUEnDNZ+jNC2AFfezVv9l6vkNIv5f6EtfOk5APi0NLeVPIko+jF7AnugwZMRPJwUgE Lw+39p17Jwr0m00Z3hnpRAjAyIgawGFiatt/PkGih0MHPmwp7BfsnKeZGO5RrOSIcCAr yFiulajplpcYE0F4WM96lansMaMPurDtDuCxtVfY0iZidR7n6LyjRy4CS6WzYsEG4jno cjNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w73ZQo8L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si157335pgl.511.2019.06.20.11.20.59; Thu, 20 Jun 2019 11:21:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w73ZQo8L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728840AbfFTSNt (ORCPT + 99 others); Thu, 20 Jun 2019 14:13:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:41818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729016AbfFTSNr (ORCPT ); Thu, 20 Jun 2019 14:13:47 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C1D7621537; Thu, 20 Jun 2019 18:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054426; bh=OBMJoiPQaTvsnD2GfHaSCrxzr14ZOG3EferDDf6RBQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w73ZQo8LJHFhnKWWhEf1/4iKU6X/4FQVOqXgvti1W4J1CrO/TIspA6cMv2d8mprkD JYAwbzmzgqvNgETlTkAlkfXFhk+Cb4XH3Y+BNC7BPBI5io/jgadgN2JjtgQbHTpcvN NMX/+KD93wcrl7N4MlEnGYDuM4cpaORFXvPwcsZc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Mi , Roi Dayan , Vlad Buslov , Saeed Mahameed Subject: [PATCH 5.1 25/98] net/mlx5e: Add ndo_set_feature for uplink representor Date: Thu, 20 Jun 2019 19:56:52 +0200 Message-Id: <20190620174350.308579831@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Mi After we have a dedicated uplink representor, the new netdev ops doesn't support ndo_set_feature. Because of that, we can't change some features, eg. rxvlan. Now add it back. In this patch, I also do a cleanup for the features flag handling, eg. remove duplicate NETIF_F_HW_TC flag setting. Fixes: aec002f6f82c ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode") Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +-- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -1059,6 +1059,7 @@ void mlx5e_del_vxlan_port(struct net_dev netdev_features_t mlx5e_features_check(struct sk_buff *skb, struct net_device *netdev, netdev_features_t features); +int mlx5e_set_features(struct net_device *netdev, netdev_features_t features); #ifdef CONFIG_MLX5_ESWITCH int mlx5e_set_vf_mac(struct net_device *dev, int vf, u8 *mac); int mlx5e_set_vf_rate(struct net_device *dev, int vf, int min_tx_rate, int max_tx_rate); --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3698,8 +3698,7 @@ static int mlx5e_handle_feature(struct n return 0; } -static int mlx5e_set_features(struct net_device *netdev, - netdev_features_t features) +int mlx5e_set_features(struct net_device *netdev, netdev_features_t features) { netdev_features_t oper_features = netdev->features; int err = 0; --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -1350,6 +1350,7 @@ static const struct net_device_ops mlx5e .ndo_get_vf_stats = mlx5e_get_vf_stats, .ndo_set_vf_vlan = mlx5e_uplink_rep_set_vf_vlan, .ndo_get_port_parent_id = mlx5e_rep_get_port_parent_id, + .ndo_set_features = mlx5e_set_features, }; bool mlx5e_eswitch_rep(struct net_device *netdev) @@ -1423,10 +1424,9 @@ static void mlx5e_build_rep_netdev(struc netdev->watchdog_timeo = 15 * HZ; + netdev->features |= NETIF_F_NETNS_LOCAL; - netdev->features |= NETIF_F_HW_TC | NETIF_F_NETNS_LOCAL; - netdev->hw_features |= NETIF_F_HW_TC; - + netdev->hw_features |= NETIF_F_HW_TC; netdev->hw_features |= NETIF_F_SG; netdev->hw_features |= NETIF_F_IP_CSUM; netdev->hw_features |= NETIF_F_IPV6_CSUM; @@ -1435,7 +1435,9 @@ static void mlx5e_build_rep_netdev(struc netdev->hw_features |= NETIF_F_TSO6; netdev->hw_features |= NETIF_F_RXCSUM; - if (rep->vport != MLX5_VPORT_UPLINK) + if (rep->vport == MLX5_VPORT_UPLINK) + netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; + else netdev->features |= NETIF_F_VLAN_CHALLENGED; netdev->features |= netdev->hw_features;