Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
[linux-2.6-microblaze.git] / include / linux / skbuff.h
index b37c829..dc4b3e1 100644 (file)
@@ -381,6 +381,19 @@ enum skb_drop_reason {
                                         * the ofo queue, corresponding to
                                         * LINUX_MIB_TCPOFOMERGE
                                         */
+       SKB_DROP_REASON_TCP_RFC7323_PAWS, /* PAWS check, corresponding to
+                                          * LINUX_MIB_PAWSESTABREJECTED
+                                          */
+       SKB_DROP_REASON_TCP_INVALID_SEQUENCE, /* Not acceptable SEQ field */
+       SKB_DROP_REASON_TCP_RESET,      /* Invalid RST packet */
+       SKB_DROP_REASON_TCP_INVALID_SYN, /* Incoming packet has unexpected SYN flag */
+       SKB_DROP_REASON_TCP_CLOSE,      /* TCP socket in CLOSE state */
+       SKB_DROP_REASON_TCP_FASTOPEN,   /* dropped by FASTOPEN request socket */
+       SKB_DROP_REASON_TCP_OLD_ACK,    /* TCP ACK is old, but in window */
+       SKB_DROP_REASON_TCP_TOO_OLD_ACK, /* TCP ACK is too old */
+       SKB_DROP_REASON_TCP_ACK_UNSENT_DATA, /* TCP ACK for data we haven't sent yet */
+       SKB_DROP_REASON_TCP_OFO_QUEUE_PRUNE, /* pruned from TCP OFO queue */
+       SKB_DROP_REASON_TCP_OFO_DROP,   /* data already in receive queue */
        SKB_DROP_REASON_IP_OUTNOROUTES, /* route lookup failed */
        SKB_DROP_REASON_BPF_CGROUP_EGRESS,      /* dropped by
                                                 * BPF_PROG_TYPE_CGROUP_SKB
@@ -408,11 +421,9 @@ enum skb_drop_reason {
                                         */
        SKB_DROP_REASON_XDP,            /* dropped by XDP in input path */
        SKB_DROP_REASON_TC_INGRESS,     /* dropped in TC ingress HOOK */
-       SKB_DROP_REASON_PTYPE_ABSENT,   /* not packet_type found to handle
-                                        * the skb. For an etner packet,
-                                        * this means that L3 protocol is
-                                        * not supported
-                                        */
+       SKB_DROP_REASON_UNHANDLED_PROTO,        /* protocol not implemented
+                                                * or not supported
+                                                */
        SKB_DROP_REASON_SKB_CSUM,       /* sk_buff checksum computation
                                         * error
                                         */
@@ -444,9 +455,35 @@ enum skb_drop_reason {
        SKB_DROP_REASON_TAP_TXFILTER,   /* dropped by tx filter implemented
                                         * at tun/tap, e.g., check_filter()
                                         */
+       SKB_DROP_REASON_ICMP_CSUM,      /* ICMP checksum error */
+       SKB_DROP_REASON_INVALID_PROTO,  /* the packet doesn't follow RFC
+                                        * 2211, such as a broadcasts
+                                        * ICMP_TIMESTAMP
+                                        */
+       SKB_DROP_REASON_IP_INADDRERRORS,        /* host unreachable, corresponding
+                                                * to IPSTATS_MIB_INADDRERRORS
+                                                */
+       SKB_DROP_REASON_IP_INNOROUTES,  /* network unreachable, corresponding
+                                        * to IPSTATS_MIB_INADDRERRORS
+                                        */
+       SKB_DROP_REASON_PKT_TOO_BIG,    /* packet size is too big (maybe exceed
+                                        * the MTU)
+                                        */
        SKB_DROP_REASON_MAX,
 };
 
+#define SKB_DR_INIT(name, reason)                              \
+       enum skb_drop_reason name = SKB_DROP_REASON_##reason
+#define SKB_DR(name)                                           \
+       SKB_DR_INIT(name, NOT_SPECIFIED)
+#define SKB_DR_SET(name, reason)                               \
+       (name = SKB_DROP_REASON_##reason)
+#define SKB_DR_OR(name, reason)                                        \
+       do {                                                    \
+               if (name == SKB_DROP_REASON_NOT_SPECIFIED)      \
+                       SKB_DR_SET(name, reason);               \
+       } while (0)
+
 /* To allow 64K frame to be packed as single skb without frag_list we
  * require 64K/PAGE_SIZE pages plus 1 additional page to allow for
  * buffers which do not start on a page boundary.
@@ -851,6 +888,7 @@ typedef unsigned char *sk_buff_data_t;
  *             delivery_time at egress.
  *     @napi_id: id of the NAPI struct this skb came from
  *     @sender_cpu: (aka @napi_id) source CPU in XPS
+ *     @alloc_cpu: CPU which did the skb allocation.
  *     @secmark: security marking
  *     @mark: Generic packet mark
  *     @reserved_tailroom: (aka @mark) number of bytes of free space available
@@ -1043,6 +1081,7 @@ struct sk_buff {
                unsigned int    sender_cpu;
        };
 #endif
+       u16                     alloc_cpu;
 #ifdef CONFIG_NETWORK_SECMARK
        __u32           secmark;
 #endif
@@ -1284,6 +1323,7 @@ struct sk_buff *__build_skb(void *data, unsigned int frag_size);
 struct sk_buff *build_skb(void *data, unsigned int frag_size);
 struct sk_buff *build_skb_around(struct sk_buff *skb,
                                 void *data, unsigned int frag_size);
+void skb_attempt_defer_free(struct sk_buff *skb);
 
 struct sk_buff *napi_build_skb(void *data, unsigned int frag_size);