From patchwork Mon May 13 08:37:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Swiatkowski X-Patchwork-Id: 1934607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=twjsgklj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VdCS94nwLz20d6 for ; Mon, 13 May 2024 18:33:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BD3EB83829; Mon, 13 May 2024 08:33:25 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id l81DILC9-U-v; Mon, 13 May 2024 08:33:25 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 05C3C838DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1715589205; bh=fvhTNgzepA70VKx+g3dMxTCle0imbaDFtOpjr7AvHfE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=twjsgkljhOLZR64i9nns3MFWW5o/6K4cz2WVCNxDrfkPy9Yw5FJETa2T3sqria+nV lSK1XYXRt1Xf6kfJanF1mnaRGB3iD7dbgrCvs8nocTa1xtxgzfeuBR9CLI1sUQ/oI7 ZrJB2xBh7HBo74m2okHyoLGYxauynTYR7ZK1O4GP/USSTGbAbA9FF+8EtxwbPyURpa KMDZUG4qMEZCIUW/5SeGAkONGqX/sfNQS1jLrJrgNGzS1UJ6vye8VxtPe7Q+Kx5EKT CICmkUbdKCtZIcCJVo0O0mnfB6OynI67SqRFGB3lsltzJMRH+E0Tjjx6kt7n93+tJf G8ngHd/UcLJxQ== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 05C3C838DE; Mon, 13 May 2024 08:33:25 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5E4D91BF86C for ; Mon, 13 May 2024 08:33:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 49889410BB for ; Mon, 13 May 2024 08:33:23 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id p97GEGr_UKND for ; Mon, 13 May 2024 08:33:19 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=198.175.65.12; helo=mgamail.intel.com; envelope-from=michal.swiatkowski@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 183D8410B9 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 183D8410B9 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by smtp4.osuosl.org (Postfix) with ESMTPS id 183D8410B9 for ; Mon, 13 May 2024 08:33:19 +0000 (UTC) X-CSE-ConnectionGUID: PscFAwReS0WJeLK+wX1toQ== X-CSE-MsgGUID: /9/2JlQDTSi+NiAKOBu3Lw== X-IronPort-AV: E=McAfee;i="6600,9927,11071"; a="22914907" X-IronPort-AV: E=Sophos;i="6.08,157,1712646000"; d="scan'208";a="22914907" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2024 01:33:19 -0700 X-CSE-ConnectionGUID: fr4M/GPUSWyMjc1W43Zzqw== X-CSE-MsgGUID: H+4gtw4uThmydvf/WbpTmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,157,1712646000"; d="scan'208";a="30303695" Received: from wasp.igk.intel.com (HELO GK3153-DR2-R750-36946.localdomain.com) ([10.102.20.192]) by fmviesa006.fm.intel.com with ESMTP; 13 May 2024 01:33:16 -0700 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Date: Mon, 13 May 2024 10:37:34 +0200 Message-ID: <20240513083735.54791-15-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240513083735.54791-1-michal.swiatkowski@linux.intel.com> References: <20240513083735.54791-1-michal.swiatkowski@linux.intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715589200; x=1747125200; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eltzYPXEe6DjzwURvU/HaK1+yLcnmQPP8HVFJtBJ5LI=; b=DTL9jeHWuHdymD4R6x/CPBRc3IpyVMUGJ/zqIFMQ7oyKCIXsyaAWmf0z wy6TM8eu3vf7OL1P9zwN/p8wip2cdm5inTEP+2m/RZ9beLNAV6Qf1A1e6 B9QCP1xL9zgsDmJLxEVFCHTKB/6ebTmzVE8YHez5CAj7J3IGCBxRVm1cp jB64yEJXO70PuXqr1H6GZEuFMlejUHKvPtL3eyiW5xuhAlFL6sTQLnEct gWCV/yLb7I8iGQVVARe7IOTYL6ezfzf5IFJzar7bYkrfwpm2G7JoJOFxg z+CBrG+Wp0/xNVa2LTYfnW8m+BnsqNHFkFNIBKEj8kpAHsXGmzY9KyvqN A==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=DTL9jeHW Subject: [Intel-wired-lan] [iwl-next v2 14/15] ice: basic support for VLAN in subfunctions X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shayd@nvidia.com, maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com, mateusz.polchlopek@intel.com, netdev@vger.kernel.org, jiri@nvidia.com, michal.kubiak@intel.com, pio.raczynski@gmail.com, przemyslaw.kitszel@intel.com, jacob.e.keller@intel.com, wojciech.drewek@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Implement add / delete vlan for subfunction type VSI. Reviewed-by: Wojciech Drewek Signed-off-by: Michal Swiatkowski --- drivers/net/ethernet/intel/ice/Makefile | 1 + .../ethernet/intel/ice/ice_sf_vsi_vlan_ops.c | 21 +++++++++++++++++++ .../ethernet/intel/ice/ice_sf_vsi_vlan_ops.h | 13 ++++++++++++ .../net/ethernet/intel/ice/ice_vsi_vlan_ops.c | 4 ++++ 4 files changed, 39 insertions(+) create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.c create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.h diff --git a/drivers/net/ethernet/intel/ice/Makefile b/drivers/net/ethernet/intel/ice/Makefile index 4d987f5dcdc1..f5ff5fba0c3a 100644 --- a/drivers/net/ethernet/intel/ice/Makefile +++ b/drivers/net/ethernet/intel/ice/Makefile @@ -32,6 +32,7 @@ ice-y := ice_main.o \ devlink/devlink.o \ devlink/devlink_port.o \ ice_sf_eth.o \ + ice_sf_vsi_vlan_ops.o \ ice_ddp.o \ ice_fw_update.o \ ice_lag.o \ diff --git a/drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.c b/drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.c new file mode 100644 index 000000000000..3d7e96721cf9 --- /dev/null +++ b/drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2023, Intel Corporation. */ + +#include "ice_vsi_vlan_ops.h" +#include "ice_vsi_vlan_lib.h" +#include "ice_vlan_mode.h" +#include "ice.h" +#include "ice_sf_vsi_vlan_ops.h" + +void ice_sf_vsi_init_vlan_ops(struct ice_vsi *vsi) +{ + struct ice_vsi_vlan_ops *vlan_ops; + + if (ice_is_dvm_ena(&vsi->back->hw)) + vlan_ops = &vsi->outer_vlan_ops; + else + vlan_ops = &vsi->inner_vlan_ops; + + vlan_ops->add_vlan = ice_vsi_add_vlan; + vlan_ops->del_vlan = ice_vsi_del_vlan; +} diff --git a/drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.h b/drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.h new file mode 100644 index 000000000000..8c44eafceea0 --- /dev/null +++ b/drivers/net/ethernet/intel/ice/ice_sf_vsi_vlan_ops.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (c) 2023, Intel Corporation. */ + +#ifndef _ICE_SF_VSI_VLAN_OPS_H_ +#define _ICE_SF_VSI_VLAN_OPS_H_ + +#include "ice_vsi_vlan_ops.h" + +struct ice_vsi; + +void ice_sf_vsi_init_vlan_ops(struct ice_vsi *vsi); + +#endif /* _ICE_SF_VSI_VLAN_OPS_H_ */ diff --git a/drivers/net/ethernet/intel/ice/ice_vsi_vlan_ops.c b/drivers/net/ethernet/intel/ice/ice_vsi_vlan_ops.c index 7aae7fdcfcdb..8c7a9b41fb63 100644 --- a/drivers/net/ethernet/intel/ice/ice_vsi_vlan_ops.c +++ b/drivers/net/ethernet/intel/ice/ice_vsi_vlan_ops.c @@ -3,6 +3,7 @@ #include "ice_pf_vsi_vlan_ops.h" #include "ice_vf_vsi_vlan_ops.h" +#include "ice_sf_vsi_vlan_ops.h" #include "ice_lib.h" #include "ice.h" @@ -77,6 +78,9 @@ void ice_vsi_init_vlan_ops(struct ice_vsi *vsi) case ICE_VSI_VF: ice_vf_vsi_init_vlan_ops(vsi); break; + case ICE_VSI_SF: + ice_sf_vsi_init_vlan_ops(vsi); + break; default: dev_dbg(ice_pf_to_dev(vsi->back), "%s does not support VLAN operations\n", ice_vsi_type_str(vsi->type));