aboutsummaryrefslogtreecommitdiffstats
path: root/dpdk/dpdk-v18.11_patches/0009-net-virtio-fill-desc-limit.patch
diff options
context:
space:
mode:
authorJianfeng Tan <henry.tjf@antfin.com>2019-11-18 06:59:50 +0000
committerJianfeng Tan <henry.tjf@antfin.com>2020-03-05 01:31:33 +0800
commit78c896b3b3127515478090c19447e27dc406427e (patch)
treed6d67d4683e9ca0409f9984a834547a572fb5310 /dpdk/dpdk-v18.11_patches/0009-net-virtio-fill-desc-limit.patch
parente4380f4866091fd92a7a57667dd938a99144f9cd (diff)
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com> Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com> Signed-off-by: Jian Zhang <wuzai.zj@antfin.com> Signed-off-by: Chen Zhao <winters.zc@antfin.com> Change-Id: I55c39de4c6cd30f991f35631eb507f770230f08e
Diffstat (limited to 'dpdk/dpdk-v18.11_patches/0009-net-virtio-fill-desc-limit.patch')
-rw-r--r--dpdk/dpdk-v18.11_patches/0009-net-virtio-fill-desc-limit.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/dpdk/dpdk-v18.11_patches/0009-net-virtio-fill-desc-limit.patch b/dpdk/dpdk-v18.11_patches/0009-net-virtio-fill-desc-limit.patch
new file mode 100644
index 0000000..146ea88
--- /dev/null
+++ b/dpdk/dpdk-v18.11_patches/0009-net-virtio-fill-desc-limit.patch
@@ -0,0 +1,42 @@
+commit 470acd1b108f20ae12b1216c9f6157b78655bcc7
+Author: Jianfeng Tan <henry.tjf@antfin.com>
+Date: Wed Dec 12 02:14:03 2018 +0000
+
+ net/virtio: fill desc limit
+
+ We shall fill desc limit accordingly, or APIs, such as
+ rte_eth_dev_adjust_nb_rx_tx_desc, will not give correct desc
+ information.
+
+ Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>
+
+diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
+index dbfa6865c..d369d5ce8 100644
+--- a/drivers/net/virtio/virtio_ethdev.c
++++ b/drivers/net/virtio/virtio_ethdev.c
+@@ -2172,6 +2172,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+ {
+ uint64_t tso_mask, host_features;
+ struct virtio_hw *hw = dev->data->dev_private;
++ struct virtqueue *vq;
+
+ dev_info->speed_capa = ETH_LINK_SPEED_10G; /* fake value */
+
+@@ -2209,6 +2210,17 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+ (1ULL << VIRTIO_NET_F_HOST_TSO6);
+ if ((host_features & tso_mask) == tso_mask)
+ dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;
++
++
++ if (hw->vqs) {
++ vq = hw->vqs[VTNET_SQ_RQ_QUEUE_IDX];
++ dev_info->rx_desc_lim.nb_max = vq->vq_nentries;
++ dev_info->rx_desc_lim.nb_min = 256;
++
++ vq = hw->vqs[VTNET_SQ_TQ_QUEUE_IDX];
++ dev_info->tx_desc_lim.nb_max = vq->vq_nentries;
++ dev_info->tx_desc_lim.nb_min = 256;
++ }
+ }
+
+ /*