From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Aaron Conole <aconole@redhat.com>
Cc: sodey@sonusnet.com, yuanhan.liu@linux.intel.com,
jianfeng.tan@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 6/7] net/virtio: Add MTU feature support
Date: Thu, 16 Feb 2017 22:17:02 +0100 [thread overview]
Message-ID: <6016b238-1c5d-9ca5-d576-c7db33e26a8b@redhat.com> (raw)
In-Reply-To: <f7to9y2szjq.fsf@redhat.com>
Hi Aaron,
On 02/16/2017 08:31 PM, Aaron Conole wrote:
> Maxime Coquelin <maxime.coquelin@redhat.com> writes:
>
>> This patch implements support for the Virtio MTU feature.
>> When negotiated, the host shares its maximum supported MTU,
>> which is used as initial MTU and as maximum MTU the application
>> can set.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>> doc/guides/nics/features/virtio.ini | 1 +
>> drivers/net/virtio/virtio_ethdev.c | 22 ++++++++++++++++++++--
>> drivers/net/virtio/virtio_ethdev.h | 3 ++-
>> drivers/net/virtio/virtio_pci.h | 3 +++
>> 4 files changed, 26 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/guides/nics/features/virtio.ini b/doc/guides/nics/features/virtio.ini
>> index 5164937..7bea075 100644
>> --- a/doc/guides/nics/features/virtio.ini
>> +++ b/doc/guides/nics/features/virtio.ini
>> @@ -24,3 +24,4 @@ ARMv8 = Y
>> x86-32 = Y
>> x86-64 = Y
>> Usage doc = Y
>> +MTU update = Y
>> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
>> index d1ff234..ad3e6e1 100644
>> --- a/drivers/net/virtio/virtio_ethdev.c
>> +++ b/drivers/net/virtio/virtio_ethdev.c
>> @@ -721,10 +721,13 @@ virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
>> uint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN +
>> hw->vtnet_hdr_size;
>> uint32_t frame_size = mtu + ether_hdr_len;
>> + uint32_t max_frame_size = hw->max_mtu + ether_hdr_len;
>>
>> - if (mtu < ETHER_MIN_MTU || frame_size > VIRTIO_MAX_RX_PKTLEN) {
>> + max_frame_size = RTE_MIN(max_frame_size, VIRTIO_MAX_RX_PKTLEN);
>> +
>> + if (mtu < ETHER_MIN_MTU || frame_size > max_frame_size) {
>> PMD_INIT_LOG(ERR, "MTU should be between %d and %d",
>> - ETHER_MIN_MTU, VIRTIO_MAX_RX_PKTLEN - ether_hdr_len);
>> + ETHER_MIN_MTU, max_frame_size - ether_hdr_len);
>> return -EINVAL;
>> }
>> return 0;
>> @@ -1392,6 +1395,21 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
>>
>> hw->max_queue_pairs = config->max_virtqueue_pairs;
>>
>> + if (vtpci_with_feature(hw, VIRTIO_NET_F_MTU)) {
>> + vtpci_read_dev_config(hw,
>> + offsetof(struct virtio_net_config, mtu),
>> + &config->mtu,
>> + sizeof(config->mtu));
>
> I think we need to check the value here against the min mtu, right?
Right. Moreover, we don't check it in Qemu.
I need to add the check both DPDK and Qemu.
Thanks,
Maxime
next prev parent reply other threads:[~2017-02-16 21:17 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 14:28 [dpdk-dev] [PATCH 0/7] virtio/vhost: " Maxime Coquelin
2017-02-13 14:28 ` [dpdk-dev] [PATCH 1/7] vhost: Enable VIRTIO_NET_F_MTU feature Maxime Coquelin
2017-02-13 14:28 ` [dpdk-dev] [PATCH 2/7] vhost: vhost-user: Add MTU protocol feature support Maxime Coquelin
2017-02-13 14:28 ` [dpdk-dev] [PATCH 3/7] vhost: Add new ready status flag Maxime Coquelin
2017-02-13 14:28 ` [dpdk-dev] [PATCH 4/7] vhost: Add API to get/set MTU value Maxime Coquelin
2017-02-13 14:28 ` [dpdk-dev] [PATCH 5/7] net/vhost: Implement mtu_set callback Maxime Coquelin
2017-02-13 14:28 ` [dpdk-dev] [PATCH 6/7] net/virtio: Add MTU feature support Maxime Coquelin
2017-02-16 19:31 ` Aaron Conole
2017-02-16 21:17 ` Maxime Coquelin [this message]
2017-02-13 14:28 ` [dpdk-dev] [PATCH 7/7] app/testpmd: print MTU value in show port info Maxime Coquelin
2017-02-23 7:10 ` [dpdk-dev] [PATCH 0/7] virtio/vhost: Add MTU feature support Yuanhan Liu
2017-03-01 7:44 ` Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 " Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 1/7] vhost: Enable VIRTIO_NET_F_MTU feature Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 2/7] vhost: vhost-user: Add MTU protocol feature support Maxime Coquelin
2017-03-08 2:31 ` Yuanhan Liu
2017-03-12 10:24 ` Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 3/7] vhost: Add new ready status flag Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 4/7] vhost: Add API to get MTU value Maxime Coquelin
2017-03-08 2:45 ` Yuanhan Liu
2017-03-12 10:23 ` Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 5/7] net/vhost: Fill rte_eth_dev's MTU property Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 6/7] net/virtio: Add MTU feature support Maxime Coquelin
2017-03-06 8:27 ` [dpdk-dev] [PATCH v2 7/7] app/testpmd: print MTU value in show port info Maxime Coquelin
2017-03-07 21:57 ` [dpdk-dev] [PATCH v2 0/7] virtio/vhost: Add MTU feature support Thomas Monjalon
2017-03-12 10:00 ` Maxime Coquelin
2017-03-12 16:33 ` [dpdk-dev] [PATCH v3 0/9] " Maxime Coquelin
2017-03-12 16:33 ` [dpdk-dev] [PATCH v3 1/9] vhost: Enable VIRTIO_NET_F_MTU feature Maxime Coquelin
2017-03-12 16:33 ` [dpdk-dev] [PATCH v3 2/9] vhost: vhost-user: Add MTU protocol feature support Maxime Coquelin
2017-03-12 16:34 ` [dpdk-dev] [PATCH v3 3/9] vhost: Add new ready status flag Maxime Coquelin
2017-03-12 16:34 ` [dpdk-dev] [PATCH v3 4/9] vhost: Add API to get MTU value Maxime Coquelin
2017-03-16 8:00 ` Yuanhan Liu
2017-03-16 11:37 ` Maxime Coquelin
2017-03-17 5:32 ` Yuanhan Liu
2017-03-17 9:59 ` Maxime Coquelin
2017-03-20 8:42 ` Yuanhan Liu
2017-03-12 16:34 ` [dpdk-dev] [PATCH v3 5/9] vhost: export " Maxime Coquelin
2017-03-12 16:34 ` [dpdk-dev] [PATCH v3 6/9] net/vhost: Fill rte_eth_dev's MTU property Maxime Coquelin
2017-03-12 16:34 ` [dpdk-dev] [PATCH v3 7/9] net/virtio: Add MTU feature support Maxime Coquelin
2017-04-05 4:52 ` Tan, Jianfeng
2017-04-05 7:11 ` Maxime Coquelin
2017-04-05 9:42 ` Tan, Jianfeng
2017-04-05 13:54 ` Maxime Coquelin
2017-04-05 14:50 ` Tan, Jianfeng
2017-04-07 16:40 ` Maxime Coquelin
2017-04-10 6:48 ` Tan, Jianfeng
2017-03-12 16:34 ` [dpdk-dev] [PATCH v3 8/9] doc: announce Virtio and Vhost MTU support Maxime Coquelin
2017-03-12 16:34 ` [dpdk-dev] [PATCH v3 9/9] app/testpmd: print MTU value in show port info Maxime Coquelin
2017-03-22 8:58 ` [dpdk-dev] [PATCH v3 0/9] virtio/vhost: Add MTU feature support Yuanhan Liu
2017-03-22 9:03 ` Maxime Coquelin
2017-03-28 5:39 ` Yao, Lei A
2017-03-30 11:34 ` Maxime Coquelin
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=6016b238-1c5d-9ca5-d576-c7db33e26a8b@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=aconole@redhat.com \
--cc=dev@dpdk.org \
--cc=jianfeng.tan@intel.com \
--cc=sodey@sonusnet.com \
--cc=yuanhan.liu@linux.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).