From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1E23A0548; Mon, 20 Sep 2021 16:43:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3302640DF7; Mon, 20 Sep 2021 16:43:42 +0200 (CEST) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id 35A9140DF5 for ; Mon, 20 Sep 2021 16:43:41 +0200 (CEST) Received: by mail-pg1-f174.google.com with SMTP id r2so17562678pgl.10 for ; Mon, 20 Sep 2021 07:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FfcXIv2RGtFE8TTPzgm0uvZmfRBqlvtNHc4+V8mmuzU=; b=AYJ98zn5A9+X0I/mPJsmIwyvmsv+QSIt+mbjALWmxBAWDkjkAyAHHnrFugpIAHP9EP drl8IqU57AHWl5+eSX6+JKLQcxEdQdrGdTeE9AosE20v8o83o1Oo4fdIc9ChMh07qXcR 3plemd5xMZ7SoURccHL6ukdedA3wSWu7pt2dl+sReveAP4sX88WZiHJzH8oKiS/+C333 XGX8fZSKUDEVnzBDCTAmR3RETIUbL/ULeDEwfkFFmyDRH0+5eA9QKupizbzeqv4aneJw ztXkNtwT6EsgjIigl0JNE7iMG4RoTEVzRgGgHmx/a4ofSVg0+GJ12tTHB6kUB85Udd4U CrHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FfcXIv2RGtFE8TTPzgm0uvZmfRBqlvtNHc4+V8mmuzU=; b=QbZCJibBSKU8t/cNSZZKpbBShVjSEnkLKMzEB1RN3MSAv55g3CcooPf0Xbt1tx5uuD 6J5MuHR7laPKwOk8A3iJU/9UCxQY11FPZZnkEVAnwKIt5ERTGvU4hIvCxkNaixZvjLgs 0d2iF7HEajHC3Acctj9ma+sUaMdlnJ3j/q75wS0NW4NeKo6JJcFKMFwFUJxNqrklAcUe wXJ8Zpewpwkhu8Ip+YATy853grkRysRhHPA69M6MGnXOl2CznlfqeSwtMblKVA7IgOV/ iehB1+kS482q5lNknQd4rmpIAVtJW0UdLvavqu7zA0OZrUp+AiZN3G6G9DqVs5KwXbCH 07lA== X-Gm-Message-State: AOAM533hFw6j4KKN6U3b8u2UFU6F3GHlGp6uWzKp9JesPMx8yAHzEx6F MJCoMvovUCicfSPByY4ryucfBA== X-Google-Smtp-Source: ABdhPJwBRsOuPRCcpO36w91jMwbYGF2FmQRGD88h0DyhC7i6EtCxJkNf7RnAHsYdjBdkul1c2Tk21w== X-Received: by 2002:a63:da49:: with SMTP id l9mr23407172pgj.277.1632149020274; Mon, 20 Sep 2021 07:43:40 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id f127sm14910258pfa.25.2021.09.20.07.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 07:43:39 -0700 (PDT) Date: Mon, 20 Sep 2021 07:43:37 -0700 From: Stephen Hemminger To: "Loftus, Ciara" Cc: "dev@dpdk.org" , "stable@dpdk.org" , "Yigit, Ferruh" , "Zhang, Qi Z" , "Burakov, Anatoly" Message-ID: <20210920074337.595f3742@hermes.local> In-Reply-To: References: <20210903161525.9929-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: fix support of secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 20 Sep 2021 13:23:57 +0000 "Loftus, Ciara" wrote: > > -----Original Message----- > > From: dev On Behalf Of Stephen Hemminger > > Sent: Friday 3 September 2021 17:15 > > To: dev@dpdk.org > > Cc: Stephen Hemminger ; > > stable@dpdk.org; xiaolong.ye@intel.com > > Subject: [dpdk-dev] [PATCH] net/af_xdp: fix support of secondary process > > > > Doing basic operations like info_get or get_stats was broken > > in af_xdp PMD. The info_get would crash because dev->device > > was NULL in secondary process. Fix this by doing same initialization > > as af_packet and tap devices. > > > > The get_stats would crash because the XDP socket is not open in > > primary process. As a workaround don't query kernel for dropped > > packets when called from secondary process. > > > > Note: this does not address the other bug which is that transmitting > > in secondary process is broken because the send() in tx_kick > > will fail because XDP socket fd is not valid in secondary process. > > Hi Stephen, > > Apologies for the delayed reply, I was on vacation. > > In the Bugzilla report you suggest we: > "mark AF_XDP as broken in with primary/secondary > and return an error in probe in secondary process". > I agree with this suggestion. However with this patch we still permit secondary, and just make sure it doesn't crash for get_stats. Did you change your mind? > Personally, I would prefer to have primary/secondary either working 100% or else not allowed at all by throwing an error during probe. What do you think? Do you have a reason/use case to permit secondary processes despite some features not being available eg. full stats, tx? > > Thanks, > Ciara There are two cases where secondary is useful even if send/receive can't work from secondary process. The pdump and proc-info applications can work with these patches. I am using XDP over pdump as an easy way to get packets into the code for testing. The flag in the documentation doesn't have a "limited" version. If you want, will send another patch to disable secondary support. Supporting secondary, means adding a mechanism to pass the socket around.