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

Commit f9d1846f authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'cxgb4-tc-offload'



Rahul Lakkireddy says:

====================
cxgb4: add support for offloading TC u32 filters

This series of patches add support to offload TC u32 filters onto
Chelsio NICs.

Patch 1 moves current common filter code to separate files
in order to provide a common api for performing packet classification
and filtering in Chelsio NICs.

Patch 2 enables filters for normal NIC configuration and implements
common api for setting and deleting filters.

Patches 3-5 add support for TC u32 offload via ndo_setup_tc.

---
v3:

Based on review and suggestion from David Miller <davem@davemloft.net>
- Fixed all local variable declarations by placing them in longest line
  first and shortest line last order.

v2:

Based on review and suggestions from Jiri Pirko <jiri@resnulli.us>:
- Replaced macros S and U with appropriate static helper functions.
- Moved completion code for set and delete filters to respective
  functions cxgb4_set_filter() and cxgb4_del_filter().  Renamed the
  original functions to __cxgb4_set_filter() and __cxgb4_del_filter()
  in case synchronization is not required.
- Dropped debugfs patch.
- Merged code for inserting and deleting u32 filters into a single
  patch.
- Reworked and fixed bugs with traversing the actions list.
- Removed all unnecessary extra ().
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ecf4ee41 b20ff726
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

obj-$(CONFIG_CHELSIO_T4) += cxgb4.o

cxgb4-objs := cxgb4_main.o l2t.o t4_hw.o sge.o clip_tbl.o cxgb4_ethtool.o cxgb4_uld.o sched.o
cxgb4-objs := cxgb4_main.o l2t.o t4_hw.o sge.o clip_tbl.o cxgb4_ethtool.o cxgb4_uld.o sched.o cxgb4_filter.o cxgb4_tc_u32.o
cxgb4-$(CONFIG_CHELSIO_T4_DCB) +=  cxgb4_dcb.o
cxgb4-$(CONFIG_CHELSIO_T4_FCOE) +=  cxgb4_fcoe.o
cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o
+29 −0
Original line number Diff line number Diff line
@@ -851,6 +851,9 @@ struct adapter {

	spinlock_t stats_lock;
	spinlock_t win0_lock ____cacheline_aligned_in_smp;

	/* TC u32 offload */
	struct cxgb4_tc_u32_table *tc_u32;
};

/* Support for "sched-class" command to allow a TX Scheduling Class to be
@@ -1025,6 +1028,32 @@ enum {
	VLAN_REWRITE
};

/* Host shadow copy of ingress filter entry.  This is in host native format
 * and doesn't match the ordering or bit order, etc. of the hardware of the
 * firmware command.  The use of bit-field structure elements is purely to
 * remind ourselves of the field size limitations and save memory in the case
 * where the filter table is large.
 */
struct filter_entry {
	/* Administrative fields for filter. */
	u32 valid:1;            /* filter allocated and valid */
	u32 locked:1;           /* filter is administratively locked */

	u32 pending:1;          /* filter action is pending firmware reply */
	u32 smtidx:8;           /* Source MAC Table index for smac */
	struct filter_ctx *ctx; /* Caller's completion hook */
	struct l2t_entry *l2t;  /* Layer Two Table entry for dmac */
	struct net_device *dev; /* Associated net device */
	u32 tid;                /* This will store the actual tid */

	/* The filter itself.  Most of this is a straight copy of information
	 * provided by the extended ioctl().  Some fields are translated to
	 * internal forms -- for instance the Ingress Queue ID passed in from
	 * the ioctl() is translated into the Absolute Ingress Queue ID.
	 */
	struct ch_filter_specification fs;
};

static inline int is_offload(const struct adapter *adap)
{
	return adap->params.offload;
+721 −0

File added.

Preview size limit exceeded, changes collapsed.

+48 −0

File added.

Preview size limit exceeded, changes collapsed.

+62 −282

File changed.

Preview size limit exceeded, changes collapsed.

Loading