Add basic init and uninit function which includes
initializing fields of ethdev private structure.
Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Adding bare minimum PMD library and doc build infrastructure
and claim the maintainership for octeontx end point PMD.
Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Device id to be probed by octeontx_ep raw device pmd is changed from
B203 to B204. B203 is for octeontx_ep net device pmd to probe.
Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Add per-tx-ring flag for packets that were pushed to HW but await
doorbell. That is to prevent a situation when a doorbell is sent due to
reaching Tx burst threshold and next send fails (e.g., due to queue
full). In such case we shouldn't send another doorbell because there are
no actual packets waiting for transmission.
Fixes: c7519ea5eb ("net/ena: call additional doorbells if needed")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Before starting transmission of Tx burst, the driver checked the
available space in the sq and limited the number of packets for
transmission accordingly.
The calculation was incorrect for fragmented packets and potentially had
significantly limited the length of Tx bursts.
This patch removes the assessment and pushes packets to the sq as long
as the burst is not exhausted and space is available in the sq.
Correct evaluation of the required space isn't possible before the burst
because it depends on the number of segments of each packet.
This patch adds per-packet space evaluation for each packet before
attempting to process it. In case there is not enough queue space, the
burst will just stop without error.
Fixes: 2061fe41f2 ("net/ena: linearize Tx mbuf")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Instead of verifying the Rx descriptor each time it's being used in the
driver code, now the verification happens on the HAL side.
This simplifies code a lot as instead of doing 2 validations, only
single one is needed. The driver have to check the rc value returned
by the ena_com upon reading the Rx descriptor and trigger the reset
if needed. It was previously the responsibility of the
validate_rx_req_id() function.
As part of the change, the version of the driver was bumped to v2.2.1.
Fixes: 2061fe41f2 ("net/ena: linearize Tx mbuf")
Cc: stable@dpdk.org
Signed-off-by: Ido Segev <idose@amazon.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Increment Tx doorbell statistics on tx_pkt_burst
after writing to doorbell and in case max burst size achieved
Fixes: c7519ea5eb ("net/ena: call additional doorbells if needed")
Cc: stable@dpdk.org
Signed-off-by: Amit Bernstein <amitbern@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
As the refill called as part of ena_start(), we end up the refill
progress with stuck buffers at the caller core cache.
Calling to flush the cache results with invalidate this cache and free
those stuck buffers.
Fixes: 1173fca25a ("ena: add polling-mode driver")
Cc: stable@dpdk.org
Signed-off-by: Ido Segev <idose@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
For newer smartNIC NVRAM versions the chip model should be read from the
PluDevice register as it provides the authoritative chip model/revision.
This method of reading the chip model is backwards compatible with
legacy NVRAM versions too.
Since the model number is purely used for reporting purposes, follow the
hardware team convention of subtracting 0x10 from the PluDevice register
to obtain the chip model/revision number.
Fixes: c7e9729da6 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Louis Peens <louis.peens@netronome.com>
In interactive mode, if testpmd exit by calling rte_exit without
restore terminal attributes, terminal will not echo keyboard input.
register a function with atexit() in prompt(), when exit() in
rte_exit() is called, the registered function restores terminal
attributes.
Fixes: 5a8fb55c48 ("app/testpmd: support unidirectional configuration")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
When testing high performance numbers, it is often that CPU performance
limits the max values device can reach (both in pps and in gbps)
Here instead of recreating each packet separately, we use clones counter
to resend the same mbuf to the line multiple times.
PMDs handle that transparently due to reference counting inside of mbuf.
Reaching max PPS on small packet sizes helps here:
Some data from our 2 port x 50G device. Using 2*6 tx queues, 64b packets,
PowerEdge R7525, AMD EPYC 7452:
./build/app/dpdk-testpmd -l 32-63 -- --forward-mode=flowgen \
--rxq=6 --txq=6 --disable-crc-strip --burst=512 \
--flowgen-clones=0 --txd=4096 --stats-period=1 --txpkts=64
Gives ~46MPPS TX output:
Tx-pps: 22926849 Tx-bps: 11738590176
Tx-pps: 23642629 Tx-bps: 12105024112
Setting flowgen-clones to 512 pushes TX almost to our device
physical limit (68MPPS) using same 2*6 queues(cores):
Tx-pps: 34357556 Tx-bps: 17591073696
Tx-pps: 34353211 Tx-bps: 17588802640
Doing similar measurements per core, I see one core can do
6.9MPPS (without clones) vs 11MPPS (with clones)
Verified on Marvell qede and atlantic PMDs.
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
"port config all max-pkt-len" command fails because it doesn't set the
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag properly.
Commit in the fixes line moved the 'DEV_RX_OFFLOAD_JUMBO_FRAME' offload
flag update from 'cmd_config_max_pkt_len_parsed()' to 'init_config()'.
'init_config()' function is only called during testpmd startup, but the
flag status needs to be calculated whenever 'max_rx_pkt_len' changes.
The issue can be reproduced as [1], where the 'max-pkt-len' reduced and
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag should be cleared but it
didn't.
Adding the 'update_jumbo_frame_offload()' helper function to update
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag and 'max_rx_pkt_len'. This
function is called both by 'init_config()' and
'cmd_config_max_pkt_len_parsed()'.
Default 'max-pkt-len' value set to zero, 'update_jumbo_frame_offload()'
updates it to "RTE_ETHER_MTU + PMD specific Ethernet overhead" when it
is zero.
If '--max-pkt-len=N' argument provided, it will be used instead.
And with each "port config all max-pkt-len" command, the
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag, 'max-pkt-len' and MTU is
updated.
[1]
--------------------------------------------------------------------------
dpdk-testpmd -c 0xf -n 4 -- -i --max-pkt-len=9000 --tx-offloads=0x8000
--rxq=4 --txq=4 --disable-rss
testpmd> set verbose 3
testpmd> port stop all
testpmd> port config all max-pkt-len 1518
testpmd> port start all
// Got fail error info without this patch
Configuring Port 0 (socket 1)
Ethdev port_id=0 rx_queue_id=0, new added offloads 0x800 must be
within per-queue offload capabilities 0x0 in rte_eth_rx_queue_setup()
Fail to configure port 0 rx queues //<-- Fail error info;
--------------------------------------------------------------------------
Bugzilla ID: 625
Fixes: 761c4d6690 ("app/testpmd: fix max Rx packet length for VLAN packets")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Tested-by: Bo Chen <box.c.chen@intel.com>
Here uses %d as printing output for enumeration member.
Fixes: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Rename some function about RSS implement functions
in order to make the functions naming style more
reasonable and consistency.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
For Kunpeng930, the NIC engine support 1280 tqps being taken over by
a PF. In this case, a maximum of 1281 interrupt resources are also
supported in this PF. To support the maximum number of queues, several
patches are made. But the interrupt related modification are missing.
So, in RX interrupt mode, a large number of queues will be aggregated
into one interrupt due to insufficient interrupts. It will lead to
waste of interrupt resources and reduces usability.
To utilize all these interrupt resources, related IMP command has been
extended. And, the I/O address of the extended interrupt resources are
different from the existing ones. So, a function used for calculating
the address offset has been added.
Fixes: 76d794566d ("net/hns3: maximize queue number")
Fixes: 27911a6e62 ("net/hns3: add Rx interrupts compatibility")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
The secondary process is applied a memory for the process_private
during initialization. Therefore, the memory needs to be released
when exiting.
Fixes: c203571b36 ("net/hns3: register and add log interface")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Here encapsulate the process code of the imp reset report and
global reset report into function in order to reduce the
complexity of the hns3_check_event_cause function.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
When parse flow director with all types, it needs to judge the spec
of item and mask of item for all packet types. The judgement is the
same for all types. Therefore, we move it into the concentrated
location.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
This patch reconstruct the Rx interrupt map to reduce the cyclic
complexity and improve readability and maintainability.
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Here moves some judgement conditions to a separated function
for parsing IPv4 hdr and TCP hdr in hns3_parse_normal function.
Also, move the check of the selected input tuple of RSS to a
separated functions named hns3_rss_input_tuple_supported
in order to enhance scalability and complexity.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Use errno array instead of switch-case for refactor
the hns3_cmd_convert_err_code function.
Besides, we add a type for ROH(RDMA Over HCCS) check
cmdq return error in Kunpeng930 NIC hardware.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
One of the hot discussions in community recently was moving queue stats
to xstats. In this solution, a temporary
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag is created to implement
the smooth switch. And the first half of this work has been completed in
the ethdev framework. Now driver needs to remove the flag from the
driver initialization process and does the rest of work.
For better readability and reasonability, per-queue stats also should be
cleared when rte_eth_stats is cleared. Otherwise, the sum of one item in
per-queue stats may be greater than corresponding item in rte_eth_stats.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
pkt_len_errors and l2_errors in Rx datapath indicate that driver
needs to discard received packets. And driver does not discard
packets for l3/l4/ol3/ol4_csum_errors in Rx datapath and others
stats in Tx datapath. Therefore, it is necessary for improving
code readability and maintainability to encapsulate error stats
and dfx stats.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
When the RSS with null key was set in sample actions list, it
caused the segmentation fault since the RSS key pointer was
NULL while did the memory copy.
This patch adds the RSS key NULL pointer checking before copying
to fix the segmentation fault issue.
Fixes: 11b1b0edda ("app/testpmd: support RSS in sample action")
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
The original code causes wrong value to be set into PFQF_HENA
register because unnecessary calling to get translated pctype
value for X722 NIC. As a result RSS is not working.
So remove the unnecessary translation.
Fixes: ef4c16fd91 ("net/i40e: refactor RSS flow")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
The PF will set the VLAN mode globally, DCF just needs to get the VLAN
mode.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
In order to optimize number of hops in the steering tables there
was the hint field of source vport in the matcher. If this hint
was provided for the wire port the actual vport match, used by
kernel, was not set in the matcher metadata register field.
This could led to not creating the rule in hardware and E-Switch
malfunction if kernel used non-zero metadata value for the wire
vport.
This patch always sets the match for the vport metadata register
value besides the hint.
Fixes: aaf34de5d8 ("net/mlx5: add wire vport hint")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Add support for new MODIFY_FIELD action to the Mellanox PMD.
This is the generic API that allows to manipulate any packet
header field by copying data from another packet field or
mark, metadata, tag, or immediate value (or pointer to it).
Since the API is generic and covers a lot of action under its
umbrella it makes sense to implement all the mechanics gradually
in order to move to this API for any packet field manipulations
in the future. This is the first step of RTE flows consolidation.
The modify field RTE flow action supports three operations: set,
add and sub. This patch brings to live only the "set" operation.
Support is provided for any packet header field as well as
meta/tag/mark and immediate value can be used as a source.
There are few limitations for this first version of API support:
- encapsulation levels are not supported, just outermost header
can be manipulated for now.
- offsets can only be 4-bytes aligned: 32, 64 and 96 for IPv6.
- the special ITEM_START ID is not supported as we do not allow
to cross packet header field boundaries yet.
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Define hardware ID for GTP TEID modification. This value
can be used later in the RTE modify field API.
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
If the count action was presented in sample actions list, MLX5 PMD
created the counter resource and saved the index of counter in the
sample resource only, the counter index of flow was not updated.
This patch removes the counter index in the sampler resource and
saves it into the flow, and adds the checking to make sure only one
count be created once per flow, it's used for all sample sub flows.
Fixes: 0756228b27 ("net/mlx5: update translate function for sample action")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Extend config file with 'fill_bpool_buffs'
which control the amount of refill buffers
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
'global_default' is only being used for 'qos'
so adding 'qos' into its name
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Extend the config file with option to forward packets
that were marked as "l2 bad pkts".
By default the driver drop those packets
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
In case ppio was not initialized yet (only at 'start' function)
the flow-ctrl setting should be saved for later stage.
Signed-off-by: Liron Himi <lironh@marvell.com>
Expose max-MTU based on the max frame size that
l4 checksum generation can be done by HW.
Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Currently the HW is configured with only one pool which its
buffer size may be larger than the rx-fifo-size.
In that situation, frame size larger than the fifo-size
is gets dropped due to fifo overrun.
This is cause because the HW works in cut-through mode which
waits to have in the fifo at least the amount of bytes as define
in the smallest pool's buffer size.
This patch add a dummy pool which its buffer size
is very small (smaller than 64B frame). This tricks the HW and
any frame size is gets passed from the FIFO to the PP2.
Signed-off-by: Liron Himi <lironh@marvell.com>