netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Yifeng Sun <pkusunyifeng@gmail.com>,
	Pravin B Shelar <pshelar@ovn.org>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org, dev@openvswitch.org
Subject: [PATCH AUTOSEL 4.19 011/209] openvswitch: Use correct reply values in datapath and vport ops
Date: Tue, 12 Nov 2019 20:47:07 -0500	[thread overview]
Message-ID: <20191113015025.9685-11-sashal@kernel.org> (raw)
In-Reply-To: <20191113015025.9685-1-sashal@kernel.org>

From: Yifeng Sun <pkusunyifeng@gmail.com>

[ Upstream commit 804fe108fc92e591ddfe9447e7fb4691ed16daee ]

This patch fixes the bug that all datapath and vport ops are returning
wrong values (OVS_FLOW_CMD_NEW or OVS_DP_CMD_NEW) in their replies.

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/openvswitch/datapath.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 8e396c7c83894..66c726595a95d 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1182,14 +1182,14 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
 						       ovs_header->dp_ifindex,
 						       reply, info->snd_portid,
 						       info->snd_seq, 0,
-						       OVS_FLOW_CMD_NEW,
+						       OVS_FLOW_CMD_SET,
 						       ufid_flags);
 			BUG_ON(error < 0);
 		}
 	} else {
 		/* Could not alloc without acts before locking. */
 		reply = ovs_flow_cmd_build_info(flow, ovs_header->dp_ifindex,
-						info, OVS_FLOW_CMD_NEW, false,
+						info, OVS_FLOW_CMD_SET, false,
 						ufid_flags);
 
 		if (IS_ERR(reply)) {
@@ -1265,7 +1265,7 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
 	}
 
 	reply = ovs_flow_cmd_build_info(flow, ovs_header->dp_ifindex, info,
-					OVS_FLOW_CMD_NEW, true, ufid_flags);
+					OVS_FLOW_CMD_GET, true, ufid_flags);
 	if (IS_ERR(reply)) {
 		err = PTR_ERR(reply);
 		goto unlock;
@@ -1389,7 +1389,7 @@ static int ovs_flow_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
 		if (ovs_flow_cmd_fill_info(flow, ovs_header->dp_ifindex, skb,
 					   NETLINK_CB(cb->skb).portid,
 					   cb->nlh->nlmsg_seq, NLM_F_MULTI,
-					   OVS_FLOW_CMD_NEW, ufid_flags) < 0)
+					   OVS_FLOW_CMD_GET, ufid_flags) < 0)
 			break;
 
 		cb->args[0] = bucket;
@@ -1730,7 +1730,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
 	ovs_dp_change(dp, info->attrs);
 
 	err = ovs_dp_cmd_fill_info(dp, reply, info->snd_portid,
-				   info->snd_seq, 0, OVS_DP_CMD_NEW);
+				   info->snd_seq, 0, OVS_DP_CMD_SET);
 	BUG_ON(err < 0);
 
 	ovs_unlock();
@@ -1761,7 +1761,7 @@ static int ovs_dp_cmd_get(struct sk_buff *skb, struct genl_info *info)
 		goto err_unlock_free;
 	}
 	err = ovs_dp_cmd_fill_info(dp, reply, info->snd_portid,
-				   info->snd_seq, 0, OVS_DP_CMD_NEW);
+				   info->snd_seq, 0, OVS_DP_CMD_GET);
 	BUG_ON(err < 0);
 	ovs_unlock();
 
@@ -1785,7 +1785,7 @@ static int ovs_dp_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
 		if (i >= skip &&
 		    ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).portid,
 					 cb->nlh->nlmsg_seq, NLM_F_MULTI,
-					 OVS_DP_CMD_NEW) < 0)
+					 OVS_DP_CMD_GET) < 0)
 			break;
 		i++;
 	}
@@ -2101,7 +2101,7 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
 
 	err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
 				      info->snd_portid, info->snd_seq, 0,
-				      OVS_VPORT_CMD_NEW);
+				      OVS_VPORT_CMD_SET);
 	BUG_ON(err < 0);
 
 	ovs_unlock();
@@ -2182,7 +2182,7 @@ static int ovs_vport_cmd_get(struct sk_buff *skb, struct genl_info *info)
 		goto exit_unlock_free;
 	err = ovs_vport_cmd_fill_info(vport, reply, genl_info_net(info),
 				      info->snd_portid, info->snd_seq, 0,
-				      OVS_VPORT_CMD_NEW);
+				      OVS_VPORT_CMD_GET);
 	BUG_ON(err < 0);
 	rcu_read_unlock();
 
@@ -2218,7 +2218,7 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
 						    NETLINK_CB(cb->skb).portid,
 						    cb->nlh->nlmsg_seq,
 						    NLM_F_MULTI,
-						    OVS_VPORT_CMD_NEW) < 0)
+						    OVS_VPORT_CMD_GET) < 0)
 				goto out;
 
 			j++;
-- 
2.20.1


  parent reply	other threads:[~2019-11-13  2:28 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13  1:46 [PATCH AUTOSEL 4.19 001/209] net: ovs: fix return type of ndo_start_xmit function Sasha Levin
2019-11-13  1:46 ` [PATCH AUTOSEL 4.19 002/209] net: xen-netback: " Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 005/209] net: hns3: Fix for netdev not up problem when setting mtu Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 006/209] net: hns3: Fix loss of coal configuration while doing reset Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 010/209] tcp: up initial rmem to 128KB and SYN rwin to around 64KB Sasha Levin
     [not found]   ` <CAP12E-JHedm+OA9Zaf6PaZBuNw5ddmeMn4RMcSWFFNrH=MpOhA@mail.gmail.com>
2019-12-17  0:00     ` Vishwanath Pai
2019-11-13  1:47 ` Sasha Levin [this message]
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 012/209] SUNRPC: Fix priority queue fairness Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 018/209] mt76x2: fix tx power configuration for VHT mcs 9 Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 019/209] mt76x2: disable WLAN core before probe Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 020/209] mt76: fix handling ps-poll frames Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 025/209] ath10k: fix vdev-start timeout on error Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 026/209] rtlwifi: btcoex: Use proper enumerated types for Wi-Fi only interface Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 032/209] ath9k: fix reporting calculated new FFT upper max Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 033/209] selftests/tls: Fix recv(MSG_PEEK) & splice() test cases Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 036/209] nl80211: Fix a GET_KEY reply attribute Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 050/209] sunrpc: Fix connect metrics Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 053/209] cxgb4: Use proper enum in cxgb4_dcb_handle_fw_update Sasha Levin
2019-11-13  1:47 ` [PATCH AUTOSEL 4.19 054/209] cxgb4: Use proper enum in IEEE_FAUX_SYNC Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 066/209] ice: Fix forward to queue group logic Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 068/209] ixgbe: Fix ixgbe TX hangs with XDP_TX beyond queue limit Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 069/209] i40e: Use proper enum in i40e_ndo_set_vf_link_state Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 070/209] ixgbe: Fix crash with VFs and flow director on interface flap Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 088/209] qed: Avoid implicit enum conversion in qed_ooo_submit_tx_buffers Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 094/209] bnxt_en: return proper error when FW returns HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 100/209] brcmfmac: reduce timeout for action frame scan Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 101/209] brcmfmac: fix full timeout waiting for action frame on-channel tx Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 102/209] qtnfmac: request userspace to do OBSS scanning if FW can not Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 103/209] qtnfmac: pass sgi rate info flag to wireless core Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 104/209] qtnfmac: inform wireless core about supported extended capabilities Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 105/209] qtnfmac: drop error reports for out-of-bounds key indexes Sasha Levin
2019-11-13  1:48 ` [PATCH AUTOSEL 4.19 123/209] net: hns3: Fix for rx vlan id handle to support Rev 0x21 hardware Sasha Levin
2019-11-13  1:49 ` [PATCH AUTOSEL 4.19 124/209] tc-testing: fix build of eBPF programs Sasha Levin
2019-11-13  1:49 ` [PATCH AUTOSEL 4.19 132/209] xfrm: use correct size to initialise sp->ovec Sasha Levin
2019-11-13  1:49 ` [PATCH AUTOSEL 4.19 134/209] iwlwifi: mvm: don't send keys when entering D3 Sasha Levin
2019-11-13  1:49 ` [PATCH AUTOSEL 4.19 135/209] xsk: proper AF_XDP socket teardown ordering Sasha Levin
2019-11-13  1:49 ` [PATCH AUTOSEL 4.19 177/209] bpf: btf: Fix a missing check bug Sasha Levin
2019-11-13  1:49 ` [PATCH AUTOSEL 4.19 178/209] net: fix generic XDP to handle if eth header was mangled Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 193/209] selftests: forwarding: Have lldpad_app_wait_set() wait for unknown, too Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 194/209] net: sched: avoid writing on noop_qdisc Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 195/209] netfilter: nft_compat: do not dump private area Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 197/209] mac80211: minstrel: fix using short preamble CCK rates on HT clients Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 198/209] mac80211: minstrel: fix CCK rate group streams value Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 199/209] mac80211: minstrel: fix sampling/reporting of CCK rates in HT mode Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 201/209] mlxsw: spectrum_switchdev: Check notification relevance based on upper device Sasha Levin
2019-11-13  1:50 ` [PATCH AUTOSEL 4.19 203/209] tcp: start receiver buffer autotuning sooner Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191113015025.9685-11-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pkusunyifeng@gmail.com \
    --cc=pshelar@ovn.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).