cxgb4: Include TCP as protocol when creating server filters
authorKumar Sanghvi <kumaras@chelsio.com>
Wed, 18 Dec 2013 11:08:20 +0000 (16:38 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Dec 2013 23:09:07 +0000 (18:09 -0500)
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>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h

index f36f8e1a101c9f3cb87c913b27603f26359eae5b..df1d6b8334a16bcc54ff706112126d1e1f82d35c 100644 (file)
@@ -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 */
index 0a8205d69d2c290aae4dbec30245c9dc3e18bd39..d3dd218376b439eb46369f958d7608dfb21de55d 100644 (file)
 
 #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)