[dpdk-dev] [RFC PATCH 4/5] kni: add support to get gso_size info

Alejandro Lucero alejandro.lucero at netronome.com
Wed May 3 15:57:42 CEST 2017


I guess this is just need this for tso offload. isn't it?

Just asking because I have done some work adding gather and tso offload to
kni and I was wondering if this is duplicated job from my part.

If you are wondering what KNI offload means, since it is not talking to any
hw, the offload is regarding the PMD where KNI is sending packet to. So if
that PMD supports hw offloads, KNI netdev can advertise that to the linux
network stack.



On Wed, May 3, 2017 at 12:21 PM, Hemant Agrawal <hemant.agrawal at nxp.com>
wrote:

> Inform userspace about gso size info
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
> ---
>  lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 3 ++-
>  lib/librte_eal/linuxapp/kni/kni_net.c                         | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> index 2cd7d9a..91ebed3 100644
> --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
> @@ -125,7 +125,8 @@ struct rte_kni_mbuf {
>         uint16_t nb_segs;       /**< Number of segments. */
>         char pad4[2];
>         uint64_t ol_flags;      /**< Offload features. */
> -       char pad2[4];
> +       uint16_t gso_size;      /**< TCP Segmentation Offload Information.
> */
> +       char pad2[2];
>         uint32_t pkt_len;       /**< Total pkt len: sum of all segment
> data_len. */
>         uint16_t data_len;      /**< Amount of data in segment buffer. */
>
> diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c
> b/lib/librte_eal/linuxapp/kni/kni_net.c
> index e4a3296..c7648d3 100644
> --- a/lib/librte_eal/linuxapp/kni/kni_net.c
> +++ b/lib/librte_eal/linuxapp/kni/kni_net.c
> @@ -252,6 +252,7 @@
>                 }
>                 pkt_kva->pkt_len = len;
>                 pkt_kva->data_len = len;
> +               pkt_kva->gso_size = skb_shinfo(skb)->gso_size; /* passes
> gso_size from Kernel to GPP */
>
>                 /* enqueue mbuf into tx_q */
>                 ret = kni_fifo_put(kni->tx_q, &pkt_va, 1);
> --
> 1.9.1
>
>


More information about the dev mailing list