From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2835A0353; Sun, 10 Nov 2019 23:47:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 038FFE07; Sun, 10 Nov 2019 23:47:44 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A736CCF3 for ; Sun, 10 Nov 2019 23:47:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2019 14:47:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,290,1569308400"; d="scan'208";a="215515331" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga002.jf.intel.com with ESMTP; 10 Nov 2019 14:47:30 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.252]) by IRSMSX103.ger.corp.intel.com ([169.254.3.139]) with mapi id 14.03.0439.000; Sun, 10 Nov 2019 22:47:29 +0000 From: "Ananyev, Konstantin" To: Thomas Monjalon , "Mcnamara, John" , "Kovacevic, Marko" , Neil Horman , Ajit Khaparde , Somnath Kotur , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Lu, Wenzhuo" , Matan Azrad , "Shahaf Shuler" , Viacheslav Ovsiienko , Rasesh Mody , Shahed Shaikh , Maxime Coquelin , "Bie, Tiwei" , "Wang, Zhihong" , Yong Wang , "Yigit, Ferruh" , Andrew Rybchenko CC: "dev@dpdk.org" , Dekel Peled Thread-Topic: [PATCH v6] ethdev: add max LRO packet size Thread-Index: AQHVlol3zI74LyhonUy3xv2EfvH8+qeFAyPQ Date: Sun, 10 Nov 2019 22:47:29 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725801A8C85765@IRSMSX104.ger.corp.intel.com> References: <20191108230753.32221-1-thomas@monjalon.net> In-Reply-To: <20191108230753.32221-1-thomas@monjalon.net> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTg0NzhjZDktMjZiNi00OTRmLTlmZjYtMGQwNGZmZWY4ZDIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieHVvd3gzdnlCZzRYZVwvK01lSGFRRWhSXC9GT3NGZjNkclVKSDlVQUtWZVo4ZlwvOGorMFcxQlhsUzIrbW80aytPRyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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 v6] ethdev: add max LRO packet size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >=20 > From: Dekel Peled >=20 > The maximum supported aggregated packet size for LRO > is advertised in rte_eth_dev_info. > For some devices, max_lro_pktlen may be different of > the basic max_rx_pktlen property. >=20 > Various PMDs supporting LRO are updated. >=20 > Signed-off-by: Dekel Peled > Signed-off-by: Thomas Monjalon > --- >=20 > v6: This is half of v5 1/3. Only the agreed part is here. > Hope it represents the consensus, so we make a step forward. > The field max_lro_pkt_size is renamed to max_lro_pktlen > in order to look like max_rx_pktlen. >=20 > --- > doc/guides/nics/features.rst | 1 + > doc/guides/rel_notes/deprecation.rst | 4 ---- > doc/guides/rel_notes/release_19_11.rst | 3 +++ > drivers/net/bnxt/bnxt_ethdev.c | 1 + > drivers/net/hinic/hinic_pmd_ethdev.c | 1 + > drivers/net/ixgbe/ixgbe_ethdev.c | 1 + > drivers/net/mlx5/mlx5.h | 3 +++ > drivers/net/mlx5/mlx5_ethdev.c | 1 + > drivers/net/mlx5/mlx5_rxq.c | 1 - > drivers/net/qede/qede_ethdev.c | 1 + > drivers/net/virtio/virtio_ethdev.c | 1 + > drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 + > lib/librte_ethdev/rte_ethdev.h | 1 + > 13 files changed, 15 insertions(+), 5 deletions(-) >=20 > diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst > index d96696801a..1b2e120a9d 100644 > --- a/doc/guides/nics/features.rst > +++ b/doc/guides/nics/features.rst > @@ -197,6 +197,7 @@ Supports Large Receive Offload. > * **[implements] rte_eth_dev_data**: ``lro``. > * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_LRO``, ``mbuf.tso_segsz`= `. > * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_= capa:DEV_RX_OFFLOAD_TCP_LRO``. > +* **[provides] rte_eth_dev_info**: ``max_lro_pktlen``. >=20 >=20 > .. _nic_features_tso: > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/= deprecation.rst > index b0b992dcb5..d4fcf9975b 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -88,10 +88,6 @@ Deprecation Notices > This scheme will allow PMDs to avoid lookup to internal ptype table on= Rx and > thereby improve Rx performance if application wishes do so. >=20 > -* ethdev: New 32-bit fields may be added for maximum LRO session size, i= n > - struct ``rte_eth_dev_info`` for the port capability and in struct > - ``rte_eth_rxmode`` for the port configuration. > - > * cryptodev: support for using IV with all sizes is added, J0 still can > be used but only when IV length in following structs ``rte_crypto_auth= _xform``, > ``rte_crypto_aead_xform`` is set to zero. When IV length is greater or= equal > diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_note= s/release_19_11.rst > index 795c7601c0..473af44374 100644 > --- a/doc/guides/rel_notes/release_19_11.rst > +++ b/doc/guides/rel_notes/release_19_11.rst > @@ -403,6 +403,9 @@ ABI Changes > align the Ethernet header on receive and all known encapsulations > preserve the alignment of the header. >=20 > +* ethdev: Added 32-bit field for maximum LRO aggregated packet size, > + as port capability in the struct ``rte_eth_dev_info``. > + > * security: The field ``replay_win_sz`` has been moved from ipsec librar= y > based ``rte_ipsec_sa_prm`` structure to security library based structu= re > ``rte_security_ipsec_xform``, which specify the Anti replay window siz= e > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethde= v.c > index 58a4f98c9f..95c60a3757 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -535,6 +535,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *e= th_dev, > /* Fast path specifics */ > dev_info->min_rx_bufsize =3D 1; > dev_info->max_rx_pktlen =3D BNXT_MAX_PKT_LEN; > + dev_info->max_lro_pktlen =3D BNXT_MAX_PKT_LEN; >=20 > dev_info->rx_offload_capa =3D BNXT_DEV_RX_OFFLOAD_SUPPORT; > if (bp->flags & BNXT_FLAG_PTP_SUPPORTED) > diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hin= ic_pmd_ethdev.c > index 9f37a404be..cbd2d032f9 100644 > --- a/drivers/net/hinic/hinic_pmd_ethdev.c > +++ b/drivers/net/hinic/hinic_pmd_ethdev.c > @@ -727,6 +727,7 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *info) > info->max_tx_queues =3D nic_dev->nic_cap.max_sqs; > info->min_rx_bufsize =3D HINIC_MIN_RX_BUF_SIZE; > info->max_rx_pktlen =3D HINIC_MAX_JUMBO_FRAME_SIZE; > + info->max_lro_pktlen =3D HINIC_MAX_JUMBO_FRAME_SIZE; > info->max_mac_addrs =3D HINIC_MAX_UC_MAC_ADDRS; > info->min_mtu =3D HINIC_MIN_MTU_SIZE; > info->max_mtu =3D HINIC_MAX_MTU_SIZE; > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index dbce7a80e9..a01b8bbf10 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -3804,6 +3804,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct = rte_eth_dev_info *dev_info) > } > dev_info->min_rx_bufsize =3D 1024; /* cf BSIZEPACKET in SRRCTL register= */ > dev_info->max_rx_pktlen =3D 15872; /* includes CRC, cf MAXFRS register = */ > + dev_info->max_lro_pktlen =3D RTE_IPV4_MAX_PKT_LEN; > dev_info->max_mac_addrs =3D hw->mac.num_rar_entries; > dev_info->max_hash_mac_addrs =3D IXGBE_VMDQ_NUM_UC_MAC; > dev_info->max_vfs =3D pci_dev->max_vfs; Actually after looking at ixgbe code once again - as we set LRO capability conditionally, we probably better to set max_lro_p= ktlen conditionally too. Something like: --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3820,6 +3820,9 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) dev_info->tx_queue_offload_capa =3D ixgbe_get_tx_queue_offloads(dev= ); dev_info->tx_offload_capa =3D ixgbe_get_tx_port_offloads(dev); + if (dev_info->rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) + dev_info->max_lro_pktlen =3D RTE_IPV4_MAX_PKT_LEN; + dev_info->default_rxconf =3D (struct rte_eth_rxconf) { .rx_thresh =3D { .pthresh =3D IXGBE_DEFAULT_RX_PTHRESH, Sorry for missed that previously. Apart from that: LGTM. > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h > index b6a51b2b4d..935adbbbf3 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -198,6 +198,9 @@ TAILQ_HEAD(mlx5_flows, rte_flow); > #define MLX5_LRO_SUPPORTED(dev) \ > (((struct mlx5_priv *)((dev)->data->dev_private))->config.lro.supported= ) >=20 > +/* Maximal size of aggregated LRO packet. */ > +#define MLX5_MAX_LRO_SIZE (UINT8_MAX * 256u) > + > /* LRO configurations structure. */ > struct mlx5_lro_config { > uint32_t supported:1; /* Whether LRO is supported. */ > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethde= v.c > index 2278b24c01..91de186365 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -552,6 +552,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *info) > /* FIXME: we should ask the device for these values. */ > info->min_rx_bufsize =3D 32; > info->max_rx_pktlen =3D 65536; > + info->max_lro_pktlen =3D MLX5_MAX_LRO_SIZE; > /* > * Since we need one CQ per QP, the limit is the minimum number > * between the two values. > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index f0ab8438d3..aca2e67e0c 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -1524,7 +1524,6 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev) > return 0; > } >=20 > -#define MLX5_MAX_LRO_SIZE (UINT8_MAX * 256u) > #define MLX5_MAX_TCP_HDR_OFFSET ((unsigned int)(sizeof(struct rte_ether_= hdr) + \ > sizeof(struct rte_vlan_hdr) * 2 + \ > sizeof(struct rte_ipv6_hdr))) > diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethde= v.c > index 53fdfde9a8..fd05856836 100644 > --- a/drivers/net/qede/qede_ethdev.c > +++ b/drivers/net/qede/qede_ethdev.c > @@ -1273,6 +1273,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev, >=20 > dev_info->min_rx_bufsize =3D (uint32_t)QEDE_MIN_RX_BUFF_SIZE; > dev_info->max_rx_pktlen =3D (uint32_t)ETH_TX_MAX_NON_LSO_PKT_LEN; > + dev_info->max_lro_pktlen =3D (uint32_t)0x7FFF; > dev_info->rx_desc_lim =3D qede_rx_desc_lim; > dev_info->tx_desc_lim =3D qede_tx_desc_lim; >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virt= io_ethdev.c > index 646de9945c..d97f3c6645 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -2435,6 +2435,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct= rte_eth_dev_info *dev_info) > RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_TX_QUEUES); > dev_info->min_rx_bufsize =3D VIRTIO_MIN_RX_BUFSIZE; > dev_info->max_rx_pktlen =3D VIRTIO_MAX_RX_PKTLEN; > + dev_info->max_lro_pktlen =3D VIRTIO_MAX_RX_PKTLEN; > dev_info->max_mac_addrs =3D VIRTIO_MAX_MAC_ADDRS; >=20 > host_features =3D VTPCI_OPS(hw)->get_features(hw); > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/v= mxnet3_ethdev.c > index d1faeaa81b..6c99a2a8e0 100644 > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c > @@ -1161,6 +1161,7 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev, > dev_info->max_tx_queues =3D VMXNET3_MAX_TX_QUEUES; > dev_info->min_rx_bufsize =3D 1518 + RTE_PKTMBUF_HEADROOM; > dev_info->max_rx_pktlen =3D 16384; /* includes CRC, cf MAXFRS register = */ > + dev_info->max_lro_pktlen =3D 16384; > dev_info->speed_capa =3D ETH_LINK_SPEED_10G; > dev_info->max_mac_addrs =3D VMXNET3_MAX_MAC_ADDRS; >=20 > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethde= v.h > index c36c1b631f..b47eea60d9 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -1183,6 +1183,7 @@ struct rte_eth_dev_info { > const uint32_t *dev_flags; /**< Device flags */ > uint32_t min_rx_bufsize; /**< Minimum size of RX buffer. */ > uint32_t max_rx_pktlen; /**< Maximum configurable length of RX pkt. */ > + uint32_t max_lro_pktlen; /**< Maximum size of LRO aggregated packet. */ > uint16_t max_rx_queues; /**< Maximum number of RX queues. */ > uint16_t max_tx_queues; /**< Maximum number of TX queues. */ > uint32_t max_mac_addrs; /**< Maximum number of MAC addresses. */ > -- > 2.23.0