Commit Graph

6086 Commits

Author SHA1 Message Date
Dekel Peled
6bd7fbd03c net/mlx5: support metadata as flow rule criteria
As described in series starting at [1], it adds option to set
metadata value as match pattern when creating a new flow rule.

This patch adds metadata support in mlx5 driver, in two parts:
- Add the validation and setting of metadata value in matcher,
  when creating a new flow rule.
- Add the passing of metadata value from mbuf to wqe when
  indicated by ol_flag, in different burst functions.

[1] "ethdev: support metadata as flow rule criteria"
    http://mails.dpdk.org/archives/dev/2018-September/113269.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
c9cce42876 ethdev: remove deprecated attach/detach functions
The hotplug attach/detach features are implemented in EAL layer.
There is a new ethdev iterator to retrieve ports from ethdev layer.

As announced earlier, the (buggy) ethdev functions are now removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
e1114ff6a5 net/mlx5: support e-switch flow count action
This commit adds support for configuring flows destined to the mlx5
eswitch with 'count' action and for querying these counts at runtime.

Each flow rule configured by the mlx5 driver is implicitly assigned
with flow counters. These counters can be retrieved when querying
the flow rule via Netlink, they can be found in each flow action
section of the reply. Hence, supporting the 'count' action in the
flow configuration command is straight-forward. When transposing
the command to a tc Netlink message we just ignore it instead of
rejecting it.
In the 'flow query count' side, the command now uses tc Netlink
query command in order to retrieve the values of the flow counters.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
684dafe795 net/mlx5: add flow query abstraction interface
Flow engine now supports multiple driver paths with each having
its own flow query implantation routine.
This patch adds an abstraction to the flow query routine in accordance
to commit 0c76d1c9a1 ("net/mlx5: add abstraction for multiple flow
drivers") done by Yongseok Koh.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
743fdbeb45 net/mlx5: use the new infrastructure for tc flow
modified TC-flow code to use the new infrastructure
introduced in "net/mlx5: refactor TC-flow infrastructure"
commit.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
d53180afe3 net/mlx5: refactor TC-flow infrastructure
This commit refactors tc_flow as a preparation to coming commits
that sends different type of messages and expect differ type of replies
while still using the same underlying routines.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Thomas Monjalon
662dbc322d ethdev: remove release function for secondary process
After previous changes, the function rte_eth_dev_release_port()
can be used for primary or secondary process as well.
The only difference with rte_eth_dev_release_port_secondary()
is the shared lock used in rte_eth_dev_release_port().

The function rte_eth_dev_release_port_secondary() was recently
added in 18.11 cycle.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Thomas Monjalon
e16adf08e5 ethdev: free all common data when releasing port
This is a clean-up of common ethdev data freeing.
All data freeing are moved to rte_eth_dev_release_port()
and done only in case of primary process.

It is probably fixing some memory leaks for PMDs which were
not freeing all data.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Hyong Youb Kim
59e657aa0b net/enic: add missing Tx offload flags
The following commit has added a number of existing offload flags such
as PKT_TX_IPV4 and PKT_TX_IPV6 to PKT_TX_OFFLOAD_MASK defined in
rte_mbuf.h. That change breaks the enic driver's Tx prepare handler.

commit ef28cfa73822 ("mbuf: fix Tx offload mask")

The enic driver keeps the supported offload flags in a local variable
(tx_offload_mask), which is strictly a subset of
PKT_TX_OFFLOAD_MASK. This variable is then used to compute the
unsupported flags (tx_offload_notsup_mask), and the Tx prepare handler
(tx_pkt_prepare) uses it to reject packets with unsupported offload
flags.

As is, tx_offload_notsup_mask ends up containing flags like
PKT_TX_IPV4 that are actually supported by the driver, which then
breaks any application that uses checksum offloads and calls the Tx
prepare handler. So add the flags to tx_offload_mask that the driver
supports but were missing in PKT_TX_OFFLOAD_MASK.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-10-26 22:14:05 +02:00
Hyong Youb Kim
432ed10d81 net/enic: fix supported packet types
The handler for dev_supported_ptypes_get currently returns null when
the vectorized Rx handler is used. It is also missing tunnel packet
types. Add the missing packet types to the supported list, and return
the right list for the vectorized Rx handler.

Fixes: 8a6ff33d6d ("net/enic: add AVX2 based vectorized Rx handler")
Fixes: 93fb21fdbe ("net/enic: enable overlay offload for VXLAN and GENEVE")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-10-26 22:14:05 +02:00
Huaibin Wang
815037b92b net/i40e: keep promiscuous on if allmulticast is enabled
Promisc should not be disabled if the all multicast mode is enabled.
Patch keeps the promiscuous on if all multicast mode is on, this
behavior is also consistent with the implementation done on ixgbe
pmd.

Cc: stable@dpdk.org

Signed-off-by: Huaibin Wang <huaibin.wang@6wind.com>
Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-26 22:14:05 +02:00
Raslan Darawsheh
c9aa56edec net/tap: access primary process queues from secondary
In the case the device is created by the primary process,
the secondary must request some file descriptors to attach the queues.
The file descriptors are shared via IPC Unix socket.

Thanks to the IPC synchronization, the secondary process
is now able to do Rx/Tx on a TAP created by the primary process.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Raslan Darawsheh
ed8132e7c9 net/tap: move fds of queues to be in process private
fd's cannot be shared between processes, and each process need to have
it's own fd's pointer.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Raslan Darawsheh
48b9dcd62a net/tap: add queue and port ids in queue structures
Port and queue ids are added to easily map the file
descriptors stored in each process private.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Anoob Joseph
95a6b04f7d use registered name for OCTEON TX references
'OCTEON TX' is the registered name. All other usages need to be fixed.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-10-26 14:16:05 +02:00
Fan Zhang
babdea5933 net/softnic: add crypto commands
This patch updates the CLI parsing of softnic with extra symmetric
cryptodev, port, session, and action support.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:16:05 +02:00
Fan Zhang
3b7f2b9e17 net/softnic: add symmetric crypto action
This patch adds symmetric crypto action support to softnic.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:13:45 +02:00
Fan Zhang
e0e52c7c29 net/softnic: configure crypto port
This patch enables the crypt port configuration in softnic.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:13:45 +02:00
Fan Zhang
29fe4822f5 net/softnic: add cryptodev
This patch adds cryptodev abstraction to softnic. The DPDK
Cryptodevs are abstracted as crypto ports in the softnic.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:13:45 +02:00
Reshma Pattan
636e5af038 net/softnic: support flow API VXLAN encap action
Added support for ethdev flow API VXLAN encap action.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-17 15:04:39 +02:00
Cristian Dumitrescu
0dac5d7ea0 net/softnic: support VXLAN encap
Add CLI support for VXLAN encap.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-17 15:04:08 +02:00
Keith Wiles
81bede55e3 eal: add macro for attribute weak
eal: add shorthand __rte_weak macro
qat: update code to use __rte_weak macro
avf: update code to use __rte_weak macro
fm10k: update code to use __rte_weak macro
i40e: update code to use __rte_weak macro
ixgbe: update code to use __rte_weak macro
mlx5: update code to use __rte_weak macro
virtio: update code to use __rte_weak macro
acl: update code to use __rte_weak macro
bpf: update code to use __rte_weak macro

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-25 02:11:23 +02:00
Shreyansh Jain
44e87c27a5 net/dpaa2: decrease link state log level
In case the link is down during initial link state check, messages for
link state check flood the console. Reducing the log level for these.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-25 00:51:05 +02:00
Anatoly Burakov
5d7b673d5f mk: build with _GNU_SOURCE defined by default
We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and driver's and application's makefile,
fix it by simply defining _GNU_SOURCE by default for all
builds.

Remove all usages of _GNU_SOURCE in source files and makefiles,
and also fixup a couple of instances of using __USE_GNU instead
of _GNU_SOURCE.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-22 11:28:27 +02:00
Raslan Darawsheh
9396ad3346 net/tap: fix reported number of Tx packets
When writev fails to send packets it doesn't update the
number of Tx packets, but it still num_tx is updated.

The value that should be returned is the actual number
of sent packets which is num_packets.

Fixes: 02f96a0a82 ("net/tap: add TUN/TAP device PMD")
CC: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2018-10-18 10:24:39 +02:00
Stephen Hemminger
ea2c9969b5 net/ixgbe: remove mild profanity
At the tail end of comment about barriers (I feel your pain);
remove mild profanity.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Stephen Hemminger
a331d57c3e net/bnx2x: remove profanity
No need for profanity in comments.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Shahaf Shuler
cd18e1b72f net/mlx5: fix build on Arm
On some ARM environment, the below compilation error will be seen

dpdk/drivers/net/mlx5/mlx5_flow_dv.c: In function
'flow_dv_translate_item_nvgre':
/tmp/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:785:22: error: pointer targets
in initialization differ in signedness [-Werror=pointer-sign]
  const char *tni_v = nvgre_v->tni;

The reason for this error is that nvgre_v->tni is defined as byte array
in size of 3B. However the code in the function iterate till the 4B in
order to copy/set also the subsequent field after it (flow_id)

Fixing by pointing to this struct from a different pointer.

Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-10-18 10:24:39 +02:00
Maxime Coquelin
6d6e95cec4 net/vhost: add parameter to enable postcopy
Introduce a new postcopy-support parameter to Vhost PMD that
passes the RTE_VHOST_USER_POSTCOPY_SUPPORT flag at vhost
device register time.

Flag should only be set if application does not prefault guest
memory using, for example, mlockall() syscall.

Default value is 0, meaning that postcopy support is disabled
unless specified explicitly.

Example to enable postcopy support for a given device:

--vdev 'net_vhost0,iface=/tmp/vhost-user1,postcopy-support=1'

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
7604677883 net/mlx5: rewrite MAC address by E-Switch
Offload following modify MAC address actions to E-Switch
via TC-Flower driver

- RTE_FLOW_ACTION_TYPE_SET_MAC_SRC
- RTE_FLOW_ACTION_TYPE_SET_MAC_DST

The corresponding rte_flow_item_eth must be present in
rte_flow pattern

Only support modify outer layer MAC address

The example testpmd command is:

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7000 / end
         actions set_mac_dst mac_addr dd:00:aa:11:bb:33 /
         set_mac_src mac_addr bb:00:cc:11:aa:22 /
	 port_id id 1 / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
a7cb5bcd28 net/mlx5: rewrite TTL by E-Switch
Offload following modify TTL actions to E-Switch via
TC-Flower driver

- RTE_FLOW_ACTION_TYPE_SET_TTL
- RTE_FLOW_ACTION_TYPE_DEC_TTL

The corresponding IP protocol rte_flow_item_ipv[4|6]
must be present in rte_flow pattern otherwith PMD
return error

The example testpmd commands are:

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7000 / end
	 actions dec_ttl /
	 port_id id 1 / end

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7001 / end
	 actions set_ttl ttl_value 10 /
	 port_id id 1 / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Rahul Lakkireddy
f683a52006 net/cxgbe: add action to swap MAC addresses
Implement RTE_FLOW_ACTION_TYPE_MAC_SWAP to offload flows with
action to swap the source and destination MAC addresses in the
outermost Ethernet header.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-10-18 10:24:39 +02:00
Ed Czeck
589876bff1 net/ark: support updated hardware and Tx meta data
Support for version 2 of DDM hardware and user tx meta data.
Verify version during initialization.

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
2018-10-18 10:24:39 +02:00
Ed Czeck
0c5b65f45c net/ark: remove useless hardware notifications
Only send notification to mpu when crossing 64 index boundary.

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
2018-10-18 10:24:39 +02:00
Ed Czeck
be410a8615 net/ark: add recovery for lack of mbufs
Attempt to allocate smaller chunk of mbufs when larger amount is
not available.  Report error when small chunk not available.

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
2018-10-18 10:24:39 +02:00
Stephen Hemminger
dcf3d57fa4 net/qede: remove invalid config option checks
Now that logging of initialization is controlled by dynamic debug
level, remove the #ifdef for RTE_LIBRTE_QEDE_DEBUG_INIT since that
config option does not exist in common_base and is not documented.

Fixes: 69b6573980 ("net/qede: implement dynamic logging")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Haiyue Wang
a710ceb172 net/avf: fix build with debug enabled
DEBUG_DUMP_DESC flag is enabled/disabled from Makefile and enabling it
causing the build issue.

Add the missed 'volatile' keyword to avoid the warning for type
mismatch, which will be treated as compiler error if WERROR_FLAGS
is enabled.

Fixes: bfd38e4d70 ("net/avf: fix missing compiler error flags")
CC: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
0eef26d073 net/mlx5: fix build with zero-size array
If the build environment doesn't have 'linux/tc_act/tc_pedit.h' header,
compiler will use needed structs defined in mlx5_flow_tcf.c.

However, there is a zero-size array defined in one struct and
ISO C forbids this when -Wpedantic is set by debug mode.

Simply put __extension__ keyword before the struct in question.

Fixes: 2ed2fe5f0a ("net/mlx5: rewrite IP address UDP/TCP port by E-Switch")

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
2018-10-18 10:24:39 +02:00
Yongseok Koh
31fda51877 net/mlx5: support multiple groups and jump action
rte_flow has 'group' attribute and 'jump' action in order to support
multiple groups. This feature is known as multi-table support ('chain' in
linux TC flower) in general because a group means a table of flows. Example
commands are:

	flow create 0 transfer priority 1 ingress
	     pattern eth / vlan vid is 100 / end
	     actions jump group 1 / end

	flow create 0 transfer priority 1 ingress
	     pattern eth / vlan vid is 200 / end
	     actions jump group 2 / end

	flow create 0 transfer group 1 priority 2 ingress
	     pattern eth / vlan vid is 100 /
	     	     ipv4 dst spec 192.168.40.0 dst prefix 24 / end
	     actions drop / end

	flow create 0 transfer group 1 priority 2 ingress
	     pattern end
	     actions of_pop_vlan / port_id id 1 / end

	flow create 0 transfer group 2 priority 2 ingress
	     pattern eth / vlan vid is 200 /
	     	     ipv4 dst spec 192.168.40.0 dst prefix 24 / end
	     actions of_pop_vlan / port_id id 2 / end

	flow create 0 transfer group 2 priority 2 ingress
	     pattern end
	     actions port_id id 2 / end

With theses flows, if a packet having vlan 200 and src_ip as 192.168.40.1,
this packet will firstly hit the 1st flow. Then it will hit the 5th flow
because of the 'jump' action. As a result, the packet will be forwarded to
port 2 (VF representor) with vlan tag being stripped off. If the packet had
vlan 100 instead, it would be dropped by the 3rd flow.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
ce44e50a58 net/atlantic: read MAC registers for debug purposes
This patch add support for dumping MAC registers.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
ce4e8d4180 net/atlantic: implement EEPROM get/set
Add support for EEPROM reading/writing.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
f7c2c2c8c5 net/atlantic: implement VLAN filters and offloads
VLAN filters and VLAN offloads implementation.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
4c4340ff30 net/atlantic: implement MTU configuration
Add support for updating MTU value.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
275d21b554 net/atlantic: implement MAC address manipulations
Add support for adding/removing MAC addresses.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
4c1c8f7646 net/atlantic: add flow control configuration
Add support for flow control feature.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
3af0d30854 net/atlantic: implement RSS and RETA manipulation API
Add support for Receive Side Scaling feature.
RSS hash and reta table configuration.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
a9ba50efbd net/atlantic: implement promisc and allmulti modes
Add support for promiscuous/allmulticast modes configuration.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
391de3291d net/atlantic: add Rx/Tx descriptors information
Add support for Rx/Tx descriptors status information.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
fbe059e872 net/atlantic: implement device statistics
Add support for device stats, xstats and queue stats

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
7943ba05f6 net/atlantic: add link status and interrupt management
Implement link interrupt, link info, link polling.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00