From patchwork Mon Jun 3 09:50:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Swiatkowski X-Patchwork-Id: 13683519 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B50BA83CA3 for ; Mon, 3 Jun 2024 09:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717407982; cv=none; b=skP7HiYKUIXjSXbQsJpccBBe3w53/j03P9EQ6zhYnkpI4bgQox/zxhUcIeYb5nlGTgD39mu99OmxK0ihb0SKD/vgbHgAvmWB0HD6ou6kE7UgNUj4NvI7tPZ3GEUxxreOo/Cj6ROAXahK/a2+S37aCKdw7pynqZZqyonAiA+hWxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717407982; c=relaxed/simple; bh=r4iGRCYTbbuic2zyU6ZXrLVnh2/GNV94oxDChKZ9j2Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IlVRnJBExxS5XKqEBg7UR4eF7oFaPFUOPlUSxYLT4w/IM9Xg3ZCm93xCVUe7tFBGOspu27DaAm6gxyGiMyL1Xav2zsbg7Nvv0e3LT/QMiVpLG/SYuR2LZE+84Eno4T8LTtlpmoYDpyvkZpcMsJ7qiMa4mIDG8GSJaV/ufYsEe4g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HP1+X/C/; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HP1+X/C/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717407981; x=1748943981; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r4iGRCYTbbuic2zyU6ZXrLVnh2/GNV94oxDChKZ9j2Q=; b=HP1+X/C/TVyAWpy5BGG7XKNhAfDDsm6YneQ7zjOIykJEkYk43/8e5XRN rQ0OzFDjGUckcUTVNJ3RzXmEalHGyhKvIXmZuOAwHJvLJdW50zrPNif+x YNS88XTEOSJ+1/2akWA04G2AzD1IN/K3yM7GQYdBYgdkVELfLFA1/rmfi 18O0C9EyLNhYaYML5JJGi0zjia9xWC3m/xMGrEPuOMBZBAv/WU0TJQkPI wCDl3s02XU4gF13pXuPxkH+GlJvDy1aqt4Lj7ie44Tsm0G091dEHfo0RF NZkloEjh699THEiJJSW+7dAVCHock7YOhieSm2bYz+suU5P++f7k/GKB8 Q==; X-CSE-ConnectionGUID: fzdimHgDTHaRHRE95PALTg== X-CSE-MsgGUID: TVdS04ygSHaYkrt06H2Jdg== X-IronPort-AV: E=McAfee;i="6600,9927,11091"; a="17732756" X-IronPort-AV: E=Sophos;i="6.08,211,1712646000"; d="scan'208";a="17732756" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 02:46:21 -0700 X-CSE-ConnectionGUID: kVrsRuwdTOO7rGrlRUgJEg== X-CSE-MsgGUID: Tok+EnPwSNemK4nJJExRnQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,211,1712646000"; d="scan'208";a="37448281" Received: from wasp.igk.intel.com (HELO GK3153-DR2-R750-36946.localdomain.com) ([10.102.20.192]) by orviesa007.jf.intel.com with ESMTP; 03 Jun 2024 02:46:17 -0700 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, jacob.e.keller@intel.com, michal.kubiak@intel.com, maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com, przemyslaw.kitszel@intel.com, wojciech.drewek@intel.com, pio.raczynski@gmail.com, jiri@nvidia.com, mateusz.polchlopek@intel.com, shayd@nvidia.com, kalesh-anakkur.purayil@broadcom.com, horms@kernel.org Subject: [iwl-next v4 14/15] ice: basic support for VLAN in subfunctions Date: Mon, 3 Jun 2024 11:50:24 +0200 Message-ID: <20240603095025.1395347-15-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240603095025.1395347-1-michal.swiatkowski@linux.intel.com> References: <20240603095025.1395347-1-michal.swiatkowski@linux.intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Implement add / delete vlan for subfunction type VSI. Reviewed-by: Simon Horman 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));