From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [bpf-next PATCH 1/2] samples/bpf: extend xdp_rxq_info to read packet payload Date: Wed, 27 Jun 2018 13:23:12 +0200 Message-ID: <20180627132312.0640448b@redhat.com> References: <152993682254.8835.8864318933370018087.stgit@firesoul> <152993686364.8835.3914229981165096265.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Networking , Daniel Borkmann , Toke =?UTF-8?B?SMO4aWxhbmQtSsO4cmdlbnNlbg==?= , Alexei Starovoitov , brouer@redhat.com To: Song Liu Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54450 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932398AbeF0LXQ (ORCPT ); Wed, 27 Jun 2018 07:23:16 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 26 Jun 2018 16:53:15 -0700 Song Liu 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