RE: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-14 Thread Razvan Stefanescu


> -Original Message-
> From: Andrew Lunn [mailto:and...@lunn.ch]
> Sent: Tuesday, March 13, 2018 5:26 PM
> To: Razvan Stefanescu <razvan.stefane...@nxp.com>
> Cc: gre...@linuxfoundation.org; de...@driverdev.osuosl.org; linux-
> ker...@vger.kernel.org; net...@vger.kernel.org; Alexander Graf
> <ag...@suse.de>; a...@arndb.de; Alexandru Marginean
> <alexandru.margin...@nxp.com>; Ruxandra Ioana Ciocoi Radulescu
> <ruxandra.radule...@nxp.com>; Ioana Ciornei <ioana.cior...@nxp.com>;
> Laurentiu Tudor <laurentiu.tu...@nxp.com>; stuyo...@gmail.com
> Subject: Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2
> Ethernet Switch driver
> 
> > Hello Andrew,
> >
> > The current driver implementation uses only a single FDB for the switch,
> > so  it is not possible configure multiple flooding domains to accommodate
> > ports partitioning.
> 
> Ah, O.K. Rather than break somebodies network by wrongly flooding, it
> would be better to return -EOPNOTSUPP when the requirement for the
> second FDB is met. The offload to hardware will then not happen, and
> the software bridge will do all the work.
> 
Thank you for your suggestion. I will add to the TODO list in v6.

Razvan
> Andrew


RE: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-14 Thread Razvan Stefanescu


> -Original Message-
> From: Andrew Lunn [mailto:and...@lunn.ch]
> Sent: Tuesday, March 13, 2018 5:26 PM
> To: Razvan Stefanescu 
> Cc: gre...@linuxfoundation.org; de...@driverdev.osuosl.org; linux-
> ker...@vger.kernel.org; net...@vger.kernel.org; Alexander Graf
> ; a...@arndb.de; Alexandru Marginean
> ; Ruxandra Ioana Ciocoi Radulescu
> ; Ioana Ciornei ;
> Laurentiu Tudor ; stuyo...@gmail.com
> Subject: Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2
> Ethernet Switch driver
> 
> > Hello Andrew,
> >
> > The current driver implementation uses only a single FDB for the switch,
> > so  it is not possible configure multiple flooding domains to accommodate
> > ports partitioning.
> 
> Ah, O.K. Rather than break somebodies network by wrongly flooding, it
> would be better to return -EOPNOTSUPP when the requirement for the
> second FDB is met. The offload to hardware will then not happen, and
> the software bridge will do all the work.
> 
Thank you for your suggestion. I will add to the TODO list in v6.

Razvan
> Andrew


Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Andrew Lunn
> Hello Andrew,
> 
> The current driver implementation uses only a single FDB for the switch,
> so  it is not possible configure multiple flooding domains to accommodate
> ports partitioning.

Ah, O.K. Rather than break somebodies network by wrongly flooding, it
would be better to return -EOPNOTSUPP when the requirement for the
second FDB is met. The offload to hardware will then not happen, and
the software bridge will do all the work.

Andrew


Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Andrew Lunn
> Hello Andrew,
> 
> The current driver implementation uses only a single FDB for the switch,
> so  it is not possible configure multiple flooding domains to accommodate
> ports partitioning.

Ah, O.K. Rather than break somebodies network by wrongly flooding, it
would be better to return -EOPNOTSUPP when the requirement for the
second FDB is met. The offload to hardware will then not happen, and
the software bridge will do all the work.

Andrew


RE: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Razvan Stefanescu


> -Original Message-
> From: Andrew Lunn [mailto:and...@lunn.ch]
> Sent: Tuesday, March 13, 2018 4:23 PM
> To: Razvan Stefanescu <razvan.stefane...@nxp.com>
> Cc: gre...@linuxfoundation.org; de...@driverdev.osuosl.org; linux-
> ker...@vger.kernel.org; net...@vger.kernel.org; Alexander Graf
> <ag...@suse.de>; a...@arndb.de; Alexandru Marginean
> <alexandru.margin...@nxp.com>; Ruxandra Ioana Ciocoi Radulescu
> <ruxandra.radule...@nxp.com>; Ioana Ciornei <ioana.cior...@nxp.com>;
> Laurentiu Tudor <laurentiu.tu...@nxp.com>; stuyo...@gmail.com
> Subject: Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2
> Ethernet Switch driver
> 
> > +/* For the moment, only flood setting needs to be updated */
> > +static int port_bridge_join(struct net_device *netdev,
> > +   struct net_device *upper_dev)
> > +{
> > +   struct ethsw_port_priv *port_priv = netdev_priv(netdev);
> > +   struct ethsw_core *ethsw = port_priv->ethsw_data;
> > +   int i, err;
> > +
> > +   for (i = 0; i < ethsw->sw_attr.num_ifs; i++)
> > +   if (ethsw->ports[i]->bridge_dev &&
> > +   (ethsw->ports[i]->bridge_dev != upper_dev)) {
> > +   netdev_err(netdev,
> > +  "Another switch port is connected to %s\n",
> > +  ethsw->ports[i]->bridge_dev->name);
> > +   return -EINVAL;
> > +   }
> > +
> > +   /* Enable flooding */
> > +   err = ethsw_port_set_flood(port_priv, 1);
> > +   if (!err)
> > +   port_priv->bridge_dev = upper_dev;
> > +
> > +   return err;
> > +}
> 
> Hi Razvan
> 
> That is not what i was meaning.
> 
> brctl addbr br0
> brctl addbr br1
> brctl addif br0 lan0
> brctl addif br0 lan1
> brctl addif br1 lan2
> brctl addif br1 lan3
> 
> Is there somewhere in the code which sets the scope for the flooding?
> lan0 can flood to lan1, but it should not flood to lan2 or lan3, since
> they are in a different bridge. I was expecting that
> ethsw_port_set_flood() takes upper_dev, in order to configure which
> ports it should flood to.
> 
>   Andrew

Hello Andrew,

The current driver implementation uses only a single FDB for the switch,
so  it is not possible configure multiple flooding domains to accommodate
ports partitioning.
 
The configuration that you mentioned will be possible when support for
multiple FDBs in the switch is added. Ports added to the same bridge
will have their flooding domain limited to a specific FDB.

Switch ports partitioning is a feature on the roadmap. I will add this
information to the TODO list.

Best regards,
Razvan Stefanescu


RE: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Razvan Stefanescu


> -Original Message-
> From: Andrew Lunn [mailto:and...@lunn.ch]
> Sent: Tuesday, March 13, 2018 4:23 PM
> To: Razvan Stefanescu 
> Cc: gre...@linuxfoundation.org; de...@driverdev.osuosl.org; linux-
> ker...@vger.kernel.org; net...@vger.kernel.org; Alexander Graf
> ; a...@arndb.de; Alexandru Marginean
> ; Ruxandra Ioana Ciocoi Radulescu
> ; Ioana Ciornei ;
> Laurentiu Tudor ; stuyo...@gmail.com
> Subject: Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2
> Ethernet Switch driver
> 
> > +/* For the moment, only flood setting needs to be updated */
> > +static int port_bridge_join(struct net_device *netdev,
> > +   struct net_device *upper_dev)
> > +{
> > +   struct ethsw_port_priv *port_priv = netdev_priv(netdev);
> > +   struct ethsw_core *ethsw = port_priv->ethsw_data;
> > +   int i, err;
> > +
> > +   for (i = 0; i < ethsw->sw_attr.num_ifs; i++)
> > +   if (ethsw->ports[i]->bridge_dev &&
> > +   (ethsw->ports[i]->bridge_dev != upper_dev)) {
> > +   netdev_err(netdev,
> > +  "Another switch port is connected to %s\n",
> > +  ethsw->ports[i]->bridge_dev->name);
> > +   return -EINVAL;
> > +   }
> > +
> > +   /* Enable flooding */
> > +   err = ethsw_port_set_flood(port_priv, 1);
> > +   if (!err)
> > +   port_priv->bridge_dev = upper_dev;
> > +
> > +   return err;
> > +}
> 
> Hi Razvan
> 
> That is not what i was meaning.
> 
> brctl addbr br0
> brctl addbr br1
> brctl addif br0 lan0
> brctl addif br0 lan1
> brctl addif br1 lan2
> brctl addif br1 lan3
> 
> Is there somewhere in the code which sets the scope for the flooding?
> lan0 can flood to lan1, but it should not flood to lan2 or lan3, since
> they are in a different bridge. I was expecting that
> ethsw_port_set_flood() takes upper_dev, in order to configure which
> ports it should flood to.
> 
>   Andrew

Hello Andrew,

The current driver implementation uses only a single FDB for the switch,
so  it is not possible configure multiple flooding domains to accommodate
ports partitioning.
 
The configuration that you mentioned will be possible when support for
multiple FDBs in the switch is added. Ports added to the same bridge
will have their flooding domain limited to a specific FDB.

Switch ports partitioning is a feature on the roadmap. I will add this
information to the TODO list.

Best regards,
Razvan Stefanescu


Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Andrew Lunn
> +/* For the moment, only flood setting needs to be updated */
> +static int port_bridge_join(struct net_device *netdev,
> + struct net_device *upper_dev)
> +{
> + struct ethsw_port_priv *port_priv = netdev_priv(netdev);
> + struct ethsw_core *ethsw = port_priv->ethsw_data;
> + int i, err;
> +
> + for (i = 0; i < ethsw->sw_attr.num_ifs; i++)
> + if (ethsw->ports[i]->bridge_dev &&
> + (ethsw->ports[i]->bridge_dev != upper_dev)) {
> + netdev_err(netdev,
> +"Another switch port is connected to %s\n",
> +ethsw->ports[i]->bridge_dev->name);
> + return -EINVAL;
> + }
> +
> + /* Enable flooding */
> + err = ethsw_port_set_flood(port_priv, 1);
> + if (!err)
> + port_priv->bridge_dev = upper_dev;
> +
> + return err;
> +}

Hi Razvan

That is not what i was meaning.

brctl addbr br0
brctl addbr br1
brctl addif br0 lan0
brctl addif br0 lan1
brctl addif br1 lan2
brctl addif br1 lan3

Is there somewhere in the code which sets the scope for the flooding?
lan0 can flood to lan1, but it should not flood to lan2 or lan3, since
they are in a different bridge. I was expecting that
ethsw_port_set_flood() takes upper_dev, in order to configure which
ports it should flood to.

  Andrew


Re: [PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Andrew Lunn
> +/* For the moment, only flood setting needs to be updated */
> +static int port_bridge_join(struct net_device *netdev,
> + struct net_device *upper_dev)
> +{
> + struct ethsw_port_priv *port_priv = netdev_priv(netdev);
> + struct ethsw_core *ethsw = port_priv->ethsw_data;
> + int i, err;
> +
> + for (i = 0; i < ethsw->sw_attr.num_ifs; i++)
> + if (ethsw->ports[i]->bridge_dev &&
> + (ethsw->ports[i]->bridge_dev != upper_dev)) {
> + netdev_err(netdev,
> +"Another switch port is connected to %s\n",
> +ethsw->ports[i]->bridge_dev->name);
> + return -EINVAL;
> + }
> +
> + /* Enable flooding */
> + err = ethsw_port_set_flood(port_priv, 1);
> + if (!err)
> + port_priv->bridge_dev = upper_dev;
> +
> + return err;
> +}

Hi Razvan

That is not what i was meaning.

brctl addbr br0
brctl addbr br1
brctl addif br0 lan0
brctl addif br0 lan1
brctl addif br1 lan2
brctl addif br1 lan3

Is there somewhere in the code which sets the scope for the flooding?
lan0 can flood to lan1, but it should not flood to lan2 or lan3, since
they are in a different bridge. I was expecting that
ethsw_port_set_flood() takes upper_dev, in order to configure which
ports it should flood to.

  Andrew


[PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Razvan Stefanescu
Introduce the DPAA2 Ethernet Switch driver, which manages Datapath Switch
(DPSW) objects discovered on the MC bus.

Suggested-by: Alexandru Marginean 
Signed-off-by: Razvan Stefanescu 
---
Changelog:
 v2:
- fix PVID cleanup in ethsw_port_add_vlan()
- rename err2 to ret in ethsw_port_add/del_vlan()
- avoid duplicate code in ethsw_probe()
- move destroy_workqueue to ethsw_takedown()
- have a function for unregistering notifiers
- above changes implement review comments for v1 from Bogdan P.
 v3:
- no changes
 v4:
- adjust to moving MC-bus out of staging
- support adding/deleting multicast entries to/from FDB
- selectively discard benign MC errors for calling add/delete fdb entries
  multiple times to avoid spamming console with stack traces
- refactor setting TCI to avoid code duplication
- clean probe code error path
 v5:
- replace ethsw_irq0_handler() with NULL
- do not allow adding ports of the same switch to multiple bridge devices

 drivers/staging/fsl-dpaa2/ethsw/Makefile |2 +-
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c  | 1531 ++
 drivers/staging/fsl-dpaa2/ethsw/ethsw.h  |   89 ++
 3 files changed, 1621 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/ethsw.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/ethsw.h

diff --git a/drivers/staging/fsl-dpaa2/ethsw/Makefile 
b/drivers/staging/fsl-dpaa2/ethsw/Makefile
index db137f7..a6d72d1 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/Makefile
+++ b/drivers/staging/fsl-dpaa2/ethsw/Makefile
@@ -4,4 +4,4 @@
 
 obj-$(CONFIG_FSL_DPAA2_ETHSW) += dpaa2-ethsw.o
 
-dpaa2-ethsw-objs := dpsw.o
+dpaa2-ethsw-objs := ethsw.o dpsw.o
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c 
b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
new file mode 100644
index 000..2127037
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -0,0 +1,1531 @@
+/* Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright 2017-2018 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of the above-listed copyright holders nor the
+ *  names of any contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "ethsw.h"
+
+static struct workqueue_struct *ethsw_owq;
+
+/* Minimal supported DPSW version */
+#define DPSW_MIN_VER_MAJOR 8
+#define DPSW_MIN_VER_MINOR 0
+
+#define DEFAULT_VLAN_ID1
+
+static int ethsw_add_vlan(struct ethsw_core *ethsw, u16 vid)
+{
+   int err;
+
+   struct dpsw_vlan_cfgvcfg = {
+   .fdb_id = 0,
+   };
+
+   if (ethsw->vlans[vid]) {
+   dev_err(ethsw->dev, "VLAN already configured\n");
+   return -EEXIST;
+   }
+
+   err = dpsw_vlan_add(ethsw->mc_io, 0,
+   ethsw->dpsw_handle, vid, );
+   if (err) {
+   dev_err(ethsw->dev, "dpsw_vlan_add err %d\n", err);
+   return err;
+   }
+   ethsw->vlans[vid] = ETHSW_VLAN_MEMBER;
+
+   return 0;
+}
+
+static int ethsw_port_set_tci(struct ethsw_port_priv *port_priv,
+ struct dpsw_tci_cfg *tci_cfg)
+{
+   struct ethsw_core *ethsw = 

[PATCH v5 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver

2018-03-13 Thread Razvan Stefanescu
Introduce the DPAA2 Ethernet Switch driver, which manages Datapath Switch
(DPSW) objects discovered on the MC bus.

Suggested-by: Alexandru Marginean 
Signed-off-by: Razvan Stefanescu 
---
Changelog:
 v2:
- fix PVID cleanup in ethsw_port_add_vlan()
- rename err2 to ret in ethsw_port_add/del_vlan()
- avoid duplicate code in ethsw_probe()
- move destroy_workqueue to ethsw_takedown()
- have a function for unregistering notifiers
- above changes implement review comments for v1 from Bogdan P.
 v3:
- no changes
 v4:
- adjust to moving MC-bus out of staging
- support adding/deleting multicast entries to/from FDB
- selectively discard benign MC errors for calling add/delete fdb entries
  multiple times to avoid spamming console with stack traces
- refactor setting TCI to avoid code duplication
- clean probe code error path
 v5:
- replace ethsw_irq0_handler() with NULL
- do not allow adding ports of the same switch to multiple bridge devices

 drivers/staging/fsl-dpaa2/ethsw/Makefile |2 +-
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c  | 1531 ++
 drivers/staging/fsl-dpaa2/ethsw/ethsw.h  |   89 ++
 3 files changed, 1621 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/ethsw.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/ethsw.h

diff --git a/drivers/staging/fsl-dpaa2/ethsw/Makefile 
b/drivers/staging/fsl-dpaa2/ethsw/Makefile
index db137f7..a6d72d1 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/Makefile
+++ b/drivers/staging/fsl-dpaa2/ethsw/Makefile
@@ -4,4 +4,4 @@
 
 obj-$(CONFIG_FSL_DPAA2_ETHSW) += dpaa2-ethsw.o
 
-dpaa2-ethsw-objs := dpsw.o
+dpaa2-ethsw-objs := ethsw.o dpsw.o
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c 
b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
new file mode 100644
index 000..2127037
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -0,0 +1,1531 @@
+/* Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright 2017-2018 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of the above-listed copyright holders nor the
+ *  names of any contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "ethsw.h"
+
+static struct workqueue_struct *ethsw_owq;
+
+/* Minimal supported DPSW version */
+#define DPSW_MIN_VER_MAJOR 8
+#define DPSW_MIN_VER_MINOR 0
+
+#define DEFAULT_VLAN_ID1
+
+static int ethsw_add_vlan(struct ethsw_core *ethsw, u16 vid)
+{
+   int err;
+
+   struct dpsw_vlan_cfgvcfg = {
+   .fdb_id = 0,
+   };
+
+   if (ethsw->vlans[vid]) {
+   dev_err(ethsw->dev, "VLAN already configured\n");
+   return -EEXIST;
+   }
+
+   err = dpsw_vlan_add(ethsw->mc_io, 0,
+   ethsw->dpsw_handle, vid, );
+   if (err) {
+   dev_err(ethsw->dev, "dpsw_vlan_add err %d\n", err);
+   return err;
+   }
+   ethsw->vlans[vid] = ETHSW_VLAN_MEMBER;
+
+   return 0;
+}
+
+static int ethsw_port_set_tci(struct ethsw_port_priv *port_priv,
+ struct dpsw_tci_cfg *tci_cfg)
+{
+   struct ethsw_core *ethsw = port_priv->ethsw_data;
+   struct net_device *netdev =