From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 58F201B43A for ; Thu, 31 Jan 2019 12:01:57 +0100 (CET) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190131110156euoutp02cdb99729e3555ce7dba94952c3bcd794~_6eq6FOVF2291522915euoutp02T for ; Thu, 31 Jan 2019 11:01:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190131110156euoutp02cdb99729e3555ce7dba94952c3bcd794~_6eq6FOVF2291522915euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548932516; bh=2n6Z4dLwBRJLSKBttnYbO1QH3cmBzd++/n49CV3Qt+I=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=fkZz48z/9r8dsLSbHr7HtNUBSNYJd7h9PiXjcAnKpl3ZE3I3gx57siNahWvgzpshW HgqII+ZgHvrFU8pgXv/8ZWH2TJH3u6YZEpwM8/pLThuRqg9GdApOA9jGv7ifgsrpxG ZbDHb8gthWsC1KoSIr9kEMtUfc9JwaxSIacm1S8c= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190131110155eucas1p29234d6c9d05f459c308b874640ef5e17~_6eqbZP9R2344023440eucas1p2D; Thu, 31 Jan 2019 11:01:55 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id C9.24.04806.3A5D25C5; Thu, 31 Jan 2019 11:01:55 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190131110154eucas1p150b171c1c77a49e12843d28b61116966~_6epiwFOA2481324813eucas1p16; Thu, 31 Jan 2019 11:01:54 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190131110154eusmtrp2cd0a2b3f36aae8eae7403c1cad423dfb~_6epUapdf2784727847eusmtrp2P; Thu, 31 Jan 2019 11:01:54 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-81-5c52d5a337d5 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BD.BF.04128.2A5D25C5; Thu, 31 Jan 2019 11:01:54 +0000 (GMT) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190131110153eusmtip2427699097013fddbabe038ec9ce2b20b~_6eo0xYTV0996609966eusmtip2z; Thu, 31 Jan 2019 11:01:53 +0000 (GMT) To: Jens Freimann , dev@dpdk.org Cc: tiwei.bie@intel.com, maxime.coquelin@redhat.com, stable@dpdk.org From: Ilya Maximets Message-ID: <2cb3d89b-5fe4-735c-2dc9-62ba49d305f2@samsung.com> Date: Thu, 31 Jan 2019 14:01:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190131091736.14844-1-jfreimann@redhat.com> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAKsWRmVeSWpSXmKPExsWy7djPc7qLrwbFGDzqEbN492k7k8WV9p/s FufWLGWxONa5h8XiX8cfdoutDf+ZHNg8fi1YyuqxeM9LJo/3+66yefRtWcUYwBLFZZOSmpNZ llqkb5fAlbGv6z5jQZdQxbIPW9gbGB/zdTFyckgImEi09kxm7GLk4hASWMEo8e/1ThYI5wuj RNPBvWwQzmdGie97brPBtLx7uYsdIrGcUeLRvM3MIAkhgY+MEq0rgNo5OIQF7CWmLgFbISJg JrHs/AmwXmYBF4k7e1sZQW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ek1fVrJC2PIS29/OYZ7AKDQLSfssJC2zkLTMQtKygJFlFaNIamlxbnpusZFecWJucWleul5y fu4mRmB8bTv2c8sOxq53wYcYBTgYlXh4H6wNjBFiTSwrrsw9xCjBwawkwjvvSlCMEG9KYmVV alF+fFFpTmrxIUZToOcmMkuJJucDYz+vJN7Q1NDcwtLQ3Njc2MxCSZz3vEFllJBAemJJanZq akFqEUwfEwenVANjgfTJyOIpzy+9qdNnePC4/ean5lX8odZ79tcqq13bOtWXU/q0Hut5p2T7 BV/PF9tnLNp2qii66N52m4rn6lFTNznzv36dcPHI3tXTVHivMh8w421tFFn32vR9zG6t6CNa y+YVb5VwkBbzXvi4pL0uam2p97H/xrutt83eUyP/+FNPrcqc2YrblViKMxINtZiLihMB5WGv esUCAAA= X-CMS-MailID: 20190131110154eucas1p150b171c1c77a49e12843d28b61116966 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190131110154eucas1p150b171c1c77a49e12843d28b61116966 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190131110154eucas1p150b171c1c77a49e12843d28b61116966 References: <20190131091736.14844-1-jfreimann@redhat.com> Subject: Re: [dpdk-dev] [v3] net/virtio: set offload flag for jumbo frames 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: , X-List-Received-Date: Thu, 31 Jan 2019 11:01:57 -0000 On 31.01.2019 12:17, Jens Freimann wrote: > Port configuration fails because offload flags don't match the expected > value when max-pkt-len is set to a value that should enable receive port > offloading but doesn't. > > There are two cases to consider: > > 1. VIRTIO_NET_F_MTU is set. Then we need to check if the requested > max-pkt-len fits into the MTU plus header. If yes we set the > offload flag. > 2. VIRTIO_NET_F_MTU is not set. We can set the offload flag. > > Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API") > Cc: stable@dpdk.org > > Signed-off-by: Jens Freimann > Reviewed-by: Maxime Coquelin > --- > v2->v3: > * remove unnecessary brackets (Maxime) > * fix commit message (David) > > v1->v2: > * include virtnet hdr, ethernet header, vlan tag when comparing against > max-rx-pkt-len (Maxime) > > drivers/net/virtio/virtio_ethdev.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 7c4c1df00..f39d4e630 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -2351,6 +2351,20 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > if ((host_features & tso_mask) == tso_mask) > dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TCP_LRO; > > + if (host_features & (1ULL << VIRTIO_NET_F_MTU)) { > + struct virtio_net_config config; > + uint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN + > + hw->vtnet_hdr_size; > + vtpci_read_dev_config(hw, > + offsetof(struct virtio_net_config, mtu), > + &config.mtu, sizeof(config.mtu)); > + if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= > + config.mtu + ether_hdr_len) > + dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; > + } else { > + dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; > + } > + Why we can't just use 'hw->max_mtu' here for checking instead of reading 'config.mtu' ? Also, It's already calculated with regards to VIRTIO_NET_F_MTU. > dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS | > DEV_TX_OFFLOAD_VLAN_INSERT; > if (host_features & (1ULL << VIRTIO_NET_F_CSUM)) { >