From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0069.outbound.protection.outlook.com [104.47.0.69]) by dpdk.org (Postfix) with ESMTP id 51C731ADD3 for ; Tue, 12 Dec 2017 13:53:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=swRctA+8TZO7qEcLxIYrImchmgdN0tvtzo9+HYHXSgg=; b=PW0KtClbyxcUDnAwZngHuz9evpy0/TjqSxZVPg7qATaNImUflSOz5zCDGxtirSsXbff/6H0jSrKLT1RtRukFusRFTbglfppGazDcOI14nmrYG/Hbfq0J/4UwcORkkEfz3AgUfFDn1w4JEbdvWiJPmtTd5MamNW3eNxOZg6gyv6Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:53:43 +0000 From: Shahaf Shuler To: ferruh.yigit@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org Date: Tue, 12 Dec 2017 14:52:54 +0200 Message-Id: <0614d77f456768b3694e7f18c1c0cb7ee732f5e5.1513082773.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123120804.143897-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: DB6PR1001CA0037.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::23) To VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2209a068-4232-4e02-39e5-08d5415f60cb X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3150; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 3:+RZYmGxONhA/n7vx1k7fd7feGBv+Sh2QT/ctrX2tyKCVy211qlPQXc2s9KJau0eY5/xKjh7UXdYt6GAYF7boEW0NQOt7UgINsrvyOaGJbdsPH8D25eNJA+b4BMUbbX1Ax6AwK6olXOBvoLRsZE5iTJVMb1M7FCi0ZVH7Az/yre0tHbLqdMIikA91cHm3Xa0D1TBDBRoLwj74ubnFXlHlwA/axK2mzRRYdFCHlDTX4+oycdIkxKBqiH52F3qE/rQY; 25:zWl+ThrhUipPs40GN9Wsu5Ln+eSkTmzEUv4EHE3fIZm7FRahd+sUTAilN4uj9leY9Wtzk7ty3hRPbFRQ7dDeDXO34RpH8pQmEp/8zCTC58KUhpGGHIyACjvkneMNQxNyUNlAwm/rbzBpV+qntmPkM+f+RT8Xy6Fzrg/zd7X4iTh+W0oQXwOmUhEPoQiJ7VrfdkTm3M8qUcm897wl8AiCI49J5rZxcC4JFxgqrQ+KM7lsMxXpjh803S2QPjk3vJNaZvlTdIE2Ts3X6jg2+qR7EM7cRwMns9OqK5cS80+jYoIJ5U+SV52jbgN9dB4QTBC5Fr9lNN07mNbSIkjdKgzDxg==; 31:RbfHx12ZD2BdI9iUqvdzEhuP3mcyUIO8XzSytUk2UoXkeFqSDTkiTpMPSWi63zHUcBy6nC+18cNl0kcw7bYf0NGD9ypUaV5FJuO8gw/p5XUe8Qo9ppqQj6BcTDdnwFN6Cw/iDO+IEdOxY+3J/AWH45+Mh/eX63oljySs6eipaoYBdvXFcUcJAMVREmHZNOBSmIXbiNs05yyMW4Y4yx9eyUJio88pSclMdiCCQ1+U7Og= X-MS-TrafficTypeDiagnostic: VI1PR05MB3150: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 20:JP2NurC3+lsm9p2G2IGi3dP74/VPL0tB8DkJ5lX4gpFDuUAXV4TV4BkmnLapSMVpCECdT9P8RJrZVFaoyjwhscQiqPTu9qS2/6J6DkcIdvX7kP9hXUFB2tbvjUyJ7V2o57kOWhVuT7i686S8bDFQbjQqpE3uHqoocbIuLWWdTKsWFtI0Ij8Lz6OSArZzuWDsmEX3cVu04S4pZ1DNnzpfQ1vq5L9GtMP+2keB7D/Hf/XeOHwLGmuguI+82Je1xZ1sQBT/UKDGzJLMezu9ALnEeDGQe5UTEA8182UZOf0fkZq5UZdm0h3cWSKC33hTW7E6Z5h7d80VqALZxs0EcOzy85QEKLQpb+ep6cbO0PtkLXn8ZFo2A/Sm5wcifRKFYkyGqwKRwspCz0J1zE3eR/SZUTFEuyxmDT5MutgMzuNBmSV8TZSYBBaylAbmEfVb49IDjLYH6gihWV8suLVms1BWbszqCrC3oJAfprxags8OkKd09b0qaCG+tHtAEgcJLKC0; 4:FAB22uW5gjK4l18U2AXyTevSGP/mIuZsrOOeXCfoNf9g4c06R6n4rkLjcykP0jJ/BSN7baU108Uv1JwWpuE2AUiS1Z4+IjaAJhN2zHmqnGLy9xGv6czaL29E5T+5SXrjw5x8/UaE85wdlnZNu7pDP2be2IJV7w7HwHkcTQMv0Q5GFh3RfJvpzenbi+NgXBcgG2xMTr3b0g7zs5hLT2nb4ZBqODsvpBYNB8sLF3wpIXCrWFaUW5bKJjIK5hVqIycmZUXFDlMs84F5PKghjd5Lrw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3150; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3150; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(376002)(199004)(189003)(55016002)(81166006)(106356001)(7736002)(81156014)(47776003)(8676002)(305945005)(105586002)(66066001)(36756003)(4326008)(118296001)(53936002)(16586007)(50466002)(48376002)(7696005)(33026002)(69596002)(52116002)(51416003)(478600001)(5660300001)(16526018)(97736004)(21086003)(316002)(6116002)(76176011)(3846002)(50226002)(6666003)(2906002)(2950100002)(8936002)(86362001)(68736007)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3150; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB3150; 23:oDMWTdlM/nzU1CIfEl+61FiFnd/S6WKGJPa4wA3JV?= =?us-ascii?Q?y16kyHK+T/AP6DvhoOzXZMxq/aP6ganmOFMwBogx4MKzB7ugjaWWbBOeJ/ev?= =?us-ascii?Q?gejT0Y91a9mOqTi5uBPPFLRVyeBfIBeYKvMyvQqWLEJUP60Ii7WFjzS8yKN8?= =?us-ascii?Q?YkburIuqR6WBjRy3KHG/VdE+EbIQ5cXg+zGukQoHXZPtosyGfpNb5NFobnKX?= =?us-ascii?Q?sf8tVwInx63E40xOs3MC9S0MRy2AWEEDEy/uru906YMIJSsVlzMQ5mDcUOmV?= =?us-ascii?Q?y2IS+XRY52gZGg51vMcedwVZ9WnJCvGZohnHmmO/Ze34vow5Q2rgwqwWLwcR?= =?us-ascii?Q?BHJgZ/LO7YxkNHfBHa7zRpPuSHtoS8IYMGzDirXyk5iVmwVZIzOAcvdmNEND?= =?us-ascii?Q?v4r5J27r9vGtIfpta6BzpFA/mzNLT5WS/jobN0Lr7rvCLlviUKoFl2RjhYRH?= =?us-ascii?Q?cNfoc1H9SH1uMlRYZrg3vZwtaX9HgwA/F7z4dPRbTHd52SutpeXze7Sx78xH?= =?us-ascii?Q?GdsSHyp2LeYfErx4FuRTjnVPkRvbB/kwe3IvpSGY3IaqfN82PDFtST8kRJ/Y?= =?us-ascii?Q?/je0dDvxRapvfynpH5UM9CbSbhyHEmCzXD6u4VoYtwl7R0ZIFPoS/IrgXyDy?= =?us-ascii?Q?XQeZix33YaJ6qGtQ2Z4aBg7Ne0rHMUWwxxMQmDTW3VrPxOu3uxcfXuWprRs0?= =?us-ascii?Q?9sYPbEGIAl6+1VYeCXIeKmj46A7lefLaCF/ZYt92Nd8taTAinIfiT40lM564?= =?us-ascii?Q?1INMYCMlz6bnYGoRo/9bDd2GxJNR+6A2C9YYn8zEu02kWsgWRAzyzTKOsYqL?= =?us-ascii?Q?to4XKpk9NblJ1+IU3LpjXqpaICiPqTPscm1So++q/yvC+aguak8Zo1gipX7u?= =?us-ascii?Q?+AHi4tUEuvDMwP7b7GpD5vbqaNGelJPi8yF0vCPaIJYknDgRHQVEIcu+/EYK?= =?us-ascii?Q?SfzoHUHgZviDucXbyBFuRD+Ob4lc3REHIgQcghAaAm6t3az7U39sVwLAr6ub?= =?us-ascii?Q?GEQsibTFaaw8QwVV5Eb5+uUeNLwPMX9pKWtGVFj7AP7Hm11ZmbnxRKS9KA7E?= =?us-ascii?Q?PD1QLo=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 6:OkhS1aU/h8+9ZbT0MMaHq7+tUl/TOqgpYIB1mGrVANBVL9vO0iVkhPJAWXy8qP/KgsK1JE0kEi83tmPw7ZZC+O+TpKEZsA20DA7px+k8H/TafN5wlFpCbVlMyIlDnj/uv1Pz6kfJ1BuUY5C27mbLC8WXBp2GcuEeTfDh/6UvX4uK7QnhAfVRwZ6wxCr9KCPJi4b2Clyiu/t4lXpbE2VAoQn2kxF9VLFxPWqXf7+NCALSQKqDL8KKZ9E6Hwa7kIiMlRk5kLezyjs34Mqz4WAf16D6x3jMnLRSAhlo3iiDjiu4w1cLkVd11m5+LOPh6PWEQdtquNtl1utPaaz2S3Z3u86kWnZCdXAXxvc2y0wCmzE=; 5:UBfLNRv2NUu4POwbYWFd8ukcDNfeiixUw9aRWu4axCRZuhFvzg6q1T9NBk8g77J7JaYq4bwxA6DZeVgO236G4QypQzeu7pNI79IQDd/OQtKPz4ww9yL95JEZy3lIdZUpAotwt50DwPUlEcdxi6qMnzWEWrx3NCXh2myuzS/7d0Y=; 24:s/174Wi+dmA1XfbtlP/hgUYedO3lB0k1Jq/PiWqsYc6R2cEvvNVMrYeDZgin2GTLMHGhJNELpEXL3+jNBYFvPN6VrmycwQgfwUktFfVfO+Q=; 7:LETV49PHSVGPADRxTJYc/1Z9qwceybrCvigIYzvnIrGUBrmhYrnVyQAnb9bWfWEZ55gydT62k3G/zJ72+b8HBnb5TgBZHnueExD4aBY09pkqMVlA+EbJ2/rnOYgodlo8BcrJ8ZSy7ruX1nWzeW4ldo7Kze3HSeXmqqMDJU+Vouw4WR8vjsZpUGu1XuYOC8hIkIzq7PUqwG6e1oxpK8dge7doNT1ozNARtvJfG/r8gOhuKXDmwD9QDOIaJrhwpvZX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:53:43.8016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2209a068-4232-4e02-39e5-08d5415f60cb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3150 Subject: [dpdk-dev] [PATCH v2 10/10] app/testpmd: fix on the flight VLAN configuration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2017 12:53:45 -0000 On ethdev there is an API to configure VLAN offloads after the port was started and without reconfiguration of the port or queues. In the current design of the application, when the Rx offloads are changed (through "port config all" CLI command) the port configuration is overwritten, therefore the configuration made for the VLAN is lost. This patch is to address the issue by a configuration of each port Rx offloads separately instead of using the global Rx config. Fixes: 6dbb2b336586 ("app/testpmd: convert to new Ethdev Rx offloads API") Signed-off-by: Shahaf Shuler --- app/test-pmd/cmdline.c | 217 +++++++++++++++++++++++--------------------- app/test-pmd/config.c | 27 ++++-- app/test-pmd/testpmd.c | 2 +- 3 files changed, 135 insertions(+), 111 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index d1b8dab..00a229a 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1577,34 +1577,38 @@ struct cmd_config_max_pkt_len_result { __attribute__((unused)) void *data) { struct cmd_config_max_pkt_len_result *res = parsed_result; - uint64_t rx_offloads = rx_mode.offloads; + portid_t pid; if (!all_ports_stopped()) { printf("Please stop all ports first\n"); return; } - if (!strcmp(res->name, "max-pkt-len")) { - if (res->value < ETHER_MIN_LEN) { - printf("max-pkt-len can not be less than %d\n", - ETHER_MIN_LEN); + RTE_ETH_FOREACH_DEV(pid) { + struct rte_port *port = &ports[pid]; + uint64_t rx_offloads = port->dev_conf.rxmode.offloads; + + if (!strcmp(res->name, "max-pkt-len")) { + if (res->value < ETHER_MIN_LEN) { + printf("max-pkt-len can not be less than %d\n", + ETHER_MIN_LEN); + return; + } + if (res->value == port->dev_conf.rxmode.max_rx_pkt_len) + return; + + port->dev_conf.rxmode.max_rx_pkt_len = res->value; + if (res->value > ETHER_MAX_LEN) + rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; + else + rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME; + port->dev_conf.rxmode.offloads = rx_offloads; + } else { + printf("Unknown parameter\n"); return; } - if (res->value == rx_mode.max_rx_pkt_len) - return; - - rx_mode.max_rx_pkt_len = res->value; - if (res->value > ETHER_MAX_LEN) - rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; - else - rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME; - } else { - printf("Unknown parameter\n"); - return; } - rx_mode.offloads = rx_offloads; - init_port_config(); cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); @@ -1706,103 +1710,108 @@ struct cmd_config_rx_mode_flag { __attribute__((unused)) void *data) { struct cmd_config_rx_mode_flag *res = parsed_result; - uint64_t rx_offloads = rx_mode.offloads; + portid_t pid; if (!all_ports_stopped()) { printf("Please stop all ports first\n"); return; } - if (!strcmp(res->name, "crc-strip")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "scatter")) { - if (!strcmp(res->value, "on")) { - rx_offloads |= DEV_RX_OFFLOAD_SCATTER; - } else if (!strcmp(res->value, "off")) { - rx_offloads &= ~DEV_RX_OFFLOAD_SCATTER; + RTE_ETH_FOREACH_DEV(pid) { + struct rte_port *port; + uint64_t rx_offloads; + + port = &ports[pid]; + rx_offloads = port->dev_conf.rxmode.offloads; + if (!strcmp(res->name, "crc-strip")) { + if (!strcmp(res->value, "on")) + rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP; + else if (!strcmp(res->value, "off")) + rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP; + else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "scatter")) { + if (!strcmp(res->value, "on")) { + rx_offloads |= DEV_RX_OFFLOAD_SCATTER; + } else if (!strcmp(res->value, "off")) { + rx_offloads &= ~DEV_RX_OFFLOAD_SCATTER; + } else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "rx-cksum")) { + if (!strcmp(res->value, "on")) + rx_offloads |= DEV_RX_OFFLOAD_CHECKSUM; + else if (!strcmp(res->value, "off")) + rx_offloads &= ~DEV_RX_OFFLOAD_CHECKSUM; + else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "rx-timestamp")) { + if (!strcmp(res->value, "on")) + rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP; + else if (!strcmp(res->value, "off")) + rx_offloads &= ~DEV_RX_OFFLOAD_TIMESTAMP; + else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "hw-vlan")) { + if (!strcmp(res->value, "on")) { + rx_offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_VLAN_STRIP); + } else if (!strcmp(res->value, "off")) { + rx_offloads &= ~(DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_VLAN_STRIP); + } else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "hw-vlan-filter")) { + if (!strcmp(res->value, "on")) + rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; + else if (!strcmp(res->value, "off")) + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; + else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "hw-vlan-strip")) { + if (!strcmp(res->value, "on")) + rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; + else if (!strcmp(res->value, "off")) + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; + else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "hw-vlan-extend")) { + if (!strcmp(res->value, "on")) + rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; + else if (!strcmp(res->value, "off")) + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; + else { + printf("Unknown parameter\n"); + return; + } + } else if (!strcmp(res->name, "drop-en")) { + if (!strcmp(res->value, "on")) + rx_drop_en = 1; + else if (!strcmp(res->value, "off")) + rx_drop_en = 0; + else { + printf("Unknown parameter\n"); + return; + } } else { printf("Unknown parameter\n"); return; } - } else if (!strcmp(res->name, "rx-cksum")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_CHECKSUM; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_CHECKSUM; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "rx-timestamp")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_TIMESTAMP; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan")) { - if (!strcmp(res->value, "on")) { - rx_offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_VLAN_STRIP); - } - else if (!strcmp(res->value, "off")) { - rx_offloads &= ~(DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_VLAN_STRIP); - } - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan-filter")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan-strip")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan-extend")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "drop-en")) { - if (!strcmp(res->value, "on")) - rx_drop_en = 1; - else if (!strcmp(res->value, "off")) - rx_drop_en = 0; - else { - printf("Unknown parameter\n"); - return; - } - } else { - printf("Unknown parameter\n"); - return; + port->dev_conf.rxmode.offloads = rx_offloads; } - rx_mode.offloads = rx_offloads; init_port_config(); diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 33848d8..3bb99ff 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2664,21 +2664,26 @@ struct igb_ring_desc_16_bytes { { int diag; int vlan_offload; + uint64_t port_rx_offloads = ports[port_id].dev_conf.rxmode.offloads; if (port_id_is_invalid(port_id, ENABLED_WARN)) return; vlan_offload = rte_eth_dev_get_vlan_offload(port_id); - if (on) + if (on) { vlan_offload |= ETH_VLAN_EXTEND_OFFLOAD; - else + port_rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; + } else { vlan_offload &= ~ETH_VLAN_EXTEND_OFFLOAD; + port_rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; + } diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload); if (diag < 0) printf("rx_vlan_extend_set(port_pi=%d, on=%d) failed " "diag=%d\n", port_id, on, diag); + ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads; } void @@ -2686,21 +2691,26 @@ struct igb_ring_desc_16_bytes { { int diag; int vlan_offload; + uint64_t port_rx_offloads = ports[port_id].dev_conf.rxmode.offloads; if (port_id_is_invalid(port_id, ENABLED_WARN)) return; vlan_offload = rte_eth_dev_get_vlan_offload(port_id); - if (on) + if (on) { vlan_offload |= ETH_VLAN_STRIP_OFFLOAD; - else + port_rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; + } else { vlan_offload &= ~ETH_VLAN_STRIP_OFFLOAD; + port_rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; + } diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload); if (diag < 0) printf("rx_vlan_strip_set(port_pi=%d, on=%d) failed " "diag=%d\n", port_id, on, diag); + ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads; } void @@ -2722,21 +2732,26 @@ struct igb_ring_desc_16_bytes { { int diag; int vlan_offload; + uint64_t port_rx_offloads = ports[port_id].dev_conf.rxmode.offloads; if (port_id_is_invalid(port_id, ENABLED_WARN)) return; vlan_offload = rte_eth_dev_get_vlan_offload(port_id); - if (on) + if (on) { vlan_offload |= ETH_VLAN_FILTER_OFFLOAD; - else + port_rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; + } else { vlan_offload &= ~ETH_VLAN_FILTER_OFFLOAD; + port_rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; + } diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload); if (diag < 0) printf("rx_vlan_filter_set(port_pi=%d, on=%d) failed " "diag=%d\n", port_id, on, diag); + ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads; } int diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 3758410..48021bf 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -603,6 +603,7 @@ static int eth_event_callback(portid_t port_id, port = &ports[pid]; /* Apply default Tx configuration for all ports */ port->dev_conf.txmode = tx_mode; + port->dev_conf.rxmode = rx_mode; rte_eth_dev_info_get(pid, &port->dev_info); if (numa_support) { @@ -2113,7 +2114,6 @@ struct pmd_test_command { RTE_ETH_FOREACH_DEV(pid) { port = &ports[pid]; - port->dev_conf.rxmode = rx_mode; port->dev_conf.fdir_conf = fdir_conf; if (nb_rxq > 1) { port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; -- 1.8.3.1