Skip to content

Commit

Permalink
datapath: Fix kernel style issues.
Browse files Browse the repository at this point in the history
Suggested-by: Sergei Shtylyov <[email protected]>
Signed-off-by: Jesse Gross <[email protected]>
  • Loading branch information
jessegross committed Feb 5, 2014
1 parent e3b406a commit 978188b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions datapath/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
#endif
.snd_portid = upcall_info->portid,
};
size_t len, plen;
size_t len;
unsigned int hlen;
int err, dp_ifindex;

Expand Down Expand Up @@ -472,9 +472,12 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
skb_zerocopy(user_skb, skb, skb->len, hlen);

/* Pad OVS_PACKET_ATTR_PACKET if linear copy was performed */
if (!(dp->user_features & OVS_DP_F_UNALIGNED) &&
(plen = (ALIGN(user_skb->len, NLA_ALIGNTO) - user_skb->len)) > 0)
memset(skb_put(user_skb, plen), 0, plen);
if (!(dp->user_features & OVS_DP_F_UNALIGNED)) {
size_t plen = NLA_ALIGN(user_skb->len) - user_skb->len;

if (plen > 0)
memset(skb_put(user_skb, plen), 0, plen);
}

((struct nlmsghdr *) user_skb->data)->nlmsg_len = user_skb->len;

Expand Down
3 changes: 2 additions & 1 deletion datapath/flow_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ void ovs_flow_free(struct sw_flow *flow, bool deferred)
struct sw_flow_mask *mask = flow->mask;

/* ovs-lock is required to protect mask-refcount and
* mask list. */
* mask list.
*/
ASSERT_OVSL();
BUG_ON(!mask->ref_count);
mask->ref_count--;
Expand Down

0 comments on commit 978188b

Please sign in to comment.