Skip to content

extend set/get netlink for embedded

John Fastabend netdev 2 versions In review

Get series with b4
b4 am 20121024181033.14378.33097.stgit@jf-dev1-dcblab

Versions newest first · linked by author and title

  1. v2 Latest3 patches 9 repliesIn review
  2. v13 patches 4 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: create generic bridge opsinclude/linux/netdevice.h net/bridge/br_device.c net/bridge/br_netlink.c +2 more+108 -602 replies
2/3net: set and query VEB/VEPA bridge mode via PF_BRIDGEinclude/uapi/linux/if_bridge.h net/bridge/br_netlink.c net/bridge/br_private.h +1 more+102 -74 replies
3/3ixgbe: add setlink, getlink support to ixgbe and ixgbevfdrivers/net/ethernet/intel/ixgbe/ixgbe_main.c drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +2 more+122 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [net-next PATCH v2 0/3] extend set/get netlink for embedded

This extends the PF_BRIDGE setlink and getlink so that they can be used generically outside of the Linux bridge module. Doing this allows embedded devices to use the same netlink interface that the software bridge is currently using.

In this patchset I opted to create two new ndo ops ndo_bridge_setlink and ndo_bridge_getlink. These ops pass the nlmsghdr to the device for handling. The netlink message is extended to support nested IFLA_AF_SPEC attributes. A IFLA_BRIDGE_FLAGS attribute is used to determine the target of the message either a master netdev is the target or the target is "self" indicating the target is the netdev. In this way we can send netlink msg to an embedded device or the linux sw bridge or both. If the set completes sucessfully the flag is cleared in this way we can learn what failed in the both case. This scheme is similar to how FDB updates are handled. If no flag attribute is present the message is sent to the master device to support the existing messages.

An initial IFLA_BRIDGE_MODE attribute is added to indicate if the bridge is in a VEPA mode or VEB mode. This is most useful for SR-IOV device and can be used to indicate support for VF to VF or VF to PF traffic. Without this we have no way of knowing this other then trial and error because not all hardware supports this.

In the future additional attributes can be added to handle other attributes. We could for example move some of the linux bridge sysfs attributes here if we want a netlink interface for them. This should also allow DSA switches to use the bridging tools. See RFC patch from Lennert

http://patchwork.ozlabs.org/patch/16578/

I could have simply added the VEPA attribute handling to the rtnl_setlink() routine but it seemed like a good feature to have all the bridging events and configuration on the same type. Also this should allow more powerful offloaded switches like the hardware supported via DSA access to the bridge control interface.

Also I think this interface should allow Vlad to add his port based VLAN interface here as well.

Any feedback/criticism appreciated thanks!

---

John Fastabend (3):
ixgbe: add setlink, getlink support to ixgbe and ixgbevf
net: set and query VEB/VEPA bridge mode via PF_BRIDGE
net: create generic bridge ops

 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     |   59 ++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c    |    3 
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   10 +
 include/linux/netdevice.h                         |   10 +
 include/linux/rtnetlink.h                         |    3 
 include/uapi/linux/if_bridge.h                    |   18 ++
 net/bridge/br_device.c                            |    2 
 net/bridge/br_netlink.c                           |   75 +-------
 net/bridge/br_private.h                           |    7 +
 net/core/rtnetlink.c                              |  207 +++++++++++++++++++++
 10 files changed, 328 insertions(+), 66 deletions(-)
Signature · 1 line
Signature