Skip to content

Commit d5e63bd

Browse files
committed
Revert "af_packet: add interframe drop cmsg (v6)"
This reverts commit 9777500. Neil is reimplementing this generically, outside of AF_PACKET. Signed-off-by: David S. Miller <[email protected]>
1 parent 91b2a3f commit d5e63bd

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

include/linux/if_packet.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ struct sockaddr_ll
4848
#define PACKET_RESERVE 12
4949
#define PACKET_TX_RING 13
5050
#define PACKET_LOSS 14
51-
#define PACKET_GAPDATA 15
5251

5352
struct tpacket_stats
5453
{
5554
unsigned int tp_packets;
5655
unsigned int tp_drops;
57-
unsigned int tp_gap;
5856
};
5957

6058
struct tpacket_auxdata

net/packet/af_packet.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -524,31 +524,6 @@ static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk,
524524
return res;
525525
}
526526

527-
/*
528-
* If we've lost frames since the last time we queued one to the
529-
* sk_receive_queue, we need to record it here.
530-
* This must be called under the protection of the socket lock
531-
* to prevent racing with other softirqs and user space
532-
*/
533-
static inline void record_packet_gap(struct sk_buff *skb,
534-
struct packet_sock *po)
535-
{
536-
/*
537-
* We overload the mark field here, since we're about
538-
* to enqueue to a receive queue and no body else will
539-
* use this field at this point
540-
*/
541-
skb->mark = po->stats.tp_gap;
542-
po->stats.tp_gap = 0;
543-
return;
544-
545-
}
546-
547-
static inline __u32 check_packet_gap(struct sk_buff *skb)
548-
{
549-
return skb->mark;
550-
}
551-
552527
/*
553528
This function makes lazy skb cloning in hope that most of packets
554529
are discarded by BPF.
@@ -652,7 +627,6 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
652627

653628
spin_lock(&sk->sk_receive_queue.lock);
654629
po->stats.tp_packets++;
655-
record_packet_gap(skb, po);
656630
__skb_queue_tail(&sk->sk_receive_queue, skb);
657631
spin_unlock(&sk->sk_receive_queue.lock);
658632
sk->sk_data_ready(sk, skb->len);
@@ -661,7 +635,6 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
661635
drop_n_acct:
662636
spin_lock(&sk->sk_receive_queue.lock);
663637
po->stats.tp_drops++;
664-
po->stats.tp_gap++;
665638
spin_unlock(&sk->sk_receive_queue.lock);
666639

667640
drop_n_restore:
@@ -839,7 +812,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
839812

840813
ring_is_full:
841814
po->stats.tp_drops++;
842-
po->stats.tp_gap++;
843815
spin_unlock(&sk->sk_receive_queue.lock);
844816

845817
sk->sk_data_ready(sk, 0);
@@ -1449,7 +1421,6 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
14491421
struct sk_buff *skb;
14501422
int copied, err;
14511423
struct sockaddr_ll *sll;
1452-
__u32 gap;
14531424

14541425
err = -EINVAL;
14551426
if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT))
@@ -1528,10 +1499,6 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
15281499
put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(aux), &aux);
15291500
}
15301501

1531-
gap = check_packet_gap(skb);
1532-
if (gap)
1533-
put_cmsg(msg, SOL_PACKET, PACKET_GAPDATA, sizeof(__u32), &gap);
1534-
15351502
/*
15361503
* Free or return the buffer as appropriate. Again this
15371504
* hides all the races and re-entrancy issues from us.

0 commit comments

Comments
 (0)