diff options
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index 901c824bfe6d..ff9c013ce535 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -833,10 +833,26 @@ static int do_trace(struct t3cdev *dev, struct sk_buff *skb) | |||
833 | return 0; | 833 | return 0; |
834 | } | 834 | } |
835 | 835 | ||
836 | /* | ||
837 | * That skb would better have come from process_responses() where we abuse | ||
838 | * ->priority and ->csum to carry our data. NB: if we get to per-arch | ||
839 | * ->csum, the things might get really interesting here. | ||
840 | */ | ||
841 | |||
842 | static inline u32 get_hwtid(struct sk_buff *skb) | ||
843 | { | ||
844 | return ntohl((__force __be32)skb->priority) >> 8 & 0xfffff; | ||
845 | } | ||
846 | |||
847 | static inline u32 get_opcode(struct sk_buff *skb) | ||
848 | { | ||
849 | return G_OPCODE(ntohl((__force __be32)skb->csum)); | ||
850 | } | ||
851 | |||
836 | static int do_term(struct t3cdev *dev, struct sk_buff *skb) | 852 | static int do_term(struct t3cdev *dev, struct sk_buff *skb) |
837 | { | 853 | { |
838 | unsigned int hwtid = ntohl(skb->priority) >> 8 & 0xfffff; | 854 | unsigned int hwtid = get_hwtid(skb); |
839 | unsigned int opcode = G_OPCODE(ntohl(skb->csum)); | 855 | unsigned int opcode = get_opcode(skb); |
840 | struct t3c_tid_entry *t3c_tid; | 856 | struct t3c_tid_entry *t3c_tid; |
841 | 857 | ||
842 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); | 858 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); |
@@ -914,7 +930,7 @@ int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n) | |||
914 | { | 930 | { |
915 | while (n--) { | 931 | while (n--) { |
916 | struct sk_buff *skb = *skbs++; | 932 | struct sk_buff *skb = *skbs++; |
917 | unsigned int opcode = G_OPCODE(ntohl(skb->csum)); | 933 | unsigned int opcode = get_opcode(skb); |
918 | int ret = cpl_handlers[opcode] (dev, skb); | 934 | int ret = cpl_handlers[opcode] (dev, skb); |
919 | 935 | ||
920 | #if VALIDATE_TID | 936 | #if VALIDATE_TID |