Commit Graph

21 Commits

Author SHA1 Message Date
Bruce Richardson
5566a3e358 drivers: use SPDX tag for Intel copyright files
Replace the BSD license header with the SPDX tag for files
with only an Intel copyright on them.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-04 22:41:39 +01:00
Radu Nicolau
cd54819d03 net/ixgbe: fix IPsec Rx with SSE
And small performance improvement

Fixes: 9a0752f498 ("net/ixgbe: enable inline IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-11-01 22:17:06 +01:00
Santosh Shukla
455da54539 mbuf: rename physical address to IOVA
Rename buf_physaddr to buf_iova.
Keep the deprecated name in an anonymous union to avoid breaking
the API.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-11-06 22:44:26 +01:00
Radu Nicolau
71864623ba net/ixgbe: fix build without security library
Fixes: 9a0752f498 ("net/ixgbe: enable inline IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Tested-by: David Marchand <david.marchand@6wind.com>
2017-10-26 22:30:28 +02:00
Olivier Matz
380a7aab1a mbuf: rename deprecated VLAN flags
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Radu Nicolau
9a0752f498 net/ixgbe: enable inline IPsec
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
2017-10-26 03:12:34 +02:00
Qi Zhang
ee4427e0fe net/ixgbe: support packet type parsing in SSE Rx
Hardware PTYPE in Rx desc will be parsed to fill mbuf's packet_type.

Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-06 15:00:56 +02:00
Bruce Richardson
5ea4d4688d net/ixgbe: remove fallback code for x86 non-SSE4
Since SSE4 is now part of minimum requirements for DPDK on x86, we no
longer need this fallback code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
631a2f530b net/ixgbe: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-12 10:41:25 +01:00
Qi Zhang
6d65eba145 net/ixgbe: fix memory overflow in 32-bit SSE Rx
Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: c95584dc2b ("ixgbe: new vectorized functions for Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-05-05 17:40:21 +02:00
Konstantin Ananyev
b81f5fa27f net/ixgbe: remove option to disable offload flags
Having packets received without any offload flags given in the mbuf is not
very useful, and performance tests with testpmd indicates little
benefit is got with the current code by turning off the flags. This makes
the build-time option pointless, so we can remove it.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-04-19 15:37:37 +02:00
Konstantin Ananyev
f160666a10 net/ixgbe: eliminate mbuf write on rearm
With the mbuf rework, we now have 8 contiguous bytes to be rearmed in the
mbuf just before the 8-bytes of olflags. If we don't do the rearm write
inside the descriptor ring replenishment function, and delay it to
receiving the packet, we can do a single 16B write inside the RX function
to set both the rearm data, and the flags together.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-04-19 15:37:37 +02:00
Jerin Jacob
dc448dc460 mbuf: make rearm data address naturally aligned
To avoid multiple stores on fast path, Ethernet drivers
aggregate the writes to data_off, refcnt, nb_segs and port
to an uint64_t data and write the data in one shot
with uint64_t* at &mbuf->rearm_data address.

Some of the non-IA platforms have store operation overhead
if the store address is not naturally aligned.This patch
fixes the performance issue on those targets.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Olivier Matz
ebb7bcabb8 drivers/net: do not touch mbuf next or nb segs on Rx
Now that the m->next pointer and m->nb_segs is expected to be set (to
NULL and 1 respectively) after a mempool_get(), we can avoid to write them
in the Rx functions of drivers.

Only some drivers are patched, it's not an exhaustive patch. It gives
the idea to do the same in other drivers.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Zhiyong Yang
646412f9ff net/ixgbe: remove limit of Tx burst size
To add a wrapper function to remove the limit of tx burst size and
implement the "make an best effort to transmit the pkts" policy.
The patch makes ixgbe vec function work in a consistent behavior
like ixgbe_xmit_pkts_simple and ixgbe_xmit_pkts do that.

Cc: Helin Zhang <helin.zhang@intel.com>
Cc: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-04-04 19:02:55 +02:00
Qi Zhang
bd85525efb net/ixgbe: fix out of order Rx read
In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile
modifier will be cast away, allowing the compiler to reorder the
load instructions.

The Rx recv function's correctness is relying on these load
instructions following a strict sequence, reading the descriptors
in reverse order, so we add compiler barrier to prevent compiler
reorder.

Fixes: c95584dc2b ("ixgbe: new vectorized functions for Rx/Tx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-10-26 19:38:18 +02:00
Xiao Wang
9bc52f49fc net/ixgbe: implement new Rx checksum flag
Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-10-14 01:41:34 +02:00
Olivier Matz
b4f3c136a1 net/ixgbe: support checksum flags in SSE vector Rx
Update desc_to_olflags_v() to set PKT_RX_IP_CKSUM_BAD and
PKT_RX_L4_CKSUM_BAD in the ol_fags of the mbuf.

The Rx vector function can now be used with hw_ip_checksum
enabled.

Tested with:

  cd dpdk.org/
  make config T=x86_64-native-linuxapp-gcc
  make -j32
  mkdir -p /mnt/huge
  mount -t hugetlbfs nodev /mnt/huge
  echo 256 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
  modprobe uio_pci_generic
  python tools/dpdk_nic_bind.py -b uio_pci_generic 0000:04:00.0
  ./build/app/testpmd -l 2,4 -- --total-num-mbufs=65536 -i --port-topology=chained --enable-rx-cksum --disable-hw-vlan-filter --disable-hw-vlan-strip
    set fwd rxonly
    set verbose 1
    start

  # send packets to testpmd using scapy
  eh = Ether(src="00:01:02:03:04:05", dst="00:1B:21:AB:8F:10")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=42)/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=45)/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")

  # result
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_IP_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
    PKT_RX_IP_CKSUM_BAD

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-10-14 01:23:40 +02:00
Yuanhan Liu
0af54f09d9 net: fix clang build
Interestingly, clang and gcc has different prototype for _mm_prefetch().
For gcc, we have

   _mm_prefetch (const void *__P, enum _mm_hint __I)

While for clang, it's

   #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))

That's how the following error comes with clang:

   error: cast from 'const void *' to 'void *' drops const qualifier
   [-Werror,-Wcast-qual]
           _mm_prefetch((const void *)rused, _MM_HINT_T0);
   /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/xmmintrin.h:684:58:
   note: expanded from macro '_mm_prefetch'
            #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a),
                                          0, (sel)))

What's weird is that the build was actaully Okay before. I met it while
apply Jerin's vector support for ARM patch set: he just move this piece
of code to another file, nothing else changed.

This patch fix the issue when Jerin's patchset is applied. Thus, I think
it's still needed.

Similarly, make the same change to other _mm_prefetch users, just in case
this weird issue shows up again somehow later.

Fixes: fc3d66212f ("virtio: add vector Rx")
Fixes: c95584dc2b ("ixgbe: new vectorized functions for Rx/Tx")
Fixes: 9ed94e5bb0 ("i40e: add vector Rx")
Fixes: 7092be8437 ("fm10k: add vector Rx")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-09-28 02:18:39 +02:00
Olivier Matz
ba9eebbb60 net/ixgbe: fix build whith offload flags disabled
The ixgbe driver does not compile if CONFIG_RTE_IXGBE_RX_OLFLAGS_ENABLE=n
because the macro has not the proper number of parameters. To reproduce
the issue:

  make config T=x86_64-native-linuxapp-gcc
  sed -i 's,\(IXGBE_RX_OLFLAGS_ENABLE\)=y,\1=n,' build/.config
  make -j4
  [...]
   ixgbe_rxtx_vec_sse.c: In function ‘_recv_raw_pkts_vec’:
   ixgbe_rxtx_vec_sse.c:345:53: error:
     macro "desc_to_olflags_v" passed 3 arguments, but takes just 2
      desc_to_olflags_v(descs, vlan_flags, &rx_pkts[pos]);
                                                        ^
   ixgbe_rxtx_vec_sse.c:345:3: error:
     ‘desc_to_olflags_v’ undeclared (first use in this function)
      desc_to_olflags_v(descs, vlan_flags, &rx_pkts[pos]);
      ^
   ixgbe_rxtx_vec_sse.c:231:10: error:
     variable ‘vlan_flags’ set but not used
     uint8_t vlan_flags;
             ^

This patch fixes the number of arguments in the macro, and ensures that
vlan_flags is marked as used to avoid the third error.

Fixes: b37b528d95 ("mbuf: add new Rx flags for stripped VLAN")

Reported-by: Amin Tootoonchian <amint@icsi.berkeley.edu>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-07-05 10:59:28 +02:00
Jianbo Liu
0e51f9dc48 net/ixgbe: rename x86 vector driver file
To be consistent with the naming for ARM NEON implementation,
ixgbe_rxtx_vec.c is renamed to ixgbe_rxtx_vec_sse.c.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-15 17:13:54 +02:00