From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael Kerrisk (man-pages)" Subject: Re: status in PACKET_RX_RING is actually a bit mask Date: Thu, 24 Apr 2014 12:16:39 +0200 Message-ID: <5358E487.40007@gmail.com> References: <5358C4FC.80204@redhat.com> <5358C7E0.9040704@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-man-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Carsten Andrich , Daniel Borkmann Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Stefan Puiu , lnx-man , Willem de Bruijn , Neil Horman List-Id: linux-man@vger.kernel.org On 04/24/2014 11:17 AM, Carsten Andrich wrote: > I'd ack the patch, too. > However if we start clarifying the bitmask situation, we should do it > properly. packet.7 mentions TP_STATUS_xyz several times and never > actually differentiates between setting bits and setting the whole > tp_status variable. Actually both occurs inside the kernel: > http://lingrok.org/xref/linux-net-next/net/packet/af_packet.c#798 > http://lingrok.org/xref/linux-net-next/net/packet/af_packet.c#2300 > > I could prepare another patch for review, that clarifies the tp_status > usage for all references to TP_STATUS_xyz values. > Unless Stefan would like to do this himself, since it's actually his > "discovery" ;) I'd be happy to receive a patch from either of you. Cheers, Michael > Daniel Borkmann schrieb: >> On 04/24/2014 10:04 AM, Michael Kerrisk (man-pages) wrote: >>>> Now to your question. It can easily be seen from the if_packet.h header >>>> file http://lingrok.org/xref/linux-net-next/include/uapi/linux/if_packet.h#93 >>>> that TP_STATUS_* are individual bits that are set in tp_status field. >>> >>> So, I take it that that's an Ack-for the patch by Stefan? >> >> Feel free to add my Ack. One nit below: >> >> diff --git a/man7/packet.7 b/man7/packet.7 >> index 1d3f222..6bac465 100644 >> --- a/man7/packet.7 >> +++ b/man7/packet.7 >> @@ -353,9 +353,9 @@ The packet socket owns all slots with status >> .BR TP_STATUS_KERNEL . >> After filling a slot, it changes the status of the slot to transfer >> ownership to the application. >> -During normal operation, the new status is >> -.BR TP_STATUS_USER , >> -to signal that a correctly received packet has been stored. >> +During normal operation, the new status has the >> +.BR TP_STATUS_USER >> +bit set to signal that a correctly received packet has been stored. >> >> ^--- I would drop the 'correctly' here as it rather raises questions >> what 'incorrectly' would mean in this context. >> >> When the application has finished processing a packet, it transfers >> ownership of the slot back to the socket by setting the status to >> >> >>> >>> Cheers, >>> >>> Michael >>> > > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html