data.type = FILTER_IPV4_5TUPLE;
data.u.ipv4.src_addr = ntohl(keys->addrs.src);
data.u.ipv4.dst_addr = ntohl(keys->addrs.dst);
- data.u.ipv4.src_port = ntohs(keys->ports.port16[0]);
- data.u.ipv4.dst_port = ntohs(keys->ports.port16[1]);
+ data.u.ipv4.src_port = ntohs(keys->ports.src);
+ data.u.ipv4.dst_port = ntohs(keys->ports.dst);
data.u.ipv4.flags = FILTER_FIELDS_IPV4_5TUPLE;
spin_lock_bh(&enic->devcmd_lock);
fsp->h_u.tcp_ip4_spec.ip4dst = n->keys.addrs.dst;
fsp->m_u.tcp_ip4_spec.ip4dst = (__u32)~0;
- fsp->h_u.tcp_ip4_spec.psrc = n->keys.ports.port16[0];
+ fsp->h_u.tcp_ip4_spec.psrc = n->keys.ports.src;
fsp->m_u.tcp_ip4_spec.psrc = (__u16)~0;
- fsp->h_u.tcp_ip4_spec.pdst = n->keys.ports.port16[1];
+ fsp->h_u.tcp_ip4_spec.pdst = n->keys.ports.dst;
fsp->m_u.tcp_ip4_spec.pdst = (__u16)~0;
fsp->ring_cookie = n->rq_id;
/**
* flow_dissector_key_tp_ports:
* @ports: port numbers of Transport header
- * port16[0]: src port number
- * port16[1]: dst port number
+ * src: source port number
+ * dst: destination port number
*/
struct flow_dissector_key_ports {
union {
__be32 ports;
- __be16 port16[2];
+ struct {
+ __be16 src;
+ __be16 dst;
+ };
};
};
keys.addrs.src = inet->inet_saddr;
keys.addrs.dst = inet->inet_daddr;
- keys.ports.port16[0] = inet->inet_sport;
- keys.ports.port16[1] = inet->inet_dport;
+ keys.ports.src = inet->inet_sport;
+ keys.ports.dst = inet->inet_dport;
sk->sk_txhash = flow_hash_from_keys(&keys);
}
keys.addrs.src = (__force __be32)ipv6_addr_hash(&np->saddr);
keys.addrs.dst = (__force __be32)ipv6_addr_hash(&sk->sk_v6_daddr);
- keys.ports.port16[0] = inet->inet_sport;
- keys.ports.port16[1] = inet->inet_dport;
+ keys.ports.src = inet->inet_sport;
+ keys.ports.dst = inet->inet_dport;
sk->sk_txhash = flow_hash_from_keys(&keys);
}
/* get a consistent hash (same value on both flow directions) */
if (((__force u32)keys->addrs.dst < (__force u32)keys->addrs.src) ||
(((__force u32)keys->addrs.dst == (__force u32)keys->addrs.src) &&
- ((__force u16)keys->ports.port16[1] < (__force u16)keys->ports.port16[0]))) {
+ ((__force u16)keys->ports.dst < (__force u16)keys->ports.src))) {
swap(keys->addrs.dst, keys->addrs.src);
- swap(keys->ports.port16[0], keys->ports.port16[1]);
+ swap(keys->ports.src, keys->ports.dst);
}
hash = __flow_hash_3words((__force u32)keys->addrs.dst,
static u32 flow_get_proto_src(const struct sk_buff *skb, const struct flow_keys *flow)
{
if (flow->ports.ports)
- return ntohs(flow->ports.port16[0]);
+ return ntohs(flow->ports.src);
return addr_fold(skb->sk);
}
static u32 flow_get_proto_dst(const struct sk_buff *skb, const struct flow_keys *flow)
{
if (flow->ports.ports)
- return ntohs(flow->ports.port16[1]);
+ return ntohs(flow->ports.dst);
return addr_fold(skb_dst(skb)) ^ (__force u16) tc_skb_protocol(skb);
}