Subject: Re: [bpf-next PATCH 1/2] samples/bpf: extend xdp_rxq_info to read packet payload

From: Jesper Dangaard Brouer <[email-masked]>
Date: Wed, 27 Jun 2018 13:23:12 +0200

On Tue, 26 Jun 2018 16:53:15 -0700
Song Liu <[email-masked]> wrote:

> > +static char* options2str(enum cfg_options_flags flag)
> > +{
> > +       if (flag == NO_TOUCH)
> > +               return "no_touch";
> > +       if (flag & READ_MEM)
> > +               return "read";
> > +       fprintf(stderr, "ERR: Unknown config option flags");
> > +       exit(EXIT_FAIL);
> > +}
> > +  
> 
> enum cfg_options_flags is used as a bitmap in other parts of the sample.
> So this function is a little weird (with more flags added).

Sure, and do I handle this correctly in the next patch.

I'm uncertain what you want me to change?
Do you want me to drop the enum, and use #define instead?

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer