be2net: convert dest field in udp-hdr to host-endian
The "dest" field in the UDP-hdr of a TX skb is in network endian format.
Convert it to host endian before accessing it. The os2bmc patch,
mentioned below introduced this code.
Fixes: 760c295e0e8d ("be2net: Support for OS2BMC") Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
be2net: fix wrong return value in be_check_ufi_compatibility()
In the commit a6e6ff6eee12f3e
("be2net: simplify UFI compatibility checking"), a return value of "-1"
was incorrectly used in place of "false". This patch fixes it.
Fixes: a6e6ff6eee12f3e ("be2net: simplify UFI compatibility checking") Signed-off-by: Vasundhara Volam <vasundhara.volam@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
pci_enable_device() call sets device power state to D0; there is no need
doing it again.
Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
The current code assumes that bridge functionality (EVB) in the adapter
is enabled only when SR-IOV is enabled. This is not always true.
This patch uses the GET_HSW_CONFIG FW cmd to query this from the FW.
Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This change will make be_setup_wol() routine more compact and readable
by removing some duplicate code.
Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Arnd Bergmann [Mon, 18 May 2015 21:06:45 +0000 (23:06 +0200)]
be2net: make hwmon interface optional
The hwmon interface in the be2net driver causes a link error when
be2net is built-in while the hwmon subsystem is a loadable module:
drivers/built-in.o: In function `be_probe':
drivers/net/ethernet/emulex/benet/be_main.c:5761: undefined reference to `devm_hwmon_device_register_with_groups'
This adds a new Kconfig symbol, following the example of multiple
other drivers that have the same problem. The new CONFIG_BE2NET_HWMON
will not be available when (BE2NET=y && HWMON=m) to avoid this
problem.
We have to also mark be_hwmon_show_temp as 'static' to ensure the
compiler can optimize out all the unused code.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 29e9122b3a ("be2net: Export board temperature using hwmon-sysfs interface.") Signed-off-by: David S. Miller <davem@davemloft.net>
Venkata Duvvuru [Wed, 13 May 2015 07:30:14 +0000 (13:00 +0530)]
be2net: Support for OS2BMC.
OS2BMC feature will allow the server to communicate with the on-board
BMC/idrac (Baseboard Management Controller) over the LOM via
standard Ethernet.
When OS2BMC feature is enabled, the LOM will filter traffic coming
from the host. If the destination MAC address matches the iDRAC MAC
address, it will forward the packet to the NC-SI side band interface
for iDRAC processing. Otherwise, it would send it out on the wire to
the external network. Broadcast and multicast packets are sent on the
side-band NC-SI channel and on the wire as well. Some of the packet
filters are not supported in the NIC and hence driver will identify
such packets and will hint the NIC to send those packets to the BMC.
This is done by duplicating packets on the management ring. Packets
are sent to the management ring, by setting mgmt bit in the wrb header.
The NIC will forward the packets on the management ring to the BMC
through the side-band NC-SI channel.
Please refer to this online document for more details,
http://www.dell.com/downloads/global/products/pedge/
os_to_bmc_passthrough_a_new_chapter_in_system_management.pdf
Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Venkata Duvvuru [Wed, 13 May 2015 07:30:13 +0000 (13:00 +0530)]
be2net: Report a "link down" to the stack when a fatal error or fw reset happens.
When an error (related to HW or FW) is detected on a function, the driver
must pro-actively report a "link down" to the stack so that a possible
failover can be initiated. This is being done currently only for some
HW errors. This patch reports a "link down" even for fatal FW errors and
EEH errors.
Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Venkata Duvvuru [Wed, 13 May 2015 07:30:12 +0000 (13:00 +0530)]
be2net: Export board temperature using hwmon-sysfs interface.
Ethtool statistics is not the right place to display board temperature.
This patch adds support to export die temperature of devices supported
by be2net driver via the sysfs hwmon interface.
Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Wed, 6 May 2015 09:30:39 +0000 (05:30 -0400)]
be2net: update copyright year to 2015
Signed-off-by: Vasundhara Volam <vasundhara.volam@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Wed, 6 May 2015 09:30:37 +0000 (05:30 -0400)]
be2net: simplify UFI compatibility checking
The code in be_check_ufi_compatibility() checks to see if a UFI file meant
for a lower rev of a chip is being flashed on a higher rev, which is
disallowed. This patch re-writes the code needed for this check in a much
simpler manner.
Signed-off-by: Vasundhara Volam <vasundhara.volam@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Suresh Reddy [Wed, 6 May 2015 09:30:36 +0000 (05:30 -0400)]
be2net: post full RXQ on interface enable
When an RXQ is created in be_open(), the driver currently posts only
64 buffers. This sometimes results in packet drops when there is a traffic
burst as soon as the interface is enabled.
This patch fixes this problem by posting the full RXQ on interface enable.
Signed-off-by: Suresh Reddy <Suresh.Reddy@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Wed, 6 May 2015 09:30:35 +0000 (05:30 -0400)]
be2net: check for INSUFFICIENT_VLANS error
When the FW runs out of vlan filters it can either return an
INSUFFICIENT_RESOURCES error or an INSUFFICIENT_VLANS error.
The driver currently checks only for the former error value.
This patch adds a check for the latter value too.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Somnath Kotur [Wed, 6 May 2015 09:30:34 +0000 (05:30 -0400)]
be2net: receive pkts with L3, L4 errors on VFs
Currently pkts with L3 or L4 errors received on PFs are not dropped
by the adapter, but instead sent to the stack. This helps the network stack
to better reflect error statistics. This was not being done on BE3 VFs.
This patch fixes this for BE3 VFs.
Signed-off-by: Somnath Kotur <somnath.kotur@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Padmanabh Ratnakar [Wed, 6 May 2015 09:30:33 +0000 (05:30 -0400)]
be2net: set interrupt moderation for Skyhawk-R using EQ-DB
Currently adaptive interrupt moderation is set by calculating
and configuring an EQ-delay every second. This is done via
a FW-cmd. But, on Skyhawk-R a "re-arm to interrupt" delay
can be set while ringing the EQ-DB. This patch uses this
facility to calculate and set the interrupt delay every 1ms.
This helps moderating interrupts better when the traffic
is bursty.
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Wed, 6 May 2015 09:30:32 +0000 (05:30 -0400)]
be2net: add support for spoofchk setting
This patch adds support for spoofchk configuration for VFs.
When it is enabled, "spoof checking" is done for both MAC-address and VLAN.
For each VF, the HW ensures that the source MAC address (or vlan) of
every outgoing packet exists in the MAC-list (or vlan-list) configured
for RX filtering for that VF. If not, the packet is dropped and an error
is reported to the driver in the TX completion; this is reflected in the
"tx_spoof_check_err" ethtool counter.
This feature is supported in Skyhawk FW version 10.6.31.0 and above.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Santosh Shilimkar [Wed, 14 Oct 2015 15:52:49 +0000 (08:52 -0700)]
Merge branch 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek:
RDS: make send_batch_count tunable effective
RDS: make use of kfree_rcu() and avoid the call_rcu() chain
RDS: verify the underlying transport exists before creating a connection
RDS/IB: print string constants in more places
ib/rds: runtime debuggability enhancement
Santosh Shilimkar [Wed, 14 Oct 2015 15:52:38 +0000 (08:52 -0700)]
Merge branch 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek: (50 commits)
mpt2sas: setpci reset kernel oops fix
ixgbe: Advance version to 4.2.1
ixgbe: X540 thermal warning interrupt not a GPI
ixgbe: Fix FCRTH value in VM-to-VM loopback mode
ixgbe: Only clear adapter_stopped if ixgbe_setup_fc succeeded
ixgbe: Correct several flaws with with DCA setup
ixgbe: Add new X550EM SFP+ device ID
ixgbe: Update ixgbe_disable_pcie_master flow for X550*
ixgbe: Add small packet padding support for X550
ixgbe: Correct setting of RDRXCTL register for X550* devices
ixgbe: Correct error path in semaphore handling
ixgbe: Add I2C bus mux support
ixgbe: Limit SFP polling rate
ixgbe: Allow SFP+ on more than 82598 and 82599
ixgbe: Add logic to reset CS4227 when needed
ixgbe: Fix 1G and 10G link stability for X550EM_x SFP+
ixgbe: Add X550EM_x dual-speed SFP+ support
ixgbe: Allow reduced delays during SFP detection
ixgbe: Clear I2C destination location
ixgbe: Enable bit-banging mode on X550
...
Santosh Shilimkar [Tue, 13 Oct 2015 17:10:40 +0000 (10:10 -0700)]
Merge branch 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek-ofed into topic/uek-4.1/ofed
* 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek-ofed:
RDS/IB: print string constants in more places
ib/rds: runtime debuggability enhancement
Santosh Shilimkar [Thu, 8 Oct 2015 22:59:14 +0000 (15:59 -0700)]
RDS: make send_batch_count tunable effective
The send_batch_count tunable is stale and code relies on
hard-coded batch count value. Its a nice feature and lets you
tune the system based on different HCAs. TCP transport as well
have different characteristics and tunable can be useful.
There is no change in default behavior with this patch.
Santosh Shilimkar [Thu, 8 Oct 2015 23:26:32 +0000 (16:26 -0700)]
RDS: make use of kfree_rcu() and avoid the call_rcu() chain
call_rcu() chains are expensive and its use in rds_ib_remove_ipaddr()
is just to kfree() the rds_ib_ipaddr. Chains make use of high-latency
rcu_barrier() in modules which can be avoided.
Makes use of kfree_rcu() which is exactly meant for such use
This patch provides the ability to dynamically turn on or off various
types of debug/diag prints inside the RDS module.
The run-time debug prints are controlled by a rds module parameter,
rds_rt_debug_bitmap.
Here is the definition for different bits. We have implemented feature
related bits, such as Connection Management, Active Bonding, Error prints,
Send, Recv.
in net/rds/rds_rt_debug.h
...
enum {
/* bit 0 ~ 19 are feature related bits */
RDS_RTD_ERR = 1 << 0, /* 0x1 */
RDS_RTD_ERR_EXT = 1 << 1, /* 0x2 */
In general, *EXTRA bits mean that you will get extra information but
possible flood prints as well. But every bit can be controlled by users
so users can decide how much information they want to see/collect. The
current embedded printk level used for this patch is KERN_INFO. Most
likely all the msgs will only go to /var/log/messages without showing up
on console if we use the default settings for /proc/sys/kernel/printk and
/etc/rsyslog.conf in ol6 environment.
E.g if we want to turn on RDS_RTD_ERR and RDS_RTD_CM bits. What we can
do is
In mpt2sas driver due to lack of synchronization between ioctl,
BRM status access through sysfs, pci resource removal kernel oops
happen as ioctl path and BRM status sysfs access path still tries
to access the removed resources
Two locks added to provide syncrhonization
1. pci_access_mutex: Mutex to synchronize ioctl,sysfs show path and
pci resource handling. PCI resource freeing will lead to free
vital hardware/memory resource, which might be in use by cli/sysfs
path functions resulting in Null pointer reference followed by kernel
crash. To avoid the above race condition we use mutex syncrhonization
which ensures the syncrhonization between cli/sysfs_show path
Note: pci_access_mutex is used only if nytro warpdrive cards
(ioc->is_warpdrive based on device id) are used
as we could not test this case with other SAS2 HBA cards
We can remove this check if this behaviour confirmed from other
cards.
2. spinlock on list operations over IOCs
Case: when multiple warpdrive cards(IOCs) are in use
Each IOC will added to the ioc list stucture on initialization.
Watchdog threads run at regular intervals to check IOC for any
fault conditions which will trigger the dead_ioc thread to
deallocate pci resource, resulting deleting the IOC netry from list,
this deletion need to protected by spinlock to enusre that
ioc removal is syncrhonized, if not synchronized it might lead to
list_del corruption as the ioc list is traversed in cli path
Signed-off-by: Nagarajkumar Narayanan <nagarajkumar.narayanan@seagate.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 6229b414b3adb3aac0b54e67d72d6462fc230c0d)
With the addition of X550em_x SFP+ support, the driver is now
functionally equivalent to what will be the 4.2.1 driver when
released, so change the version to match.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 21dd560162d4bbf98cc81b303bfa19740ae5b964) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The X540 thermal interrupt (IXGBE_EIMS_TS) is not an SDP, so it
doesn't need to be enabled in ixgbe_setup_gpie(). In fact the
value is simply not for the GPIE register at all.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c5846ba44500293d290eb2a31bd344565f237ad3) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The 82599 and X540 datasheets require that FCRTH be "set" for Tx
switching (VM-to-VM loopback) but it did not previously specify what
the value should be set to. It has now been determined that
the correct value is RXPBSIZE - (24*1024).
This setting is also required for later devices.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bc1fc64fd2d9093496e5b04c6d94d26bfa629c9c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
A logic error here results in the adapter_stopped flag only being
cleared when ixgbe_setup_fc returns an error. Correct the logic.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3507a9b8c9d1684b5095c97f587ee46184e590da) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This change does two things. First, it makes it so that we always
set the relaxed ordering bits related to the DCA registers even if
DCA is not enabled. Second, it moves the configuration out of the
ixgbe_down function and into the ixgbe_configure function before
enabling the Rx and Tx rings. This ensures that DCA is configured
correctly before starting to process packets.
Thanks to Alex Duyck for this fix.
CC: Alex Duyck <aduyck@mirantis.com> Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 9de7605ea2389d5ab86d6fbb3f1a11b87665a35c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 018d7146eee1942f27675bdabf9b43586bfaef72) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch skips the PCI transactions pending check in
ixgbe_disable_pcie_master. This is done to addresses a known HW
issue where the PCI transactions pending bit sticks high when there
are pending transactions. HW engineering instructed to workaround
this issue by wait and then continue with our reset flow.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7fc151035487916b266257c2e7b8b6cb2a5cd04f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch sets RDRXCTL.PSP when the driver is in SRIOV mode which
enables padding of small packets.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f961ddae164a5288a62146aae191da7bc1ecedb4) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Setting the X550* RDRXCTL register should fall through into X540
and 82599, not 82598.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 052a1a724338bbf4721f8b4d7de8486701fc37cb) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The timeout path is supposed to release the semaphore, so do that.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5967fe225686bcae17352de172573964a15b17d5) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Take control of an I2C mux that selects which SFP is attached to
the I2C bus. The control of the mux is captured in the taking and
releasing of the related semaphore. Because only port 1 can control
the mux, port 1 always leaves the mux set to select port 0.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 449e21a92411ba35bfa68b4464aa7dbd1f705d28) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reduce the frequency of polling for SFP modules. Because the
service task sometimes runs at high rates, we can poll for
SFPs too often. When an SFP is not present, the I2C timeouts
that result are very costly. So, prevent SFP polling from
being done more than once every two seconds. To reduce latency,
the poll time is cleared in a couple of cases to permit the
next service task execution to poll the SFP module.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 58e7cd24d474c87763387f606e403012f562760b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Since SFP+ can be used with some X550 devices, permit them to be
detected.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 69eec0c2fa8781a6abae96af1f11069e1965cbfe) Signed-off-by: Brian Maly <brian.maly@oracle.com>
On some hardware platforms, the CS4227 does not initialize properly.
Detect those cases and reset it appropriately.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 542b6eecf4c3640f15a84ff89525131d421e7c8c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Configures the CS4227 correctly for both 1G and 10G operation,
by moving the code to ixgbe_setup_mac_link_sfp_x550em(). It
needs to be in this function because we need both the module
type and the speed, and this is the only function in the init
flow that knows the speed. In contrast,
ixgbe_setup_sfp_modules_X550em() does not know the speed, so we
can't do anything useful here. This is a fundamental difference
from the previous flow, and is due to the way the CS4227 is
implemented.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit e23f33367882450c66f7de8805b98ce7665a7ba9) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch adds X550EM_x SFP+ dual-speed support. 82599 fiber link
code was moved from ixgbe_82599.c to ixgbe_common.c for use by
X550EM. SFP MAC link code is added to x550EM.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6d373a1bbb99bdfb9ce820aec9ae5f2e02c8891f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reduce the number of retries during PHY detection. This reduces
pauses when no SFP is present. Once an SFP is detected, the normal
retry count will be used.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 56f6ed1ce13b0cb85ae9537f839df7c4ba1f5369) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Clear the destination location for I2C data initially so that
the received data will not be affected by previous attempts.
This could have returned wrong data in certain retry sequences.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6ee8c9a70d65ee37251465348501a067138050d7) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Set the bit banging mode in the hardware when performing bit banging
I2C operations on X550. Also control the output enable on both the
clock and data lines.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 25b1029789f98f945a03a2d04662a94b357aacb9) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The lan_id is being set after a previous I2C eeprom access which
makes no sense because it needs to be set before any access. Move
the setting to before the access.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit da4ea4baf77c9e45c53671e465043ffaf26fd45d) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Most I2C accesses take and release semaphores for each access. Now
there is a reason to perform multiple I2C operations under the same
holding of the semaphore, so provide unlocked I2C methods for that
purpose.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bb5ce9a5cb6e915a2b284a8785686716823679d1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Provide I2C combined operations on X550EM, not X550 devices.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4f9e3a3de0e2fbc49c036322cb2ee656ea8b93fc) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Add support for the SFP insertion interrupt on X550EM devices with
SFPs.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit cbd45ec7aae9a20835d1a64c7a1910eb5dcec57b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When an SFP not present error is returned by the reset_hw method,
accept it and go on, since an SFP can still be inserted. Previously
it was only accepted for 82598 devices.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 29a8dca1997f880563e53e9ba0fcb50b03bd23af) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Setting ndo_features_check to passthru_features_check allows the driver
to skip the check for multiple tagged TSO packets and enables stacked
VLAN TSO.
Tested with 82599ES.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0f90300f4fd30968a4d40fe47a9043be9912cb31) Signed-off-by: Brian Maly <brian.maly@oracle.com>
X550 has HW support for SCTP flow director filters SCTP mask. This
patch adds it like we do for UDP and TCP.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5532408b48834bd762ed53c22aabed5dae0748d6) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch is part of the future enablement of X550 SFP+ support. This
HW uses different SDP so the interrupts need to be set up accordingly.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a023bbd0b1a3716397d8d54ba5b95e09b8e27699) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch updates the lowest limit for adaptive interrupt interrupt
moderation to roughly 12K interrupts per second.
The way I came about reaching 12K as the desired interrupt rate is by
testing with UDP flows. Specifically I had a simple test that ran a
netperf UDP_STREAM test at varying sizes. What I found was as the packet
sizes increased the performance fell steadily behind until we were only
able to receive at ~4Gb/s with a message size of 65507. A bit of digging
found that we were dropping packets for the socket in the network stack,
and looking at things further what I found was I could solve it by increasing
the interrupt rate, or increasing the rmem_default/rmem_max. What I found was
that when the interrupt coalescing resulted in more data being processed
per interrupt than could be stored in the socket buffer we started losing
packets and the performance dropped. So I reached 12K based on the
following math.
rmem_default = 212992
skb->truesize = 2994
212992 / 2994 = 71.14 packets to fill the buffer
packet rate at 1514 packet size is 812744pps
71.14 / 812744 = 87.9us to fill socket buffer
From there it was just a matter of choosing the interrupt rate and
providing a bit of wiggle room which is why I decided to go with 12K
interrupts per second as that uses a value of 84us.
The data below is based on VM to VM over a direct assigned ixgbe interface.
The test run was:
netperf -H <ip> -t UDP_STREAM"
Socket Message Elapsed Messages CPU Service
Size Size Time Okay Errors Throughput Util Demand
bytes bytes secs # # 10^6bits/sec % SS us/KB
Before:
212992 65507 60.00 1100662 0 9613.4 10.89 0.557
212992 60.00 473474 4135.4 11.27 0.576
Using bare metal the data is similar but not as dramatic as the throughput
increases from about 8.5Gb/s to 9.5Gb/s.
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8ac34f10a5ea4c7b6f57dfd52b0693a2b67d9ac4) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When the .remove() callback for a PF is called, SR-IOV support for the
device is disabled, which requires unbinding and removing the VFs.
The VFs may be in-use either by the host kernel or userspace, such as
assigned to a VM through vfio-pci. In this latter case, the VFs may
be removed either by shutting down the VM or hot-unplugging the
devices from the VM. Unfortunately in the case of a Windows 2012 R2
guest, hot-unplug is broken due to the ordering of the PF driver
teardown. Disabling SR-IOV prior to unregister_netdev() avoids this
issue.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6b010e9b1f0a406d1d35202a694fa724a559bf77) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Add checks for systems that don't have SFP's to avoid incorrectly
acting on interrupts that are falsely interpreted as SFP events.
This also includes a modified check generating the EICR mask to be
more forward-looking.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4ccc650cc845476885f73660b2e6335852f0f75c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Resolve warnings resulting from redundant initialization of the
get_bus_info field in the mac_ops_X550* structures.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 990a2d6ed543bd18b864b8a11f7be3368c67ccea) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When unbinding an SR-IOV device with VFs configured from ixgbe, the
driver behaves in one of two ways. If max_vfs was specified, the
SR-IOV state is disabled, removing the VFs. The occurs regardless of
whether the VF count was later modified through sysfs. If however
max_vfs is zero, such as by not specifying the module parameter, the
VFs persist after the PF is unbound from ixgbe. If the PF is then
bound to vfio-pci to be assigned to a VM, the PF is non-functional.
>From the comment, commit da36b64736cf ("ixgbe: Implement PCI SR-IOV
sysfs callback operation") clearly intended this alternate behavior,
but probably didn't realize the PF doesn't work in this mode.
This bimodal behavior is confusing to users and results in a state
where the PF is broken for other uses unless the user sets
sriov_numvfs to zero prior to unbinding the device. Remove this
behavior so that VFs are removed and the PF is functional for other
uses after unbind, regardless of the way VFs are enabled.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7837e2867f56ec4435e75af54236732885303694) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Now that we can do 2.5G link speed, we need to be able to report it.
Also change the nested triadic involved in creating the log message
to instead use a simpler switch statement to set a string pointer.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 454adb008d78e4ecdfec3f2e5e9eb08ee5a60f1a) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch resolves an issue where users were not able to dynamically
set number of queues for 82598 via ethtool -L
Reported-by: Tal Abudi <talabudi@gmail.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7e3f5c8881ba45eba1c74344b00558920008e6e6) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Allows to change the rxfh indirection table and/or key using
ethtool interface.
Signed-off-by: Tom Barbette <tom.barbette@ulg.ac.be> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1c7cf0784e4d448ed8a07c5fc1e3aac1528272f1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Avoid a needless PHY access on copper phys to save the 10ms wait
time for each PHY access. A helper function is introduced to
actually do the register access and process the contents.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ae8140aa6bf5c7aafc0d9c2f612c5b59bea1ce9f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
We already cache this FW/SW semaphore mask so might as well use it
for consistency.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 897b9349f056d1c1cf5141ded4ec26766d845f8b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch removes the redundant lan_id in the phy struct and uses
the bus version. Both variables exist and intend to represent the
STATUS register LAN_ID field. However, phy.lan_id is not bit shifted
so the phy.lan_id = 0x0 for LAN Id 0 and phy.lan_id = 0x4 for LAN Id 1.
Where bus.lan_id is bit shifted so bus.lan_id = 0x0 for LAN Id 0 and
bus.lan_id = 0x1 for LAN Id 1. There seems no need for the additional
lan_id variable and this should make the code less confusing.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d5702dea43fc517c389f2d9825213dabbfdaed5e) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The ixgbe never has as very doubtfully ever will support either
PCI or PCI-X devices. So remove the unused types from the
ixgbe_bus_type. Thanks to Alex Duyck for suggesting this.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fa888b891384ccbf18e70af2e02f5173e55e5e7f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
With this patch we add support for a new bus type ixgbe_bus_type_internal.
X550em devices use IOSF and not PCIe bus so this new type is to accommodate
them.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f9328bc6a7edc0fbaea836007b4261ca6233d96f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Added ixgbe_get_bus_info_X550em to X550 code. ixgbe_get_bus_info_X550em
sets bus.width to ixgbe_bus_width_unknown and bus.speed to
ixgbe_bus_speed_unknown, because IOSF does not report a PCIe bus
width or speed.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 454c65dd1a1e7fdaa5bbd3a34e14ab5560fbfad7) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When the device is closing or suspending, call ixgbe_enter_lplu to
enter low power link up state on devices that support it. When this
is done, prevent the phy from being reset in the ixgbe_down path
so that link is present when calling ixgbe_enter_lplu.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6ac7439459606a57265800e60b14d58365ab19eb) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Add support for VXLAN RX offloads for the X55x devices that support
them.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 67359c3c9fc8e9fbed991bbe0cfeda55c7e0a64c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
By using GSO for UDP-encapsulated packets, all ixgbe devices can
be directed to generate checksums for the inner headers because
the outer UDP checksum can be zero. So point the machinery at the
inner headers and have the hardware generate the checksum.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f467bc06022d4d37de459f9498ff4fbc7e9b0fca) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Wait up to about 100 us for FDIRCMD writes to complete and return
failure indications.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d490d15877b2e6fc2d800ea232a0eca54cf4592c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
There are various reasons why this method may or may not need to be
defined and some of these we don't know until runtime. So we will
set the value in get_invariants.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b5529ef5be1f0a0089988ec51541aa9573e94476) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch adds a support function that will indicate for the
existence of management FW.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bd8069ace513dd2741bc7177eeebc9a392451db1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The following commit added the capability of entering low power mode:
ixgbe: Add a PHY power state method
This works fine with newer drivers that support this capability,
however older drivers that dont support this encounter a regression
as they are not able to restore power mode at boot when the driver
loads. This regression is encountered when booting a newer kernel/driver
that supports low power mode, then doing a warm reboot to an older
kernel or other OS like FreeBSD that do not know how to restore the
power mode. In this case a cold reboot is required to restore power
mode.
Santosh Shilimkar [Thu, 8 Oct 2015 15:24:16 +0000 (08:24 -0700)]
Merge branch 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek:
uek-rpm: configs: sync up configs with v4.1.9
uek-rpm: build: Update the base release to 9 with stable v4.1.9
uek-rpm: configs: Rationalise CRYPTO config for OL6
Santosh Shilimkar [Thu, 8 Oct 2015 15:24:10 +0000 (08:24 -0700)]
Merge branch 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek: (419 commits)
uek-rpm: Enable config for OVN xsigo drivers
Add Oracle virtual Networking Drivers for uek4 kernel
ib_sdp/cma: readd SDP support to cma_save_net_info
ib/sdp: Enable usermode FMR
ib/sdp: fix null dereference of sk->sk_wq in sdp_rx_irq()
sdp: fix keepalive functionality
ib_sdp: fix deadlock when sdp_cma_handler is called while socket is being closed
ib_sdp: add unhandled events to rdma_cm_event_str
ib_sdp/uek-rpm: configs: enable compilation for sdp
ib_sdp: porting sdp from uek2 to uek-4.1
ib_sdp: remove APM code
sdp: Kconfig and Makefile changes
sdp: port the code to uek2
sdp: added debug print for the event: RDMA_CM_EVENT_ALT_PATH_LOADED
sdp: prepare support to kernel 2.6.39-200.1.1.el5uek: add macro to get sk_sleep
sdp: add support to kernel 2.6.39-200.1.1.el5uek
sdp: add [rt]x_bytes counters to sdpstats
sdp: Fix Bug 114242 - Multi connection net_perf causes server to hang
FMR: remove FMR failure messages
sdp: make sdp memory leak print a debug
...
Santosh Shilimkar [Thu, 8 Oct 2015 15:23:52 +0000 (08:23 -0700)]
Merge branch 'topic/uek-4.1/xen' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/xen' of git://ca-git.us.oracle.com/linux-uek:
xen-netfront: respect user provided max_queues
net/xen-netfront: only napi_synchronize() if running
net/xen-netfront: only clean up queues if present
xen-netback: respect user provided max_queues
xen-netback: require fewer guest Rx slots when not using GSO
xen-netback: add support for multicast control
xen/netback: Wake dealloc thread after completing zerocopy work
xen-netback: Allocate fraglist early to avoid complex rollback
net/xen-netback: off by one in BUG_ON() condition
xen-netback: remove duplicated function definition
net/xen-netback: Don't mix hexa and decimal with 0x in the printf format
net/xen-netback: Remove unused code in xenvif_rx_action
Santosh Shilimkar [Thu, 8 Oct 2015 15:23:24 +0000 (08:23 -0700)]
Merge branch 'topic/uek-4.1/stable-cherry-picks' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/stable-cherry-picks' of git://ca-git.us.oracle.com/linux-uek: (160 commits)
Linux 4.1.9
cxl: Don't remove AFUs/vPHBs in cxl_reset
ipv4: off-by-one in continuation handling in /proc/net/route
net: dsa: Do not override PHY interface if already configured
inet: fix races with reqsk timers
inet: fix possible request socket leak
netlink: make sure -EBUSY won't escape from netlink_insert
bna: fix interrupts storm caused by erroneous packets
bridge: netlink: account for the IFLA_BRPORT_PROXYARP_WIFI attribute size and policy
bridge: netlink: account for the IFLA_BRPORT_PROXYARP attribute size and policy
udp: fix dst races with multicast early demux
rds: fix an integer overflow test in rds_info_getsockopt()
rocker: free netdevice during netdevice removal
net: sched: fix refcount imbalance in actions
act_bpf: fix memory leaks when replacing bpf programs
packet: tpacket_snd(): fix signed/unsigned comparison
packet: missing dev_put() in packet_do_bind()
fib_trie: Drop unnecessary calls to leaf_pull_suffix
net/mlx4_core: Fix wrong index in propagating port change event to VFs
bridge: netlink: fix slave_changelink/br_setport race conditions
...
Santosh Shilimkar [Thu, 8 Oct 2015 15:21:54 +0000 (08:21 -0700)]
Merge branch 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek: (33 commits)
igb: bump version to igb-5.3.0
igb: use ARRAY_SIZE to replace calculating sizeof(a)/sizeof(a[0])
igb: report unsupported ethtool settings in set_coalesce
igb: Fix i354 88E1112 PHY on RCC boards using AutoMediaDetect
igb: Pull timestamp from fragment before adding it to skb
igb: only report generic filters in get_ts_info
igb: bump version of igb to 5.2.18
igb: disable IPv6 extension header processing
igb: Don't use NETDEV_FRAG_PAGE_MAX_SIZE in descriptor calculation
igb: simplify and clean up igb_enable_mas()
e1000e: Increase driver version number
e1000e: Fix tight loop implementation of systime read algorithm
e1000e: Fix incorrect ASPM locking
e1000e: Cosmetic changes
e1000e: Fix EEE in Sx implementation
e1000e: Cleanup qos request in error handling of e1000_open
e1000e: i219 - k1 workaround for LPT is not required for SPT
e1000e: i219 - Increase minimum FIFO read/write min gap
e1000e: i219 - increase IPG for speed 10/100 full duplex
e1000e: i219 - fix to enable both ULP and EEE in Sx state
...
Add Oracle virtual Networking Drivers for uek4 kernel
This commit adds 4 kernel modules: xscore, xsvnic, xve
and xsvhba developed by Xsigo (acquired by Oracle) and used in the Oracle
virtual networking (OVN) products which provide provide virtual network and
storage adapter devices on the servers dynamically at runtime.
The heart of OVN product is the Fabric Interconnect (FI).
Hosts and IO modules connect to the FI using Infiniband fabric.
IO modules can be N/W card or/and FC card.
The "xscore" module is responsible for doing FI topology discovery
and establishing the connection with FI. It is involved in retrieving
virtual device management commands such as INSTALL, DELETE, etc.
This module provides wrapper for IB framework API's which will be used
by its client modules "xsvnic", "xsvhba" and "xve".
The "xve" module supprots the Xsigo Virtual Ethernet(XVE) protocol.
The "xsvnic" module supports the Xsigo vNIC functinality. These modules
interface between kernel networking stack and the "xscore" module.
On the egress side, it processes the N/W packet sends it to "xscore"
module which is then wrapped into a IB packet.
On the ingress side, "xscore" receives the N/W packet which is
encapsulated inside IB packet and transfers it to "xsvnic" or "xve".
The modules "xsvnic"/"xve" process this packet and send it to the
kernel networking stack. The "xsvnic" interacts with N/W card gateway
connected to the FI whereas, "xve" interacts with another host in the
same IB fabric.
The "xsvhba" module support for the Xsigo virtual HBA allowing SAN
Connectivity. The "xsvhba" module interfaces with SCSI layer. It
communicates with the FC card gateway connected to the FI. It is
responsible for accepting/transporting the SCSI commands from/to
the specified SCSI target. The "xsvhba" module uses "xscore" to
wrap(unwrap) the commands in a IB packet and transmit(receive) it.
Wei Liu [Thu, 10 Sep 2015 10:18:58 +0000 (11:18 +0100)]
xen-netfront: respect user provided max_queues
Originally that parameter was always reset to num_online_cpus during
module initialisation, which renders it useless.
The fix is to only set max_queues to num_online_cpus when user has not
provided a value.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Cc: David Vrabel <david.vrabel@citrix.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Tested-by: David Vrabel <david.vrabel@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 32a844056fd43dda647e1c3c6b9983bdfa04d17d) Signed-off-by: Annie Li <annie.li@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Chas Williams <3chas3@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 274b045509175db0405c784be85e8cce116e6f7d) Signed-off-by: Annie Li <annie.li@oracle.com>
Chas Williams [Wed, 19 Aug 2015 23:14:20 +0000 (19:14 -0400)]
net/xen-netfront: only clean up queues if present
If you simply load and unload the module without starting the interfaces,
the queues are never created and you get a bad pointer dereference.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Chas Williams <3chas3@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9a873c71e91cabf4c10fd9bbd8358c22deaf6c9e) Signed-off-by: Annie Li <annie.li@oracle.com>
Wei Liu [Thu, 10 Sep 2015 10:18:57 +0000 (11:18 +0100)]
xen-netback: respect user provided max_queues
Originally that parameter was always reset to num_online_cpus during
module initialisation, which renders it useless.
The fix is to only set max_queues to num_online_cpus when user has not
provided a value.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Reported-by: Johnny Strom <johnny.strom@linuxsolutions.fi> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4c82ac3c37363e8c4ded6a5fe1ec5fa756b34df3) Signed-off-by: Annie Li <annie.li@oracle.com>
The PV frontend in IPXE only places 4 requests on the guest Rx ring.
Since netback required at least (MAX_SKB_FRAGS + 1) slots, IPXE could
not receive any packets.
a) If GSO is not enabled on the VIF, fewer guest Rx slots are required
for the largest possible packet. Calculate the required slots
based on the maximum GSO size or the MTU.
This calculation of the number of required slots relies on 1650d5455bd2 (xen-netback: always fully coalesce guest Rx packets)
which present in 4.0-rc1 and later.
b) Reduce the Rx stall detection to checking for at least one
available Rx request. This is fine since we're predominately
concerned with detecting interfaces which are down and thus have
zero available Rx requests.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1d5d48523900a4b0f25d6b52f1a93c84bd671186) Signed-off-by: Annie Li <annie.li@oracle.com>
Paul Durrant [Wed, 2 Sep 2015 16:58:36 +0000 (17:58 +0100)]
xen-netback: add support for multicast control
Xen's PV network protocol includes messages to add/remove ethernet
multicast addresses to/from a filter list in the backend. This allows
the frontend to request the backend only forward multicast packets
which are of interest thus preventing unnecessary noise on the shared
ring.
The canonical netif header in git://xenbits.xen.org/xen.git specifies
the message format (two more XEN_NETIF_EXTRA_TYPEs) so the minimal
necessary changes have been pulled into include/xen/interface/io/netif.h.
To prevent the frontend from extending the multicast filter list
arbitrarily a limit (XEN_NETBK_MCAST_MAX) has been set to 64 entries.
This limit is not specified by the protocol and so may change in future.
If the limit is reached then the next XEN_NETIF_EXTRA_TYPE_MCAST_ADD
sent by the frontend will be failed with NETIF_RSP_ERROR.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 210c34dcd8d912dcc740f1f17625a7293af5cb56) Signed-off-by: Annie Li <annie.li@oracle.com>
Ross Lagerwall [Tue, 4 Aug 2015 14:40:59 +0000 (15:40 +0100)]
xen/netback: Wake dealloc thread after completing zerocopy work
Waking the dealloc thread before decrementing inflight_packets is racy
because it means the thread may go to sleep before inflight_packets is
decremented. If kthread_stop() has already been called, the dealloc
thread may wait forever with nothing to wake it. Instead, wake the
thread only after decrementing inflight_packets.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 57b229063ae6dc65036209018dc7f4290cc026bb) Signed-off-by: Annie Li <annie.li@oracle.com>
Ross Lagerwall [Mon, 3 Aug 2015 14:38:03 +0000 (15:38 +0100)]
xen-netback: Allocate fraglist early to avoid complex rollback
Determine if a fraglist is needed in the tx path, and allocate it if
necessary before setting up the copy and map operations.
Otherwise, undoing the copy and map operations is tricky.
This fixes a use-after-free: if allocating the fraglist failed, the copy
and map operations that had been set up were still executed, writing
over the data area of a freed skb.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2475b22526d70234ecfe4a1ff88aed69badefba9) Signed-off-by: Annie Li <annie.li@oracle.com>
Dan Carpenter [Sat, 11 Jul 2015 22:20:55 +0000 (01:20 +0300)]
net/xen-netback: off by one in BUG_ON() condition
The > should be >=. I also added spaces around the '-' operations so
the code is a little more consistent and matches the condition better.
Fixes: f53c3fe8dad7 ('xen-netback: Introduce TX grant mapping') Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 50c2e4dd6749725338621fff456b26d3a592259f) Signed-off-by: Annie Li <annie.li@oracle.com>
xen-netback: remove duplicated function definition
There are two duplicated xenvif_zerocopy_callback() definitions.
Remove one of them.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Liang Li <liang.z.li@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6ab13b27699e5a71cca20d301c3c424653bd0841) Signed-off-by: Annie Li <annie.li@oracle.com>
Julien Grall [Tue, 16 Jun 2015 19:10:48 +0000 (20:10 +0100)]
net/xen-netback: Don't mix hexa and decimal with 0x in the printf format
Append 0x to all %x in order to avoid while reading when there is other
decimal value in the log.
Also replace some of the hexadecimal print to decimal to uniformize the
format with netfront.
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle> Signed-off-by: Julien Grall <julien.grall@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: netdev@vger.kernel.org Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 68946159da1b0b6791c5990242940950b9383cfc) Signed-off-by: Annie Li <annie.li@oracle.com>