From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3E6545A64 for ; Fri, 22 Jul 2016 00:49:13 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 21 Jul 2016 15:48:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,401,1464678000"; d="scan'208";a="1000111437" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga001.jf.intel.com with ESMTP; 21 Jul 2016 15:48:57 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.51]) by IRSMSX102.ger.corp.intel.com ([169.254.2.123]) with mapi id 14.03.0248.002; Thu, 21 Jul 2016 23:48:56 +0100 From: "Ananyev, Konstantin" To: "Kulasek, TomaszX" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] doc: announce ABI change for rte_eth_dev structure Thread-Index: AQHR42Ph+H7D9jswiE+CcJzq4idrzqAjfOLA Date: Thu, 21 Jul 2016 22:48:56 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B80AD8@irsmsx105.ger.corp.intel.com> References: <1469024691-58750-1-git-send-email-tomaszx.kulasek@intel.com> <1469114659-66063-1-git-send-email-tomaszx.kulasek@intel.com> In-Reply-To: <1469114659-66063-1-git-send-email-tomaszx.kulasek@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] doc: announce ABI change for rte_eth_dev structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2016 22:49:13 -0000 >=20 > This is an ABI deprecation notice for DPDK 16.11 in librte_ether about > changes in rte_eth_dev and rte_eth_desc_lim structures. >=20 > As discussed in that thread: >=20 > http://dpdk.org/ml/archives/dev/2015-September/023603.html >=20 > Different NIC models depending on HW offload requested might impose > different requirements on packets to be TX-ed in terms of: >=20 > - Max number of fragments per packet allowed > - Max number of fragments per TSO segments > - The way pseudo-header checksum should be pre-calculated > - L3/L4 header fields filling > - etc. >=20 >=20 > MOTIVATION: > ----------- >=20 > 1) Some work cannot (and didn't should) be done in rte_eth_tx_burst. > However, this work is sometimes required, and now, it's an > application issue. >=20 > 2) Different hardware may have different requirements for TX offloads, > other subset can be supported and so on. >=20 > 3) Some parameters (eg. number of segments in ixgbe driver) may hung > device. These parameters may be vary for different devices. >=20 > For example i40e HW allows 8 fragments per packet, but that is after > TSO segmentation. While ixgbe has a 38-fragment pre-TSO limit. >=20 > 4) Fields in packet may require different initialization (like eg. will > require pseudo-header checksum precalculation, sometimes in a > different way depending on packet type, and so on). Now application > needs to care about it. >=20 > 5) Using additional API (rte_eth_tx_prep) before rte_eth_tx_burst let to > prepare packet burst in acceptable form for specific device. >=20 > 6) Some additional checks may be done in debug mode keeping tx_burst > implementation clean. >=20 >=20 > PROPOSAL: > --------- >=20 > To help user to deal with all these varieties we propose to: >=20 > 1. Introduce rte_eth_tx_prep() function to do necessary preparations of > packet burst to be safely transmitted on device for desired HW > offloads (set/reset checksum field according to the hardware > requirements) and check HW constraints (number of segments per > packet, etc). >=20 > While the limitations and requirements may differ for devices, it > requires to extend rte_eth_dev structure with new function pointer > "tx_pkt_prep" which can be implemented in the driver to prepare and > verify packets, in devices specific way, before burst, what should to > prevent application to send malformed packets. >=20 > 2. Also new fields will be introduced in rte_eth_desc_lim: > nb_seg_max and nb_mtu_seg_max, providing an information about max > segments in TSO and non-TSO packets acceptable by device. >=20 > This information is useful for application to not create/limit > malicious packet. >=20 >=20 > APPLICATION (CASE OF USE): > -------------------------- >=20 > 1) Application should to initialize burst of packets to send, set > required tx offload flags and required fields, like l2_len, l3_len, > l4_len, and tso_segsz >=20 > 2) Application passes burst to the rte_eth_tx_prep to check conditions > required to send packets through the NIC. >=20 > 3) The result of rte_eth_tx_prep can be used to send valid packets > and/or restore invalid if function fails. >=20 > eg. >=20 > for (i =3D 0; i < nb_pkts; i++) { >=20 > /* initialize or process packet */ >=20 > bufs[i]->tso_segsz =3D 800; > bufs[i]->ol_flags =3D PKT_TX_TCP_SEG | PKT_TX_IPV4 > | PKT_TX_IP_CKSUM; > bufs[i]->l2_len =3D sizeof(struct ether_hdr); > bufs[i]->l3_len =3D sizeof(struct ipv4_hdr); > bufs[i]->l4_len =3D sizeof(struct tcp_hdr); > } >=20 > /* Prepare burst of TX packets */ > nb_prep =3D rte_eth_tx_prep(port, 0, bufs, nb_pkts); >=20 > if (nb_prep < nb_pkts) { > printf("tx_prep failed\n"); >=20 > /* drop or restore invalid packets */ >=20 > } >=20 > /* Send burst of TX packets */ > nb_tx =3D rte_eth_tx_burst(port, 0, bufs, nb_prep); >=20 > /* Free any unsent packets. */ >=20 >=20 >=20 > Signed-off-by: Tomasz Kulasek > --- > doc/guides/rel_notes/deprecation.rst | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/= deprecation.rst > index f502f86..485aacb 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -41,3 +41,10 @@ Deprecation Notices > * The mempool functions for single/multi producer/consumer are deprecate= d and > will be removed in 16.11. > It is replaced by rte_mempool_generic_get/put functions. > + > +* In 16.11 ABI changes are plained: the ``rte_eth_dev`` structure will b= e > + extended with new function pointer ``tx_pkt_prep`` allowing verificati= on > + and processing of packet burst to meet HW specific requirements before > + transmit. Also new fields will be added to the ``rte_eth_desc_lim`` st= ructure: > + ``nb_seg_max`` and ``nb_mtu_seg_max`` provideing information about num= ber of > + segments limit to be transmitted by device for TSO/non-TSO packets. > -- Acked-by: Konstantin Ananyev > 1.7.9.5