From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by dpdk.org (Postfix) with ESMTP id 3C3C25F0F for ; Fri, 9 Mar 2018 00:15:09 +0100 (CET) Received: by mail-pg0-f66.google.com with SMTP id i14so2847633pgv.3 for ; Thu, 08 Mar 2018 15:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wkccsee+miTG6wwkuBm7HqC+gFB9zl7ZRHLn3iAhq/A=; b=btmUUYP8ZDnC27QSapGd0HhIMfhFDmyqMd9drD2yCkqrI6aOtuR69lAvg/8oWhl8lg Eqz5RpOvzIB4D1YVqlC0oFfvwb34gl37zgspejI5swnjDUcHTEAI9AQHPeGmKWVxvz3x JRiIkth8w9IjOSg/f7I/PmLpt0xgAdKe8wNOeHP+m33aLSxp+E9fNjxsvc1I7PwM+BDC XiDxkx9CHFcAltyZ79Kw4MHHKORq9OcgmkHflZd/PiLObjeKaZqRw7qyrl53s/1036xI mZWis59UuYWUFahjbeEm0UQz5x9trDq3m7F8VgpaTT2JAxbwzkf1quU+bYbWy9xEQJcR pKJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wkccsee+miTG6wwkuBm7HqC+gFB9zl7ZRHLn3iAhq/A=; b=EulWys0eCQsVNh/hQ7eirvvWkfrXTQ3l++uDxX3qK2HpHb9umd/4YfkN0Fo3+8Znn0 +Z270++JHtDXdmSBlP8Ho1X36YWHILNpswPcMtmt+w1yCd5ZH5kpBkXdE+gZzEdP58ms rjaRijhXDtNi08SMtLQuzV4CWvZd2AdMlQ67BWG8Q0fyp8BijPJFXaxCogRxCLdU1dq/ 92h48pjk6pawfpcHYdhJPxlDGtIJvIqGfbMkTk3JWIo/PVTu9egko60BA91KWejpWMiY +nmGkoy9QWvLUlpqjQQyPqwPfkSx3GrK65ktMFOmfE4s56TWMnAej7cQRI5ht3+gvroz aKFA== X-Gm-Message-State: APf1xPBWcEyaBjfCT0IsNhluEos1gCJBzykkLq+v66gkBRvR6qBGnnL7 Nfjy99wdD8ismTZ9GShBKvePpN7vinI= X-Google-Smtp-Source: AG47ELv4uik9+J7YOYka6/IzTY6MrnzGVCQjgy9whbEc0MBwwF7VtCQaMKOksC94hLEsOoAB0J4C+Q== X-Received: by 10.101.78.5 with SMTP id r5mr22448208pgt.33.1520550908401; Thu, 08 Mar 2018 15:15:08 -0800 (PST) Received: from xeon-e3 (204-195-71-95.wavecable.com. [204.195.71.95]) by smtp.gmail.com with ESMTPSA id u28sm43155304pfl.19.2018.03.08.15.15.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Mar 2018 15:15:08 -0800 (PST) Date: Thu, 8 Mar 2018 15:15:00 -0800 From: Stephen Hemminger To: Qi Zhang Cc: dev@dpdk.org, magnus.karlsson@intel.com, bjorn.topel@intel.com Message-ID: <20180308151500.2365b677@xeon-e3> In-Reply-To: <20180308135249.28187-7-qi.z.zhang@intel.com> References: <20180308135249.28187-1-qi.z.zhang@intel.com> <20180308135249.28187-7-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC v2 6/7] net/af_xdp: load BPF file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2018 23:15:09 -0000 On Thu, 8 Mar 2018 21:52:48 +0800 Qi Zhang wrote: > +struct bpf_insn prog[] = { > + { > + .code = 0x85, //call imm > + .dst_reg = 0, > + .src_reg = 0, > + .off = 0, > + .imm = BPF_FUNC_xdpsk_redirect, > + }, > + { > + .code = 0x95, //exit > + .dst_reg = 0, > + .src_reg = 0, > + .off = 0, > + .imm = 0, > + }, > +}; > + > +int load_bpf_file(void) > +{ > + int fd; > + > + fd = bpf_load_program(BPF_PROG_TYPE_XDP, prog, > + ARRAY_SIZE(prog), > + "GPL", 0, > + bpf_log_buf, BPF_LOG_BUF_SIZE); Still have license conflict here. The short bpf program is in BSD code and therefore is BSD, not GPL. But kernel won't let you load non-GPL programs. Please check with Intel open source compliance to find a GPL solution. A possible license safe solution is more complex. You need to provide original program source for the BPF program under dual clause (GPL-2/BSD-3); then read in that object file and load it. A user wishing to exercise their GPL rights can then take your source file and modify and create new file to load. Doing this also creates additional GPL issues for appliance vendors using AF_XDP. They need to make available the source of all these XDP BPF programs. Complying with mixed licenses is hard.