diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 79 |
1 files changed, 29 insertions, 50 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ec54785d34f9..7a5057fbb7cd 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -984,6 +984,9 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi, | |||
984 | void netif_napi_del(struct napi_struct *napi); | 984 | void netif_napi_del(struct napi_struct *napi); |
985 | 985 | ||
986 | struct napi_gro_cb { | 986 | struct napi_gro_cb { |
987 | /* This indicates where we are processing relative to skb->data. */ | ||
988 | int data_offset; | ||
989 | |||
987 | /* This is non-zero if the packet may be of the same flow. */ | 990 | /* This is non-zero if the packet may be of the same flow. */ |
988 | int same_flow; | 991 | int same_flow; |
989 | 992 | ||
@@ -1087,6 +1090,29 @@ extern int dev_restart(struct net_device *dev); | |||
1087 | #ifdef CONFIG_NETPOLL_TRAP | 1090 | #ifdef CONFIG_NETPOLL_TRAP |
1088 | extern int netpoll_trap(void); | 1091 | extern int netpoll_trap(void); |
1089 | #endif | 1092 | #endif |
1093 | extern void *skb_gro_header(struct sk_buff *skb, unsigned int hlen); | ||
1094 | extern int skb_gro_receive(struct sk_buff **head, | ||
1095 | struct sk_buff *skb); | ||
1096 | |||
1097 | static inline unsigned int skb_gro_offset(const struct sk_buff *skb) | ||
1098 | { | ||
1099 | return NAPI_GRO_CB(skb)->data_offset; | ||
1100 | } | ||
1101 | |||
1102 | static inline unsigned int skb_gro_len(const struct sk_buff *skb) | ||
1103 | { | ||
1104 | return skb->len - NAPI_GRO_CB(skb)->data_offset; | ||
1105 | } | ||
1106 | |||
1107 | static inline void skb_gro_pull(struct sk_buff *skb, unsigned int len) | ||
1108 | { | ||
1109 | NAPI_GRO_CB(skb)->data_offset += len; | ||
1110 | } | ||
1111 | |||
1112 | static inline void skb_gro_reset_offset(struct sk_buff *skb) | ||
1113 | { | ||
1114 | NAPI_GRO_CB(skb)->data_offset = 0; | ||
1115 | } | ||
1090 | 1116 | ||
1091 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 1117 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
1092 | unsigned short type, | 1118 | unsigned short type, |
@@ -1375,12 +1401,15 @@ extern int netif_receive_skb(struct sk_buff *skb); | |||
1375 | extern void napi_gro_flush(struct napi_struct *napi); | 1401 | extern void napi_gro_flush(struct napi_struct *napi); |
1376 | extern int dev_gro_receive(struct napi_struct *napi, | 1402 | extern int dev_gro_receive(struct napi_struct *napi, |
1377 | struct sk_buff *skb); | 1403 | struct sk_buff *skb); |
1404 | extern int napi_skb_finish(int ret, struct sk_buff *skb); | ||
1378 | extern int napi_gro_receive(struct napi_struct *napi, | 1405 | extern int napi_gro_receive(struct napi_struct *napi, |
1379 | struct sk_buff *skb); | 1406 | struct sk_buff *skb); |
1380 | extern void napi_reuse_skb(struct napi_struct *napi, | 1407 | extern void napi_reuse_skb(struct napi_struct *napi, |
1381 | struct sk_buff *skb); | 1408 | struct sk_buff *skb); |
1382 | extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, | 1409 | extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, |
1383 | struct napi_gro_fraginfo *info); | 1410 | struct napi_gro_fraginfo *info); |
1411 | extern int napi_frags_finish(struct napi_struct *napi, | ||
1412 | struct sk_buff *skb, int ret); | ||
1384 | extern int napi_gro_frags(struct napi_struct *napi, | 1413 | extern int napi_gro_frags(struct napi_struct *napi, |
1385 | struct napi_gro_fraginfo *info); | 1414 | struct napi_gro_fraginfo *info); |
1386 | extern void netif_nit_deliver(struct sk_buff *skb); | 1415 | extern void netif_nit_deliver(struct sk_buff *skb); |
@@ -1574,56 +1603,6 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) | |||
1574 | return (1 << debug_value) - 1; | 1603 | return (1 << debug_value) - 1; |
1575 | } | 1604 | } |
1576 | 1605 | ||
1577 | /* Test if receive needs to be scheduled but only if up */ | ||
1578 | static inline int netif_rx_schedule_prep(struct napi_struct *napi) | ||
1579 | { | ||
1580 | return napi_schedule_prep(napi); | ||
1581 | } | ||
1582 | |||
1583 | /* Add interface to tail of rx poll list. This assumes that _prep has | ||
1584 | * already been called and returned 1. | ||
1585 | */ | ||
1586 | static inline void __netif_rx_schedule(struct napi_struct *napi) | ||
1587 | { | ||
1588 | __napi_schedule(napi); | ||
1589 | } | ||
1590 | |||
1591 | /* Try to reschedule poll. Called by irq handler. */ | ||
1592 | |||
1593 | static inline void netif_rx_schedule(struct napi_struct *napi) | ||
1594 | { | ||
1595 | if (netif_rx_schedule_prep(napi)) | ||
1596 | __netif_rx_schedule(napi); | ||
1597 | } | ||
1598 | |||
1599 | /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */ | ||
1600 | static inline int netif_rx_reschedule(struct napi_struct *napi) | ||
1601 | { | ||
1602 | if (napi_schedule_prep(napi)) { | ||
1603 | __netif_rx_schedule(napi); | ||
1604 | return 1; | ||
1605 | } | ||
1606 | return 0; | ||
1607 | } | ||
1608 | |||
1609 | /* same as netif_rx_complete, except that local_irq_save(flags) | ||
1610 | * has already been issued | ||
1611 | */ | ||
1612 | static inline void __netif_rx_complete(struct napi_struct *napi) | ||
1613 | { | ||
1614 | __napi_complete(napi); | ||
1615 | } | ||
1616 | |||
1617 | /* Remove interface from poll list: it must be in the poll list | ||
1618 | * on current cpu. This primitive is called by dev->poll(), when | ||
1619 | * it completes the work. The device cannot be out of poll list at this | ||
1620 | * moment, it is BUG(). | ||
1621 | */ | ||
1622 | static inline void netif_rx_complete(struct napi_struct *napi) | ||
1623 | { | ||
1624 | napi_complete(napi); | ||
1625 | } | ||
1626 | |||
1627 | static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) | 1606 | static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) |
1628 | { | 1607 | { |
1629 | spin_lock(&txq->_xmit_lock); | 1608 | spin_lock(&txq->_xmit_lock); |