[PATCH v9 05/12] net/nfp: add flower PF setup logic

Ferruh Yigit ferruh.yigit at xilinx.com
Tue Sep 20 16:57:12 CEST 2022


On 9/15/2022 11:44 AM, Chaoyong He wrote:
> Adds the vNIC initialization logic for the flower PF vNIC. The flower
> firmware application exposes this vNIC for the purposes of fallback
> traffic in the switchdev use-case.
> 
> Adds minimal dev_ops for this PF vNIC device. Because the device is
> being exposed externally to DPDK it needs to implements a minimal set
> of dev_ops.
> 
> Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>

<...>

> +
> +struct dp_packet {
> +	struct rte_mbuf mbuf;
> +	uint32_t source;
> +};
> +
> +static void
> +nfp_flower_pf_mp_init(__rte_unused struct rte_mempool *mp,
> +		__rte_unused void *opaque_arg,
> +		void *packet,
> +		__rte_unused unsigned int i)
> +{
> +	struct dp_packet *pkt = packet;
> +	/* Indicate that this pkt is from DPDK */
> +	pkt->source = 3;
> +}
> +
> +static struct rte_mempool *
> +nfp_flower_pf_mp_create(void)
> +{
> +	uint32_t nb_mbufs;
> +	unsigned int numa_node;
> +	struct rte_mempool *pktmbuf_pool;
> +	uint32_t n_rxd = PF_VNIC_NB_DESC;
> +	uint32_t n_txd = PF_VNIC_NB_DESC;
> +
> +	nb_mbufs = RTE_MAX(n_rxd + n_txd + MAX_PKT_BURST + MEMPOOL_CACHE_SIZE, 81920U);
> +
> +	numa_node = rte_socket_id();
> +	pktmbuf_pool = rte_pktmbuf_pool_create("flower_pf_mbuf_pool", nb_mbufs,
> +			MEMPOOL_CACHE_SIZE, MBUF_PRIV_SIZE,
> +			RTE_MBUF_DEFAULT_BUF_SIZE, numa_node);
> +	if (pktmbuf_pool == NULL) {
> +		PMD_INIT_LOG(ERR, "Cannot init pf vnic mbuf pool");
> +		return NULL;
> +	}
> +
> +	rte_mempool_obj_iter(pktmbuf_pool, nfp_flower_pf_mp_init, NULL);
> +
> +	return pktmbuf_pool;
> +}
> +

Hi Chaoyong,

Again, similar comment to previous versions, what I understand is this 
new flower FW supports HW flow filter and intended use case is for OvS 
HW acceleration.
But is DPDK driver need to know OvS data structures, like "struct 
dp_packet", can it be transparent to application, I am sure there are 
other devices offloading some OvS task to HW.

@Ian, @David,

Can you please comment on above usage, do you guys see any way to escape 
from OvS specific code in the driver?



More information about the dev mailing list