summaryrefslogtreecommitdiff
path: root/lib/librte_mbuf
AgeCommit message (Collapse)Author
2019-04-02mbuf: add function to generate raw Tx offload valueKonstantin Ananyev
Operations to set/update bit-fields often cause compilers to generate suboptimal code. To help avoid such situation for tx_offload fields: introduce new enum for tx_offload bit-fields lengths and offsets, and new function to generate raw tx_offload value. Add new test-case into UT for introduced function. Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-04-02mbuf: remove Intel offload checks from generic APIAndrew Rybchenko
rte_validate_tx_offload() is used in Tx prepare callbacks (RTE_LIBRTE_ETHDEV_DEBUG only) to check Tx offloads consistency. Requirement that packet headers should not be fragmented is not documented and unclear where it comes from except rte_net_intel_cksum_prepare() functions which relies on it. It could be NIC vendor specific driver or hardware limitation, but, if so, it should be documented and checked in corresponding Tx prepare callbacks. Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-02-12mbuf: fix a typoRami Rosen
This trivial patch fixes a typo in rte_mbuf.h. Fixes: f20b50b946da ("mbuf: optimize refcnt update") Cc: stable@dpdk.org Signed-off-by: Rami Rosen <ramirose@gmail.com>
2019-01-28mbuf: fix struct initialization with C++Ed Czeck
g++ reports "error: missing initializer for member" Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
2019-01-15mbuf: add function returning buffer addressYongseok Koh
This patch introduces two new functions - rte_mbuf_buf_addr() and rte_mbuf_data_addr_default(). rte_mbuf_buf_addr() reutrns the buffer address of given mbuf which comes after mbuf structure and private data. rte_mbuf_data_addr_default() returns the default address of mbuf data taking the headroom into account. Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
2019-01-15mbuf: add a non fatal sanity check helperDavid Marchand
Let's add a little helper that does the same as rte_mbuf_sanity_check but without the panic. Signed-off-by: David Marchand <david.marchand@6wind.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-01-15mbuf: add sanity checks on segment metadataDavid Marchand
Add some basic checks on the segments offset and length metadata: always funny to have a < 0 tailroom cast to uint16_t ;-). Signed-off-by: David Marchand <david.marchand@6wind.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-01-14mbuf: remove experimental tag for external attachmentYongseok Koh
Remove the experimental tag of rte_pktmbuf_attach_extbuf() which was introduced in 18.05. Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-01-14mbuf: remove deprecated macroYongseok Koh
RTE_MBUF_INDIRECT() is replaced with RTE_MBUF_CLONED() and removed. This macro was deprecated in release 18.05 when EXT_ATTACHED_MBUF was introduced. Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-01-14mbuf: fix C++ compatibility by making sched struct visibleHarry van Haaren
Although C compilation works with the struct rte_mbuf_sched declared inside the struct rte_mbuf namespace, C++ fails to compile. This fix moves the rte_mbuf_sched struct up to the global namespace, instead of declaring it inside the struct mbuf namespace. The struct rte_mbuf_sched is being used on the stack in rte_mbuf_sched_get() and as a cast in _set(). For this reason, it must be exposed as an available type. Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-12-22mbuf: implement generic format for sched fieldReshma Pattan
This patch implements the changes proposed in the deprecation notes [1][2]. librte_mbuf changes: The mbuf->hash.sched field is updated to support generic definition in line with the ethdev traffic manager and meter APIs. The new generic format contains: queue ID, traffic class, color. Added public APIs to set and get these new fields to and from mbuf. librte_sched changes: In addtion, following API functions of the sched library have been modified with an additional parameter of type struct rte_sched_port to accommodate the changes made to mbuf sched field. (i)rte_sched_port_pkt_write() (ii) rte_sched_port_pkt_read_tree_path() librte_pipeline, qos_sched UT, qos_sched app are updated to make use of new changes. Also mbuf->hash.txadapter has been added for eventdev txq, rte_event_eth_tx_adapter_txq_set and rte_event_eth_tx_adapter_txq_get() are updated to use mbuf->hash.txadapter.txq. doc: Release notes updated. Removed deprecation notice for mbuf->hash.sched and sched API. [1] http://mails.dpdk.org/archives/dev/2018-February/090651.html [2] https://mails.dpdk.org/archives/dev/2018-November/119051.html Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Tested-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
2018-10-26ethdev: support metadata as flow rule criteriaDekel Peled
As described in [1], a new rte_flow item is added to support metadata to use as flow rule match pattern. The metadata is an opaque item, fully controlled by the application. The use of metadata is relevant for egress rules only. It can be set in the flow rule using the RTE_FLOW_ITEM_META. An additional member 'tx_metadata' is added in union with existing member 'hash' of struct 'rte_mbuf', located to avoid conflicts with existing fields. This additional member is used to carry the metadata item. Application should set the packet metadata in the mbuf dedicated field, and set the PKT_TX_METADATA flag in the mbuf->ol_flags. The NIC will use the packet metadata as match criteria for relevant flow rules. This patch introduces metadata item type for rte_flow RTE_FLOW_ITEM_META, along with corresponding struct rte_flow_item_meta and ol_flag PKT_TX_METADATA. [1] "[RFC,v2] ethdev: support metadata as flow rule criteria" Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-25mbuf: add IGMP packet typeJerin Jacob
Add support for IGMP packet type. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-10-25mbuf: add MPLS packet typeJerin Jacob
Add support of MPLS packet type. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-10-25mbuf: add FCoE packet typeJerin Jacob
Add support of FCoE packet type. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-10-25mbuf: fix library version on meson buildFerruh Yigit
Fixes: d27a6261875d ("mbuf: remove control mbuf") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
2018-10-18mbuf: fix missing Tx outer UDP checksum flag nameNithin Dabilpuram
Fix missing Tx outer udp checksum flag name Fixes: df694a05bfff ("ethdev: add Tx offload outer UDP checksum definition") Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-10-18mbuf: fix offload flag name and listJerin Jacob
Fix missing PKT_TX* & PKT_RX* ol_flag name and fix ol_flag list. Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload") Fixes: 829a1c2c41dc ("mbuf: extend flow director field") Fixes: 63c0d74daaa9 ("mbuf: add Tx side tunneling type") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-11ethdev: add Tx offload outer UDP checksum definitionJerin Jacob
Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer UDP checksum offload. To use hardware Tx outer UDP checksum offload, the user needs to, - enable following in mbuf: a) fill outer_l2_len and outer_l3_len in mbuf b) set the PKT_TX_OUTER_UDP_CKSUM flag c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11ethdev: add Rx offload outer UDP checksum definitionJerin Jacob
Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum status. - To use hardware Rx outer UDP checksum offload, the user needs to configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath. - Driver updates checksum status in mbuf ol_flag as PKT_RX_OUTER_L4_CKSUM_* flags. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11mbuf: clarify QinQ flag usageFerruh Yigit
Update implementation that when PKT_RX_QINQ_STRIPPED mbuf ol_flags set by PMD, PKT_RX_QINQ, PKT_RX_VLAN_STRIPPED & PKT_RX_VLAN should be also set. Clarify mbuf documentations that when PKT_RX_QINQ set PKT_RX_VLAN also should be set. So that appllication can rely on PKT_RX_QINQ flag to access both mbuf.vlan_tci & mbuf.vlan_tci_outer Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-10-11mbuf: fix Tx offload maskJerin Jacob
Fixes missing PKT_TX_UDP_SEG, PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4, PKT_TX_IPV6 and PKT_TX_IPV4 values in PKT_TX_OFFLOAD_MASK. Also sort them in bit wise order to recognize missing items later. Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload") Fixes: 1c3b7c33e977 ("mbuf: add Tx offloading flags for tunnels") Fixes: 711ba9e23e68 ("mbuf: remove aliasing of Tx offloading flags with Rx ones") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com>
2018-10-01eventdev: add eth Tx adapter APIsNikhil Rao
The ethernet Tx adapter abstracts the transmit stage of an event driven packet processing application. The transmit stage may be implemented with eventdev PMD support or use a rte_service function implemented in the adapter. These APIs provide a common configuration and control interface and an transmit API for the eventdev PMD implementation. The transmit port is specified using mbuf::port. The transmit queue is specified using the rte_event_eth_tx_adapter_txq_set() function. Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-09-19mbuf: remove deprecated segment free functionsDavid Marchand
__rte_mbuf_raw_free and __rte_pktmbuf_prefree_seg have been deprecated for a long time now (early 17.05), are not part of the abi and are easily replaced with existing api. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-08-09eal: remove experimental tag for user mbuf pool opsOlivier Matz
Remove experimental tag from rte_eal_mbuf_user_pool_ops(). Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-07-26mbuf: remove experimental tag from pool opsHemant Agrawal
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-07-13mbuf: add accessor function for private data areaDan Gora
Add an inline accessor function to return the starting address of the private data area in the supplied mbuf. This allows applications to easily access the private data area between the struct rte_mbuf and the data buffer in the specified mbuf without creating private macros or accessor functions. No checks are made to ensure that a private data area actually exists in the buffer. Signed-off-by: Dan Gora <dg@adax.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-06-15mbuf: fix typo in IPv6 macro commentHaiyue Wang
Comment should mention IPv6, not IPv4. Fixes: f295a00a2b44 ("mbuf: add definitions of unified packet types") Cc: stable@dpdk.org Signed-off-by: Haiyue Wang <haiyue.wang@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-28doc: announce removal of indirect mbuf check macroYongseok Koh
Link: http://dpdk.org/ml/archives/dev/2018-April/099476.html Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-05-22mbuf: avoid integer promotion in prepend/adj/chainAndy Green
GCC 8.1 warned: In function 'rte_pktmbuf_prepend': rte_mbuf.h:1908:17: warning: conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] m->data_off -= len; ^~~ m->data_off is a uint16_t uint16_t data_off; len (a uint16_t) is promoted to an int using -=. Do the subtraction explicitly and cast the result to uint16_t. The below += or -= changes are solving the same thing. In function 'rte_pktmbuf_adj': rte_mbuf.h:1969:17: warning: conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] m->data_off += len; ^~~ In function 'rte_pktmbuf_chain': rte_mbuf.h:2082:19: warning: conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] head->nb_segs += tail->nb_segs; ^~~~ Also uint16_t uint16_t nb_segs; /**< Number of segments. */ Fixes: 08b563ffb19d ("mbuf: replace data pointer by an offset") Fixes: 1a60a0daa6e4 ("mbuf: fix segments number type increase") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-22mbuf: avoid implicit demotion in 64-bit arithmeticAndy Green
GCC 8.1 warned: In function 'rte_validate_tx_offload': rte_mbuf.h:2112:19: warning: conversion to 'uint64_t' {aka 'long unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] inner_l3_offset += m->outer_l2_len + m->outer_l3_len; ^~ uint64_t inner_l3_offset... /* fields for TX offloading of tunnels */ uint64_t outer_l3_len:9; /**< Outer L3 (IP) Hdr Length. */ uint64_t outer_l2_len:7; /**< Outer L2 (MAC) Hdr Length. */ We want to do the arithmetic entirely in uint64_t space, but with the +=, the rhs type becomes int since the bitfields will fit in int. Elaborate the artithmetic to be u64 = u64 + int + int, so the type of the result is correct to be stored in the u64. Fixes: 4fb7e803eb ("ethdev: add Tx preparation") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-22mbuf: fix type of variables in linearize functionAndy Green
GCC 8.1 warned: In function 'rte_pktmbuf_linearize': rte_mbuf.h:1873:32: warning: conversion to 'int' from 'uint32_t' {aka 'unsigned int'} may change the sign of the result [-Wsign-conversion] rte_mbuf.h:2166:13: note: in expansion of macro 'rte_pktmbuf_pkt_len' copy_len = rte_pktmbuf_pkt_len(mbuf) - rte_pktmbuf_data_len(mbuf); rte_mbuf.h:2180:51: warning: conversion to 'size_t' {aka 'long unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] rte_memcpy(buffer, rte_pktmbuf_mtod(m, char *), seg_len); ^~~~~~~ The temp is consumed as a size_t. So let's make it a size_t in the first place. Fixes: 1feda4d8fc ("mbuf: add a function to linearize a packet") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-22mbuf: fix type of private size in detachAndy Green
GCC 8.1 warned: In function 'rte_pktmbuf_detach': rte_mbuf.h:1583:17: warning: conversion from 'uint32_t' {aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] m->priv_size = priv_size; ^~~~~~~~~ The temp priv_size is declared as a uint32_t. But it only deals in uint16_t. m->priv_size is a uint16_t. Change it to a uint16_t. Fixes: 355e6735b3 ("mbuf: fix cloning with private mbuf data") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-21mbuf: explicit cast of size on detachAndy Green
GCC 8.1 warned: In function 'rte_pktmbuf_detach': rte_mbuf.h:1580:14: warning: conversion from 'long unsigned int' to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion] mbuf_size = sizeof(struct rte_mbuf) + priv_size; ^~~~~~ Fixes: 355e6735b335 ("mbuf: fix cloning with private mbuf data") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com>
2018-05-21mbuf: explicit cast of external buffer lengthAndy Green
GCC 8.1 warned: rte_common.h:141:34: warning: conversion from 'long unsigned int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] #define RTE_PTR_DIFF(ptr1, ptr2) ((uintptr_t)(ptr1) - (uintptr_t)(ptr2)) ^ rte_mbuf.h:1360:13: note: in expansion of macro 'RTE_PTR_DIFF' *buf_len = RTE_PTR_DIFF(shinfo, buf_addr); Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-21mbuf: explicit cast of headroom on resetAndy Green
GCC 8.1 warned: rte_common.h:384:2: warning: conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] __extension__ ({ \ ^~~~~~~~~~~~~ rte_mbuf.h:1204:16: note: in expansion of macro 'RTE_MIN' m->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, (uint16_t)m->buf_len); RTE_PKTMBUF_HEADROOM is typ 128, so it doesn't make trouble. Fixes: 08b563ffb19d ("mbuf: replace data pointer by an offset") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-21mbuf: explicit casts of reference counterAndy Green
differences to the atomic16 are signed, but the atomic16 itself is unsigned. It needs to be made explicit with casts. Fixes: af75078fece3 ("first public release") Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-05-21mbuf: fix reference counter integer promotionAndy Green
GCC 8.1 warned: "1 + value", where value is an uint16_t causes promotion to a signed int. The compiler complained that we are shoving an int into a uint16_t return type with different size and sign. Bumping and returning value directly instead removes the promotion and the problem. Fixes: f20b50b946da ("mbuf: optimize refcnt update") Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-05-18mbuf: fix C++ build on void pointer castDavid Marchand
Including rte_mbuf.h in C++ triggers the following warning as C++ does not allow implicit casting of a void *. In file included from test.cpp:1:0: rte_mbuf.h: In function ‘rte_mbuf_ext_shared_info* rte_pktmbuf_ext_shinfo_init_helper(void*, uint16_t*, rte_mbuf_extbuf_free_callback_t, void*)’: rte_mbuf.h:1349:9: error: invalid conversion from ‘void*’ to ‘rte_mbuf_ext_shared_info*’ [-fpermissive] shinfo = RTE_PTR_ALIGN_FLOOR(RTE_PTR_SUB(buf_end, ^ Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") Signed-off-by: David Marchand <david.marchand@6wind.com>
2018-05-14lib: clear experimental version tag in linker scriptsFerruh Yigit
Remove version tag from experimental block in linker version scripts (.map files). That label is not used by linker and information only. It is useful for version blocks but not useful for experimental block but confusing. Removing those labels. Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2018-04-27mbuf: support attaching external bufferYongseok Koh
This patch introduces a new way of attaching an external buffer to a mbuf. Attaching an external buffer is quite similar to mbuf indirection in replacing buffer addresses and length of a mbuf, but a few differences: - When an indirect mbuf is attached, refcnt of the direct mbuf would be 2 as long as the direct mbuf itself isn't freed after the attachment. In such cases, the buffer area of a direct mbuf must be read-only. But external buffer has its own refcnt and it starts from 1. Unless multiple mbufs are attached to a mbuf having an external buffer, the external buffer is writable. - There's no need to allocate buffer from a mempool. Any buffer can be attached with appropriate free callback. - Smaller metadata is required to maintain shared data such as refcnt. Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDPXueming Li
This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP. MPLS-in-GRE protocol link: https://tools.ietf.org/html/rfc4023 MPLS-in-UDP protocol link: https://tools.ietf.org/html/rfc7510 Signed-off-by: Xueming Li <xuemingl@mellanox.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-27ethdev: introduce new tunnel VXLAN-GPEXueming Li
VXLAN-GPE enables VXLAN for all protocols. Protocol link: https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt Signed-off-by: Xueming Li <xuemingl@mellanox.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-04-27ethdev: introduce generic IP/UDP tunnel checksum and TSOXueming Li
This patch introduce new TX offload flags for device that supports IP or UDP tunneled packet L3/L4 checksum and TSO offload. It will be used for non-standard tunnels. The support from the device is for inner and outer checksums on IPV4/TCP/UDP and TSO for *any packet with the following format*: <some headers> / [optional IPv4/IPv6] / [optional TCP/UDP] / <some headers> / [optional inner IPv4/IPv6] / [optional TCP/UDP] For example the following packets can use this feature: 1. eth / ipv4 / udp / VXLAN / ip / tcp 2. eth / ipv4 / GRE / MPLS / ipv4 / udp Please note that specific tunnel headers that contain payload length, sequence id or checksum will not be updated. Signed-off-by: Xueming Li <xuemingl@mellanox.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-04-23mbuf: improve tunnel Tx offloads API docThomas Monjalon
Add few details to remind TSO flag, checksum flags and header lengths. The doxygen syntax for MPLS-in-UDP is fixed. Fixes: d95188551fa1 ("mbuf: introduce new Tx offload flag for MPLS-in-UDP") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-04-23mbuf: fix Tx checksum offload API docThomas Monjalon
When introducing rte_eth_tx_prepare(), the constraints on checksum pre-filling for Tx offloads were relaxed because implemented in the PMDs with rte_net_intel_cksum_flags_prepare() helper. As a consequence, these old requirements are removed for: - PKT_TX_OUTER_IP_CKSUM - PKT_TX_IP_CKSUM - PKT_TX_[L4]_CKSUM - PKT_TX_TCP_SEG Not sure SCTP offload is properly implemented though. A reference to rte_eth_tx_prepare() is added in rte_eth_tx_burst() doc. Fixes: 609dd68ef14f ("mbuf: enhance the API documentation of offload flags") Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-04-11mbuf: remove control mbufOlivier Matz
The rte_ctrlmbuf structure is not used by any example application in dpdk. Remove it, as announced on the mailing list. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-04-04mbuf: fix truncated strncpyStephen Hemminger
Gcc-8 discovers issue with platform_mempool_ops. rte_mbuf_pool_ops.c:26:3: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(mz->addr, ops_name, strlen(ops_name)); Since the ops_name is already checked for size, using strncpy here is unnecessary; just use strcpy. Fixes: a3acc3144a76 ("mbuf: add pool ops selection functions") Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-02-06mbuf: fix logic of user mempool ops APINipun Gupta
The existing rte_eal_mbuf_default mempool ops can return the compile time default ops name if the user has not provided command line inputs for mempool ops name. It will break the logic of best mempool ops as it will never return platform hw mempool ops. This patch introduces a new API to just return the user mempool ops only. Fixes: 8b0f7f434132 ("mbuf: maintain user and compile time mempool ops name") Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-02-01mbuf: use SPDX tagsOlivier Matz
Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>