From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0042.outbound.protection.outlook.com [104.47.1.42]) by dpdk.org (Postfix) with ESMTP id C98B81B682 for ; Tue, 26 Dec 2017 10:45:06 +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=tfL+ZTlHzy4zAbKF9IAaFqZQgHaaLboDPSTls/FF5UU=; b=f1i9rH+D0v1NBGDGaofag2AF36XPc/jsVAgiaXq/KXu1hpi4VaxeQyMl2yG/mVXZsmY4ZEBIzgjZtdH9R912xY/AbfjBdmQe2IcCDAZDs0tqrDWBXoBKyYHPS+S3hkM61eDEnpAbTkkO+97Q8BXT5BBvaNTMpPgrZf3JhVYHxPE= 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.345.14; Tue, 26 Dec 2017 09:45:04 +0000 From: Shahaf Shuler To: jingjing.wu@intel.com, ferruh.yigit@intel.com Cc: dev@dpdk.org Date: Tue, 26 Dec 2017 11:44:24 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: DB6PR07CA0012.eurprd07.prod.outlook.com (2603:10a6:6:2d::22) To VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9602a56-16f8-4219-82a3-08d54c4557f3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307)(7153060); SRVR:VI1PR05MB3150; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 3:05dbZY/Yp2MzaP45RO6Z4vb98ym66R4T7aIz0JVL2c8l+0dR/wPJQ6NN8+HW0TV+QnGe/Q/NbtaQ+ieckCzxgfDURo4+V6cOpsnhbD915cW/QFrF2O3g8/LYX10qGskuRKQlWZV0n3jQpp3/I8pLaL+gcMzBDm2398ku9zL1b05U27h/Bqmt1lvHYDJ4JjGpOkFKkgkBIrvfk9nQAbd+yhdJdbkLcMUHncX2ttUZ/WF2Kn7HBVAHhoGvp8iU6MFI; 25:sQu/9cLWIio6+daj7PWSZvRkoIrZK1la/8lGupsyQNkf46A0Hmo0d8+lHzkhrBPPFlrZIw9uh4YobyoKTr+5yW03hyfx99UjWO5chkxUL8gfJVcumqZv+EnuMRpJuJmWRdiCRing9gQJmgvjyiE0xRk0djK+7jZiXBGakuMy9NPDSA1XolUWSqLBsijV7ZDlE3HLGX4MGoTR6Is5SZqBsrpNY//CHN6QIMQ8D76ir7NbI6MU6Y+6/4eyqbICUuzjHsMMuuWb6FQQSI8GqZwGsaYTnQ/Fye7kE0ReHH4fhXAWKl+xPQpY9os5fdKewIsqWBvaAvjpt8zx7LFIFAzNqA==; 31:fH1ej2t3zqx9RoIxIwPycTMApGoQ0egtGpbS3n+FORy9Yi4a/s6t00VnL/+KA0ul01uCCLoXT3pLRcJW9969KR7LQ+csWui8WRCHm0fcj36b36Xy6SLTTVnKjx0s/+jhQ0D5rt05bSrKkGy6mIPVJoGGuivNhkO0CLtBDV4NPifd9TK8tA0RipHhdebp7otSPXdeitYlbJVB3PBX8x44YludK65ukCpfdB/49Mp8JKg= X-MS-TrafficTypeDiagnostic: VI1PR05MB3150: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 20:sFhvVqWKZu5jNwzfalKC0phwCuKtXit0k5lGcAX0o27UCwHyu4gIeRIEx+0vOgLB0M8K6XMaU3KpgDlnaQNf14h37LmzL+H5ct5aO2rlQDUfc5Aeu9HUZCFMSpdG++E0asvXc68HxS93QEafthFV/w9TsrvkOKb5DwRuujyntNOfh9ppL94TmIC4EzQlckYmXsD64NZO1FNNB0pT4sT1O55tiNxjfYVfYp4lWs8IDsiBUQ/zUnb9MgFrbmYbqNPSR9+HrNwztILAfjlPigIijBvBMeLUiVuOBXYs3uC6Rh1Zc4RqBicr/klgTHrN2zNZO6WAf5/J5AVpB6CLhKbC5FNgcAel5paeYGU8bBzRPZY48PslRU8TycdsRSDg/11swwl8+CaBdcE8K/RLSGEffXH59PvSN/GCey/xfw0AdBm9L+uTrYKFU+rXH8xmyoBcjrB+MMaFO5LQK9cKnUoMgP9dAqBAgDAU5CqpxhFdaZbBuDXOt9QdwJVDmk/zyw8D; 4:mb7/kSryi7geJF1tD/whIPoe/j1TqPpMV9Jpb+hmHOxJrR3IKzW5XhF/eQRO5MyOO33yjJuFWop3+YY3uuyvBZnnvICYx9zPJEYWaFud3bdAFjbY9IWWZGQdEuunB6h+ZSxl307XZpa67djO7pZlgeBLMy0ti0/qtzb/0cJ6DoSvSLEmeNRuY11R9mmOAsYezXnTMcuXdfZE3Pqu5feEgZ7S5xHA2Sx//jK8Munfhf360nmNNBxxUbJPNDoGW5JcY7szp6eJRuf8+7SrKrGCKQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041268)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR05MB3150; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3150; X-Forefront-PRVS: 053315510E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(346002)(39380400002)(376002)(199004)(189003)(33026002)(50226002)(52116002)(51416003)(55016002)(8936002)(76176011)(7696005)(81166006)(36756003)(86362001)(68736007)(3846002)(81156014)(6116002)(386003)(16586007)(316002)(8676002)(50466002)(69596002)(48376002)(53936002)(2906002)(25786009)(2950100002)(6666003)(5660300001)(118296001)(16526018)(21086003)(4326008)(478600001)(97736004)(106356001)(47776003)(305945005)(7736002)(66066001)(105586002); 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:Hx1COneGrPXh06JFWlTr2Llw9ISpT7z0QDIOJ9MrP?= =?us-ascii?Q?BwDeleyXJBVn9iFkpNEUsC1abPqAiLVs+pyttkstDNLyTr2sTejdwZpmDq0s?= =?us-ascii?Q?9PRmtpG1RH3gwO3quuxnlWa96hM/u13KXz5RKW9FF8DTp+JH8tepqg/xmzer?= =?us-ascii?Q?d+7kWF8oo94heWcgCCzPWwf5pbpX1735Bdkq1YjPchF0WaCVHGAdXTolS5j2?= =?us-ascii?Q?WXNP9hIxTnz/bjy601g8OBQsjvObIBb4/fODhtOXuEsTIjVCEFsIE0dc4+K8?= =?us-ascii?Q?jZHYM9QiN/iRuDc7dwN1gqTpb9ixibDPoHwcgQc0zOkDAvB9qtawscw/S44i?= =?us-ascii?Q?ewMNyBE43sR+JcSb8Dw0D3gLVWVgup/zS73ueUi9dmbGvpUENlax8okG2OyN?= =?us-ascii?Q?Tu9gJDV2tQNvEXGPGdRrlkBkvWL7lfEulipNaixgeVfjvaozccmW+HUUCoqf?= =?us-ascii?Q?Wc0ViGljxi47Q1IqJrcmTm5IRRD6ihZI8cyocjws1BPOBWvErlFsx4lIqnet?= =?us-ascii?Q?c6Y1kLBniuQJ0+RjJaM/HzNm8gCfV4yjkppvHYTcahC44gjjBnjcqJQWCuDH?= =?us-ascii?Q?mf3Ahg4qqR5zxW0W0NJixwrd/76iVq4mrJ5HEU3zJywKs4uLYiyCa6iADvg3?= =?us-ascii?Q?3sx617+QPf9y+nnSQcsSPhV+d1AF7AvqmuGq4Al5g0sYfSxvxN9yoUSxN/ra?= =?us-ascii?Q?l8K1AMN3cNpkOZ/fly+60sstRTaVUyz7yvCszzqV4ia/35vRLDLRvFTiPLRK?= =?us-ascii?Q?jgN82a26UKtpWpzxk2hcyBVNPRNZl23cbIeEZnnYYG656SHPa62j1zG2s+K0?= =?us-ascii?Q?I5i/K15qPC6YoCvlVyHR3BpkQeptZy0OFG+Vcxub3tCCpr1N/ZNd5aNgpak3?= =?us-ascii?Q?WPFEG5XxYWcqnghgP9pDTVDyxLcDa1bAN3KN7tKd8RXWYjnCZ9vjBFWi2Ayx?= =?us-ascii?Q?nhJWHikFx6FcmvZPtfOjuTJpRSJiyMs+NdxJi5tn4sxGEGfdgo9y6fdsN284?= =?us-ascii?Q?sHm+kGumcNbp4aj2gjgRN9hYBkhqDXc/9jZLwkb5hIERQ8UaeoatoXUYAy/l?= =?us-ascii?Q?me+wYRtCkcVEarilo9oajtIkWwjA9plpROwakx8ZxGYlM30tIb6SQSRmAyuG?= =?us-ascii?Q?QxhS2K5iLw=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 6:jiwgwK/yhxHZQXU5B9gG/shB6/nKg81IX6+AYiHjNCyr78UAng3QyzYjMoWIQL1/T8pC5AIhYX/HsRcRQH8IK9XzZU+C72M7IGzWL83DBxgb6ph3HcdaImM51J95uBgNZS8oGBwXSZRDxRwsIfHTTuNiO9xE/sSZFnv//iZBKJ3kFbJQ9EMfTutPTm0V3wH56zuuSg8kkclSz2VL0v2nVvYy43OG7yRAfjW6nyZXpfIDBAIZmheGcsztz9NJG0EwcXoN5Kcw3ixbBRy6FeFQyrw9Pvw0GJBHLvy145tgsiy0TIcC24ku2tyDZJmMyix8kiG657jIVzrLNw7HuugBucTp2AJq5uZmvQbhaPs08+s=; 5:dzE5XlswcmNlHKm4SvTWia7g0FFMxI8RUXoApKAI6F9UIh2X/9OD7h0jhDgBtBySKW+i7+yhDXvNjQSlid7aUZLBqAcP+8znxrHhfatP/poAIccWs1kfWyZwv0kA1ncua+aI/8rFOrTfmZv8OcJhD/itPA8ioo98bHH9hXErF50=; 24:Bp/Yal8zR1ENpWby7a324P3leIJqy6KA5LHP2zo0aTrlSOQD4ljvY/6rLefGmzc+jfCXwfPBkjIGfHLxQgUaQme9KykVF6LPcetyK60Z0Xg=; 7:se/Y/kd1O4M4h5gHqOO4OBXCHAKx0rWfcPvOeEDOWPkzVl7KfMPEQ6zi1pu7nqi4ORNWbBOW5R2H+1d8jGCKtWxvb74l0d+xoxKoZZJPCmusKsi4aM81Bl0QhFrTte5K2gNUHYmkCt+rI+ASun1ma2ADeOvZ9xoIvljH9XxHzMcziWx2ER0O1GRxGRTYAb78RpL9d91vcgp1jMgFmn6OmIWKSXDnOyCWu+1DpQeVtFqNxsVOVheaP1JlnoIbzQij SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:45:04.5605 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9602a56-16f8-4219-82a3-08d54c4557f3 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 v3 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, 26 Dec 2017 09:45:07 -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 d1b8dab6e..00a229a41 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1577,34 +1577,38 @@ cmd_config_max_pkt_len_parsed(void *parsed_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 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, __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 d32a4672b..da968cb64 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2665,21 +2665,26 @@ vlan_extend_set(portid_t port_id, int on) { 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 @@ -2687,21 +2692,26 @@ rx_vlan_strip_set(portid_t port_id, int on) { 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 @@ -2723,21 +2733,26 @@ rx_vlan_filter_set(portid_t port_id, int on) { 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 91dcb31c0..c1fb387fb 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -603,6 +603,7 @@ init_config(void) 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) { @@ -2089,7 +2090,6 @@ init_port_config(void) 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; -- 2.12.0