From: Ilya Maximets <i.maximets@samsung.com>
To: Jens Freimann <jfreimann@redhat.com>
Cc: dev@dpdk.org, tiwei.bie@intel.com, maxime.coquelin@redhat.com
Subject: Re: [dpdk-dev] [v4] net/virtio: set offload flag for jumbo frames
Date: Fri, 1 Feb 2019 18:21:25 +0300 [thread overview]
Message-ID: <35e0590f-a303-87c8-06fa-e745a3deb2f7@samsung.com> (raw)
In-Reply-To: <20190201151312.432t55b4relhqv3d@jenstp.localdomain>
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
>
prev parent reply other threads:[~2019-02-01 15:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-01 10:03 [dpdk-dev] [PATCH v4] " Jens Freimann
[not found] ` <CGME20190201142739eucas1p1eff46b874ee985b7aa2d32b185e837c1@eucas1p1.samsung.com>
2019-02-01 14:27 ` [dpdk-dev] [v4] " Ilya Maximets
2019-02-01 15:13 ` Jens Freimann
2019-02-01 15:21 ` Ilya Maximets [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35e0590f-a303-87c8-06fa-e745a3deb2f7@samsung.com \
--to=i.maximets@samsung.com \
--cc=dev@dpdk.org \
--cc=jfreimann@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=tiwei.bie@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).