netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
@ 2018-06-04 17:56 Jeff Kirsher
  2018-06-04 17:56 ` [net-next 01/12] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Jeff Kirsher
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

This series contains a smorgasbord of updates to documentation, e1000e,
igb, ixgbe, ixgbevf and i40e.

Benjamin Poirier fixes a potential kernel crash due to NULL pointer
dereference in e1000e.

Jeff updates the kernel documentation for e100 and e1000 to correct
default values and URLs which were incorrect in the documentation.  Also
took the time to update these to the new reStructured text format for
kernel documentation.

Joanna Yurdal fixes a missing PTP transmit timestamp by ensuring that
TSICR gets cleared when ICR is cleared.

Sergey updates igb to reset all the transmit queues at one time so that
we only have to wait once for all the queues to be reset.

Alex fixes ixgbevf so that malicious driver detection (MDD) can co-exist
with XDP.

Emil and Tony extend the RTNL lock to ensure we get the most up-to-date
values for the bits and avoid a possible race condition when going down.

YueHaibing from Huawei introduces a helper function in ixgbe for
operation reads to simplify the code a bit more.

Daniel Borkmann adds support for XDP meta data when using build SKB
for i40e.

Shannon Nelson provides twp fixes for the IPSec code in ixgbe, first is
to make sure we do not try to offload the decryption of any incoming
packet that is destined for the management engine.  The other fix is to
resolve a cast problem introduced by a sparse cleanup patch.

The following are changes since commit 8284fd4cb85577eecca024fe1e7a35b39ed0f3f5:
  Merge branch 'selftests-net-various'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 10GbE

Alexander Duyck (1):
  ixgbevf: Fix coexistence of malicious driver detection with XDP

Benjamin Poirier (1):
  e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes

Daniel Borkmann (1):
  bpf, i40e: add meta data support

Emil Tantilov (1):
  ixgbevf: fix possible race in the reset subtask

Jeff Kirsher (2):
  Documentation: e100: Update the Intel 10/100 driver doc
  Documentation: e1000: Update kernel documentation

Joanna Yurdal (1):
  igb: Clear TSICR interrupts together with ICR

Sergey Nemov (1):
  igb: Wait 10ms just once after TX queues reset

Shannon Nelson (2):
  ixgbe: check ipsec ip addr against mgmt filters
  ixgbe: fix broken ipsec Rx with proper cast on spi

Tony Nguyen (1):
  ixgbe: fix possible race in reset subtask

YueHaibing (1):
  ixgbe: introduce a helper to simplify code

 .../networking/{e100.txt => e100.rst}         | 60 ++++++-------
 .../networking/{e1000.txt => e1000.rst}       | 59 +++---------
 Documentation/networking/index.rst            |  2 +
 MAINTAINERS                                   |  4 +-
 drivers/net/ethernet/intel/e1000e/netdev.c    | 15 ++--
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 39 ++++++--
 drivers/net/ethernet/intel/igb/igb_main.c     | 15 ++--
 .../net/ethernet/intel/ixgbe/ixgbe_debugfs.c  | 57 +++++-------
 .../net/ethernet/intel/ixgbe/ixgbe_ipsec.c    | 90 ++++++++++++++++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  6 +-
 drivers/net/ethernet/intel/ixgbevf/ixgbevf.h  |  1 +
 .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 42 +++++++--
 12 files changed, 236 insertions(+), 154 deletions(-)
 rename Documentation/networking/{e100.txt => e100.rst} (79%)
 rename Documentation/networking/{e1000.txt => e1000.rst} (89%)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [net-next 01/12] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 02/12] Documentation: e100: Update the Intel 10/100 driver doc Jeff Kirsher
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Benjamin Poirier, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Benjamin Poirier <bpoirier@suse.com>

There have been multiple reports of crashes that look like
kernel: RIP: 0010:[<ffffffff8110303f>] timecounter_read+0xf/0x50
[...]
kernel: Call Trace:
kernel:  [<ffffffffa0806b0f>] e1000e_phc_gettime+0x2f/0x60 [e1000e]
kernel:  [<ffffffffa0806c5d>] e1000e_systim_overflow_work+0x1d/0x80 [e1000e]
kernel:  [<ffffffff810992c5>] process_one_work+0x155/0x440
kernel:  [<ffffffff81099e16>] worker_thread+0x116/0x4b0
kernel:  [<ffffffff8109f422>] kthread+0xd2/0xf0
kernel:  [<ffffffff8163184f>] ret_from_fork+0x3f/0x70

These can be traced back to the fact that e1000e_systim_reset() skips the
timecounter_init() call if e1000e_get_base_timinca() returns -EINVAL, which
leads to a null deref in timecounter_read().

Commit 83129b37ef35 ("e1000e: fix systim issues", v4.2-rc1) reworked
e1000e_get_base_timinca() in such a way that it can return -EINVAL for
e1000_pch_spt if the SYSCFI bit is not set in TSYNCRXCTL.

Some experimentation has shown that on I219 (e1000_pch_spt, "MAC: 12")
adapters, the E1000_TSYNCRXCTL_SYSCFI flag is unstable; TSYNCRXCTL reads
sometimes don't have the SYSCFI bit set. Retrying the read shortly after
finds the bit to be set. This was observed at boot (probe) but also link up
and link down.

Moreover, the phc (PTP Hardware Clock) seems to operate normally even after
reads where SYSCFI=0. Therefore, remove this register read and
unconditionally set the clock parameters.

Reported-by: Achim Mildenberger <admin@fph.physik.uni-karlsruhe.de>
Message-Id: <20180425065243.g5mqewg5irkwgwgv@f2>
Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1075876
Fixes: 83129b37ef35 ("e1000e: fix systim issues")
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index d3fef7fefea8..acf1e8b52b8e 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3527,15 +3527,12 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
 		}
 		break;
 	case e1000_pch_spt:
-		if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
-			/* Stable 24MHz frequency */
-			incperiod = INCPERIOD_24MHZ;
-			incvalue = INCVALUE_24MHZ;
-			shift = INCVALUE_SHIFT_24MHZ;
-			adapter->cc.shift = shift;
-			break;
-		}
-		return -EINVAL;
+		/* Stable 24MHz frequency */
+		incperiod = INCPERIOD_24MHZ;
+		incvalue = INCVALUE_24MHZ;
+		shift = INCVALUE_SHIFT_24MHZ;
+		adapter->cc.shift = shift;
+		break;
 	case e1000_pch_cnp:
 		if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
 			/* Stable 24MHz frequency */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 02/12] Documentation: e100: Update the Intel 10/100 driver doc
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
  2018-06-04 17:56 ` [net-next 01/12] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 03/12] Documentation: e1000: Update kernel documentation Jeff Kirsher
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

Over the years, several of the links have changed or are no longer valid
so update them.  In addition, the default values were incorrect for a
couple of parameters.

Converted the text file to the reStructuredText (RST) format, since the
Linux kernel documentation now uses this format for documentation.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
---
 .../networking/{e100.txt => e100.rst}         | 60 +++++++++----------
 Documentation/networking/index.rst            |  1 +
 MAINTAINERS                                   |  2 +-
 3 files changed, 29 insertions(+), 34 deletions(-)
 rename Documentation/networking/{e100.txt => e100.rst} (79%)

diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.rst
similarity index 79%
rename from Documentation/networking/e100.txt
rename to Documentation/networking/e100.rst
index 54810b82c01a..d4d837027925 100644
--- a/Documentation/networking/e100.txt
+++ b/Documentation/networking/e100.rst
@@ -1,7 +1,7 @@
 Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters
 ==============================================================
 
-March 15, 2011
+June 1, 2018
 
 Contents
 ========
@@ -36,16 +36,9 @@ Channel Bonding documentation can be found in the Linux kernel source:
 Identifying Your Adapter
 ========================
 
-For more information on how to identify your adapter, go to the Adapter &
-Driver ID Guide at:
-
-  http://support.intel.com/support/network/adapter/pro100/21397.htm
-
-For the latest Intel network drivers for Linux, refer to the following
-website. In the search field, enter your adapter name or type, or use the
-networking link on the left to search for your adapter:
-
-  http://downloadfinder.intel.com/scripts-df/support_intel.asp
+For information on how to identify your adapter, and for the latest Intel
+network drivers, refer to the Intel Support website:
+http://www.intel.com/support
 
 Driver Configuration Parameters
 ===============================
@@ -57,22 +50,26 @@ Rx Descriptors: Number of receive descriptors. A receive descriptor is a data
    structure that describes a receive buffer and its attributes to the network
    controller. The data in the descriptor is used by the controller to write
    data from the controller to host memory. In the 3.x.x driver the valid range
-   for this parameter is 64-256. The default value is 64. This parameter can be
-   changed using the command:
+   for this parameter is 64-256. The default value is 256. This parameter can be
+   changed using the command::
 
-   ethtool -G eth? rx n, where n is the number of desired rx descriptors.
+   ethtool -G eth? rx n
+
+   Where n is the number of desired Rx descriptors.
 
 Tx Descriptors: Number of transmit descriptors. A transmit descriptor is a data
    structure that describes a transmit buffer and its attributes to the network
    controller. The data in the descriptor is used by the controller to read
    data from the host memory to the controller. In the 3.x.x driver the valid
-   range for this parameter is 64-256. The default value is 64. This parameter
-   can be changed using the command:
+   range for this parameter is 64-256. The default value is 128. This parameter
+   can be changed using the command::
+
+   ethtool -G eth? tx n
 
-   ethtool -G eth? tx n, where n is the number of desired tx descriptors.
+   Where n is the number of desired Tx descriptors.
 
 Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by
-   default. The ethtool utility can be used as follows to force speed/duplex.
+   default. The ethtool utility can be used as follows to force speed/duplex.::
 
    ethtool -s eth?  autoneg off speed {10|100} duplex {full|half}
 
@@ -81,7 +78,7 @@ Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by
 
 Event Log Message Level:  The driver uses the message level flag to log events
    to syslog. The message level can be set at driver load time. It can also be
-   set using the command:
+   set using the command::
 
    ethtool -s eth? msglvl n
 
@@ -112,9 +109,9 @@ Additional Configurations
   ---------------------
   In order to see link messages and other Intel driver information on your
   console, you must set the dmesg level up to six. This can be done by
-  entering the following on the command line before loading the e100 driver:
+  entering the following on the command line before loading the e100 driver::
 
-       dmesg -n 8
+       dmesg -n 6
 
   If you wish to see all messages issued by the driver, including debug
   messages, set the dmesg level to eight.
@@ -146,7 +143,8 @@ Additional Configurations
 
   NAPI (Rx polling mode) is supported in the e100 driver.
 
-  See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
+  See https://wiki.linuxfoundation.org/networking/napi for more information
+  on NAPI.
 
   Multiple Interfaces on Same Ethernet Broadcast Network
   ------------------------------------------------------
@@ -160,7 +158,7 @@ Additional Configurations
   If you have multiple interfaces in a server, either turn on ARP
   filtering by
 
-  (1) entering: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
+  (1) entering:: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
       (this only works if your kernel's version is higher than 2.4.5), or
 
   (2) installing the interfaces in separate broadcast domains (either
@@ -169,15 +167,11 @@ Additional Configurations
 
 Support
 =======
-
 For general information, go to the Intel support website at:
+http://www.intel.com/support/
 
-    http://support.intel.com
-
-    or the Intel Wired Networking project hosted by Sourceforge at:
-
-    http://sourceforge.net/projects/e1000
-
-If an issue is identified with the released source code on the supported
-kernel with a supported adapter, email the specific information related to the
-issue to e1000-devel@lists.sourceforge.net.
+or the Intel Wired Networking project hosted by Sourceforge at:
+http://sourceforge.net/projects/e1000
+If an issue is identified with the released source code on a supported kernel
+with a supported adapter, email the specific information related to the issue
+to e1000-devel@lists.sf.net.
diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
index cbd9bdd4a79e..d11a62977edd 100644
--- a/Documentation/networking/index.rst
+++ b/Documentation/networking/index.rst
@@ -10,6 +10,7 @@ Contents:
    batman-adv
    can
    dpaa2/index
+   e100
    kapi
    z8530book
    msg_zerocopy
diff --git a/MAINTAINERS b/MAINTAINERS
index 0ae0dbf0e15e..d68981ca9896 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7089,7 +7089,7 @@ Q:	http://patchwork.ozlabs.org/project/intel-wired-lan/list/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue.git
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
 S:	Supported
-F:	Documentation/networking/e100.txt
+F:	Documentation/networking/e100.rst
 F:	Documentation/networking/e1000.txt
 F:	Documentation/networking/e1000e.txt
 F:	Documentation/networking/igb.txt
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 03/12] Documentation: e1000: Update kernel documentation
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
  2018-06-04 17:56 ` [net-next 01/12] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Jeff Kirsher
  2018-06-04 17:56 ` [net-next 02/12] Documentation: e100: Update the Intel 10/100 driver doc Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 04/12] igb: Clear TSICR interrupts together with ICR Jeff Kirsher
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

Updated the e1000.txt kernel documentation with the latest information.

Also convert the text file to reStructuredText (RST) format, since the
Linux kernel documentation now uses this format for documentation.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
---
 .../networking/{e1000.txt => e1000.rst}       | 59 ++++---------------
 Documentation/networking/index.rst            |  1 +
 MAINTAINERS                                   |  2 +-
 3 files changed, 12 insertions(+), 50 deletions(-)
 rename Documentation/networking/{e1000.txt => e1000.rst} (89%)

diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.rst
similarity index 89%
rename from Documentation/networking/e1000.txt
rename to Documentation/networking/e1000.rst
index 1f6ed848363d..616848940e63 100644
--- a/Documentation/networking/e1000.txt
+++ b/Documentation/networking/e1000.rst
@@ -154,7 +154,7 @@ NOTE:  When e1000 is loaded with default settings and multiple adapters
        are in use simultaneously, the CPU utilization may increase non-
        linearly.  In order to limit the CPU utilization without impacting
        the overall throughput, we recommend that you load the driver as
-       follows:
+       follows::
 
            modprobe e1000 InterruptThrottleRate=3000,3000,3000
 
@@ -167,8 +167,8 @@ NOTE:  When e1000 is loaded with default settings and multiple adapters
 
 RxDescriptors
 -------------
-Valid Range:   80-256 for 82542 and 82543-based adapters
-               80-4096 for all other supported adapters
+Valid Range:   48-256 for 82542 and 82543-based adapters
+               48-4096 for all other supported adapters
 Default Value: 256
 
 This value specifies the number of receive buffer descriptors allocated
@@ -230,8 +230,8 @@ speed.  Duplex should also be set when Speed is set to either 10 or 100.
 
 TxDescriptors
 -------------
-Valid Range:   80-256 for 82542 and 82543-based adapters
-               80-4096 for all other supported adapters
+Valid Range:   48-256 for 82542 and 82543-based adapters
+               48-4096 for all other supported adapters
 Default Value: 256
 
 This value is the number of transmit descriptors allocated by the driver.
@@ -242,41 +242,10 @@ NOTE:  Depending on the available system resources, the request for a
        higher number of transmit descriptors may be denied.  In this case,
        use a lower number.
 
-TxDescriptorStep
-----------------
-Valid Range:    1 (use every Tx Descriptor)
-                4 (use every 4th Tx Descriptor)
-
-Default Value:  1 (use every Tx Descriptor)
-
-On certain non-Intel architectures, it has been observed that intense TX
-traffic bursts of short packets may result in an improper descriptor
-writeback. If this occurs, the driver will report a "TX Timeout" and reset
-the adapter, after which the transmit flow will restart, though data may
-have stalled for as much as 10 seconds before it resumes.
-
-The improper writeback does not occur on the first descriptor in a system
-memory cache-line, which is typically 32 bytes, or 4 descriptors long.
-
-Setting TxDescriptorStep to a value of 4 will ensure that all TX descriptors
-are aligned to the start of a system memory cache line, and so this problem
-will not occur.
-
-NOTES: Setting TxDescriptorStep to 4 effectively reduces the number of
-       TxDescriptors available for transmits to 1/4 of the normal allocation.
-       This has a possible negative performance impact, which may be
-       compensated for by allocating more descriptors using the TxDescriptors
-       module parameter.
-
-       There are other conditions which may result in "TX Timeout", which will
-       not be resolved by the use of the TxDescriptorStep parameter. As the
-       issue addressed by this parameter has never been observed on Intel
-       Architecture platforms, it should not be used on Intel platforms.
-
 TxIntDelay
 ----------
 Valid Range:   0-65535 (0=off)
-Default Value: 64
+Default Value: 8
 
 This value delays the generation of transmit interrupts in units of
 1.024 microseconds.  Transmit interrupt reduction can improve CPU
@@ -288,7 +257,7 @@ TxAbsIntDelay
 -------------
 (This parameter is supported only on 82540, 82545 and later adapters.)
 Valid Range:   0-65535 (0=off)
-Default Value: 64
+Default Value: 32
 
 This value, in units of 1.024 microseconds, limits the delay in which a
 transmit interrupt is generated.  Useful only if TxIntDelay is non-zero,
@@ -310,7 +279,7 @@ Copybreak
 ---------
 Valid Range:   0-xxxxxxx (0=off)
 Default Value: 256
-Usage: insmod e1000.ko copybreak=128
+Usage: modprobe e1000.ko copybreak=128
 
 Driver copies all packets below or equaling this size to a fresh RX
 buffer before handing it up the stack.
@@ -328,14 +297,6 @@ Default Value:  0 (disabled)
 Allows PHY to turn off in lower power states. The user can turn off
 this parameter in supported chipsets.
 
-KumeranLockLoss
----------------
-Valid Range: 0-1
-Default Value: 1 (enabled)
-
-This workaround skips resetting the PHY at shutdown for the initial
-silicon releases of ICH8 systems.
-
 Speed and Duplex Configuration
 ==============================
 
@@ -397,12 +358,12 @@ Additional Configurations
   ------------
   Jumbo Frames support is enabled by changing the MTU to a value larger than
   the default of 1500.  Use the ifconfig command to increase the MTU size.
-  For example:
+  For example::
 
        ifconfig eth<x> mtu 9000 up
 
   This setting is not saved across reboots.  It can be made permanent if
-  you add:
+  you add::
 
        MTU=9000
 
diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
index d11a62977edd..fec8588a588e 100644
--- a/Documentation/networking/index.rst
+++ b/Documentation/networking/index.rst
@@ -11,6 +11,7 @@ Contents:
    can
    dpaa2/index
    e100
+   e1000
    kapi
    z8530book
    msg_zerocopy
diff --git a/MAINTAINERS b/MAINTAINERS
index d68981ca9896..32472fbf4d6e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7090,7 +7090,7 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue.git
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
 S:	Supported
 F:	Documentation/networking/e100.rst
-F:	Documentation/networking/e1000.txt
+F:	Documentation/networking/e1000.rst
 F:	Documentation/networking/e1000e.txt
 F:	Documentation/networking/igb.txt
 F:	Documentation/networking/igbvf.txt
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 04/12] igb: Clear TSICR interrupts together with ICR
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 03/12] Documentation: e1000: Update kernel documentation Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 05/12] igb: Wait 10ms just once after TX queues reset Jeff Kirsher
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Joanna Yurdal, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Joanna Yurdal <jyu@trackman.com>

Issuing "ip link set up/down" can block TSICR interrupts, what results in
missing PTP Tx timestamp and no PPS pulse generation.

Problem happens when the link is set up with the TSICR interrupts pending.
ICR is cleared before enabling interrupts, while TSICR is not. When all TSICR
interrupts are pending at this moment, time_sync interrupt will never
be generated. TSICR should be cleared as well.

In order to reproduce the issue:
1. Setup linux with IEEE 1588 grandmaster and PPS output enabled
2. Continue setting link up/down with random intervals between commands
3. Wait until PPS is not generated ( only one pulse is generated and PPS
dies), and ptp4l complains constantly about Tx timeout.

Signed-off-by: Joanna Yurdal <jyu@trackman.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 78574c06635b..20b728218d20 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2058,6 +2058,7 @@ int igb_up(struct igb_adapter *adapter)
 		igb_assign_vector(adapter->q_vector[0], 0);
 
 	/* Clear any pending interrupts. */
+	rd32(E1000_TSICR);
 	rd32(E1000_ICR);
 	igb_irq_enable(adapter);
 
@@ -3865,6 +3866,7 @@ static int __igb_open(struct net_device *netdev, bool resuming)
 		napi_enable(&(adapter->q_vector[i]->napi));
 
 	/* Clear any pending interrupts. */
+	rd32(E1000_TSICR);
 	rd32(E1000_ICR);
 
 	igb_irq_enable(adapter);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 05/12] igb: Wait 10ms just once after TX queues reset
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 04/12] igb: Clear TSICR interrupts together with ICR Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 06/12] ixgbevf: Fix coexistence of malicious driver detection with XDP Jeff Kirsher
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Sergey Nemov, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Sergey Nemov <sergey.nemov@intel.com>

Move 10ms sleep out of function resetting TX queue.
Reset all the TX queues in one turn and
wait for all of them just once.

Use usleep_range() instead of mdelay() in order not to
affect transmission on other interfaces.

Signed-off-by: Sergey Nemov <sergey.nemov@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 20b728218d20..c33821d2afb3 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4055,11 +4055,6 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
 	u64 tdba = ring->dma;
 	int reg_idx = ring->reg_idx;
 
-	/* disable the queue */
-	wr32(E1000_TXDCTL(reg_idx), 0);
-	wrfl();
-	mdelay(10);
-
 	wr32(E1000_TDLEN(reg_idx),
 	     ring->count * sizeof(union e1000_adv_tx_desc));
 	wr32(E1000_TDBAL(reg_idx),
@@ -4090,8 +4085,16 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
  **/
 static void igb_configure_tx(struct igb_adapter *adapter)
 {
+	struct e1000_hw *hw = &adapter->hw;
 	int i;
 
+	/* disable the queues */
+	for (i = 0; i < adapter->num_tx_queues; i++)
+		wr32(E1000_TXDCTL(adapter->tx_ring[i]->reg_idx), 0);
+
+	wrfl();
+	usleep_range(10000, 20000);
+
 	for (i = 0; i < adapter->num_tx_queues; i++)
 		igb_configure_tx_ring(adapter, adapter->tx_ring[i]);
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 06/12] ixgbevf: Fix coexistence of malicious driver detection with XDP
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (4 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 05/12] igb: Wait 10ms just once after TX queues reset Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 07/12] ixgbevf: fix possible race in the reset subtask Jeff Kirsher
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

In the case of the VF driver it is supposed to provide a context descriptor
that allows us to provide information about the header offsets inside of
the frame. However in the case of XDP we don't really have any of that
information since the data is minimally processed. As a result we were
seeing malicious driver detection (MDD) events being triggered when the PF
had that functionality enabled.

To address this I have added a bit of new code that will "prime" the XDP
ring by providing one context descriptor that assumes the minimal setup of
an Ethernet frame which is an L2 header length of 14. With just that we can
provide enough information to make the hardware happy so that we don't
trigger MDD events.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf.h  |  1 +
 .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 36 +++++++++++++++----
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
index 70c75681495f..56a1031dcc07 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
@@ -76,6 +76,7 @@ enum ixgbevf_ring_state_t {
 	__IXGBEVF_TX_DETECT_HANG,
 	__IXGBEVF_HANG_CHECK_ARMED,
 	__IXGBEVF_TX_XDP_RING,
+	__IXGBEVF_TX_XDP_RING_PRIMED,
 };
 
 #define ring_is_xdp(ring) \
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 083041129539..2d5a706c3c29 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -991,24 +991,45 @@ static int ixgbevf_xmit_xdp_ring(struct ixgbevf_ring *ring,
 		return IXGBEVF_XDP_CONSUMED;
 
 	/* record the location of the first descriptor for this packet */
-	tx_buffer = &ring->tx_buffer_info[ring->next_to_use];
-	tx_buffer->bytecount = len;
-	tx_buffer->gso_segs = 1;
-	tx_buffer->protocol = 0;
-
 	i = ring->next_to_use;
-	tx_desc = IXGBEVF_TX_DESC(ring, i);
+	tx_buffer = &ring->tx_buffer_info[i];
 
 	dma_unmap_len_set(tx_buffer, len, len);
 	dma_unmap_addr_set(tx_buffer, dma, dma);
 	tx_buffer->data = xdp->data;
-	tx_desc->read.buffer_addr = cpu_to_le64(dma);
+	tx_buffer->bytecount = len;
+	tx_buffer->gso_segs = 1;
+	tx_buffer->protocol = 0;
+
+	/* Populate minimal context descriptor that will provide for the
+	 * fact that we are expected to process Ethernet frames.
+	 */
+	if (!test_bit(__IXGBEVF_TX_XDP_RING_PRIMED, &ring->state)) {
+		struct ixgbe_adv_tx_context_desc *context_desc;
+
+		set_bit(__IXGBEVF_TX_XDP_RING_PRIMED, &ring->state);
+
+		context_desc = IXGBEVF_TX_CTXTDESC(ring, 0);
+		context_desc->vlan_macip_lens	=
+			cpu_to_le32(ETH_HLEN << IXGBE_ADVTXD_MACLEN_SHIFT);
+		context_desc->seqnum_seed	= 0;
+		context_desc->type_tucmd_mlhl	=
+			cpu_to_le32(IXGBE_TXD_CMD_DEXT |
+				    IXGBE_ADVTXD_DTYP_CTXT);
+		context_desc->mss_l4len_idx	= 0;
+
+		i = 1;
+	}
 
 	/* put descriptor type bits */
 	cmd_type = IXGBE_ADVTXD_DTYP_DATA |
 		   IXGBE_ADVTXD_DCMD_DEXT |
 		   IXGBE_ADVTXD_DCMD_IFCS;
 	cmd_type |= len | IXGBE_TXD_CMD;
+
+	tx_desc = IXGBEVF_TX_DESC(ring, i);
+	tx_desc->read.buffer_addr = cpu_to_le64(dma);
+
 	tx_desc->read.cmd_type_len = cpu_to_le32(cmd_type);
 	tx_desc->read.olinfo_status =
 			cpu_to_le32((len << IXGBE_ADVTXD_PAYLEN_SHIFT) |
@@ -1688,6 +1709,7 @@ static void ixgbevf_configure_tx_ring(struct ixgbevf_adapter *adapter,
 	       sizeof(struct ixgbevf_tx_buffer) * ring->count);
 
 	clear_bit(__IXGBEVF_HANG_CHECK_ARMED, &ring->state);
+	clear_bit(__IXGBEVF_TX_XDP_RING_PRIMED, &ring->state);
 
 	IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(reg_idx), txdctl);
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 07/12] ixgbevf: fix possible race in the reset subtask
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (5 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 06/12] ixgbevf: Fix coexistence of malicious driver detection with XDP Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 08/12] ixgbe: introduce a helper to simplify code Jeff Kirsher
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

Extend the RTNL lock in ixgbevf_reset_subtask() to protect the state bits
check in addition to the call to ixgbevf_reinit_locked().

This is to make sure that we get the most up-to-date values for the bits
and avoid a possible race when going down.

Suggested-by: Zhiping du <zhipingdu@tencent.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 2d5a706c3c29..59416eddd840 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -3141,15 +3141,17 @@ static void ixgbevf_reset_subtask(struct ixgbevf_adapter *adapter)
 	if (!test_and_clear_bit(__IXGBEVF_RESET_REQUESTED, &adapter->state))
 		return;
 
+	rtnl_lock();
 	/* If we're already down or resetting, just bail */
 	if (test_bit(__IXGBEVF_DOWN, &adapter->state) ||
 	    test_bit(__IXGBEVF_REMOVING, &adapter->state) ||
-	    test_bit(__IXGBEVF_RESETTING, &adapter->state))
+	    test_bit(__IXGBEVF_RESETTING, &adapter->state)) {
+		rtnl_unlock();
 		return;
+	}
 
 	adapter->tx_timeout_count++;
 
-	rtnl_lock();
 	ixgbevf_reinit_locked(adapter);
 	rtnl_unlock();
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 08/12] ixgbe: introduce a helper to simplify code
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (6 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 07/12] ixgbevf: fix possible race in the reset subtask Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 09/12] bpf, i40e: add meta data support Jeff Kirsher
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: YueHaibing, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: YueHaibing <yuehaibing@huawei.com>

ixgbe_dbg_reg_ops_read and ixgbe_dbg_netdev_ops_read copy-pasting
the same code except for ixgbe_dbg_netdev_ops_buf/ixgbe_dbg_reg_ops_buf,
so introduce a helper ixgbe_dbg_common_ops_read to remove redundant code.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 .../net/ethernet/intel/ixgbe/ixgbe_debugfs.c  | 57 +++++++------------
 1 file changed, 21 insertions(+), 36 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
index 55fe8114fe99..50dfb02fa34c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
@@ -10,15 +10,9 @@ static struct dentry *ixgbe_dbg_root;
 
 static char ixgbe_dbg_reg_ops_buf[256] = "";
 
-/**
- * ixgbe_dbg_reg_ops_read - read for reg_ops datum
- * @filp: the opened file
- * @buffer: where to write the data for the user to read
- * @count: the size of the user's buffer
- * @ppos: file position offset
- **/
-static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,
-				    size_t count, loff_t *ppos)
+static ssize_t ixgbe_dbg_common_ops_read(struct file *filp, char __user *buffer,
+					 size_t count, loff_t *ppos,
+					 char *dbg_buf)
 {
 	struct ixgbe_adapter *adapter = filp->private_data;
 	char *buf;
@@ -29,8 +23,7 @@ static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,
 		return 0;
 
 	buf = kasprintf(GFP_KERNEL, "%s: %s\n",
-			adapter->netdev->name,
-			ixgbe_dbg_reg_ops_buf);
+			adapter->netdev->name, dbg_buf);
 	if (!buf)
 		return -ENOMEM;
 
@@ -45,6 +38,20 @@ static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,
 	return len;
 }
 
+/**
+ * ixgbe_dbg_reg_ops_read - read for reg_ops datum
+ * @filp: the opened file
+ * @buffer: where to write the data for the user to read
+ * @count: the size of the user's buffer
+ * @ppos: file position offset
+ **/
+static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,
+				      size_t count, loff_t *ppos)
+{
+	return ixgbe_dbg_common_ops_read(filp, buffer, count, ppos,
+					 ixgbe_dbg_reg_ops_buf);
+}
+
 /**
  * ixgbe_dbg_reg_ops_write - write into reg_ops datum
  * @filp: the opened file
@@ -121,33 +128,11 @@ static char ixgbe_dbg_netdev_ops_buf[256] = "";
  * @count: the size of the user's buffer
  * @ppos: file position offset
  **/
-static ssize_t ixgbe_dbg_netdev_ops_read(struct file *filp,
-					 char __user *buffer,
+static ssize_t ixgbe_dbg_netdev_ops_read(struct file *filp, char __user *buffer,
 					 size_t count, loff_t *ppos)
 {
-	struct ixgbe_adapter *adapter = filp->private_data;
-	char *buf;
-	int len;
-
-	/* don't allow partial reads */
-	if (*ppos != 0)
-		return 0;
-
-	buf = kasprintf(GFP_KERNEL, "%s: %s\n",
-			adapter->netdev->name,
-			ixgbe_dbg_netdev_ops_buf);
-	if (!buf)
-		return -ENOMEM;
-
-	if (count < strlen(buf)) {
-		kfree(buf);
-		return -ENOSPC;
-	}
-
-	len = simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
-
-	kfree(buf);
-	return len;
+	return ixgbe_dbg_common_ops_read(filp, buffer, count, ppos,
+					 ixgbe_dbg_netdev_ops_buf);
 }
 
 /**
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 09/12] bpf, i40e: add meta data support
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (7 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 08/12] ixgbe: introduce a helper to simplify code Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 10/12] ixgbe: fix possible race in reset subtask Jeff Kirsher
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Daniel Borkmann, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Daniel Borkmann <daniel@iogearbox.net>

Add support for XDP meta data when using build skb variant of
the i40e driver. Implementation is analogous to the existing
ixgbe and ixgbevf support for meta data from 366a88fe2f40 ("bpf,
ixgbe: add meta data support") and be8333322eff ("ixgbevf: Add
support for meta data"). With the build skb variant we get
192 bytes of extra headroom which can be used for encaps or
meta data.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Tested-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 39 ++++++++++++++++-----
 1 file changed, 31 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 9b698c5acd05..105a26f447c0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2032,6 +2032,21 @@ static struct sk_buff *i40e_construct_skb(struct i40e_ring *rx_ring,
 #if L1_CACHE_BYTES < 128
 	prefetch(xdp->data + L1_CACHE_BYTES);
 #endif
+	/* Note, we get here by enabling legacy-rx via:
+	 *
+	 *    ethtool --set-priv-flags <dev> legacy-rx on
+	 *
+	 * In this mode, we currently get 0 extra XDP headroom as
+	 * opposed to having legacy-rx off, where we process XDP
+	 * packets going to stack via i40e_build_skb(). The latter
+	 * provides us currently with 192 bytes of headroom.
+	 *
+	 * For i40e_construct_skb() mode it means that the
+	 * xdp->data_meta will always point to xdp->data, since
+	 * the helper cannot expand the head. Should this ever
+	 * change in future for legacy-rx mode on, then lets also
+	 * add xdp->data_meta handling here.
+	 */
 
 	/* allocate a skb to store the frags */
 	skb = __napi_alloc_skb(&rx_ring->q_vector->napi,
@@ -2083,19 +2098,25 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring,
 				      struct i40e_rx_buffer *rx_buffer,
 				      struct xdp_buff *xdp)
 {
-	unsigned int size = xdp->data_end - xdp->data;
+	unsigned int metasize = xdp->data - xdp->data_meta;
 #if (PAGE_SIZE < 8192)
 	unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;
 #else
 	unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
-				SKB_DATA_ALIGN(I40E_SKB_PAD + size);
+				SKB_DATA_ALIGN(I40E_SKB_PAD +
+					       (xdp->data_end -
+						xdp->data_hard_start));
 #endif
 	struct sk_buff *skb;
 
-	/* prefetch first cache line of first page */
-	prefetch(xdp->data);
+	/* Prefetch first cache line of first page. If xdp->data_meta
+	 * is unused, this points exactly as xdp->data, otherwise we
+	 * likely have a consumer accessing first few bytes of meta
+	 * data, and then actual data.
+	 */
+	prefetch(xdp->data_meta);
 #if L1_CACHE_BYTES < 128
-	prefetch(xdp->data + L1_CACHE_BYTES);
+	prefetch(xdp->data_meta + L1_CACHE_BYTES);
 #endif
 	/* build an skb around the page buffer */
 	skb = build_skb(xdp->data_hard_start, truesize);
@@ -2103,8 +2124,10 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring,
 		return NULL;
 
 	/* update pointers within the skb to store the data */
-	skb_reserve(skb, I40E_SKB_PAD);
-	__skb_put(skb, size);
+	skb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start));
+	__skb_put(skb, xdp->data_end - xdp->data);
+	if (metasize)
+		skb_metadata_set(skb, metasize);
 
 	/* buffer is used by skb, update page_offset */
 #if (PAGE_SIZE < 8192)
@@ -2341,7 +2364,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 		if (!skb) {
 			xdp.data = page_address(rx_buffer->page) +
 				   rx_buffer->page_offset;
-			xdp_set_data_meta_invalid(&xdp);
+			xdp.data_meta = xdp.data;
 			xdp.data_hard_start = xdp.data -
 					      i40e_rx_offset(rx_ring);
 			xdp.data_end = xdp.data + size;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 10/12] ixgbe: fix possible race in reset subtask
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (8 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 09/12] bpf, i40e: add meta data support Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 11/12] ixgbe: check ipsec ip addr against mgmt filters Jeff Kirsher
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Tony Nguyen, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Tony Nguyen <anthony.l.nguyen@intel.com>

Similar to ixgbevf, the same possibility for race exists. Extend the RTNL
lock in ixgbe_reset_subtask() to protect the state bits; this is to make
sure that we get the most up-to-date values for the bits and avoid a
possible race when going down.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index ba3035c08572..dd8a3a037c2f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7621,17 +7621,19 @@ static void ixgbe_reset_subtask(struct ixgbe_adapter *adapter)
 	if (!test_and_clear_bit(__IXGBE_RESET_REQUESTED, &adapter->state))
 		return;
 
+	rtnl_lock();
 	/* If we're already down, removing or resetting, just bail */
 	if (test_bit(__IXGBE_DOWN, &adapter->state) ||
 	    test_bit(__IXGBE_REMOVING, &adapter->state) ||
-	    test_bit(__IXGBE_RESETTING, &adapter->state))
+	    test_bit(__IXGBE_RESETTING, &adapter->state)) {
+		rtnl_unlock();
 		return;
+	}
 
 	ixgbe_dump(adapter);
 	netdev_err(adapter->netdev, "Reset adapter\n");
 	adapter->tx_timeout_count++;
 
-	rtnl_lock();
 	ixgbe_reinit_locked(adapter);
 	rtnl_unlock();
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 11/12] ixgbe: check ipsec ip addr against mgmt filters
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (9 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 10/12] ixgbe: fix possible race in reset subtask Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 17:56 ` [net-next 12/12] ixgbe: fix broken ipsec Rx with proper cast on spi Jeff Kirsher
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@oracle.com>

Make sure we don't try to offload the decryption of an incoming
packet that should get delivered to the management engine.  This
is a corner case that will likely be very seldom seen, but could
really confuse someone if they were to hit it.

Suggested-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 .../net/ethernet/intel/ixgbe/ixgbe_ipsec.c    | 88 +++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index 99b170f1efd1..e1c976271bbd 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -444,6 +444,89 @@ static int ixgbe_ipsec_parse_proto_keys(struct xfrm_state *xs,
 	return 0;
 }
 
+/**
+ * ixgbe_ipsec_check_mgmt_ip - make sure there is no clash with mgmt IP filters
+ * @xs: pointer to transformer state struct
+ **/
+static int ixgbe_ipsec_check_mgmt_ip(struct xfrm_state *xs)
+{
+	struct net_device *dev = xs->xso.dev;
+	struct ixgbe_adapter *adapter = netdev_priv(dev);
+	struct ixgbe_hw *hw = &adapter->hw;
+	u32 mfval, manc, reg;
+	int num_filters = 4;
+	bool manc_ipv4;
+	u32 bmcipval;
+	int i, j;
+
+#define MANC_EN_IPV4_FILTER      BIT(24)
+#define MFVAL_IPV4_FILTER_SHIFT  16
+#define MFVAL_IPV6_FILTER_SHIFT  24
+#define MIPAF_ARR(_m, _n)        (IXGBE_MIPAF + ((_m) * 0x10) + ((_n) * 4))
+
+#define IXGBE_BMCIP(_n)          (0x5050 + ((_n) * 4))
+#define IXGBE_BMCIPVAL           0x5060
+#define BMCIP_V4                 0x2
+#define BMCIP_V6                 0x3
+#define BMCIP_MASK               0x3
+
+	manc = IXGBE_READ_REG(hw, IXGBE_MANC);
+	manc_ipv4 = !!(manc & MANC_EN_IPV4_FILTER);
+	mfval = IXGBE_READ_REG(hw, IXGBE_MFVAL);
+	bmcipval = IXGBE_READ_REG(hw, IXGBE_BMCIPVAL);
+
+	if (xs->props.family == AF_INET) {
+		/* are there any IPv4 filters to check? */
+		if (manc_ipv4) {
+			/* the 4 ipv4 filters are all in MIPAF(3, i) */
+			for (i = 0; i < num_filters; i++) {
+				if (!(mfval & BIT(MFVAL_IPV4_FILTER_SHIFT + i)))
+					continue;
+
+				reg = IXGBE_READ_REG(hw, MIPAF_ARR(3, i));
+				if (reg == xs->id.daddr.a4)
+					return 1;
+			}
+		}
+
+		if ((bmcipval & BMCIP_MASK) == BMCIP_V4) {
+			reg = IXGBE_READ_REG(hw, IXGBE_BMCIP(3));
+			if (reg == xs->id.daddr.a4)
+				return 1;
+		}
+
+	} else {
+		/* if there are ipv4 filters, they are in the last ipv6 slot */
+		if (manc_ipv4)
+			num_filters = 3;
+
+		for (i = 0; i < num_filters; i++) {
+			if (!(mfval & BIT(MFVAL_IPV6_FILTER_SHIFT + i)))
+				continue;
+
+			for (j = 0; j < 4; j++) {
+				reg = IXGBE_READ_REG(hw, MIPAF_ARR(i, j));
+				if (reg != xs->id.daddr.a6[j])
+					break;
+			}
+			if (j == 4)   /* did we match all 4 words? */
+				return 1;
+		}
+
+		if ((bmcipval & BMCIP_MASK) == BMCIP_V6) {
+			for (j = 0; j < 4; j++) {
+				reg = IXGBE_READ_REG(hw, IXGBE_BMCIP(j));
+				if (reg != xs->id.daddr.a6[j])
+					break;
+			}
+			if (j == 4)   /* did we match all 4 words? */
+				return 1;
+		}
+	}
+
+	return 0;
+}
+
 /**
  * ixgbe_ipsec_add_sa - program device with a security association
  * @xs: pointer to transformer state struct
@@ -465,6 +548,11 @@ static int ixgbe_ipsec_add_sa(struct xfrm_state *xs)
 		return -EINVAL;
 	}
 
+	if (ixgbe_ipsec_check_mgmt_ip(xs)) {
+		netdev_err(dev, "IPsec IP addr clash with mgmt filters\n");
+		return -EINVAL;
+	}
+
 	if (xs->xso.flags & XFRM_OFFLOAD_INBOUND) {
 		struct rx_sa rsa;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [net-next 12/12] ixgbe: fix broken ipsec Rx with proper cast on spi
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (10 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 11/12] ixgbe: check ipsec ip addr against mgmt filters Jeff Kirsher
@ 2018-06-04 17:56 ` Jeff Kirsher
  2018-06-04 20:27 ` [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Or Gerlitz
  2018-06-05  1:09 ` David Miller
  13 siblings, 0 replies; 23+ messages in thread
From: Jeff Kirsher @ 2018-06-04 17:56 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Shannon Nelson <shannon.nelson@oracle.com>

Fix up a cast problem introduced by a sparse cleanup patch.  This fixes
a problem where the encrypted packets were not recognized on Rx and
subsequently dropped.

Fixes: 9cfbfa701b55 ("ixgbe: cleanup sparse warnings")
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index e1c976271bbd..344a1f213a5f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -663,7 +663,7 @@ static int ixgbe_ipsec_add_sa(struct xfrm_state *xs)
 
 		/* hash the new entry for faster search in Rx path */
 		hash_add_rcu(ipsec->rx_sa_list, &ipsec->rx_tbl[sa_idx].hlist,
-			     (__force u64)rsa.xs->id.spi);
+			     (__force u32)rsa.xs->id.spi);
 	} else {
 		struct tx_sa tsa;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (11 preceding siblings ...)
  2018-06-04 17:56 ` [net-next 12/12] ixgbe: fix broken ipsec Rx with proper cast on spi Jeff Kirsher
@ 2018-06-04 20:27 ` Or Gerlitz
  2018-06-04 20:30   ` David Miller
  2018-06-05  1:09 ` David Miller
  13 siblings, 1 reply; 23+ messages in thread
From: Or Gerlitz @ 2018-06-04 20:27 UTC (permalink / raw)
  To: Jeff Kirsher, David Miller; +Cc: Linux Netdev List

On Mon, Jun 4, 2018 at 8:56 PM, Jeff Kirsher
<jeffrey.t.kirsher@intel.com> wrote:
> This series contains a smorgasbord of updates to documentation, e1000e,
> igb, ixgbe, ixgbevf and i40e.

Dave,

Did you forgot to flip the sign on the shop's door [1]?

Or.

[1] http://vger.kernel.org/~davem/net-next.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 20:27 ` [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Or Gerlitz
@ 2018-06-04 20:30   ` David Miller
  2018-06-04 21:11     ` Or Gerlitz
  0 siblings, 1 reply; 23+ messages in thread
From: David Miller @ 2018-06-04 20:30 UTC (permalink / raw)
  To: gerlitz.or; +Cc: jeffrey.t.kirsher, netdev

From: Or Gerlitz <gerlitz.or@gmail.com>
Date: Mon, 4 Jun 2018 23:27:57 +0300

> On Mon, Jun 4, 2018 at 8:56 PM, Jeff Kirsher
> <jeffrey.t.kirsher@intel.com> wrote:
>> This series contains a smorgasbord of updates to documentation, e1000e,
>> igb, ixgbe, ixgbevf and i40e.
> 
> Dave,
> 
> Did you forgot to flip the sign on the shop's door [1]?
> 
> Or.
> 
> [1] http://vger.kernel.org/~davem/net-next.html

It's open a day or two more to deal with the AF_XDP issues...

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 20:30   ` David Miller
@ 2018-06-04 21:11     ` Or Gerlitz
  2018-06-04 21:27       ` David Miller
  0 siblings, 1 reply; 23+ messages in thread
From: Or Gerlitz @ 2018-06-04 21:11 UTC (permalink / raw)
  To: David Miller; +Cc: Jeff Kirsher, Linux Netdev List

On Mon, Jun 4, 2018 at 11:30 PM, David Miller <davem@davemloft.net> wrote:
> It's open a day or two more to deal with the AF_XDP issues...

Dave,

Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be merged for
this window -- AFAIU from [1], it's still under
examination/development/research for
non Intel HWs, am I correct or this is going to get in now?

Or

[1] https://marc.info/?l=linux-netdev&m=152810546108060&w=2

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 21:11     ` Or Gerlitz
@ 2018-06-04 21:27       ` David Miller
  2018-06-04 22:02         ` Alexander Duyck
  0 siblings, 1 reply; 23+ messages in thread
From: David Miller @ 2018-06-04 21:27 UTC (permalink / raw)
  To: gerlitz.or; +Cc: jeffrey.t.kirsher, netdev

From: Or Gerlitz <gerlitz.or@gmail.com>
Date: Tue, 5 Jun 2018 00:11:35 +0300

> Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be
> merged for this window -- AFAIU from [1], it's still under
> examination/development/research for non Intel HWs, am I correct or
> this is going to get in now?

All of the pending AF_XDP changes will be merged this merge window.

I think Intel folks need to review things as fast as possible because
I pretty much refuse to revert the series or disable it in Kconfig at
this point.

Thank you.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 21:27       ` David Miller
@ 2018-06-04 22:02         ` Alexander Duyck
  2018-06-04 23:32           ` AF_XDP. Was: " Alexei Starovoitov
  0 siblings, 1 reply; 23+ messages in thread
From: Alexander Duyck @ 2018-06-04 22:02 UTC (permalink / raw)
  To: David Miller, Björn Töpel, Karlsson, Magnus,
	Alexei Starovoitov, Daniel Borkmann
  Cc: Or Gerlitz, Jeff Kirsher, Netdev

On Mon, Jun 4, 2018 at 2:27 PM, David Miller <davem@davemloft.net> wrote:
> From: Or Gerlitz <gerlitz.or@gmail.com>
> Date: Tue, 5 Jun 2018 00:11:35 +0300
>
>> Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be
>> merged for this window -- AFAIU from [1], it's still under
>> examination/development/research for non Intel HWs, am I correct or
>> this is going to get in now?
>
> All of the pending AF_XDP changes will be merged this merge window.
>
> I think Intel folks need to review things as fast as possible because
> I pretty much refuse to revert the series or disable it in Kconfig at
> this point.
>
> Thank you.

My understanding of things is that the current AF_XDP patches were
going to be updated to have more of a model agnostic API such that
they would work for either the "typewriter" mode or the descriptor
ring based approach. The current plan was to have the zero copy
patches be a follow-on after the vendor agnostic API bits in the
descriptors and such had been sorted out. I believe you guys have the
descriptor fixes already right?

In my opinion the i40e code isn't mature enough yet to really go into
anything other than maybe net-next in a couple weeks. We are going to
need a while to get adequate testing in order to flush out all the
bugs and performance regressions we are likely to see coming out of
this change.

- Alex

^ permalink raw reply	[flat|nested] 23+ messages in thread

* AF_XDP. Was: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 22:02         ` Alexander Duyck
@ 2018-06-04 23:32           ` Alexei Starovoitov
  2018-06-05  1:45             ` Alexander Duyck
  0 siblings, 1 reply; 23+ messages in thread
From: Alexei Starovoitov @ 2018-06-04 23:32 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: David Miller, Björn Töpel, Karlsson, Magnus,
	Alexei Starovoitov, Daniel Borkmann, Or Gerlitz, Jeff Kirsher,
	Netdev

On Mon, Jun 04, 2018 at 03:02:31PM -0700, Alexander Duyck wrote:
> On Mon, Jun 4, 2018 at 2:27 PM, David Miller <davem@davemloft.net> wrote:
> > From: Or Gerlitz <gerlitz.or@gmail.com>
> > Date: Tue, 5 Jun 2018 00:11:35 +0300
> >
> >> Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be
> >> merged for this window -- AFAIU from [1], it's still under
> >> examination/development/research for non Intel HWs, am I correct or
> >> this is going to get in now?
> >
> > All of the pending AF_XDP changes will be merged this merge window.
> >
> > I think Intel folks need to review things as fast as possible because
> > I pretty much refuse to revert the series or disable it in Kconfig at
> > this point.
> >
> > Thank you.
> 
> My understanding of things is that the current AF_XDP patches were
> going to be updated to have more of a model agnostic API such that
> they would work for either the "typewriter" mode or the descriptor
> ring based approach. The current plan was to have the zero copy
> patches be a follow-on after the vendor agnostic API bits in the
> descriptors and such had been sorted out. I believe you guys have the
> descriptor fixes already right?
> 
> In my opinion the i40e code isn't mature enough yet to really go into
> anything other than maybe net-next in a couple weeks. We are going to
> need a while to get adequate testing in order to flush out all the
> bugs and performance regressions we are likely to see coming out of
> this change.

I think the work everyone did in this release cycle increased my confidence
that the way descriptors are defined and the rest of uapi are stable enough
and i40e zero copy bits can land in the next release without uapi changes.
In that sense even if we merge i40e parts now, the other nic vendors
will be in the same situation and may find things that they would like
to improve in uapi.
So I propose we merge the first 7 patches of the last series now and
let 3 remaining i40e patches go via intel trees for the next release.
In the mean time other NIC vendors should start actively working
on AF_XDP support as well.
If somehow uapi would need tweaks, we can still do minor adjustments
since 4.18 won't be released for ~10 weeks.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
                   ` (12 preceding siblings ...)
  2018-06-04 20:27 ` [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Or Gerlitz
@ 2018-06-05  1:09 ` David Miller
  13 siblings, 0 replies; 23+ messages in thread
From: David Miller @ 2018-06-05  1:09 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon,  4 Jun 2018 10:56:32 -0700

> This series contains a smorgasbord of updates to documentation, e1000e,
> igb, ixgbe, ixgbevf and i40e.
 ...
> The following are changes since commit 8284fd4cb85577eecca024fe1e7a35b39ed0f3f5:
>   Merge branch 'selftests-net-various'
> and are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 10GbE

Pulled, thanks Jeff.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: AF_XDP. Was: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-04 23:32           ` AF_XDP. Was: " Alexei Starovoitov
@ 2018-06-05  1:45             ` Alexander Duyck
  2018-06-05  8:44               ` Björn Töpel
  0 siblings, 1 reply; 23+ messages in thread
From: Alexander Duyck @ 2018-06-05  1:45 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: David Miller, Björn Töpel, Karlsson, Magnus,
	Alexei Starovoitov, Daniel Borkmann, Or Gerlitz, Jeff Kirsher,
	Netdev

On Mon, Jun 4, 2018 at 4:32 PM, Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
> On Mon, Jun 04, 2018 at 03:02:31PM -0700, Alexander Duyck wrote:
>> On Mon, Jun 4, 2018 at 2:27 PM, David Miller <davem@davemloft.net> wrote:
>> > From: Or Gerlitz <gerlitz.or@gmail.com>
>> > Date: Tue, 5 Jun 2018 00:11:35 +0300
>> >
>> >> Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be
>> >> merged for this window -- AFAIU from [1], it's still under
>> >> examination/development/research for non Intel HWs, am I correct or
>> >> this is going to get in now?
>> >
>> > All of the pending AF_XDP changes will be merged this merge window.
>> >
>> > I think Intel folks need to review things as fast as possible because
>> > I pretty much refuse to revert the series or disable it in Kconfig at
>> > this point.
>> >
>> > Thank you.
>>
>> My understanding of things is that the current AF_XDP patches were
>> going to be updated to have more of a model agnostic API such that
>> they would work for either the "typewriter" mode or the descriptor
>> ring based approach. The current plan was to have the zero copy
>> patches be a follow-on after the vendor agnostic API bits in the
>> descriptors and such had been sorted out. I believe you guys have the
>> descriptor fixes already right?
>>
>> In my opinion the i40e code isn't mature enough yet to really go into
>> anything other than maybe net-next in a couple weeks. We are going to
>> need a while to get adequate testing in order to flush out all the
>> bugs and performance regressions we are likely to see coming out of
>> this change.
>
> I think the work everyone did in this release cycle increased my confidence
> that the way descriptors are defined and the rest of uapi are stable enough
> and i40e zero copy bits can land in the next release without uapi changes.
> In that sense even if we merge i40e parts now, the other nic vendors
> will be in the same situation and may find things that they would like
> to improve in uapi.
> So I propose we merge the first 7 patches of the last series now and
> let 3 remaining i40e patches go via intel trees for the next release.
> In the mean time other NIC vendors should start actively working
> on AF_XDP support as well.
> If somehow uapi would need tweaks, we can still do minor adjustments
> since 4.18 won't be released for ~10 weeks.
>

That works for me. Actually I think patch 11 can probably be included
as well since that is just sample code and could probably be used by
whatever drivers end up implementing this.

Thanks.

- Alex

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: AF_XDP. Was: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-05  1:45             ` Alexander Duyck
@ 2018-06-05  8:44               ` Björn Töpel
  2018-06-05 14:11                 ` Daniel Borkmann
  0 siblings, 1 reply; 23+ messages in thread
From: Björn Töpel @ 2018-06-05  8:44 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: Alexei Starovoitov, David Miller, Björn Töpel,
	Karlsson, Magnus, ast, Daniel Borkmann, Or Gerlitz, Jeff Kirsher,
	Netdev

Den tis 5 juni 2018 kl 03:46 skrev Alexander Duyck <alexander.duyck@gmail.com>:
>
> On Mon, Jun 4, 2018 at 4:32 PM, Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
> > On Mon, Jun 04, 2018 at 03:02:31PM -0700, Alexander Duyck wrote:
> >> On Mon, Jun 4, 2018 at 2:27 PM, David Miller <davem@davemloft.net> wrote:
> >> > From: Or Gerlitz <gerlitz.or@gmail.com>
> >> > Date: Tue, 5 Jun 2018 00:11:35 +0300
> >> >
> >> >> Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be
> >> >> merged for this window -- AFAIU from [1], it's still under
> >> >> examination/development/research for non Intel HWs, am I correct or
> >> >> this is going to get in now?
> >> >
> >> > All of the pending AF_XDP changes will be merged this merge window.
> >> >
> >> > I think Intel folks need to review things as fast as possible because
> >> > I pretty much refuse to revert the series or disable it in Kconfig at
> >> > this point.
> >> >
> >> > Thank you.
> >>
> >> My understanding of things is that the current AF_XDP patches were
> >> going to be updated to have more of a model agnostic API such that
> >> they would work for either the "typewriter" mode or the descriptor
> >> ring based approach. The current plan was to have the zero copy
> >> patches be a follow-on after the vendor agnostic API bits in the
> >> descriptors and such had been sorted out. I believe you guys have the
> >> descriptor fixes already right?
> >>
> >> In my opinion the i40e code isn't mature enough yet to really go into
> >> anything other than maybe net-next in a couple weeks. We are going to
> >> need a while to get adequate testing in order to flush out all the
> >> bugs and performance regressions we are likely to see coming out of
> >> this change.
> >
> > I think the work everyone did in this release cycle increased my confidence
> > that the way descriptors are defined and the rest of uapi are stable enough
> > and i40e zero copy bits can land in the next release without uapi changes.
> > In that sense even if we merge i40e parts now, the other nic vendors
> > will be in the same situation and may find things that they would like
> > to improve in uapi.
> > So I propose we merge the first 7 patches of the last series now and
> > let 3 remaining i40e patches go via intel trees for the next release.
> > In the mean time other NIC vendors should start actively working
> > on AF_XDP support as well.
> > If somehow uapi would need tweaks, we can still do minor adjustments
> > since 4.18 won't be released for ~10 weeks.
> >
>
> That works for me. Actually I think patch 11 can probably be included
> as well since that is just sample code and could probably be used by
> whatever drivers end up implementing this.
>

The approach suggested by Alexei and Alex sounds good to us. Alex's
review items are very much valid, and require more time to address.
Therefore addressing i40e in the next merge windows sounds like a
great idea.

As Alex suggests, including patch 11 together with the first seven makes sense.

Thanks for spending time on our work. Very much appreciated!


Björn

> Thanks.
>
> - Alex

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: AF_XDP. Was: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
  2018-06-05  8:44               ` Björn Töpel
@ 2018-06-05 14:11                 ` Daniel Borkmann
  0 siblings, 0 replies; 23+ messages in thread
From: Daniel Borkmann @ 2018-06-05 14:11 UTC (permalink / raw)
  To: Björn Töpel, Alexander Duyck
  Cc: Alexei Starovoitov, David Miller, Björn Töpel,
	Karlsson, Magnus, ast, Daniel Borkmann, Or Gerlitz, Jeff Kirsher,
	Netdev

On 06/05/2018 10:44 AM, Björn Töpel wrote:
> Den tis 5 juni 2018 kl 03:46 skrev Alexander Duyck <alexander.duyck@gmail.com>:
>> On Mon, Jun 4, 2018 at 4:32 PM, Alexei Starovoitov
>> <alexei.starovoitov@gmail.com> wrote:
>>> On Mon, Jun 04, 2018 at 03:02:31PM -0700, Alexander Duyck wrote:
>>>> On Mon, Jun 4, 2018 at 2:27 PM, David Miller <davem@davemloft.net> wrote:
>>>>> From: Or Gerlitz <gerlitz.or@gmail.com>
>>>>> Date: Tue, 5 Jun 2018 00:11:35 +0300
>>>>>
>>>>>> Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be
>>>>>> merged for this window -- AFAIU from [1], it's still under
>>>>>> examination/development/research for non Intel HWs, am I correct or
>>>>>> this is going to get in now?
>>>>>
>>>>> All of the pending AF_XDP changes will be merged this merge window.
>>>>>
>>>>> I think Intel folks need to review things as fast as possible because
>>>>> I pretty much refuse to revert the series or disable it in Kconfig at
>>>>> this point.
>>>>>
>>>>> Thank you.
>>>>
>>>> My understanding of things is that the current AF_XDP patches were
>>>> going to be updated to have more of a model agnostic API such that
>>>> they would work for either the "typewriter" mode or the descriptor
>>>> ring based approach. The current plan was to have the zero copy
>>>> patches be a follow-on after the vendor agnostic API bits in the
>>>> descriptors and such had been sorted out. I believe you guys have the
>>>> descriptor fixes already right?
>>>>
>>>> In my opinion the i40e code isn't mature enough yet to really go into
>>>> anything other than maybe net-next in a couple weeks. We are going to
>>>> need a while to get adequate testing in order to flush out all the
>>>> bugs and performance regressions we are likely to see coming out of
>>>> this change.
>>>
>>> I think the work everyone did in this release cycle increased my confidence
>>> that the way descriptors are defined and the rest of uapi are stable enough
>>> and i40e zero copy bits can land in the next release without uapi changes.
>>> In that sense even if we merge i40e parts now, the other nic vendors
>>> will be in the same situation and may find things that they would like
>>> to improve in uapi.
>>> So I propose we merge the first 7 patches of the last series now and
>>> let 3 remaining i40e patches go via intel trees for the next release.
>>> In the mean time other NIC vendors should start actively working
>>> on AF_XDP support as well.
>>> If somehow uapi would need tweaks, we can still do minor adjustments
>>> since 4.18 won't be released for ~10 weeks.
>>
>> That works for me. Actually I think patch 11 can probably be included
>> as well since that is just sample code and could probably be used by
>> whatever drivers end up implementing this.
> 
> The approach suggested by Alexei and Alex sounds good to us. Alex's
> review items are very much valid, and require more time to address.
> Therefore addressing i40e in the next merge windows sounds like a
> great idea.
> 
> As Alex suggests, including patch 11 together with the first seven makes sense.

Ok with it as well, and I've pushed just that, thanks everyone!

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-06-05 14:11 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-04 17:56 [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Jeff Kirsher
2018-06-04 17:56 ` [net-next 01/12] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Jeff Kirsher
2018-06-04 17:56 ` [net-next 02/12] Documentation: e100: Update the Intel 10/100 driver doc Jeff Kirsher
2018-06-04 17:56 ` [net-next 03/12] Documentation: e1000: Update kernel documentation Jeff Kirsher
2018-06-04 17:56 ` [net-next 04/12] igb: Clear TSICR interrupts together with ICR Jeff Kirsher
2018-06-04 17:56 ` [net-next 05/12] igb: Wait 10ms just once after TX queues reset Jeff Kirsher
2018-06-04 17:56 ` [net-next 06/12] ixgbevf: Fix coexistence of malicious driver detection with XDP Jeff Kirsher
2018-06-04 17:56 ` [net-next 07/12] ixgbevf: fix possible race in the reset subtask Jeff Kirsher
2018-06-04 17:56 ` [net-next 08/12] ixgbe: introduce a helper to simplify code Jeff Kirsher
2018-06-04 17:56 ` [net-next 09/12] bpf, i40e: add meta data support Jeff Kirsher
2018-06-04 17:56 ` [net-next 10/12] ixgbe: fix possible race in reset subtask Jeff Kirsher
2018-06-04 17:56 ` [net-next 11/12] ixgbe: check ipsec ip addr against mgmt filters Jeff Kirsher
2018-06-04 17:56 ` [net-next 12/12] ixgbe: fix broken ipsec Rx with proper cast on spi Jeff Kirsher
2018-06-04 20:27 ` [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04 Or Gerlitz
2018-06-04 20:30   ` David Miller
2018-06-04 21:11     ` Or Gerlitz
2018-06-04 21:27       ` David Miller
2018-06-04 22:02         ` Alexander Duyck
2018-06-04 23:32           ` AF_XDP. Was: " Alexei Starovoitov
2018-06-05  1:45             ` Alexander Duyck
2018-06-05  8:44               ` Björn Töpel
2018-06-05 14:11                 ` Daniel Borkmann
2018-06-05  1:09 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).