From: Andrew Rybchenko Date: Thu, 7 Feb 2019 12:17:53 +0000 (+0000) Subject: net/sfc: support Rx packet types get in secondary process X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2646d42fff6df8dcecec1b9c85a9c3129a4b764d;p=dpdk.git net/sfc: support Rx packet types get in secondary process Secondary process needs to know packet classes supported by the NIC on Rx. Signed-off-by: Andrew Rybchenko --- diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst index 1b7f14cb25..2b0f60d3d8 100644 --- a/doc/guides/rel_notes/release_19_05.rst +++ b/doc/guides/rel_notes/release_19_05.rst @@ -63,6 +63,7 @@ New Features * Added support for Tx descriptor status API in a secondary process. * Added support for RSS RETA and hash configuration get API in a secondary process. + * Added support for Rx packet types list in a secondary process. Removed Items diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c index 8526a84b57..83001cb68f 100644 --- a/drivers/net/sfc/sfc.c +++ b/drivers/net/sfc/sfc.c @@ -342,6 +342,15 @@ sfc_try_start(struct sfc_adapter *sa) goto fail_nic_init; encp = efx_nic_cfg_get(sa->nic); + + /* + * Refresh (since it may change on NIC reset/restart) a copy of + * supported tunnel encapsulations in shared memory to be used + * on supported Rx packet type classes get. + */ + sa->priv.shared->tunnel_encaps = + encp->enc_tunnel_encapsulations_supported; + if (encp->enc_tunnel_encapsulations_supported != 0) { sfc_log_init(sa, "apply tunnel config"); rc = efx_tunnel_reconfigure(sa->nic); @@ -728,6 +737,13 @@ sfc_attach(struct sfc_adapter *sa) encp = efx_nic_cfg_get(sa->nic); + /* + * Make a copy of supported tunnel encapsulations in shared + * memory to be used on supported Rx packet type classes get. + */ + sa->priv.shared->tunnel_encaps = + encp->enc_tunnel_encapsulations_supported; + if (sa->priv.dp_tx->features & SFC_DP_TX_FEAT_TSO) { sa->tso = encp->enc_fw_assisted_tso_v2_enabled; if (!sa->tso) diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index 39b4ba52ce..725dd5ee62 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -184,6 +184,7 @@ struct sfc_adapter_shared { struct sfc_rss rss; boolean_t isolated; + uint32_t tunnel_encaps; struct rte_pci_addr pci_addr; uint16_t port_id; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index a54a9e66bc..286550863f 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -182,11 +182,8 @@ static const uint32_t * sfc_dev_supported_ptypes_get(struct rte_eth_dev *dev) { const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev); - struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); - const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic); - uint32_t tunnel_encaps = encp->enc_tunnel_encapsulations_supported; - return sap->dp_rx->supported_ptypes_get(tunnel_encaps); + return sap->dp_rx->supported_ptypes_get(sap->shared->tunnel_encaps); } static int @@ -1897,6 +1894,7 @@ sfc_eth_dev_clear_ops(struct rte_eth_dev *dev) } static const struct eth_dev_ops sfc_eth_dev_secondary_ops = { + .dev_supported_ptypes_get = sfc_dev_supported_ptypes_get, .rx_queue_count = sfc_rx_queue_count, .rx_descriptor_done = sfc_rx_descriptor_done, .rx_descriptor_status = sfc_rx_descriptor_status,