linux/drivers
Aaron Young 67d0719f06 ldmvsw: Make sunvnet_common compatible with ldmvsw
Modify sunvnet common code and data structures to be compatible
  with both sunvnet and ldmvsw drivers.

  Details:

  Sunvnet operates on "vnet-port" nodes which appear in the Machine
  Description (MD) in a guest domain. Ldmvsw operates on "vsw-port"
  nodes which appear in the MD of a service domain.

  A difference between the sunvnet driver and the ldmvsw driver is
  the sunvnet driver creates a network interface (i.e. a struct net_device)
  for every vnet-port *parent* "network" node. Several vnet-ports may appear
  under this common parent network node - each corresponding to a common parent
  network interface.  Conversely, since bridge/vswitch software will need
  to interface with every vsw-port in a system, the ldmvsw driver creates
  a network interface (i.e. a struct net_device) for every vsw-port - not
  every parent node as with sunvnet.  This difference required some special
  handling in the common code as explained below.

  There are 2 key data structures used by the sunvnet and ldmvsw drivers
  (which are now found in sunvnet_common.h):

  1. struct vnet_port
     This structure represents a vnet-port node in sunvnet and a vsw-port
     in the ldmvsw driver.

  2. struct vnet
     This structure represents a parent "network" node in sunvnet and a parent
     "virtual-network-switch" node in ldmvsw.

  Since the sunvnet driver allocates a net_device for every parent "network"
  node, a net_device member appears in the struct vnet. Since the ldmvsw
  driver allocates a net_device for every port, a net_device member was
  added to the vnet_port. The common code distinguishes which structure
  net_device member to use by checking a 'vsw' bit that was added to the
  vnet_port structure. See the VNET_PORT_TO_NET_DEVICE() marco in
  sunvnet_common.h.

  The netdev_priv() in sunvnet is allocated as a vnet. The netdev_priv()
  in ldmvsw is a vnet_port. Therefore, any place in the common code
  where a netdev_priv() call was made, a wrapper function was implemented
  in each driver to first get the vnet and/or vnet_port (in a driver
  specific way) and pass them as newly added parameters to the common
  functions (see wrapper funcs: vnet_set_rx_mode() and vnet_poll_controller()).
  Since these wrapper functions call __tx_port_find(), __tx_port_find() was
  moved from the common code back into sunvnet.c. Note - ldmvsw.c does not
  require this function.

  These changes also required that port_is_up() be made
  into a common function and thus it was given a _common suffix and
  exported like the other common functions.

  A wrapper function was also added for vnet_start_xmit_common() to pass a
  driver-specific function arg to return the port associated with a given
  struct sk_buff and struct net_device. This was required because
  vnet_start_xmit_common() grabs a lock prior to getting the associated
  port. Using a function pointer arg allowed the code to work unchanged
  without risking changes to the non-trivial locking logic in
  vnet_start_xmit_common().

  Signed-off-by: Aaron Young <aaron.young@oracle.com>
  Signed-off-by: Rashmi Narasimhan <rashmi.narasimhan@oracle.com>
  Reviewed-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
  Reviewed-by: Alexandre Chartre <Alexandre.Chartre@oracle.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-18 19:33:00 -04:00
..
accessibility
acpi nfit: Continue init even if ARS commands are unimplemented 2016-03-04 16:46:13 -08:00
amba
android drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE 2016-02-20 15:43:56 -08:00
ata ata: ahci: don't mark HotPlugCapable Ports as external/removable 2016-02-29 16:17:57 -05:00
atm
auxdisplay
base
bcma bcma: move flash detection code to ChipCommon core driver 2016-03-07 14:41:08 +02:00
block
bluetooth Bluetooth: btmrvl_sdio: fix firmware activation failure 2016-03-10 19:51:29 +01:00
bus bus: mvebu-mbus: provide api for obtaining IO and DRAM window information 2016-03-14 12:19:46 -04:00
cdrom
char drivers: char: random: add get_random_long() 2016-02-27 10:28:52 -08:00
clk clk: rockchip: associate SCLK_MAC_PLL and disable reparenting on rk3036 2016-03-16 19:28:02 -04:00
clocksource
connector
cpufreq cpufreq: mediatek: allow building as a module 2016-03-01 02:43:05 +01:00
cpuidle
crypto
dca
devfreq PM / devfreq: tegra: Set freq in rate callback 2016-02-23 14:27:42 +09:00
dio
dma dmaengine: pxa_dma: fix cyclic transfers 2016-03-03 21:06:45 +05:30
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga
gpio gpio: rcar: Add Runtime PM handling for interrupts 2016-02-25 15:46:27 +01:00
gpu Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
hid
hsi
hv
hwmon hwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook 2016-02-19 17:14:25 -08:00
hwspinlock
hwtracing
i2c i2c: brcmstb: allocate correct amount of memory for regmap 2016-03-01 19:16:45 +01:00
ide
idle
iio
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
input
iommu iommu/vt-d: Use BUS_NOTIFY_REMOVED_DEVICE in hotplug path 2016-02-29 23:55:16 +01:00
ipack
irqchip irqchip/gicv3-its: Avoid cache flush beyond ITS_BASERn memory size 2016-02-17 17:39:05 +00:00
isdn mISDN: Support DR6 indication in mISDNipac driver 2016-03-14 15:51:29 -04:00
leds
lguest
lightnvm
macintosh
mailbox
mcb
md dm: fix dm_rq_target_io leak on faults with .request_fn DM w/ blk-mq paths 2016-02-21 20:27:50 -05:00
media
memory
memstick
message
mfd
misc misc: sram: add optional ioremap without write combining 2016-03-14 12:19:45 -04:00
mmc
mtd ubi: Fix out of bounds write in volume update code 2016-03-05 21:56:23 +01:00
net ldmvsw: Make sunvnet_common compatible with ldmvsw 2016-03-18 19:33:00 -04:00
nfc NFC: microread: Drop platform data header file 2016-03-09 23:25:45 +01:00
ntb
nubus
nvdimm nvdimm: use 'u64' for pfn flags 2016-02-23 17:17:20 -08:00
nvme nvme: fix max_segments integer truncation 2016-03-03 14:43:10 -07:00
nvmem
of of_mdio: use PTR_ERR_OR_ZERO() 2016-03-14 15:31:58 -04:00
oprofile
parisc
parport
pci PCI updates for v4.5: 2016-03-03 12:54:39 -08:00
pcmcia
perf
phy
pinctrl
platform
pnp
power power: bq27xxx_battery: Restore device name 2016-02-21 20:49:34 +01:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 s390/dasd: fix performance drop 2016-02-17 09:24:07 +01:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
sfi
sh drivers: sh: Restore legacy clock domain on SuperH platforms 2016-02-25 09:05:19 +09:00
sn
soc
spi
spmi
ssb ssb: host_soc depends on sprom 2016-02-26 12:47:32 +02:00
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
target
tc
thermal
thunderbolt
tty
uio
usb USB-serial fixes for v4.5-rc7 2016-03-03 12:37:21 -08:00
uwb
vfio vfio: fix ioctl error handling 2016-02-28 07:38:52 -07:00
vhost vhost: fix error path in vhost_init_used() 2016-03-02 17:01:49 +02:00
video fbcon: set a default value to blink interval 2016-02-26 13:19:55 +02:00
virt
virtio virtio-pci: read the right virtio_pci_notify_cap field 2016-03-02 17:01:49 +02:00
vlynq
vme
w1
watchdog Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2016-03-01 08:57:34 -08:00
xen Xen bug fixes for 4.5-rc5 2016-02-22 13:57:01 -08:00
zorro
Kconfig
Makefile