File: clip_tbl.h

package info (click to toggle)
linux 6.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,532,052 kB
  • sloc: ansic: 23,400,063; asm: 266,720; sh: 108,896; makefile: 49,712; python: 36,925; perl: 36,810; cpp: 6,044; yacc: 4,904; lex: 2,722; awk: 1,440; ruby: 25; sed: 5
file content (45 lines) | stat: -rw-r--r-- 1,328 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 *  This file is part of the Chelsio T4 Ethernet driver for Linux.
 *  Copyright (C) 2003-2014 Chelsio Communications.  All rights reserved.
 *
 *  Written by Deepak (deepak.s@chelsio.com)
 *
 *  This program is distributed in the hope that it will be useful, but WITHOUT
 *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *  FITNESS FOR A PARTICULAR PURPOSE.  See the LICENSE file included in this
 *  release for licensing terms and conditions.
 */

#include <linux/refcount.h>

struct clip_entry {
	spinlock_t lock;	/* Hold while modifying clip reference */
	refcount_t refcnt;
	struct list_head list;
	union {
		struct sockaddr_in addr;
		struct sockaddr_in6 addr6;
	};
};

struct clip_tbl {
	unsigned int clipt_start;
	unsigned int clipt_size;
	rwlock_t lock;
	atomic_t nfree;
	struct list_head ce_free_head;
	void *cl_list;
	struct list_head hash_list[];
};

enum {
	CLIPT_MIN_HASH_BUCKETS = 2,
};

struct clip_tbl *t4_init_clip_tbl(unsigned int clipt_start,
				  unsigned int clipt_end);
int cxgb4_clip_get(const struct net_device *dev, const u32 *lip, u8 v6);
void cxgb4_clip_release(const struct net_device *dev, const u32 *lip, u8 v6);
int clip_tbl_show(struct seq_file *seq, void *v);
int cxgb4_update_root_dev_clip(struct net_device *dev);
void t4_cleanup_clip_tbl(struct adapter *adap);