Skip to content

Commit 12b276f

Browse files
Kumar Sanghvidavem330
authored andcommitted
cxgb4: add support to create hash filters
Add support to create hash (exact-match) filters based on the value of 'hash' field in ch_filter_specification. Allocate SMT/L2T entries if DMAC-rewrite/SMAC-rewrite is requested. Allocate CLIP entry in case of IPv6 filter. Use cpl_act_open_req[6] to send hash filter create request to hw. Also, the filter tuple is calculated as part of sending this request. Hash-filter reply is processed on getting cpl_act_open_rpl. In case of success, various bits/fields in filter-tcb are set per filter requirement, such as enabling filter hitcnts, and/or various header rewrite operations, such as VLAN-rewrite, NAT or (L3/L4)-rewrite, and SMAC/DMAC-rewrite. In case of failure, clear the filter entry and release any hw resources occupied by it. The patch also moves the functions set_tcb_field, set_tcb_tflag and configure_filter_smac towards beginning of file. Signed-off-by: Kumar Sanghvi <[email protected]> Signed-off-by: Rahul Lakkireddy <[email protected]> Signed-off-by: Ganesh Goudar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5c31254 commit 12b276f

File tree

6 files changed

+562
-50
lines changed

6 files changed

+562
-50
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ struct ch_filter_specification {
10501050
* matching that doesn't exist as a (value, mask) tuple.
10511051
*/
10521052
uint32_t type:1; /* 0 => IPv4, 1 => IPv6 */
1053+
u32 hash:1; /* 0 => wild-card, 1 => exact-match */
10531054

10541055
/* Packet dispatch information. Ingress packets which match the
10551056
* filter rules will be dropped, passed to the host or switched back
@@ -1107,7 +1108,14 @@ enum {
11071108
};
11081109

11091110
enum {
1110-
NAT_MODE_ALL = 7, /* NAT on entire 4-tuple */
1111+
NAT_MODE_NONE = 0, /* No NAT performed */
1112+
NAT_MODE_DIP, /* NAT on Dst IP */
1113+
NAT_MODE_DIP_DP, /* NAT on Dst IP, Dst Port */
1114+
NAT_MODE_DIP_DP_SIP, /* NAT on Dst IP, Dst Port and Src IP */
1115+
NAT_MODE_DIP_DP_SP, /* NAT on Dst IP, Dst Port and Src Port */
1116+
NAT_MODE_SIP_SP, /* NAT on Src IP and Src Port */
1117+
NAT_MODE_DIP_SIP_SP, /* NAT on Dst IP, Src IP and Src Port */
1118+
NAT_MODE_ALL /* NAT on entire 4-tuple */
11111119
};
11121120

11131121
/* Host shadow copy of ingress filter entry. This is in host native format

0 commit comments

Comments
 (0)