dpdk.git
7 years agonet/mrvl: support for promiscuous and allmulticast
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:36 +0000 (17:00 +0200)]
net/mrvl: support for promiscuous and allmulticast

Add support for promiscuous and allmulticast modes.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support jumbo frame
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:35 +0000 (17:00 +0200)]
net/mrvl: support jumbo frame

Add jumbo frame support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support updating MTU
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:34 +0000 (17:00 +0200)]
net/mrvl: support updating MTU

Add support for updating mtu.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add link speed capabilities
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:33 +0000 (17:00 +0200)]
net/mrvl: add link speed capabilities

Return supported link speed capabilities via rte_dev_info_get().

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add link update
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:32 +0000 (17:00 +0200)]
net/mrvl: add link update

Add support for retrieving physical link information i.e:
speed, duplex and link status.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add Rx/Tx support
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:31 +0000 (17:00 +0200)]
net/mrvl: add Rx/Tx support

Add rx/tx support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add net PMD skeleton
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:30 +0000 (17:00 +0200)]
net/mrvl: add net PMD skeleton

Add mrvl net pmd driver skeleton providing base for the further
development. Besides the basic functionality QoS configuration is
introduced as well.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agomk: link the whole cfgfile library
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:29 +0000 (17:00 +0200)]
mk: link the whole cfgfile library

MRVL net pmd needs rte_cfgfile to parse QoS configuration file thus
librte_pmd_mrvl.a contains undefined symbols from librte_cfgfile.a.

As a result linking applications under app/ directory will fail
because librte_cfgfile.a comes before librte_pmd_mrvl.a during
the linking stage.

Linking the whole librte_cfgfile.a solves the issue.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mlx5: add vectorized Rx/Tx burst for ARM
Yongseok Koh [Mon, 9 Oct 2017 18:47:00 +0000 (11:47 -0700)]
net/mlx5: add vectorized Rx/Tx burst for ARM

Brings vectorization through NEON instructions.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: fix configuration of Rx CQE compression
Yongseok Koh [Mon, 9 Oct 2017 18:46:59 +0000 (11:46 -0700)]
net/mlx5: fix configuration of Rx CQE compression

With the upstream rdma-core, to enable Rx CQE compression,
mlx5dv_create_cq() in Direct Verbs has to be used instead of regular
Verbs call (ibv_create_cq()). And if the size of CQE is 128 bytes,
compression is supported only by certain devices. Thus, it has to be
decided by checking the capability bits.

Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: match Rx completion entry size to cacheline
Yongseok Koh [Mon, 9 Oct 2017 18:46:58 +0000 (11:46 -0700)]
net/mlx5: match Rx completion entry size to cacheline

The size of Rx completion entry should match the size of a cacheline.
This is already reflected in struct mlx5_cqe by adding 64bytes padding
if a cacheline is 128bytes. Some ARM CPUs have 128bytes cacheline.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: separate shareable vector functions
Yongseok Koh [Mon, 9 Oct 2017 18:46:57 +0000 (11:46 -0700)]
net/mlx5: separate shareable vector functions

Considering more architecture (e.g. ARM and PowerPC) will be added for
vectorized Rx/Tx burst, all the shareable functions which don't use any
vector intrinsics need to be separated from architecture-dependent
functions. All the vector functions for x86 SSE are moved to a new
header file - mlx5_rxtx_vec_sse.h. And shareable common functions are
now in mlx5_rxtx_vec.c.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: use static assert for compile-time sanity checks
Yongseok Koh [Mon, 9 Oct 2017 18:46:56 +0000 (11:46 -0700)]
net/mlx5: use static assert for compile-time sanity checks

Replace compile-time sanity check with static_assert() as c11 standard
has been set. Add mlx5_rxtx_vec.h and move the sanity checks to the file

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: rename a file of SSE Rx/Tx
Yongseok Koh [Mon, 9 Oct 2017 18:46:55 +0000 (11:46 -0700)]
net/mlx5: rename a file of SSE Rx/Tx

Rename mlx5_rxtx_vec_sse.c to mlx5_rxtx_vec.c to separate shareable
vector functions.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: cleanup memory barriers
Yongseok Koh [Mon, 9 Oct 2017 18:46:54 +0000 (11:46 -0700)]
net/mlx5: cleanup memory barriers

Updating a consumer index to HW doesn't require a memory barrier in case
that there's no updated data to be posted to HW, but a compiler barrier
is sufficient. rte_wmb() is replaced with rte_io_wmb() when it makes
changes visible to HW, not other core.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: add new operations for isolated mode
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:06 +0000 (16:45 +0200)]
net/mlx5: add new operations for isolated mode

Isolated works exclusively with the generic flow API, this patch adds a
new set of operations valid in this mode.

 - promiscuous*()
 - allmulticast*()
 - reta*()
 - rss*()

are not supported in this mode as it is fully supported by generic flow
API.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: support flow director
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:05 +0000 (16:45 +0200)]
net/mlx5: support flow director

Support same functionalities as in
commit cf521eaa3c76 ("net/mlx5: remove flow director support")

This implementation is done on top of the generic flow API.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: handle RSS hash configuration in RSS flow
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:04 +0000 (16:45 +0200)]
net/mlx5: handle RSS hash configuration in RSS flow

Add RSS support according to the RSS configuration.

A special case is handled, when the pattern does not cover the RSS hash
configuration request such as:

flow create 0 ingress pattern eth / end actions rss queues 0 1 end / end

In such situation with the default configuration of testpmd RSS i.e. IP,
it should be converted to 3 Verbs flow to handle correctly the request:

 1. IPv4 flow, an extra IPv4 wildcard specification needs to be added in
    the conversion.
 2. IPv6 flow, same as for IPv4.
 3. Ethernet followed by any other protocol on which no RSS can be
    performed and thus the traffic will be redirected to the first queue
    of the user request.

The same kind of issue is handled if the RSS is performed only on UDPv4
or UDPv6 or TCPv*.

This does not handle a priority conflict which can occurs if the user
adds several colliding flow rules.  Currently in the example above, the
request is already consuming 2 priorities (1 for IPv4/IPV6 matching
rule priority and one for Ethernet matching rule priority + 1).

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: move verbs flows and attributes
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:03 +0000 (16:45 +0200)]
net/mlx5: move verbs flows and attributes

Moves ibv_attr containing the specification of the flow from Verbs point
of view also with the verbs flow itself near the related verbs objects
making the flow.

This is also a preparation to handle correctly the RSS hash
configuration provided by the user, has multiple Verbs flows will be
necessary for a single generic flow.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: reorganise functions in the file
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:02 +0000 (16:45 +0200)]
net/mlx5: reorganise functions in the file

Move mlx5_flow_validate/create/flush/isolate() to the end of the file.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use a better name for the flow parser
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:01 +0000 (16:45 +0200)]
net/mlx5: use a better name for the flow parser

struct mlx5_flow_parse was commonly used with the name "flow" confusing
sometimes the development.  The variable name is replaced by parser to
reflect its use.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: merge internal parser and actions structures
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:00 +0000 (16:45 +0200)]
net/mlx5: merge internal parser and actions structures

struct mlx5_flow_parse now embed fields from struct mlx5_flow_action.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: process flows actions before of items
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:59 +0000 (16:44 +0200)]
net/mlx5: process flows actions before of items

In case the pattern contains an RSS actions, the RSS configuration to
use is the one provided by the user.  To make the correct conversion
from DPDK RSS hash fields to Verbs ones according to the users requests
the actions must be processed first.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fully convert a flow to verbs in validate
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:58 +0000 (16:44 +0200)]
net/mlx5: fully convert a flow to verbs in validate

Validation of flows is only making few verifications on the pattern, in
some situation the validate action could end by with success whereas the
pattern could not be converted correctly.

This brings this conversion verification part also to the validate.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: remove hash Rx queues support
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:57 +0000 (16:44 +0200)]
net/mlx5: remove hash Rx queues support

From this commit the RSS support becomes un-available until it is
replaced by the generic flow implementation.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: handle a single RSS hash key for all protocols
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:56 +0000 (16:44 +0200)]
net/mlx5: handle a single RSS hash key for all protocols

Since RSS configuration can also be used by flow API, there is no more
necessity to keep a list of RSS configurable for each protocol.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use flow to enable unicast traffic
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:55 +0000 (16:44 +0200)]
net/mlx5: use flow to enable unicast traffic

RSS hash configuration is currently ignored by the PMD, this commits
removes the RSS feature.

This functionality will be added in a later commit.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use flow to enable all multi mode
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:54 +0000 (16:44 +0200)]
net/mlx5: use flow to enable all multi mode

RSS hash configuration is currently ignored by the PMD, this commits
removes the RSS feature on promiscuous mode.

This functionality will be added in a later commit.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use flow to enable promiscuous mode
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:53 +0000 (16:44 +0200)]
net/mlx5: use flow to enable promiscuous mode

RSS hash configuration is currently ignored by the PMD, this commits
removes the RSS feature on promiscuous mode.

This functionality will be added in a later commit.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix clang compilation error
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:52 +0000 (16:44 +0200)]
net/mlx5: fix clang compilation error

drivers/net/mlx5/mlx5_rxq.c:606:6: error: comparison of constant 4
      with expression of type 'enum hash_rxq_flow_type' is always true
      [-Werror,-Wtautological-constant-out-of-range-compare]
i != (int)RTE_DIM((*priv->hash_rxqs)[0].special_flow);
~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Clang expects to have an index going upto special_flow size which is
defined by MLX5_MAX_SPECIAL_FLOWS and value is 4.  Comparing to an
unrelated enum where index my be lower cause this compilation issue.

Fixes: 36351ea34b92 ("net/mlx: fix build with icc")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add hash Rx queue object
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:51 +0000 (16:44 +0200)]
net/mlx5: add hash Rx queue object

Hash Rx queue is an high level queue providing the RSS hash algorithm,
key and indirection table to spread the packets.  Those objects can be
easily shared between several Verbs flows.  This commit bring this
capability to the PMD.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: make indirection tables shareable
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:50 +0000 (16:44 +0200)]
net/mlx5: make indirection tables shareable

Indirection table in verbs side resides in a list of final work queues
to spread the packets according to an higher level queue.  This
indirection table can be shared among the hash Rx queues which points
to them.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add reference counter on DPDK Rx queues
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:49 +0000 (16:44 +0200)]
net/mlx5: add reference counter on DPDK Rx queues

Use the same design for DPDK queue as for Verbs queue for symmetry, this
also helps in fixing some issues like the DPDK release queue API which
is not expected to fail.  With such design, the queue is released when
the reference counters reaches 0.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add reference counter on DPDK Tx queues
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:48 +0000 (16:44 +0200)]
net/mlx5: add reference counter on DPDK Tx queues

Use the same design for DPDK queue as for Verbs queue for symmetry, this
also helps in fixing some issues like the DPDK release queue API which
is not expected to fail.  With such design, the queue is released when
the reference counters reaches 0.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: separate DPDK from verbs Tx queue objects
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:47 +0000 (16:44 +0200)]
net/mlx5: separate DPDK from verbs Tx queue objects

Move verbs object to their own functions to allocate/release them
independently from the DPDK queue.  At the same time a reference counter
is added to help in issues detections when the queue is being release
but still in use somewhere else (flows for instance).

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: separate DPDK from verbs Rx queue objects
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:46 +0000 (16:44 +0200)]
net/mlx5: separate DPDK from verbs Rx queue objects

Move verbs object to their own functions to allocate/release them
independently from the DPDK queue.  At the same time a reference counter
is added to help in issues detections when the queue is being release
but still in use somewhere else (flows for instance).

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add reference counter on memory region
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:45 +0000 (16:44 +0200)]
net/mlx5: add reference counter on memory region

This patch introduce the Memory region as a shared object where users
should get a reference to it by calling the priv_mr_get() or
priv_mr_new() to create the memory region.  This last one will
register the memory pool in the kernel driver and retrieve the
associated memory region.

This should help to reduce the memory consumption cause by registering
multiple times the same memory pool.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix SSE Rx support verification
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:44 +0000 (16:44 +0200)]
net/mlx5: fix SSE Rx support verification

The number of queues in DPDK does not means that the array of queue will be
totally filled, those information are uncorrelated.  The number of queues
is provided in the port configuration whereas the array is filled by
calling tx/rx_queue_setup().  As this number of queue is not increased or
decrease according to tx/rx_queue_setup() or tx/rx_queue_release(), PMD
must consider a queue may not be initialised in some position of the array.

Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix crash during RETA update
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:43 +0000 (16:44 +0200)]
net/mlx5: fix crash during RETA update

Reta update needs to stop/start the port but stopping the port does not
disable the polling functions which may end in a segfault if a core is
polling the queue while the control thread is modifying it.

This patch changes the sequences to an order where such situation cannot
happen.

Fixes: aa13338faf5e ("net/mlx5: rebuild flows on updating RETA")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: verify all flows are been removed on close
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:42 +0000 (16:44 +0200)]
net/mlx5: verify all flows are been removed on close

Debug tools to verify all flows are be un-register from the NIC.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: remove redundant started flag
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:41 +0000 (16:44 +0200)]
net/mlx5: remove redundant started flag

This flag is already present in the Ethernet device.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: prefix Tx structures and functions
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:40 +0000 (16:44 +0200)]
net/mlx5: prefix Tx structures and functions

Prefix struct txq_ctrl and associated function with mlx5.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: prefix Rx structures and functions
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:39 +0000 (16:44 +0200)]
net/mlx5: prefix Rx structures and functions

Prefix struct rxq_ctrl and associated functions with mlx5.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: remove flow director support
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:38 +0000 (16:44 +0200)]
net/mlx5: remove flow director support

Generic flow API should be use for flow steering as is provides a better
and easier way to configure flows.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: merge action and flow parser structure
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:37 +0000 (16:44 +0200)]
net/mlx5: merge action and flow parser structure

mlx5_flow_create() and mlx5_flow_validate() are making common checks.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agoapp/testpmd: fix build with i40e disabled
Kirill Rybalchenko [Mon, 9 Oct 2017 14:38:02 +0000 (15:38 +0100)]
app/testpmd: fix build with i40e disabled

Precompiler instructions #ifdef RTE_LIBRTE_I40E_PMD ... #endif
were not placed correctly, which caused number of
compilation errors if I40E PMD is disabled.

Fixes: 5a4806d304e0 ("app/testpmd: support updating pctype mapping")

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agonet/bnxt: fix build
Mark Kavanagh [Mon, 9 Oct 2017 13:59:30 +0000 (14:59 +0100)]
net/bnxt: fix build

For gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7),
As of 5ef3b79fdfe6f, compilation of DPDK fails with the following
ERROR MESSAGE:
"bnxt_filter.c:960:117: error: ‘vnic’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]".

Resolve this by initializing 'vnic' to NULL;

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
7 years agoapp/testpmd: fix quitting in container
Phil Yang [Fri, 22 Sep 2017 06:21:32 +0000 (14:21 +0800)]
app/testpmd: fix quitting in container

In container, the process cannot be terminated by SIGINT/SIGTERM when
execute with 'stats-period' option.
Fixed by adding a flag to exit stats period loop after received either
SIGINT or SIGTERM.

Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
7 years agoapp/testpmd: fix forward port ids setting
Matan Azrad [Sun, 3 Sep 2017 13:19:07 +0000 (16:19 +0300)]
app/testpmd: fix forward port ids setting

The corrupted code didn't check the port availability when
it was trying to set the forward port IDs array.
However, when it was counting the number of ports, the availability
was checked by RTE_ETH_FOREACH_DEV iterator.

Hence, even when ETH devices ports were not in ATTACHED state,
the testpmd tried to forward traffic by them and got segmentation
fault at queue access time.

For example:
When EAL command line parameters include two devices, the first
is failsafe with two sub devices and the second is any device,
testpmd gets two devices by the iterator and sets for forwarding
both, the failsafe device and the failsafe first sub device
(instead of the second sub device).
After the first failsafe sub device state was changed to DEFERRED,
testpmd tries to forward traffic through the deferred device
because it didn't check the port availability in setting time.

The fix uses the RTE_ETH_FOREACH_DEV iterator for the forward
port IDs default setting.

Fixes: cb894d99eceb ("ethdev: add deferred intermediate device state")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agoapp/testpmd: fix invalid port id parameters
Li Han [Tue, 22 Aug 2017 05:03:42 +0000 (13:03 +0800)]
app/testpmd: fix invalid port id parameters

in parse_ringnuma_config/parse_portnuma_config functions, port_id
should be less than RTE_MAX_ETHPORTS, but port_id_is_invalid check
assumes that port_id may be RTE_PORT_ALL (65535).

Also fix port_id storage size.

Fixes: 4468635fdd04 ("app/testpmd: forbid actions on invalid port")
Cc: stable@dpdk.org
Signed-off-by: Li Han <han.li1@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoapp/testpmd: fix DDP package filesize detection
Daniel Mrzyglod [Fri, 18 Aug 2017 14:17:36 +0000 (16:17 +0200)]
app/testpmd: fix DDP package filesize detection

This issue was about passing unsigned argument where should be signed
number.
In reality this is about wrong usage of fseek and ftell to determine
filesize.
This patch is compliant to suggestions from FIO19-C:
"Do not use fseek() and ftell() to compute the size of a regular file"

Coverity issue: 143454
Fixes: a92a5a2cbbff ("app/testpmd: add command for loading DDP")
Cc: stable@dpdk.org
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/qede/base: update base driver version to 8.30.8.0
Rasesh Mody [Sat, 7 Oct 2017 06:31:12 +0000 (23:31 -0700)]
net/qede/base: update base driver version to 8.30.8.0

This patch updates the base driver version to 8.30.8.0.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: fix return code to align with FW
Rasesh Mody [Sat, 7 Oct 2017 06:31:11 +0000 (23:31 -0700)]
net/qede/base: fix return code to align with FW

This change aligns the PF behavior with that of the L2-fw, so that flows
(to remove an incorrect MAC) for PF and VF could remain the same.

Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: fix for VF malicious indication
Rasesh Mody [Sat, 7 Oct 2017 06:31:10 +0000 (23:31 -0700)]
net/qede/base: fix for VF malicious indication

IOV regression testing led to discovery of a minor issue + possibly race
in IOV flows:
 a. Malicious indications in VF-database on PF-side get cleared during
    FLR flows - but not when disabling SRIOV. At least in Linux if you
    disable IOV while having a malicious VF you wouldn't be able to
    clear the indication as driver would prevent from initializing it.
 b. Possible race during PF response to VF - the channel is made ready
    only after sending the rc via dmae to VF. It's possible due to
    context switch at end of DMAE [when releasing Mutex] that VF would
    start running and send another message prior to PF clearing the
    channel, making the FW consider that VF to be malicious.

This patch fixes that by
 - clearing the indication even if we're only going to disable VF
 - resetting the channel to ready before PF copies the rc to the VF, PF
   can then continue and send an additional message

Fixes: 47b302d64624 ("net/qede/base: add handling of malicious VF")
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: fix access to an uninitialized list
Rasesh Mody [Sat, 7 Oct 2017 06:31:09 +0000 (23:31 -0700)]
net/qede/base: fix access to an uninitialized list

Fix an access to an uninitialized list when the management FW is not
initialized by simply doing the list initialization always, at a
previous step, before ecore_mcp_cmd_init() can stop in the middle and
return.

Fixes: 22c996968bf7 ("net/qede/base: revise management FW mbox access scheme")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: change default page size of ILT clients
Rasesh Mody [Sat, 7 Oct 2017 06:31:08 +0000 (23:31 -0700)]
net/qede/base: change default page size of ILT clients

Change the default page size of internal lookup table (ILT) clients to
64K

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: check device personality for feature setting
Rasesh Mody [Sat, 7 Oct 2017 06:31:07 +0000 (23:31 -0700)]
net/qede/base: check device personality for feature setting

- Add non-L2 personality macros and add a personality check before
  setting the HW features

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: code cleanup
Rasesh Mody [Sat, 7 Oct 2017 06:31:06 +0000 (23:31 -0700)]
net/qede/base: code cleanup

- Remove some dead definitions, function declarations and unused
   variables
 - Remove an obsolete workaround from ecore_int_igu_enable()
 - Remove set variables that are not used
 - Remove needless check in  ecore_init_wfq_param() when configuring
   minimum vport BW. We already check whether total for all vports is
   greater than the PF's, so no need to check independently the current
   requested configuration as well.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: semantic changes
Rasesh Mody [Sat, 7 Oct 2017 06:31:05 +0000 (23:31 -0700)]
net/qede/base: semantic changes

- Move define CRC8_TABLE_SIZE to header file
 - Move/relocate ecore_vf_start()
 - Other semantic changes

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add/change/revise logs
Rasesh Mody [Sat, 7 Oct 2017 06:31:04 +0000 (23:31 -0700)]
net/qede/base: add/change/revise logs

Changes include:
 - adding new log to print Dcbx version
 - reformatting log in ecore_dmae_operation_wait() in case of DMA engine
   failure
 - changing verbosity of some log messages such as:
   VFs incorrect behavior should be logged on PF with DP_VERBOSE(), not
   DP_NOTICE(). In general keep IOV-related logs at low verbosity.
   Log the critical issues from VF perspective, like message to PF
   times-out or the PF rejects the VF configuration, as NOTICE than
   VERBOSE
 - Add a printout of some MCP CPU info in case of no MFW response

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add/fix comments
Rasesh Mody [Sat, 7 Oct 2017 06:31:03 +0000 (23:31 -0700)]
net/qede/base: add/fix comments

Fix few comments and add a new one describing SW channel implementation
limitation

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add various OS abstraction macros
Rasesh Mody [Sat, 7 Oct 2017 06:31:02 +0000 (23:31 -0700)]
net/qede/base: add various OS abstraction macros

- Introduce OSAL_IOV_VF_VPORT_STOP to allow VF to carry out required
   operations and prevent a potential assert before closing vport
 - Add OSAL_DIV_S64() for 64-bit division on 32-bit platforms.
 - Add OSAL for transceiver update OSAL_TRANSCEIVER_UPDATE()
 - Add OSAL for MFW command preemption OSAL_MFW_CMD_PREEMPT() within the
   spinning loops while sending a mailbox command to the MFW
 - Implement OSAL_SPIN_LOCK_IRQSAVE macro
 - Rename OSAL_NUM_ACTIVE_CPU() to OSAL_NUM_CPUS()

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: use the correct size value
Rasesh Mody [Sat, 7 Oct 2017 06:31:01 +0000 (23:31 -0700)]
net/qede/base: use the correct size value

Use the correct size value while copying chassis/port id values.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add check for DMA engine state
Rasesh Mody [Sat, 7 Oct 2017 06:31:00 +0000 (23:31 -0700)]
net/qede/base: add check for DMA engine state

Check DMA engine state to verify it is not called before it is
initialized

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add LLDP support
Rasesh Mody [Sat, 7 Oct 2017 06:30:59 +0000 (23:30 -0700)]
net/qede/base: add LLDP support

This patch adds base driver LLDP protocol support and handle LLDP
received TLV update events.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: introduce HW/SW channel
Rasesh Mody [Sat, 7 Oct 2017 06:30:58 +0000 (23:30 -0700)]
net/qede/base: introduce HW/SW channel

Introduce 2 new API functions, one for the VF and the other for
PF [per-VF] which allows to decide whether to use HW/SW channel
for PF<->VF communication(a per-VF configuration). A HyperV might
have different VMs with different requirements.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add NVRAM config options
Rasesh Mody [Sat, 7 Oct 2017 06:30:57 +0000 (23:30 -0700)]
net/qede/base: add NVRAM config options

Add NVRAM config options:
 - Rename caution temperature threshold
 - New field EXT_PHY_MDI_PAIR_SWAP
 - BCM54220 1GBT PHY

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add xcvr type and DON FW defines
Rasesh Mody [Sat, 7 Oct 2017 06:30:56 +0000 (23:30 -0700)]
net/qede/base: add xcvr type and DON FW defines

Add support to firmware for:
 - New SFP type 1000BaseT
 - DON (Diag Over Network). This feature implements a server side for
   process data access commands over Ethernet.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agodoc: add octeontx ethdev driver documentation
Jerin Jacob [Sun, 8 Oct 2017 12:44:30 +0000 (18:14 +0530)]
doc: add octeontx ethdev driver documentation

Adding octeontx ethdev driver documentation and claim octeontx ethdev
driver maintainership.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/octeontx: add start and stop support
Jerin Jacob [Sun, 8 Oct 2017 12:44:29 +0000 (18:14 +0530)]
net/octeontx: add start and stop support

add start, stop and close support.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add packet type parsing support
Jerin Jacob [Sun, 8 Oct 2017 12:44:28 +0000 (18:14 +0530)]
net/octeontx: add packet type parsing support

Mark packet type parsing in features.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add packet receive burst function
Jerin Jacob [Sun, 8 Oct 2017 12:44:27 +0000 (18:14 +0530)]
net/octeontx: add packet receive burst function

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add packet transmit burst function
Jerin Jacob [Sun, 8 Oct 2017 12:44:26 +0000 (18:14 +0530)]
net/octeontx: add packet transmit burst function

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add Tx queue setup and release ops
Jerin Jacob [Sun, 8 Oct 2017 12:44:25 +0000 (18:14 +0530)]
net/octeontx: add Tx queue setup and release ops

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add Tx queue start and stop
Jerin Jacob [Sun, 8 Oct 2017 12:44:24 +0000 (18:14 +0530)]
net/octeontx: add Tx queue start and stop

Mark "Queue start/stop" as P as its been implemented only for tx queue.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add Rx queue setup and release ops
Jerin Jacob [Sun, 8 Oct 2017 12:44:23 +0000 (18:14 +0530)]
net/octeontx: add Rx queue setup and release ops

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add MAC addr set op
Jerin Jacob [Sun, 8 Oct 2017 12:44:22 +0000 (18:14 +0530)]
net/octeontx: add MAC addr set op

Implement "mac_addr_set" op and mark "Unicast MAC filter" feature as "P"
as "mac_addr_add" and "mac_addr_remove" are not implemented.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add basic stats support
Jerin Jacob [Sun, 8 Oct 2017 12:44:21 +0000 (18:14 +0530)]
net/octeontx: add basic stats support

Mark Basic stats support in features.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add promiscuous mode ops
Jerin Jacob [Sun, 8 Oct 2017 12:44:20 +0000 (18:14 +0530)]
net/octeontx: add promiscuous mode ops

Mark Promiscuous mode in features.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add link update
Jerin Jacob [Sun, 8 Oct 2017 12:44:19 +0000 (18:14 +0530)]
net/octeontx: add link update

Mark Link status in features.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add device info
Jerin Jacob [Sun, 8 Oct 2017 12:44:18 +0000 (18:14 +0530)]
net/octeontx: add device info

Mark Speed capabilities, Lock-free Tx queue in features.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add device configure
Jerin Jacob [Sun, 8 Oct 2017 12:44:17 +0000 (18:14 +0530)]
net/octeontx: add device configure

mark Jumbo frame, CRC offload support in features.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: create ethdev ports
Jerin Jacob [Sun, 8 Oct 2017 12:44:16 +0000 (18:14 +0530)]
net/octeontx: create ethdev ports

Create ethdev ports by registering  withethdev subsystem based on
"nr_port" vdev argument or maximum physical ports available in the system.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add net device probe and remove
Jerin Jacob [Sun, 8 Oct 2017 12:44:15 +0000 (18:14 +0530)]
net/octeontx: add net device probe and remove

An octeontx ethdev device consists of multiple PKO VF devices, a PKI
VF device and multiple SSOVF devices which shared between eventdev.
This patch adds a vdev based device called "eth_octeontx" which
will create multiple ethernet ports based on "nr_port" or maximum
physical ports are available in the system.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: add remaining PKO operations
Jerin Jacob [Sun, 8 Oct 2017 12:44:14 +0000 (18:14 +0530)]
net/octeontx/base: add remaining PKO operations

Adding remaining PKO operations like flow control, Tx channel query,
etc.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: add base PKO operations
Jerin Jacob [Sun, 8 Oct 2017 12:44:13 +0000 (18:14 +0530)]
net/octeontx/base: add base PKO operations

PKO is the packet output processing unit, which receives the packet
from the core and sends to the BGX interface. This patch adds the
basic PKO operation like open, close, start and stop. These operations
are implemented through mailbox messages and kernel PF driver being the
server to process the message with the logical port identifier.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: add remaining PKI operations
Jerin Jacob [Sun, 8 Oct 2017 12:44:12 +0000 (18:14 +0530)]
net/octeontx/base: add remaining PKI operations

Adding remaining PKI operations and sync up the mailbox
definitions with PF driver.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: add base PKI operations
Jerin Jacob [Sun, 8 Oct 2017 12:44:11 +0000 (18:14 +0530)]
net/octeontx/base: add base PKI operations

PKI is packet input unit, which receives the packet from the
BGX interface. This patch adds the basic PKI operation like
open, close, start and stop. These operations are implemented through
mailbox messages and kernel PF driver being the server to process the
message with the logical port identifier.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: probe PKI and PKO PCIe VF devices
Jerin Jacob [Sun, 8 Oct 2017 12:44:10 +0000 (18:14 +0530)]
net/octeontx/base: probe PKI and PKO PCIe VF devices

An octeontx ethdev device consists of multiple PKO VF devices and an PKI
VF device. On Octeontx HW, each Rx queues are enumerated as SSOVF device
which is exposed as event_octeontx device, Tx queues are enumerated as
PKOVF device, and ingress packet configuration is accomplished through
PKIVF device.

In order to expose as an single ethdev instance, On PCIe VF probe,
the driver stores the information associated with the PCIe VF device and
later with vdev infrastructure creates ethdev device with earlier
probed PCIe VF device.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: add remaining BGX operations
Jerin Jacob [Sun, 8 Oct 2017 12:44:09 +0000 (18:14 +0530)]
net/octeontx/base: add remaining BGX operations

Adding remaining BGX operations like, link status, statistics,
promiscuous configuration etc.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: add base BGX operations
Jerin Jacob [Sun, 8 Oct 2017 12:44:08 +0000 (18:14 +0530)]
net/octeontx/base: add base BGX operations

BGX is an HW MAC interface. This patch adds the basic BGX operation like
open, close, start and stop. These operations are implemented through
mailbox messages and kernel PF driver being the server to process the
message with the physical port identifier.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agoevent/octeontx: introduce specialized mbox message copy
Jerin Jacob [Sun, 8 Oct 2017 12:44:07 +0000 (18:14 +0530)]
event/octeontx: introduce specialized mbox message copy

Some of the internal toolchain versions create unaligned
memory access fault when copying from 17-31B buffer using memcpy.

Subsequent patches in this series will be using 17-31B mbox message.
Since the mailbox message copy comes in slow path, changing memcpy to
byte-per-byte copy to workaround the issue.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx/base: add octeontx IO operations
Jerin Jacob [Sun, 8 Oct 2017 12:44:06 +0000 (18:14 +0530)]
net/octeontx/base: add octeontx IO operations

Adding octeontx specific io operations. Added a stub for building
against non octeontx targets.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agonet/octeontx: add build infrastructure
Jerin Jacob [Sun, 8 Oct 2017 12:44:05 +0000 (18:14 +0530)]
net/octeontx: add build infrastructure

Adding bare minimum PMD library and doc build infrastructure.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agoapp/testpmd: give more hint on invalid RETA size
Yuanhan Liu [Fri, 7 Jul 2017 06:02:13 +0000 (14:02 +0800)]
app/testpmd: give more hint on invalid RETA size

Print the valid RTE size range so that user knows what goes wrong.

Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
7 years agoapp/testpmd: allow to query any RETA size
Yuanhan Liu [Fri, 7 Jul 2017 06:02:12 +0000 (14:02 +0800)]
app/testpmd: allow to query any RETA size

Currently, testpmd just allows to query the RETA info only when the
required size equals to configured RETA size.

This patch allows to query any RETA size <= the configured size. This
helps when the RETA size is big (say 512) and when I just want to peak
few RETA entries.

Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agodoc: add GSO programmer's guide
Mark Kavanagh [Sat, 7 Oct 2017 14:56:44 +0000 (22:56 +0800)]
doc: add GSO programmer's guide

Add programmer's guide doc to explain the design and use of the
GSO library.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
7 years agoapp/testpmd: enable TCP/IPv4 VxLAN and GRE GSO
Jiayu Hu [Sat, 7 Oct 2017 14:56:43 +0000 (22:56 +0800)]
app/testpmd: enable TCP/IPv4 VxLAN and GRE GSO

This patch adds GSO support to the csum forwarding engine. Oversized
packets transmitted over a GSO-enabled port will undergo segmentation
(with the exception of packet-types unsupported by the GSO library).
GSO support is disabled by default.

GSO support may be toggled on a per-port basis, using the command:

        "set port <port_id> gso on|off"

The maximum packet length (including the packet header and payload) for
GSO segments may be set with the command:

        "set gso segsz <length>"

Show GSO configuration for a given port with the command:

"show port <port_id> gso"

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
7 years agogso: support GRE GSO
Mark Kavanagh [Sat, 7 Oct 2017 14:56:42 +0000 (22:56 +0800)]
gso: support GRE GSO

This patch adds GSO support for GRE-tunneled packets. Supported GRE
packets must contain an outer IPv4 header, and inner TCP/IPv4 headers.
They may also contain a single VLAN tag. GRE GSO doesn't check if all
input packets have correct checksums and doesn't update checksums for
output packets. Additionally, it doesn't process IP fragmented packets.

As with VxLAN GSO, GRE GSO uses a two-segment MBUF to organize each
output packet, which requires multi-segment mbuf support in the TX
functions of the NIC driver. Also, if a packet is GSOed, GRE GSO reduces
its MBUF refcnt by 1. As a result, when all of its GSOed segments are
freed, the packet is freed automatically.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
7 years agogso: support VxLAN GSO
Mark Kavanagh [Sat, 7 Oct 2017 14:56:41 +0000 (22:56 +0800)]
gso: support VxLAN GSO

This patch adds a framework that allows GSO on tunneled packets.
Furthermore, it leverages that framework to provide GSO support for
VxLAN-encapsulated packets.

Supported VxLAN packets must have an outer IPv4 header (prepended by an
optional VLAN tag), and contain an inner TCP/IPv4 packet (with an optional
inner VLAN tag).

VxLAN GSO doesn't check if input packets have correct checksums and
doesn't update checksums for output packets. Additionally, it doesn't
process IP fragmented packets.

As with TCP/IPv4 GSO, VxLAN GSO uses a two-segment MBUF to organize each
output packet, which mandates support for multi-segment mbufs in the TX
functions of the NIC driver. Also, if a packet is GSOed, VxLAN GSO
reduces its MBUF refcnt by 1. As a result, when all of its GSO'd segments
are freed, the packet is freed automatically.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>