* [dpdk-dev] [PATCH 1/1] net/szedata2: convert to new offload API
@ 2018-04-03 15:06 Matej Vido
2018-04-05 17:02 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Matej Vido @ 2018-04-03 15:06 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, remes
Offload API is currently used only to setup correct receive function
for scattered packets.
Use offloads member instead of bitfield and advertise correct
capabilities.
Signed-off-by: Matej Vido <vido@cesnet.cz>
---
drivers/net/szedata2/rte_eth_szedata2.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 1d02aee..3cfe388 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1016,7 +1016,7 @@ struct pmd_internals {
eth_dev_configure(struct rte_eth_dev *dev)
{
struct rte_eth_dev_data *data = dev->data;
- if (data->dev_conf.rxmode.enable_scatter == 1) {
+ if (data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_SCATTER) {
dev->rx_pkt_burst = eth_szedata2_rx_scattered;
data->scattered_rx = 1;
} else {
@@ -1031,6 +1031,7 @@ struct pmd_internals {
struct rte_eth_dev_info *dev_info)
{
struct pmd_internals *internals = dev->data->dev_private;
+
dev_info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
dev_info->if_index = 0;
dev_info->max_mac_addrs = 1;
@@ -1038,6 +1039,10 @@ struct pmd_internals {
dev_info->max_rx_queues = internals->max_rx_queues;
dev_info->max_tx_queues = internals->max_tx_queues;
dev_info->min_rx_bufsize = 0;
+ dev_info->rx_offload_capa = DEV_RX_OFFLOAD_SCATTER;
+ dev_info->tx_offload_capa = 0;
+ dev_info->rx_queue_offload_capa = 0;
+ dev_info->tx_queue_offload_capa = 0;
dev_info->speed_capa = ETH_LINK_SPEED_100G;
}
@@ -1514,14 +1519,10 @@ struct pmd_internals {
internals->max_rx_queues, internals->max_tx_queues);
/* Set rx, tx burst functions */
- if (data->dev_conf.rxmode.enable_scatter == 1 ||
- data->scattered_rx == 1) {
+ if (data->scattered_rx == 1)
dev->rx_pkt_burst = eth_szedata2_rx_scattered;
- data->scattered_rx = 1;
- } else {
+ else
dev->rx_pkt_burst = eth_szedata2_rx;
- data->scattered_rx = 0;
- }
dev->tx_pkt_burst = eth_szedata2_tx;
/* Set function callbacks for Ethernet API */
--
1.8.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-05 17:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 15:06 [dpdk-dev] [PATCH 1/1] net/szedata2: convert to new offload API Matej Vido
2018-04-05 17:02 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).