Skip to content

Commit

Permalink
cxgb4: Include TCP as protocol when creating server filters
Browse files Browse the repository at this point in the history
We were creating LE Workaround Server Filters without specifying
IPPROTO_TCP (6) in the filters (when F_PROTOCOL is set in TP_VLAN_PRI_MAP).
This meant that UDP packets with matching IP Addresses/Ports would get
caught up in the filter and be delivered to ULDs like iw_cxgb4.
So, include the protocol information in the server filter properly.

Based on original work by Casey Leedom <leedom@chelsio.com>

Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kumar Sanghvi authored and David S. Miller committed Dec 22, 2013
1 parent b6f8eae commit 7c89e55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4217,6 +4217,11 @@ int cxgb4_create_server_filter(const struct net_device *dev, unsigned int stid,
}
}

if (adap->filter_mode & F_PROTOCOL) {
f->fs.val.proto = IPPROTO_TCP;
f->fs.mask.proto = ~0;
}

f->fs.dirsteer = 1;
f->fs.iq = queue;
/* Mark filter as locked */
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,10 @@

#define A_TP_TX_SCHED_PCMD 0x25

#define S_PROTOCOL 5
#define V_PROTOCOL(x) ((x) << S_PROTOCOL)
#define F_PROTOCOL V_PROTOCOL(1U)

#define S_PORT 1
#define V_PORT(x) ((x) << S_PORT)
#define F_PORT V_PORT(1U)
Expand Down

0 comments on commit 7c89e55

Please sign in to comment.