From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 166971B4DC for ; Fri, 1 Feb 2019 16:21:29 +0100 (CET) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190201152128euoutp01f192a42ab0b4185ff375027e1f3bb3c3~-RqkZsKfj0921809218euoutp01b for ; Fri, 1 Feb 2019 15:21:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190201152128euoutp01f192a42ab0b4185ff375027e1f3bb3c3~-RqkZsKfj0921809218euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549034488; bh=AK5BiddMjOzVgArH7TZ09IkYqiScQobhepFkwYdZd0Q=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=YYVLsWos4Tft/Rq9PIPgzZvHFVWpIHHZcMwznVsJ+YTvj+VT3jQZZ0e3IqgTnxbiz h7p8X+VMW6XFvpDzrwPwgfmJv37rw5W0E5ZK4eIbjAenqbtqMM+OMk1tnIpYQUGRdM fSKnoa7NTpC2XcEMwvxsj+k608FH+7KQSoXgwopU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190201152128eucas1p261db3f40449507f97dad0012a2ce67d8~-RqjxENIT0057000570eucas1p2-; Fri, 1 Feb 2019 15:21:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 78.57.04806.7F3645C5; Fri, 1 Feb 2019 15:21:27 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190201152127eucas1p123fa1a4c2e6f9e25c7bb96dd36d90cb3~-RqjGQXMA0117501175eucas1p1T; Fri, 1 Feb 2019 15:21:27 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190201152127eusmtrp211798f8a3b43a4a61fbca169d5d5c79c~-Rqi4BA_61836418364eusmtrp2e; Fri, 1 Feb 2019 15:21:27 +0000 (GMT) X-AuditID: cbfec7f5-79db79c0000012c6-32-5c5463f7c5af Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 45.B8.04128.7F3645C5; Fri, 1 Feb 2019 15:21:27 +0000 (GMT) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190201152126eusmtip2592c6d1c69fe8d3a5e5c5721d4469a8d~-RqiZbM8S1081310813eusmtip2s; Fri, 1 Feb 2019 15:21:26 +0000 (GMT) To: Jens Freimann Cc: dev@dpdk.org, tiwei.bie@intel.com, maxime.coquelin@redhat.com From: Ilya Maximets Message-ID: <35e0590f-a303-87c8-06fa-e745a3deb2f7@samsung.com> Date: Fri, 1 Feb 2019 18:21:25 +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: <20190201151312.432t55b4relhqv3d@jenstp.localdomain> Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDKsWRmVeSWpSXmKPExsWy7djPc7rfk0NiDNb2WFu8+7SdyeJK+092 i3NrlrJYHOvcw2KxteE/kwOrx68FS1k9Fu95yeTxft9VNo++LasYA1iiuGxSUnMyy1KL9O0S uDImHrnIWnCPv+Lm9PWMDYwrebsYOTkkBEwk2te+Yeti5OIQEljBKHH9wSNWCOcLo8Sfq1MZ IZzPjBJdn2YzwbQ09/+EalnOKLG6eR5Uy0dGiSnHtzCCVAkL2Et8bOoE6xAR0JB4//YHK4jN LOAo0Xtt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HFOoJltvw6wQcxXl/gz7xIzhC0u0fRl JdReeYnmrbOZJzAKzULSPgtJyywkLbOQtCxgZFnFKJJaWpybnltspFecmFtcmpeul5yfu4kR GFnbjv3csoOx613wIUYBDkYlHt4Nv4JihFgTy4orcw8xSnAwK4nwFkeHxAjxpiRWVqUW5ccX leakFh9iNAV6biKzlGhyPjDq80riDU0NzS0sDc2NzY3NLJTEec8bVEYJCaQnlqRmp6YWpBbB 9DFxcEo1MDIteDPdprb50vxL4qKP2K+IiuUdXpXv8s8if96GBcd22+ZaeqgvybhynuXc1mv6 yVU59kcKH0SqpT980vNdPuCgdOR+y2ulLx991zo2p7e6a1F16f7dXIa5t2+lzU/aMKHcdruV Xlt3c8gm0cWb5vo8KHf+79dq5WyetmaCanFK4sRO5dKqt0osxRmJhlrMRcWJANzbON7CAgAA X-CMS-MailID: 20190201152127eucas1p123fa1a4c2e6f9e25c7bb96dd36d90cb3 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190201142739eucas1p1eff46b874ee985b7aa2d32b185e837c1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190201142739eucas1p1eff46b874ee985b7aa2d32b185e837c1 References: <20190201100348.6730-1-jfreimann@redhat.com> <20190201151312.432t55b4relhqv3d@jenstp.localdomain> Subject: Re: [dpdk-dev] [v4] 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: Fri, 01 Feb 2019 15:21:30 -0000 On 01.02.2019 18:13, Jens Freimann wrote: > On Fri, Feb 01, 2019 at 05:27:37PM +0300, Ilya Maximets wrote: >> On 01.02.2019 13:03, Jens Freimann wrote: >>> +    if (host_features & (1ULL << VIRTIO_NET_F_MTU)) { >>> +        uint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN + >>> +            hw->vtnet_hdr_size; >>> +        if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= >>> +                hw->max_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; >>> +    } >>> + >> >> As I wrote for v3, hw->max_mtu already calculated taking VIRTIO_NET_F_MTU >> into account. If VIRTIO_NET_F_MTU is not set, hw->max_mtu is equal to >> "VIRTIO_MAX_RX_PKTLEN - ETHER_HDR_LEN - VLAN_TAG_LEN - hw->vtnet_hdr_size". >> i.e. "hw->max_mtu + ether_hdr_len" equal to VIRTIO_MAX_RX_PKTLEN which is >> larger or equal to rxmode.max_rx_pkt_len. >> So, there is no need to check for VIRTIO_NET_F_MTU here. You may just perform >> same check for both cases. > > I should read more carefully :). I think I get what you mean now. > hw->max_mtu already includes ether_hdr_len, so it doesn't need > re-calculation here. And in case of VIRTIO_NET_F_MTU the mtu is > checked during feature negotiation.  > So it basically boils down to        if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= w->max_mtu) >                dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; > 'hw->max_mtu' does not include 'ether_hdr_len'. But yes, VIRTIO_NET_F_MTU already checked during negotiation. So, it will be: if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= hw->max_mtu + ether_hdr_len) dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; >> This doesn't give any performance or so, but will simplify the code. > > Thanks for the review! > > regards, > Jens >