Unified · Split
| @@ -35,8 +35,8 @@ int enic_addfltr_5t(struct enic *enic, struct flow_keys *keys, u16 rq) · 34 unmodified lines | ||
| 35 | 35 | data.type = FILTER_IPV4_5TUPLE; |
| 36 | 36 | data.u.ipv4.src_addr = ntohl(keys->addrs.src); |
| 37 | 37 | data.u.ipv4.dst_addr = ntohl(keys->addrs.dst); |
| 38 | − data.u.ipv4.src_port = ntohs(keys->ports.port16[0]); | |
| 39 | − data.u.ipv4.dst_port = ntohs(keys->ports.port16[1]); | |
| 38 | + data.u.ipv4.src_port = ntohs(keys->ports.src); | |
| 39 | + data.u.ipv4.dst_port = ntohs(keys->ports.dst); | |
| 40 | 40 | data.u.ipv4.flags = FILTER_FIELDS_IPV4_5TUPLE; |
| 41 | 41 | |
| 42 | 42 | spin_lock_bh(&enic->devcmd_lock); |
| @@ -352,10 +352,10 @@ static int enic_grxclsrule(struct enic *enic, struct ethtool_rxnfc *cmd) · 351 unmodified lines | ||
| 352 | 352 | fsp->h_u.tcp_ip4_spec.ip4dst = n->keys.addrs.dst; |
| 353 | 353 | fsp->m_u.tcp_ip4_spec.ip4dst = (__u32)~0; |
| 354 | 354 | |
| 355 | − fsp->h_u.tcp_ip4_spec.psrc = n->keys.ports.port16[0]; | |
| 355 | + fsp->h_u.tcp_ip4_spec.psrc = n->keys.ports.src; | |
| 356 | 356 | fsp->m_u.tcp_ip4_spec.psrc = (__u16)~0; |
| 357 | 357 | |
| 358 | − fsp->h_u.tcp_ip4_spec.pdst = n->keys.ports.port16[1]; | |
| 358 | + fsp->h_u.tcp_ip4_spec.pdst = n->keys.ports.dst; | |
| 359 | 359 | fsp->m_u.tcp_ip4_spec.pdst = (__u16)~0; |
| 360 | 360 | |
| 361 | 361 | fsp->ring_cookie = n->rq_id; |
| @@ -34,13 +34,16 @@ struct flow_dissector_key_addrs { · 33 unmodified lines | ||
| 34 | 34 | /** |
| 35 | 35 | * flow_dissector_key_tp_ports: |
| 36 | 36 | * @ports: port numbers of Transport header |
| 37 | − * port16[0]: src port number | |
| 38 | − * port16[1]: dst port number | |
| 37 | + * src: source port number | |
| 38 | + * dst: destination port number | |
| 39 | 39 | */ |
| 40 | 40 | struct flow_dissector_key_ports { |
| 41 | 41 | union { |
| 42 | 42 | __be32 ports; |
| 43 | − __be16 port16[2]; | |
| 43 | + struct { | |
| 44 | + __be16 src; | |
| 45 | + __be16 dst; | |
| 46 | + }; | |
| 44 | 47 | }; |
| 45 | 48 | }; |
| 46 | 49 | |
| @@ -362,8 +362,8 @@ static inline void inet_set_txhash(struct sock *sk) · 361 unmodified lines | ||
| 362 | 362 | |
| 363 | 363 | keys.addrs.src = inet->inet_saddr; |
| 364 | 364 | keys.addrs.dst = inet->inet_daddr; |
| 365 | − keys.ports.port16[0] = inet->inet_sport; | |
| 366 | − keys.ports.port16[1] = inet->inet_dport; | |
| 365 | + keys.ports.src = inet->inet_sport; | |
| 366 | + keys.ports.dst = inet->inet_dport; | |
| 367 | 367 | |
| 368 | 368 | sk->sk_txhash = flow_hash_from_keys(&keys); |
| 369 | 369 | } |
| @@ -700,8 +700,8 @@ static inline void ip6_set_txhash(struct sock *sk) · 699 unmodified lines | ||
| 700 | 700 | |
| 701 | 701 | keys.addrs.src = (__force __be32)ipv6_addr_hash(&np->saddr); |
| 702 | 702 | keys.addrs.dst = (__force __be32)ipv6_addr_hash(&sk->sk_v6_daddr); |
| 703 | − keys.ports.port16[0] = inet->inet_sport; | |
| 704 | − keys.ports.port16[1] = inet->inet_dport; | |
| 703 | + keys.ports.src = inet->inet_sport; | |
| 704 | + keys.ports.dst = inet->inet_dport; | |
| 705 | 705 | |
| 706 | 706 | sk->sk_txhash = flow_hash_from_keys(&keys); |
| 707 | 707 | } |
| @@ -385,9 +385,9 @@ static inline u32 __flow_hash_from_keys(struct flow_keys *keys, u32 keyval) · 384 unmodified lines | ||
| 385 | 385 | /* get a consistent hash (same value on both flow directions) */ |
| 386 | 386 | if (((__force u32)keys->addrs.dst < (__force u32)keys->addrs.src) || |
| 387 | 387 | (((__force u32)keys->addrs.dst == (__force u32)keys->addrs.src) && |
| 388 | − ((__force u16)keys->ports.port16[1] < (__force u16)keys->ports.port16[0]))) { | |
| 388 | + ((__force u16)keys->ports.dst < (__force u16)keys->ports.src))) { | |
| 389 | 389 | swap(keys->addrs.dst, keys->addrs.src); |
| 390 | − swap(keys->ports.port16[0], keys->ports.port16[1]); | |
| 390 | + swap(keys->ports.src, keys->ports.dst); | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | hash = __flow_hash_3words((__force u32)keys->addrs.dst, |
| @@ -88,7 +88,7 @@ static u32 flow_get_proto(const struct sk_buff *skb, const struct flow_keys *flo · 87 unmodified lines | ||
| 88 | 88 | static u32 flow_get_proto_src(const struct sk_buff *skb, const struct flow_keys *flow) |
| 89 | 89 | { |
| 90 | 90 | if (flow->ports.ports) |
| 91 | − return ntohs(flow->ports.port16[0]); | |
| 91 | + return ntohs(flow->ports.src); | |
| 92 | 92 | |
| 93 | 93 | return addr_fold(skb->sk); |
| 94 | 94 | } |
| @@ -96,7 +96,7 @@ static u32 flow_get_proto_src(const struct sk_buff *skb, const struct flow_keys · 1 unmodified line | ||
| 96 | 96 | static u32 flow_get_proto_dst(const struct sk_buff *skb, const struct flow_keys *flow) |
| 97 | 97 | { |
| 98 | 98 | if (flow->ports.ports) |
| 99 | − return ntohs(flow->ports.port16[1]); | |
| 99 | + return ntohs(flow->ports.dst); | |
| 100 | 100 | |
| 101 | 101 | return addr_fold(skb_dst(skb)) ^ (__force u16) tc_skb_protocol(skb); |
| 102 | 102 | } |