mirror of https://gitee.com/openkylin/linux.git
net: Fix typo of SKB_SGO_CB_OFFSET
The SKB_SGO_CB_OFFSET should be SKB_GSO_CB_OFFSET which means the
offset of the GSO in skb cb. This patch fixes the typo.
Fixes: 9207f9d45b
("net: preserve IP control block during GSO segmentation")
Signed-off-by: Cambda Zhu <cambda@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3b85720d3f
commit
a08e7fd912
|
@ -4389,8 +4389,8 @@ struct skb_gso_cb {
|
||||||
__wsum csum;
|
__wsum csum;
|
||||||
__u16 csum_start;
|
__u16 csum_start;
|
||||||
};
|
};
|
||||||
#define SKB_SGO_CB_OFFSET 32
|
#define SKB_GSO_CB_OFFSET 32
|
||||||
#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)((skb)->cb + SKB_SGO_CB_OFFSET))
|
#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)((skb)->cb + SKB_GSO_CB_OFFSET))
|
||||||
|
|
||||||
static inline int skb_tnl_header_len(const struct sk_buff *inner_skb)
|
static inline int skb_tnl_header_len(const struct sk_buff *inner_skb)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3266,7 +3266,7 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
|
||||||
* It may return NULL if the skb requires no segmentation. This is
|
* It may return NULL if the skb requires no segmentation. This is
|
||||||
* only possible when GSO is used for verifying header integrity.
|
* only possible when GSO is used for verifying header integrity.
|
||||||
*
|
*
|
||||||
* Segmentation preserves SKB_SGO_CB_OFFSET bytes of previous skb cb.
|
* Segmentation preserves SKB_GSO_CB_OFFSET bytes of previous skb cb.
|
||||||
*/
|
*/
|
||||||
struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
|
struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
|
||||||
netdev_features_t features, bool tx_path)
|
netdev_features_t features, bool tx_path)
|
||||||
|
@ -3295,7 +3295,7 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
|
||||||
features &= ~NETIF_F_GSO_PARTIAL;
|
features &= ~NETIF_F_GSO_PARTIAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BUILD_BUG_ON(SKB_SGO_CB_OFFSET +
|
BUILD_BUG_ON(SKB_GSO_CB_OFFSET +
|
||||||
sizeof(*SKB_GSO_CB(skb)) > sizeof(skb->cb));
|
sizeof(*SKB_GSO_CB(skb)) > sizeof(skb->cb));
|
||||||
|
|
||||||
SKB_GSO_CB(skb)->mac_offset = skb_headroom(skb);
|
SKB_GSO_CB(skb)->mac_offset = skb_headroom(skb);
|
||||||
|
|
|
@ -263,7 +263,7 @@ static int ip_finish_output_gso(struct net *net, struct sock *sk,
|
||||||
* insufficent MTU.
|
* insufficent MTU.
|
||||||
*/
|
*/
|
||||||
features = netif_skb_features(skb);
|
features = netif_skb_features(skb);
|
||||||
BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_SGO_CB_OFFSET);
|
BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_GSO_CB_OFFSET);
|
||||||
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
|
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
|
||||||
if (IS_ERR_OR_NULL(segs)) {
|
if (IS_ERR_OR_NULL(segs)) {
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
|
|
@ -2109,7 +2109,7 @@ static int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||||
if (likely(!udp_unexpected_gso(sk, skb)))
|
if (likely(!udp_unexpected_gso(sk, skb)))
|
||||||
return udp_queue_rcv_one_skb(sk, skb);
|
return udp_queue_rcv_one_skb(sk, skb);
|
||||||
|
|
||||||
BUILD_BUG_ON(sizeof(struct udp_skb_cb) > SKB_SGO_CB_OFFSET);
|
BUILD_BUG_ON(sizeof(struct udp_skb_cb) > SKB_GSO_CB_OFFSET);
|
||||||
__skb_push(skb, -skb_mac_offset(skb));
|
__skb_push(skb, -skb_mac_offset(skb));
|
||||||
segs = udp_rcv_segment(sk, skb, true);
|
segs = udp_rcv_segment(sk, skb, true);
|
||||||
skb_list_walk_safe(segs, skb, next) {
|
skb_list_walk_safe(segs, skb, next) {
|
||||||
|
|
|
@ -305,7 +305,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
|
||||||
struct sk_buff *segs, *nskb;
|
struct sk_buff *segs, *nskb;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
BUILD_BUG_ON(sizeof(*OVS_CB(skb)) > SKB_SGO_CB_OFFSET);
|
BUILD_BUG_ON(sizeof(*OVS_CB(skb)) > SKB_GSO_CB_OFFSET);
|
||||||
segs = __skb_gso_segment(skb, NETIF_F_SG, false);
|
segs = __skb_gso_segment(skb, NETIF_F_SG, false);
|
||||||
if (IS_ERR(segs))
|
if (IS_ERR(segs))
|
||||||
return PTR_ERR(segs);
|
return PTR_ERR(segs);
|
||||||
|
|
|
@ -535,8 +535,8 @@ static int xfrm_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb
|
||||||
{
|
{
|
||||||
struct sk_buff *segs, *nskb;
|
struct sk_buff *segs, *nskb;
|
||||||
|
|
||||||
BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_SGO_CB_OFFSET);
|
BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_GSO_CB_OFFSET);
|
||||||
BUILD_BUG_ON(sizeof(*IP6CB(skb)) > SKB_SGO_CB_OFFSET);
|
BUILD_BUG_ON(sizeof(*IP6CB(skb)) > SKB_GSO_CB_OFFSET);
|
||||||
segs = skb_gso_segment(skb, 0);
|
segs = skb_gso_segment(skb, 0);
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
if (IS_ERR(segs))
|
if (IS_ERR(segs))
|
||||||
|
|
Loading…
Reference in New Issue