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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add support for EEPROM reading/writing.
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
VLAN filters and VLAN offloads implementation.
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
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>
Add support for flow control feature.
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
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>
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>
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>
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>
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>