aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-06-22 05:40:14 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-23 05:07:29 -0400
commit7967168cefdbc63bf332d6b1548eca7cd65ebbcc (patch)
treec45759149ae0acdc89d746e556a0ae278d11776d /drivers/net/s2io.c
parentd4828d85d188dc70ed172802e798d3978bb6e29e (diff)
[NET]: Merge TSO/UFO fields in sk_buff
Having separate fields in sk_buff for TSO/UFO (tso_size/ufo_size) is not going to scale if we add any more segmentation methods (e.g., DCCP). So let's merge them. They were used to tell the protocol of a packet. This function has been subsumed by the new gso_type field. This is essentially a set of netdev feature bits (shifted by 16 bits) that are required to process a specific skb. As such it's easy to tell whether a given device can process a GSO skb: you just have to and the gso_type field and the netdev's features field. I've made gso_type a conjunction. The idea is that you have a base type (e.g., SKB_GSO_TCPV4) that can be modified further to support new features. For example, if we add a hardware TSO type that supports ECN, they would declare NETIF_F_TSO | NETIF_F_TSO_ECN. All TSO packets with CWR set would have a gso_type of SKB_GSO_TCPV4 | SKB_GSO_TCPV4_ECN while all other TSO packets would be SKB_GSO_TCPV4. This means that only the CWR packets need to be emulated in software. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 11daed495b97..3defe5d4f7d3 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3959,8 +3959,8 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3959 txdp->Control_1 = 0; 3959 txdp->Control_1 = 0;
3960 txdp->Control_2 = 0; 3960 txdp->Control_2 = 0;
3961#ifdef NETIF_F_TSO 3961#ifdef NETIF_F_TSO
3962 mss = skb_shinfo(skb)->tso_size; 3962 mss = skb_shinfo(skb)->gso_size;
3963 if (mss) { 3963 if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV4) {
3964 txdp->Control_1 |= TXD_TCP_LSO_EN; 3964 txdp->Control_1 |= TXD_TCP_LSO_EN;
3965 txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); 3965 txdp->Control_1 |= TXD_TCP_LSO_MSS(mss);
3966 } 3966 }
@@ -3980,10 +3980,10 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3980 } 3980 }
3981 3981
3982 frg_len = skb->len - skb->data_len; 3982 frg_len = skb->len - skb->data_len;
3983 if (skb_shinfo(skb)->ufo_size) { 3983 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) {
3984 int ufo_size; 3984 int ufo_size;
3985 3985
3986 ufo_size = skb_shinfo(skb)->ufo_size; 3986 ufo_size = skb_shinfo(skb)->gso_size;
3987 ufo_size &= ~7; 3987 ufo_size &= ~7;
3988 txdp->Control_1 |= TXD_UFO_EN; 3988 txdp->Control_1 |= TXD_UFO_EN;
3989 txdp->Control_1 |= TXD_UFO_MSS(ufo_size); 3989 txdp->Control_1 |= TXD_UFO_MSS(ufo_size);
@@ -4009,7 +4009,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4009 txdp->Host_Control = (unsigned long) skb; 4009 txdp->Host_Control = (unsigned long) skb;
4010 txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); 4010 txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len);
4011 4011
4012 if (skb_shinfo(skb)->ufo_size) 4012 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
4013 txdp->Control_1 |= TXD_UFO_EN; 4013 txdp->Control_1 |= TXD_UFO_EN;
4014 4014
4015 frg_cnt = skb_shinfo(skb)->nr_frags; 4015 frg_cnt = skb_shinfo(skb)->nr_frags;
@@ -4024,12 +4024,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4024 (sp->pdev, frag->page, frag->page_offset, 4024 (sp->pdev, frag->page, frag->page_offset,
4025 frag->size, PCI_DMA_TODEVICE); 4025 frag->size, PCI_DMA_TODEVICE);
4026 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); 4026 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
4027 if (skb_shinfo(skb)->ufo_size) 4027 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
4028 txdp->Control_1 |= TXD_UFO_EN; 4028 txdp->Control_1 |= TXD_UFO_EN;
4029 } 4029 }
4030 txdp->Control_1 |= TXD_GATHER_CODE_LAST; 4030 txdp->Control_1 |= TXD_GATHER_CODE_LAST;
4031 4031
4032 if (skb_shinfo(skb)->ufo_size) 4032 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
4033 frg_cnt++; /* as Txd0 was used for inband header */ 4033 frg_cnt++; /* as Txd0 was used for inband header */
4034 4034
4035 tx_fifo = mac_control->tx_FIFO_start[queue]; 4035 tx_fifo = mac_control->tx_FIFO_start[queue];
@@ -4043,7 +4043,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4043 if (mss) 4043 if (mss)
4044 val64 |= TX_FIFO_SPECIAL_FUNC; 4044 val64 |= TX_FIFO_SPECIAL_FUNC;
4045#endif 4045#endif
4046 if (skb_shinfo(skb)->ufo_size) 4046 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4)
4047 val64 |= TX_FIFO_SPECIAL_FUNC; 4047 val64 |= TX_FIFO_SPECIAL_FUNC;
4048 writeq(val64, &tx_fifo->List_Control); 4048 writeq(val64, &tx_fifo->List_Control);
4049 4049