From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A867CA9EC0 for ; Tue, 29 Oct 2019 03:27:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C4C120717 for ; Tue, 29 Oct 2019 03:27:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MMSIUGEE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726464AbfJ2D1X (ORCPT ); Mon, 28 Oct 2019 23:27:23 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:44385 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbfJ2D1X (ORCPT ); Mon, 28 Oct 2019 23:27:23 -0400 Received: by mail-lf1-f65.google.com with SMTP id v4so5960187lfd.11; Mon, 28 Oct 2019 20:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fRT58ADovXG1ZWMqpYAZ5DZDhgM6jsnS7oCs8Ms26/I=; b=MMSIUGEEqKcCoAIubIMgjGaRz1zCC7LZa3WmwbnF19eF0Yb+S9aNya9dWRJh5yh7LP WB6hjI+Ob1nPkaO9dz+M054/gaC76z9xb7xKy3HB2Rz68tgnowwIteGzgD6nGd0QlQRd rvY5bjBtk5qsKhhavgsOs7DpA4LilPiJw12aldCBLoZnuCkpLMxnHcEBXj7plm3Hz+z9 YDGMQtXBUzbxkkvl/hQR/tNzG4c6EsZLqzUoekD0bWKhOI3sb2Qet5/J7fAi5S7gdOhr Ik78U9fuD70UmZE1iD9FVjPRVYco2y6+FBctlGwp/NTEq5T9KRbt2uS6YxL2JwDq8bxe NmCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fRT58ADovXG1ZWMqpYAZ5DZDhgM6jsnS7oCs8Ms26/I=; b=nD4TTqE057Oko5sIiqREs4JvIKWXUof6le8b9aPGUJsI6PafsqUcPfIqVh8WY0vQgZ m/EaofrMnTY0pTuGXV8Hh9sa2bZwwkmV9pYW1VA82maAUx4mDZrOKSay5vmQYZ3fNiT8 9FAcjV7SwC9vKUJe17krd9VZyPwztLl2/HvNQ39Lqt9fnflbwfkBVyQDmuIJR+jrd2A+ eFjgIpEmIth8UHuQNYROwRq2WV0sxU4RHj86uXMe7nWvhXzEdRssQKfkAwR2TuOJIv6k LQmo7ydxOvsS/7802b4xo51fJNc9VbCc1+Hq6ojp73Fttum1j0qdB34xOxDZtdsOPyc3 o42A== X-Gm-Message-State: APjAAAVgdCBTvmdNc/qVh6YxU0jPV9JARzcVAjEJY7muKg0W6PX3EUjG mECrR4IkncK3CgOozg+l2ltCvga5sDFTOwiAYn8= X-Google-Smtp-Source: APXvYqxsy4IXL3cahH/iBgrux0wUQOjfLPCYAJZaXG0qNpCMGC3fGQRqMr44/vSZ4RuSrRMb37pC96oN+qaPn/ebG+c= X-Received: by 2002:a19:4848:: with SMTP id v69mr625755lfa.6.1572319641228; Mon, 28 Oct 2019 20:27:21 -0700 (PDT) MIME-Version: 1.0 References: <1571995035-21889-1-git-send-email-magnus.karlsson@intel.com> In-Reply-To: <1571995035-21889-1-git-send-email-magnus.karlsson@intel.com> From: Alexei Starovoitov Date: Mon, 28 Oct 2019 20:27:09 -0700 Message-ID: Subject: Re: [PATCH bpf-next v3] libbpf: fix compatibility for kernels without need_wakeup To: Magnus Karlsson Cc: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Alexei Starovoitov , Daniel Borkmann , Network Development , Jonathan Lemon , bpf , degeneloy@gmail.com, John Fastabend Content-Type: text/plain; charset="UTF-8" Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Fri, Oct 25, 2019 at 2:17 AM Magnus Karlsson wrote: > > When the need_wakeup flag was added to AF_XDP, the format of the > XDP_MMAP_OFFSETS getsockopt was extended. Code was added to the > kernel to take care of compatibility issues arrising from running > applications using any of the two formats. However, libbpf was > not extended to take care of the case when the application/libbpf > uses the new format but the kernel only supports the old > format. This patch adds support in libbpf for parsing the old > format, before the need_wakeup flag was added, and emulating a > set of static need_wakeup flags that will always work for the > application. > > v2 -> v3: > * Incorporated code improvements suggested by Jonathan Lemon > > v1 -> v2: > * Rebased to bpf-next > * Rewrote the code as the previous version made you blind > > Fixes: a4500432c2587cb2a ("libbpf: add support for need_wakeup flag in AF_XDP part") > Reported-by: Eloy Degen > Signed-off-by: Magnus Karlsson Applied. Thanks