Re: [PATCH v2 net-next af-packet 1/2] Enhance af-packet to provide(near zero)lossless packet capture functionality.

From: chetan loke
Date: Wed Jul 06 2011 - 17:45:27 EST


On Tue, Jul 5, 2011 at 11:01 AM, David Miller <davem@xxxxxxxxxxxxx> wrote:

>
> That issue only exists because you haven't defined a common header
> struct that the current, and all future, block descriptor variants can
> include at the start of their definitions.

what's common today may not be common tomorrow. After much thinking I
decided to not provide a generic header because I wouldn't want to
enforce anything.

new format:

union bd_header_u {
/* renamed struct bd_v1 to hdr_v1 */
struct hdr_v1 h1;
} __attribute__ ((__packed__));

struct block_desc {
__u16 version;
__u16 offset_to_priv;
union bd_header_u hdr;
} __attribute__ ((__packed__));

Is this ok with you?


>
> Use real data structures, not opaque "offset+size" poking into the
> descriptors.
>
Used to writing firmware APIs. APIs use words/bytes so that they can
be interpreted by firmware folks too.

Chetan Loke
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/