Skip to content

Commit 9b67aa4

Browse files
samuel-gauthierdavem330
authored andcommitted
openvswitch: restore OVS_FLOW_CMD_NEW notifications
Since commit fb5d1e9 ("openvswitch: Build flow cmd netlink reply only if needed."), the new flows are not notified to the listeners of OVS_FLOW_MCGROUP. This commit fixes the problem by using the genl function, ie genl_has_listerners() instead of netlink_has_listeners(). Signed-off-by: Samuel Gauthier <[email protected]> Signed-off-by: Nicolas Dichtel <[email protected]> Acked-by: Pravin B Shelar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0d56637 commit 9b67aa4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/openvswitch/datapath.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ static const struct genl_multicast_group ovs_dp_vport_multicast_group = {
7878

7979
/* Check if need to build a reply message.
8080
* OVS userspace sets the NLM_F_ECHO flag if it needs the reply. */
81-
static bool ovs_must_notify(struct genl_info *info,
82-
const struct genl_multicast_group *grp)
81+
static bool ovs_must_notify(struct genl_family *family, struct genl_info *info,
82+
unsigned int group)
8383
{
8484
return info->nlhdr->nlmsg_flags & NLM_F_ECHO ||
85-
netlink_has_listeners(genl_info_net(info)->genl_sock, 0);
85+
genl_has_listeners(family, genl_info_net(info)->genl_sock,
86+
group);
8687
}
8788

8889
static void ovs_notify(struct genl_family *family,
@@ -763,7 +764,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(const struct sw_flow_actions *act
763764
{
764765
struct sk_buff *skb;
765766

766-
if (!always && !ovs_must_notify(info, &ovs_dp_flow_multicast_group))
767+
if (!always && !ovs_must_notify(&dp_flow_genl_family, info, 0))
767768
return NULL;
768769

769770
skb = genlmsg_new_unicast(ovs_flow_cmd_msg_size(acts), info, GFP_KERNEL);

0 commit comments

Comments
 (0)