forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'check-vlan-filter-feature-in-vlan_vids_add_by_dev-and-v…
…lan_vids_del_by_dev' Liu Jian says: ==================== check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() v2->v3: Filter using vlan_hw_filter_capable(). Add one basic test. ==================== Link: https://lore.kernel.org/r/20231216075219.2379123-1-liujian56@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
readonly NETNS="ns-$(mktemp -u XXXXXX)" | ||
|
||
ret=0 | ||
|
||
cleanup() { | ||
ip netns del $NETNS | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
fail() { | ||
echo "ERROR: ${1:-unexpected return code} (ret: $_)" >&2 | ||
ret=1 | ||
} | ||
|
||
ip netns add ${NETNS} | ||
ip netns exec ${NETNS} ip link add bond0 type bond mode 0 | ||
ip netns exec ${NETNS} ip link add bond_slave_1 type veth peer veth2 | ||
ip netns exec ${NETNS} ip link set bond_slave_1 master bond0 | ||
ip netns exec ${NETNS} ethtool -K bond0 rx-vlan-filter off | ||
ip netns exec ${NETNS} ip link add link bond_slave_1 name bond_slave_1.0 type vlan id 0 | ||
ip netns exec ${NETNS} ip link add link bond0 name bond0.0 type vlan id 0 | ||
ip netns exec ${NETNS} ip link set bond_slave_1 nomaster | ||
ip netns exec ${NETNS} ip link del veth2 || fail "Please check vlan HW filter function" | ||
|
||
exit $ret |