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=-0.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,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 B7A47C433E0 for ; Thu, 6 Aug 2020 12:09:23 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 853C322D0B for ; Thu, 6 Aug 2020 12:09:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PnGEDlhR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 853C322D0B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1k3XtG-0002a8-TL; Thu, 06 Aug 2020 00:52:30 -0400 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1k3XtE-0002a3-5G for kernelnewbies@kernelnewbies.org; Thu, 06 Aug 2020 00:52:28 -0400 Received: by mail-il1-x12a.google.com with SMTP id j9so35964575ilc.11 for ; Wed, 05 Aug 2020 21:52:27 -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=ZnpdKnmofdBEuhNTEps4CzXRuJzFJqIjWW2S+jXkf+s=; b=PnGEDlhR9h14fKBjc+sUNJG1h8ZTBpUerVdNLWQbKwNn2Wgeo9C2q5LApwbzioqlc6 Q1anrshwvylmmQTm35IlmiXnaxTMtpKPco/ld/f6k6oZ6yWdZUNRU9JfAoDZBg7alWPg azZEkXceHqgB8YJJlkdq9FpQmFeJRXe2r7ycdp/odcin1z51Ga1d5Z1TqVG4GlaTySTU UgeMGOfXz6c6XM9N9NJOnYGNbdnj/LWOdZXdJNBm8hXnc1r9wnVDh2yOTA3J4aVGDm1M VbI8VX3wZl/lCM+Nw57auUSd1ix6xFo9mXqXXBOuPX4U2A/haVn0Ja5gc2tChM2AiBGH 0YRA== 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=ZnpdKnmofdBEuhNTEps4CzXRuJzFJqIjWW2S+jXkf+s=; b=gnnA/M5B6ZTbb3x56NXk2FbbcLjdOBbwPLtiRKDX/3Yd1oAB5zsnFT2dav5Of7EpN/ JalPMPS2bcqM5nBXAcg9NJ4JIF0tx4fVw51Zny7XV9SBsjSYQEaCr08iH1c0zitZgKZI eAmMGnmJjkPIYsbuY1HRu923BX/IgDkSXgnA+w4fzix/oss+BtZKDnlWBFuD7fS/rf3l 67dUkXW47HIOk9yPuoCux++zCXg6iKwoVyyQAhAdYDfnlG6/Ku1qYMdF0Um9fXusOYZm dpnSUACn7mGupZE2NWLXOJqqt1Cvcd0/WgICPTlwSnAFfkE12Qg99+7t2DRjFr5zGkXB VgCw== X-Gm-Message-State: AOAM532kv2OADvSU5JC9icrdRBwZqDEj+6ZbajNgGuu23ni8VpJSI8eG 0tVsjNWd20KhMsxoXfNnNqfN26eRrXdOMm/Ehl4= X-Google-Smtp-Source: ABdhPJxiQTjR9hrirGQDTrG0fgXk3Yx6Z0OHoAfsyssmcza8vRDRUMKmsQECM2T4TWm7Y+wSa147JzYWl2a8l4Nwnis= X-Received: by 2002:a05:6e02:f04:: with SMTP id x4mr7958976ilj.193.1596689545067; Wed, 05 Aug 2020 21:52:25 -0700 (PDT) MIME-Version: 1.0 References: <108692.1596678216@turing-police> In-Reply-To: <108692.1596678216@turing-police> From: Vasu M Date: Wed, 5 Aug 2020 21:52:14 -0700 Message-ID: Subject: Re: Relationship between Rx/Tx ring and Skbuff. To: =?UTF-8?Q?Valdis_Kl=C4=93tnieks?= Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4001022839054440049==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============4001022839054440049== Content-Type: multipart/alternative; boundary="000000000000267f7105ac2e4155" --000000000000267f7105ac2e4155 Content-Type: text/plain; charset="UTF-8" > On Wed, 05 Aug 2020 11:34:52 -0700, Vasu M said: > > > it on a high level, when a packet is received in a NIC, DMA moves the > > packets from the NIC frame buffer into the RX ring buffer in the driver. > A > > hardware interrupt is then raised and the top half moves the packet to > the > > RX ring buffer. > > Umm... I would expect the packet to be moved to the RX ring buffer exactly > once, > not twice... > I am sorry, yes, thats a mistake and it makes sense. If the DMA moves the packet to the RX ring, the top half just acknowledges the interrupt and schedules the softirq to drain the packets from RX. Subsequently, after the packets go through sk_buff, they get queued in the socket recv buffer and get to user space memory finally? I suppose I am only scratching the surface leaving so many details. --000000000000267f7105ac2e4155 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Wed, 05 Aug 2020 11:34:52 = -0700, Vasu M said:

> it on a high level, when a packet is received in a NIC, DMA=C2=A0 move= s the
> packets from the NIC frame buffer into the RX ring buffer in the drive= r. A
> hardware interrupt is then raised and the top half moves the packet to= the
> RX ring buffer.

Umm... I would expect the packet to be moved to the RX ring buffer exactly = once,
not twice...

I am sorry, yes, thats a m= istake and it makes sense. If the DMA moves the packet to the RX ring, the = top half just acknowledges the interrupt and schedules the softirq to drain= the packets from RX. Subsequently, after the packets go through sk_buff, t= hey get queued in the socket recv buffer and get to user space memory final= ly? I suppose I am only scratching the surface leaving so many details.=C2= =A0

=C2=A0
--000000000000267f7105ac2e4155-- --===============4001022839054440049== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============4001022839054440049==--