port attribute.
Using port PHYS name (ndo_get_phys_port_name) for the key is particularly
-useful for dynically-named ports where the device names it's ports based on
+useful for dynamically-named ports where the device names its ports based on
external configuration. For example, if a physical 40G port is split logically
into 4 10G ports, resulting in 4 port netdevs, the device can give a unique
name for each port using port PHYS name. The udev rule would be:
If the switchdev driver (and device) only supports offloading of the default
network namespace (netns), the driver should set this feature flag to prevent
the port netdev from being moved out of the default netns. A netns-aware
-driver/device would not set this flag and be resposible for partitioning
+driver/device would not set this flag and be responsible for partitioning
hardware to preserve netns containment. This means hardware cannot forward
traffic from a port in one namespace to another port in another namespace.
bridge fdb add ADDR dev DEV [vlan VID] [self]
+XXX: what should be done if offloading this rule to hardware fails (for
+example, due to full capacity in hardware tables) ?
+
Note: by default, the bridge does not filter on VLAN and only bridges untagged
traffic. To enable VLAN support, turn on VLAN filtering:
case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = &obj->ipv4_fib;
err = rocker_port_fib_ipv4(rocker_port, obj->trans,
- fib4->dst, fib4->dst_len,
+ htonl(fib4->dst), fib4->dst_len,
fib4->fi, fib4->tb_id, 0);
break;
default:
case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = &obj->ipv4_fib;
err = rocker_port_fib_ipv4(rocker_port, SWITCHDEV_TRANS_NONE,
- fib4->dst, fib4->dst_len, fib4->fi,
- fib4->tb_id, ROCKER_OP_FLAG_REMOVE);
+ htonl(fib4->dst), fib4->dst_len,
+ fib4->fi, fib4->tb_id,
+ ROCKER_OP_FLAG_REMOVE);
break;
default:
err = -EOPNOTSUPP;
enum switchdev_obj_id id;
enum switchdev_trans trans;
union {
- struct switchdev_obj_vlan { /* PORT_VLAN */
+ struct switchdev_obj_vlan { /* PORT_VLAN */
u16 flags;
u16 vid_start;
u16 vid_end;
}
EXPORT_SYMBOL_GPL(switchdev_port_attr_set);
-int __switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
+static int __switchdev_port_obj_add(struct net_device *dev,
+ struct switchdev_obj *obj)
{
const struct switchdev_ops *ops = dev->switchdev_ops;
struct net_device *lower_dev;
struct switchdev_obj fib_obj = {
.id = SWITCHDEV_OBJ_IPV4_FIB,
.ipv4_fib = {
- .dst = htonl(dst),
+ .dst = dst,
.dst_len = dst_len,
.fi = fi,
.tos = tos,
struct switchdev_obj fib_obj = {
.id = SWITCHDEV_OBJ_IPV4_FIB,
.ipv4_fib = {
- .dst = htonl(dst),
+ .dst = dst,
.dst_len = dst_len,
.fi = fi,
.tos = tos,