[dpdk-stable] patch 'app/testpmd: fix check for invalid ports' has been queued to stable release 16.11.1
Yuanhan Liu
yuanhan.liu at linux.intel.com
Mon Jan 23 08:46:47 CET 2017
Hi,
FYI, your patch has been queued to stable release 16.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 01/28/17.
So please shout if anyone has objections.
---
Note 16.11 is a LTS release. v16.11.1 is planned to be released
shortly (about 2-3 weeks) after v17.02.
---
Thanks.
--yliu
---
>From 3545e2e92e2b8fd380d77a5f10c0461fcd11ac33 Mon Sep 17 00:00:00 2001
From: Wenzhuo Lu <wenzhuo.lu at intel.com>
Date: Tue, 13 Dec 2016 15:11:08 +0800
Subject: [PATCH] app/testpmd: fix check for invalid ports
[ upstream commit dc0537e6d6acbc27d79b7d247ca3bc7f8c20f269 ]
Some CLIs don't check the input port ID, it
may cause segmentation fault (core dumped).
Fixes: 425781ff5afe ("app/testpmd: add ixgbe VF management")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen at intel.com>
Acked-by: Jingjing Wu <jingjing.wu at intel.com>
---
app/test-pmd/cmdline.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 63b55dc..315a252 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -10807,6 +10807,9 @@ cmd_set_vf_vlan_anti_spoof_parsed(
int ret = 0;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_vlan_anti_spoof(res->port_id, res->vf_id,
is_on);
switch (ret) {
@@ -10892,6 +10895,9 @@ cmd_set_vf_mac_anti_spoof_parsed(
int ret;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_mac_anti_spoof(res->port_id, res->vf_id,
is_on);
switch (ret) {
@@ -10977,6 +10983,9 @@ cmd_set_vf_vlan_stripq_parsed(
int ret = 0;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_vlan_stripq(res->port_id, res->vf_id, is_on);
switch (ret) {
case 0:
@@ -11060,6 +11069,9 @@ cmd_set_vf_vlan_insert_parsed(
struct cmd_vf_vlan_insert_result *res = parsed_result;
int ret;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_vlan_insert(res->port_id, res->vf_id, res->vlan_id);
switch (ret) {
case 0:
@@ -11134,6 +11146,9 @@ cmd_set_tx_loopback_parsed(
int ret;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_tx_loopback(res->port_id, is_on);
switch (ret) {
case 0:
@@ -11211,6 +11226,9 @@ cmd_set_all_queues_drop_en_parsed(
int ret = 0;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_all_queues_drop_en(res->port_id, is_on);
switch (ret) {
case 0:
@@ -11294,6 +11312,9 @@ cmd_set_vf_split_drop_en_parsed(
int ret;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_split_drop_en(res->port_id, res->vf_id,
is_on);
switch (ret) {
@@ -11378,6 +11399,9 @@ cmd_set_vf_mac_addr_parsed(
struct cmd_set_vf_mac_addr_result *res = parsed_result;
int ret;
+ if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+ return;
+
ret = rte_pmd_ixgbe_set_vf_mac_addr(res->port_id, res->vf_id,
&res->mac_addr);
switch (ret) {
--
1.9.0
More information about the stable
mailing list