Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61b905da authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

net: Rename skb->rxhash to skb->hash



The packet hash can be considered a property of the packet, not just
on RX path.

This patch changes name of rxhash and l4_rxhash skbuff fields to be
hash and l4_hash respectively. This includes changing uses of the
field in the code which don't call the access functions.

Signed-off-by: default avatarTom Herbert <therbert@google.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e2e865d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -825,8 +825,8 @@ static int build_body(struct jit_ctx *ctx)
			break;
		case BPF_S_ANC_RXHASH:
			ctx->seen |= SEEN_SKB;
			BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4);
			off = offsetof(struct sk_buff, rxhash);
			BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
			off = offsetof(struct sk_buff, hash);
			emit(ARM_LDR_I(r_A, r_skb, off), ctx);
			break;
		case BPF_S_ANC_VLAN_TAG:
+2 −2
Original line number Diff line number Diff line
@@ -390,9 +390,9 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
							  mark));
			break;
		case BPF_S_ANC_RXHASH:
			BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4);
			BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
			PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
							  rxhash));
							  hash));
			break;
		case BPF_S_ANC_VLAN_TAG:
		case BPF_S_ANC_VLAN_TAG_PRESENT:
+4 −4
Original line number Diff line number Diff line
@@ -737,10 +737,10 @@ load_abs: if ((int) K < 0)
		/* icm	%r5,3,<d(type)>(%r1) */
		EMIT4_DISP(0xbf531000, offsetof(struct net_device, type));
		break;
	case BPF_S_ANC_RXHASH: /* A = skb->rxhash */
		BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4);
		/* l %r5,<d(rxhash)>(%r2) */
		EMIT4_DISP(0x58502000, offsetof(struct sk_buff, rxhash));
	case BPF_S_ANC_RXHASH: /* A = skb->hash */
		BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
		/* l %r5,<d(hash)>(%r2) */
		EMIT4_DISP(0x58502000, offsetof(struct sk_buff, hash));
		break;
	case BPF_S_ANC_VLAN_TAG:
	case BPF_S_ANC_VLAN_TAG_PRESENT:
+1 −1
Original line number Diff line number Diff line
@@ -618,7 +618,7 @@ void bpf_jit_compile(struct sk_filter *fp)
				emit_load16(r_A, struct net_device, type, r_A);
				break;
			case BPF_S_ANC_RXHASH:
				emit_skb_load32(rxhash, r_A);
				emit_skb_load32(hash, r_A);
				break;
			case BPF_S_ANC_VLAN_TAG:
			case BPF_S_ANC_VLAN_TAG_PRESENT:
+4 −4
Original line number Diff line number Diff line
@@ -553,13 +553,13 @@ void bpf_jit_compile(struct sk_filter *fp)
				}
				break;
			case BPF_S_ANC_RXHASH:
				BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4);
				if (is_imm8(offsetof(struct sk_buff, rxhash))) {
				BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
				if (is_imm8(offsetof(struct sk_buff, hash))) {
					/* mov off8(%rdi),%eax */
					EMIT3(0x8b, 0x47, offsetof(struct sk_buff, rxhash));
					EMIT3(0x8b, 0x47, offsetof(struct sk_buff, hash));
				} else {
					EMIT2(0x8b, 0x87);
					EMIT(offsetof(struct sk_buff, rxhash), 4);
					EMIT(offsetof(struct sk_buff, hash), 4);
				}
				break;
			case BPF_S_ANC_QUEUE:
Loading