From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6577741C55; Thu, 9 Feb 2023 20:45:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F32BB40E50; Thu, 9 Feb 2023 20:45:04 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060.outbound.protection.outlook.com [40.107.223.60]) by mails.dpdk.org (Postfix) with ESMTP id F1D6A4067B for ; Thu, 9 Feb 2023 20:45:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JqPhaTam6wLt9gTOxTLWHKYIjOe+1DaRw08Vwo7Bwp17pCrCI5Y2ofQydLfCI1ZXJqzmfZll5GNd1r7Ys/UlDEOpcQfqdWcBK88BwhmSxeFdVNJBU8gRckoMv7zxQJXu61SBdPxLbYuv2V/MtbdQ6i3PoucGFfoNEY1mPhFaQ1yD3hAFSAXFLIG+hherQVXxslgcN11YejmNpabKlLvnGPV9VWcfftwP6SCDHJ88nA+y6b/b5dC1aletei2u7a1hO7Ar1KVaBOiAvRr7ZN/OT6ncH4kBQ5wYvRU+6y475JBk1x6wGR6/HVpoqT6XNghTqHJ4CBEzaVJLenJ87AKbqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m9eMjdogKJPPUgyyjb3wR+khWxQi3V8uafnQsMAmNpE=; b=OG24Ixh7halQjFBWGqkOdZnNAX/NyGwsWOrFGXjzfhS7FO1U/TrbmbnkIDl+PFU2NwnIy+qulhuUkA+t8gyyRBL2VD/OjeE/a06xdZwBVBoie0cQrNiUtQ6uwhVfw7hdPhuLN+/S4wvpVcNeyPem6wjATIZlMSWlfEciW+d5+GVFxI21XunUxDl5lgiz6+Fxx0Mtv6gfrVKfTqjPgPWbxTS9l1G8walQ9d6TPUVRxskmU6BvjMVN1o4Qpa6B3/JzQEPeBBzw+euZ/e8ZFTk+x0+pYCzl7BzrkA2/5yhRifMk+luQzoVROlOJxGJFNaRVEnm3jSffGayiZynZlJF+fQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m9eMjdogKJPPUgyyjb3wR+khWxQi3V8uafnQsMAmNpE=; b=lvGeSvFVzLv8XumPVOsQTIYkELEpWjMlnCeEnKO19BI4u4kRPpK4UuQWAMCsleFaWv32cenHyxsLGCYkdBvQEYqkZusdZgxRstOvTZjDE1tyuqw6BHRMi0PFmg3WydshNuRgHyvAeuLDN1vk5XxLOg8DM42TOLH1kvXhmIWhjUU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DS7PR12MB6142.namprd12.prod.outlook.com (2603:10b6:8:9a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 19:45:00 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%6]) with mapi id 15.20.6086.017; Thu, 9 Feb 2023 19:45:00 +0000 Message-ID: <562e77e6-ea8a-7a56-6fbd-8aba70b295d4@amd.com> Date: Thu, 9 Feb 2023 19:44:54 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: Jiawei Wang , viacheslavo@nvidia.com, orika@nvidia.com, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, Aman Singh , Yuying Zhang Cc: dev@dpdk.org, rasland@nvidia.com References: <20230203050717.46914-1-jiaweiw@nvidia.com> <20230203133339.30271-1-jiaweiw@nvidia.com> <20230203133339.30271-2-jiaweiw@nvidia.com> From: Ferruh Yigit Subject: Re: [PATCH v4 1/2] ethdev: introduce the PHY affinity field in Tx queue API In-Reply-To: <20230203133339.30271-2-jiaweiw@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO0P123CA0004.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:354::9) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS7PR12MB6142:EE_ X-MS-Office365-Filtering-Correlation-Id: 9baa43b3-03ec-4632-9423-08db0ad62162 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pe44ova93rjwxTs2IjTiweDw3lgL1nvXnwYyGCorQfh01w38vf5Op+/McRG4eAIKmRshg7nGzyKb6xQ5mKp13Zdjkr9oD2mrctYTcrQqHoRSg/n76ZJz3Fcy1BBupZdEj8j/GRK6Hl5EIwDNPLsgjb3nrrVkRBM4V2xMpoMor9+IwqbzoOimgNFPBPhWzQxc7TBXsKItbKKrXLddXF56kkig0Jf0jZO+FgdaYmOwwEn7Wzzhb+Z7JzPYqWlNDQP0+vmktI2hRFZmKh6/ec9jUFCG/+r73tIkiua1lecqSMwGkhGyDAUaAssEBgZLNYa2MaOhWEFgI/JOCfJPo0koRgTKPwF75/4hU6KIpu9WWmBLhVaPc/cuDfdVQSBZe356HaAR0S2bgqVd4gTXaygay7/haeCsgpVTXYstvPy9gQlSk3nHJCXA8C1vG0SWvzPXtHUCWcE1dBnDxUNVF6w92Z/hRJjOtJ7AGoPbL8acGKr9oIoKsUoiZeor2PujWqvR30ogKrQSd6ial0qPtX2naf+ujANmn9tdWa3XlA3YlJojj3hurch/F1XaUAv7YMNH2iSS+jwavxoTg/QRszRc/AVxIkbNJM8mL7eU33v2oiurJx7OifDfQkoyN5zavhSNytLPwXwFWK03gGqqAA008HyF8vbZjqVKiJenqNqP6QDZjomMBS1S9w12bpjIOkhJld/KDPLjJxVd25k76Pq/wlBkzCYOvx32QHCT/RA+4bE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(396003)(136003)(376002)(366004)(39860400002)(451199018)(31686004)(316002)(8676002)(66946007)(66476007)(110136005)(8936002)(66556008)(186003)(4326008)(41300700001)(5660300002)(86362001)(31696002)(36756003)(38100700002)(6512007)(6666004)(6506007)(26005)(2906002)(30864003)(44832011)(53546011)(478600001)(6486002)(2616005)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dStibTRlSFc5U291YVpVZms2dXZEUE1xcXRML3M5QjVQSHgvRzBFOXp3QjBX?= =?utf-8?B?RndLWEhWaUtCVTcwU0Ixelk4a0tVaG5IWkxvNlgzdTNhZ2NvV2xqcTdKdFpX?= =?utf-8?B?NjNoa0Z5QithQmVwUE0xZ25ZU1lDNWE2U1lKcXk3dDJGU3NXZXpqZGRTWVdY?= =?utf-8?B?OWZxNkNObTV4NFlIbTN3bEVKUkRyTDVFRGU3OStnNDgwNnhGWTRxS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CMXI5Nm9jK0hUR3pZS09XM0tpK2hEMW52ZTJn?= =?utf-8?B?TktHc25UQkVya2czSmlGeGIvOVZuRHBVVFRSWW43YWhHYWMvM2lYTmhsTmJj?= =?utf-8?Q?bytdwA0Ct5BN596TLAApSz1Gu?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9baa43b3-03ec-4632-9423-08db0ad62162 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 19:45:00.5581 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qDXDEjVragdPG9PXDuUAshq4FXmN2xLW2X6Z74FAO9iZwNA0CtLYM++nWw6Fs+F1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6142 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/3/2023 1:33 PM, Jiawei Wang wrote: > When multiple physical ports are connected to a single DPDK port, > (example: kernel bonding, DPDK bonding, failsafe, etc.), > we want to know which physical port is used for Rx and Tx. > I assume "kernel bonding" is out of context, but this patch concerns DPDK bonding, failsafe or softnic. (I will refer them as virtual bonding device.) To use specific queues of the virtual bonding device may interfere with the logic of these devices, like bonding modes or RSS of the underlying devices. I can see feature focuses on a very specific use case, but not sure if all possible side effects taken into consideration. And although the feature is only relavent to virtual bondiong device, core ethdev structures are updated for this. Most use cases won't need these, so is there a way to reduce the scope of the changes to virtual bonding devices? There are a few very core ethdev APIs, like: rte_eth_dev_configure() rte_eth_tx_queue_setup() rte_eth_rx_queue_setup() rte_eth_dev_start() rte_eth_dev_info_get() Almost every user of ehtdev uses these APIs, since these are so fundemental I am for being a little more conservative on these APIs. Every eccentric features are targetting these APIs first because they are common and extending them gives an easy solution, but in long run making these APIs more complex, harder to maintain and harder for PMDs to support them correctly. So I am for not updating them unless it is a generic use case. Also as we talked about PMDs supporting them, I assume your coming PMD patch will be implementing 'tx_phy_affinity' config option only for mlx drivers. What will happen for other NICs? Will they silently ignore the config option from user? So this is a problem for the DPDK application portabiltiy. As far as I understand target is application controlling which sub-device is used under the virtual bonding device, can you pleaes give more information why this is required, perhaps it can help to provide a better/different solution. Like adding the ability to use both bonding device and sub-device for data path, this way application can use whichever it wants. (this is just first solution I come with, I am not suggesting as replacement solution, but if you can describe the problem more I am sure other people can come with better solutions.) And isn't this against the applicatio transparent to underneath device being bonding device or actual device? > This patch maps a DPDK Tx queue with a physical port, > by adding tx_phy_affinity setting in Tx queue. > The affinity number is the physical port ID where packets will be > sent. > Value 0 means no affinity and traffic could be routed to any > connected physical ports, this is the default current behavior. > > The number of physical ports is reported with rte_eth_dev_info_get(). > > The new tx_phy_affinity field is added into the padding hole of > rte_eth_txconf structure, the size of rte_eth_txconf keeps the same. > An ABI check rule needs to be added to avoid false warning. > > Add the testpmd command line: > testpmd> port config (port_id) txq (queue_id) phy_affinity (value) > > For example, there're two physical ports connected to > a single DPDK port (port id 0), and phy_affinity 1 stood for > the first physical port and phy_affinity 2 stood for the second > physical port. > Use the below commands to config tx phy affinity for per Tx Queue: > port config 0 txq 0 phy_affinity 1 > port config 0 txq 1 phy_affinity 1 > port config 0 txq 2 phy_affinity 2 > port config 0 txq 3 phy_affinity 2 > > These commands config the Tx Queue index 0 and Tx Queue index 1 with > phy affinity 1, uses Tx Queue 0 or Tx Queue 1 send packets, > these packets will be sent from the first physical port, and similar > with the second physical port if sending packets with Tx Queue 2 > or Tx Queue 3. > > Signed-off-by: Jiawei Wang > --- > app/test-pmd/cmdline.c | 100 ++++++++++++++++++++ > app/test-pmd/config.c | 1 + > devtools/libabigail.abignore | 5 + > doc/guides/rel_notes/release_23_03.rst | 4 + > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 +++ > lib/ethdev/rte_ethdev.h | 10 ++ > 6 files changed, 133 insertions(+) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index cb8c174020..f771fcf8ac 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -776,6 +776,10 @@ static void cmd_help_long_parsed(void *parsed_result, > > "port cleanup (port_id) txq (queue_id) (free_cnt)\n" > " Cleanup txq mbufs for a specific Tx queue\n\n" > + > + "port config (port_id) txq (queue_id) phy_affinity (value)\n" > + " Set the physical affinity value " > + "on a specific Tx queue\n\n" > ); > } > > @@ -12633,6 +12637,101 @@ static cmdline_parse_inst_t cmd_show_port_flow_transfer_proxy = { > } > }; > > +/* *** configure port txq phy_affinity value *** */ > +struct cmd_config_tx_phy_affinity { > + cmdline_fixed_string_t port; > + cmdline_fixed_string_t config; > + portid_t portid; > + cmdline_fixed_string_t txq; > + uint16_t qid; > + cmdline_fixed_string_t phy_affinity; > + uint8_t value; > +}; > + > +static void > +cmd_config_tx_phy_affinity_parsed(void *parsed_result, > + __rte_unused struct cmdline *cl, > + __rte_unused void *data) > +{ > + struct cmd_config_tx_phy_affinity *res = parsed_result; > + struct rte_eth_dev_info dev_info; > + struct rte_port *port; > + int ret; > + > + if (port_id_is_invalid(res->portid, ENABLED_WARN)) > + return; > + > + if (res->portid == (portid_t)RTE_PORT_ALL) { > + printf("Invalid port id\n"); > + return; > + } > + > + port = &ports[res->portid]; > + > + if (strcmp(res->txq, "txq")) { > + printf("Unknown parameter\n"); > + return; > + } > + if (tx_queue_id_is_invalid(res->qid)) > + return; > + > + ret = eth_dev_info_get_print_err(res->portid, &dev_info); > + if (ret != 0) > + return; > + > + if (dev_info.nb_phy_ports == 0) { > + printf("Number of physical ports is 0 which is invalid for PHY Affinity\n"); > + return; > + } > + printf("The number of physical ports is %u\n", dev_info.nb_phy_ports); > + if (dev_info.nb_phy_ports < res->value) { > + printf("The PHY affinity value %u is Invalid, exceeds the " > + "number of physical ports\n", res->value); > + return; > + } > + port->txq[res->qid].conf.tx_phy_affinity = res->value; > + > + cmd_reconfig_device_queue(res->portid, 0, 1); > +} > + > +cmdline_parse_token_string_t cmd_config_tx_phy_affinity_port = > + TOKEN_STRING_INITIALIZER(struct cmd_config_tx_phy_affinity, > + port, "port"); > +cmdline_parse_token_string_t cmd_config_tx_phy_affinity_config = > + TOKEN_STRING_INITIALIZER(struct cmd_config_tx_phy_affinity, > + config, "config"); > +cmdline_parse_token_num_t cmd_config_tx_phy_affinity_portid = > + TOKEN_NUM_INITIALIZER(struct cmd_config_tx_phy_affinity, > + portid, RTE_UINT16); > +cmdline_parse_token_string_t cmd_config_tx_phy_affinity_txq = > + TOKEN_STRING_INITIALIZER(struct cmd_config_tx_phy_affinity, > + txq, "txq"); > +cmdline_parse_token_num_t cmd_config_tx_phy_affinity_qid = > + TOKEN_NUM_INITIALIZER(struct cmd_config_tx_phy_affinity, > + qid, RTE_UINT16); > +cmdline_parse_token_string_t cmd_config_tx_phy_affinity_hwport = > + TOKEN_STRING_INITIALIZER(struct cmd_config_tx_phy_affinity, > + phy_affinity, "phy_affinity"); > +cmdline_parse_token_num_t cmd_config_tx_phy_affinity_value = > + TOKEN_NUM_INITIALIZER(struct cmd_config_tx_phy_affinity, > + value, RTE_UINT8); > + > +static cmdline_parse_inst_t cmd_config_tx_phy_affinity = { > + .f = cmd_config_tx_phy_affinity_parsed, > + .data = (void *)0, > + .help_str = "port config txq phy_affinity ", > + .tokens = { > + (void *)&cmd_config_tx_phy_affinity_port, > + (void *)&cmd_config_tx_phy_affinity_config, > + (void *)&cmd_config_tx_phy_affinity_portid, > + (void *)&cmd_config_tx_phy_affinity_txq, > + (void *)&cmd_config_tx_phy_affinity_qid, > + (void *)&cmd_config_tx_phy_affinity_hwport, > + (void *)&cmd_config_tx_phy_affinity_value, > + NULL, > + }, > +}; > + > /* ******************************************************************************** */ > > /* list of instructions */ > @@ -12866,6 +12965,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { > (cmdline_parse_inst_t *)&cmd_show_port_cman_capa, > (cmdline_parse_inst_t *)&cmd_show_port_cman_config, > (cmdline_parse_inst_t *)&cmd_set_port_cman_config, > + (cmdline_parse_inst_t *)&cmd_config_tx_phy_affinity, > NULL, > }; > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index acccb6b035..b83fb17cfa 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -936,6 +936,7 @@ port_infos_display(portid_t port_id) > printf("unknown\n"); > break; > } > + printf("Current number of physical ports: %u\n", dev_info.nb_phy_ports); > } > > void > diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore > index 7a93de3ba1..ac7d3fb2da 100644 > --- a/devtools/libabigail.abignore > +++ b/devtools/libabigail.abignore > @@ -34,3 +34,8 @@ > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ; Temporary exceptions till next major ABI version ; > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > + > +; Ignore fields inserted in padding hole of rte_eth_txconf > +[suppress_type] > + name = rte_eth_txconf > + has_data_member_inserted_between = {offset_of(tx_deferred_start), offset_of(offloads)} > diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst > index 73f5d94e14..e99bd2dcb6 100644 > --- a/doc/guides/rel_notes/release_23_03.rst > +++ b/doc/guides/rel_notes/release_23_03.rst > @@ -55,6 +55,10 @@ New Features > Also, make sure to start the actual text at the margin. > ======================================================= > > +* **Added affinity for multiple physical ports connected to a single DPDK port.** > + > + * Added Tx affinity in queue setup to map a physical port. > + > * **Updated AMD axgbe driver.** > > * Added multi-process support. > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 79a1fa9cb7..5c716f7679 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -1605,6 +1605,19 @@ Enable or disable a per queue Tx offloading only on a specific Tx queue:: > > This command should be run when the port is stopped, or else it will fail. > > +config per queue Tx physical affinity > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Configure a per queue physical affinity value only on a specific Tx queue:: > + > + testpmd> port (port_id) txq (queue_id) phy_affinity (value) > + > +* ``phy_affinity``: physical port to use for sending, > + when multiple physical ports are connected to > + a single DPDK port. > + > +This command should be run when the port is stopped, otherwise it fails. > + > Config VXLAN Encap outer layers > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index c129ca1eaf..2fd971b7b5 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1138,6 +1138,14 @@ struct rte_eth_txconf { > less free descriptors than this value. */ > > uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */ > + /** > + * Affinity with one of the multiple physical ports connected to the DPDK port. > + * Value 0 means no affinity and traffic could be routed to any connected > + * physical port. > + * The first physical port is number 1 and so on. > + * Number of physical ports is reported by nb_phy_ports in rte_eth_dev_info. > + */ > + uint8_t tx_phy_affinity; > /** > * Per-queue Tx offloads to be set using RTE_ETH_TX_OFFLOAD_* flags. > * Only offloads set on tx_queue_offload_capa or tx_offload_capa > @@ -1744,6 +1752,8 @@ struct rte_eth_dev_info { > /** Device redirection table size, the total number of entries. */ > uint16_t reta_size; > uint8_t hash_key_size; /**< Hash key size in bytes */ > + /** Number of physical ports connected with DPDK port. */ > + uint8_t nb_phy_ports; > /** Bit mask of RSS offloads, the bit offset also means flow type */ > uint64_t flow_type_rss_offloads; > struct rte_eth_rxconf default_rxconf; /**< Default Rx configuration */