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

Ferruh Yigit ferruh.yigit at intel.com
Fri May 5 13:43:02 CEST 2017


On 5/3/2017 12:21 PM, Hemant Agrawal 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];

rte_kni_mbuf and rte_mbuf should be binary compatible. This is
packet_type field of the mbuf struct.

When DPDK application receives the mbuf, how it will know if this
gso_size or packet_type, unless it knows underlying port is KNI. Is it
possible to use udata64 field for this?

Who will use information and how it will be used, can you please provide
some sort of sample?

Thanks,
ferruh

>  	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);
> 



More information about the dev mailing list