Skip to content

Commit 0c6a3cb

Browse files
Michal Swiatkowskianguy11
authored andcommitted
ice: basic support for VLAN in subfunctions
Implement add / delete vlan for subfunction type VSI. Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 7cde474 commit 0c6a3cb

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ ice-y := ice_main.o \
3434
devlink/devlink.o \
3535
devlink/devlink_port.o \
3636
ice_sf_eth.o \
37+
ice_sf_vsi_vlan_ops.o \
3738
ice_ddp.o \
3839
ice_fw_update.o \
3940
ice_lag.o \
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/* Copyright (c) 2023, Intel Corporation. */
3+
4+
#include "ice_vsi_vlan_ops.h"
5+
#include "ice_vsi_vlan_lib.h"
6+
#include "ice_vlan_mode.h"
7+
#include "ice.h"
8+
#include "ice_sf_vsi_vlan_ops.h"
9+
10+
void ice_sf_vsi_init_vlan_ops(struct ice_vsi *vsi)
11+
{
12+
struct ice_vsi_vlan_ops *vlan_ops;
13+
14+
if (ice_is_dvm_ena(&vsi->back->hw))
15+
vlan_ops = &vsi->outer_vlan_ops;
16+
else
17+
vlan_ops = &vsi->inner_vlan_ops;
18+
19+
vlan_ops->add_vlan = ice_vsi_add_vlan;
20+
vlan_ops->del_vlan = ice_vsi_del_vlan;
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (c) 2023, Intel Corporation. */
3+
4+
#ifndef _ICE_SF_VSI_VLAN_OPS_H_
5+
#define _ICE_SF_VSI_VLAN_OPS_H_
6+
7+
#include "ice_vsi_vlan_ops.h"
8+
9+
struct ice_vsi;
10+
11+
void ice_sf_vsi_init_vlan_ops(struct ice_vsi *vsi);
12+
13+
#endif /* _ICE_SF_VSI_VLAN_OPS_H_ */

drivers/net/ethernet/intel/ice/ice_vsi_vlan_ops.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "ice_pf_vsi_vlan_ops.h"
55
#include "ice_vf_vsi_vlan_ops.h"
6+
#include "ice_sf_vsi_vlan_ops.h"
67
#include "ice_lib.h"
78
#include "ice.h"
89

@@ -77,6 +78,9 @@ void ice_vsi_init_vlan_ops(struct ice_vsi *vsi)
7778
case ICE_VSI_VF:
7879
ice_vf_vsi_init_vlan_ops(vsi);
7980
break;
81+
case ICE_VSI_SF:
82+
ice_sf_vsi_init_vlan_ops(vsi);
83+
break;
8084
default:
8185
dev_dbg(ice_pf_to_dev(vsi->back), "%s does not support VLAN operations\n",
8286
ice_vsi_type_str(vsi->type));

0 commit comments

Comments
 (0)