staging: dpaa2-switch: make sure that the VLAN is not already configured
authorIoana Ciornei <ioana.ciornei@nxp.com>
Thu, 24 Sep 2020 11:29:00 +0000 (14:29 +0300)
committerDong Aisheng <aisheng.dong@nxp.com>
Mon, 14 Dec 2020 03:36:23 +0000 (11:36 +0800)
commit08b0f19dff27a8790e707ad860d7487f7baeeebc
treeaa06c3c3c74844136b65a96be9f68cc25bcd0558
parent04c1318866fb8e15d5a4903d8dc3c020bd05fb60
staging: dpaa2-switch: make sure that the VLAN is not already configured

When in the PREPARE state of a switchdev transaction, check if the
requested VLAN is not already configured on the switch port. This keeps
us from getting into a WARNING as below.

[ 1389.683296] dpaa2_ethsw dpsw.0 eth0: VLAN 2 already configured
[ 1389.689125] ------------[ cut here ]------------
[ 1389.694084] eth0: Commit of object (id=1) failed.
[ 1389.698863] WARNING: CPU: 0 PID: 613 at net/switchdev/switchdev.c:277 switchdev_port_obj_add_now+0xcc/0x110
[ 1389.708589] Modules linked in:
[ 1389.711634] CPU: 0 PID: 613 Comm: bridge Not tainted 5.9.0-rc2-next-20200828-00112-g7172078477c5 #59
[ 1389.720753] Hardware name: NXP Layerscape LX2160ARDB (DT)
[ 1389.726139] pstate: 40000005 (nZcv daif -PAN -UAO BTYPE=--)
[ 1389.731698] pc : switchdev_port_obj_add_now+0xcc/0x110
[ 1389.736824] lr : switchdev_port_obj_add_now+0xcc/0x110

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
drivers/staging/fsl-dpaa2/ethsw/ethsw.c