Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* Copyright (C) 2019 Chelsio Communications.  All rights reserved. */
0003 
0004 #ifndef __CXGB4_TC_MATCHALL_H__
0005 #define __CXGB4_TC_MATCHALL_H__
0006 
0007 #include <net/pkt_cls.h>
0008 
0009 enum cxgb4_matchall_state {
0010     CXGB4_MATCHALL_STATE_DISABLED = 0,
0011     CXGB4_MATCHALL_STATE_ENABLED,
0012 };
0013 
0014 struct cxgb4_matchall_egress_entry {
0015     enum cxgb4_matchall_state state; /* Current MATCHALL offload state */
0016     u8 hwtc; /* Traffic class bound to port */
0017     u64 cookie; /* Used to identify the MATCHALL rule offloaded */
0018 };
0019 
0020 struct cxgb4_matchall_ingress_entry {
0021     enum cxgb4_matchall_state state; /* Current MATCHALL offload state */
0022     u32 tid[CXGB4_FILTER_TYPE_MAX]; /* Index to hardware filter entries */
0023     /* Filter entries */
0024     struct ch_filter_specification fs[CXGB4_FILTER_TYPE_MAX];
0025     u16 viid_mirror; /* Identifier for allocated Mirror VI */
0026     u64 bytes; /* # of bytes hitting the filter */
0027     u64 packets; /* # of packets hitting the filter */
0028     u64 last_used; /* Last updated jiffies time */
0029 };
0030 
0031 struct cxgb4_tc_port_matchall {
0032     struct cxgb4_matchall_egress_entry egress; /* Egress offload info */
0033     struct cxgb4_matchall_ingress_entry ingress; /* Ingress offload info */
0034 };
0035 
0036 struct cxgb4_tc_matchall {
0037     struct cxgb4_tc_port_matchall *port_matchall; /* Per port entry */
0038 };
0039 
0040 int cxgb4_tc_matchall_replace(struct net_device *dev,
0041                   struct tc_cls_matchall_offload *cls_matchall,
0042                   bool ingress);
0043 int cxgb4_tc_matchall_destroy(struct net_device *dev,
0044                   struct tc_cls_matchall_offload *cls_matchall,
0045                   bool ingress);
0046 int cxgb4_tc_matchall_stats(struct net_device *dev,
0047                 struct tc_cls_matchall_offload *cls_matchall);
0048 
0049 int cxgb4_init_tc_matchall(struct adapter *adap);
0050 void cxgb4_cleanup_tc_matchall(struct adapter *adap);
0051 #endif /* __CXGB4_TC_MATCHALL_H__ */