From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) by dpdk.org (Postfix) with ESMTP id BD0FC3239 for ; Tue, 31 May 2016 18:53:42 +0200 (CEST) Received: by mail-pf0-f169.google.com with SMTP id 62so31840309pfd.1 for ; Tue, 31 May 2016 09:53:42 -0700 (PDT) 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=AqD8ivY48xFX8+TTDMTrq7qwXA//4VcWX9H5ty7mVdA=; b=vu68a3jBamYN7doR+f/ICSReXr1SChCXbxeFHqqIFVbQgsKjVbXG3MtQiZ4SaNo6Mw 9Dki8VN5Q+hWAiT2MHZbdTVe/yESSXQ0aFLXji3via/YGGIs+JlUwPP5jS/mphayfasp H9rnuNT2Xn+b2PwmZwM2I4BKrvXdIqX42o5ap8+W/oD/3Ca1ZiwTDOSa90LjjJajSr4r 0H+MhBuqWwncpc1yohfXGkaURMU9JBtTER/73BjtqeSZFkgwV/nWj6tq6Y8/om0pgR3M IrkEUD6YrZ7jO3NEZJcpT7swPnHtIylAq3GELN+1zaN53M8ZseSklNfZUNywhJy1qP51 yunw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AqD8ivY48xFX8+TTDMTrq7qwXA//4VcWX9H5ty7mVdA=; b=WPpBITkEuVJ8QieQhEzgHAiJ5elT/6LMaWaU6fo8HxUjG42Z90OIofCIODu84tl+4U u0p0VcRpE/TEb9C8wXXN5NjPGNJ36gVqPcDmy1k7fhTElLoZJNF4aeo3vt1d9zbgnoBS pCMCs6FbCyS3rcxfRwmC+FH08Sx/HLUktKDnad9v3Cypl4iE8+dh1sYB/F85JDXz/ARf tPtQYReE07foGxA93rhPbp/WJEAv2ISE136/Al6gEtuhaRN4YD6gvsBtT374mNqliTM9 IWUdmr6Vl6HB7Wk3Hn6sK4990xuAY+tg4VWZlqZXe6yeSKgJsnWeyPyaS4FuKxyBohLa ovqA== X-Gm-Message-State: ALyK8tKQ+fplI8N4iqYSzY4/Cm9+A+U8MTsnuknGjuIPRbUTVSBUbSTrS3950cmnFA/PaA== X-Received: by 10.98.87.149 with SMTP id i21mr42832638pfj.50.1464713621961; Tue, 31 May 2016 09:53:41 -0700 (PDT) Received: from xeon-e3 (static-50-53-72-186.bvtn.or.frontiernet.net. [50.53.72.186]) by smtp.gmail.com with ESMTPSA id a5sm56245667pat.19.2016.05.31.09.53.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 May 2016 09:53:41 -0700 (PDT) Date: Tue, 31 May 2016 09:53:55 -0700 From: Stephen Hemminger To: Jerin Jacob Cc: , , , , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Message-ID: <20160531095355.7a625ce8@xeon-e3> In-Reply-To: <1464540424-12631-3-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> <1464540424-12631-3-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 02/20] thunderx/nicvf: add pmd skeleton X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 16:53:43 -0000 On Sun, 29 May 2016 22:16:46 +0530 Jerin Jacob wrote: > + > +static struct itimerspec alarm_time = { > + .it_interval = { > + .tv_sec = 0, > + .tv_nsec = NICVF_INTR_POLL_INTERVAL_MS * 1000000, > + }, > + .it_value = { > + .tv_sec = 0, > + .tv_nsec = NICVF_INTR_POLL_INTERVAL_MS * 1000000, > + }, > +}; > + > +static void > +nicvf_interrupt(struct rte_intr_handle *hdl __rte_unused, void *arg) > +{ > + struct nicvf *nic = (struct nicvf *)arg; > + > + nicvf_reg_poll_interrupts(nic); > +} > + > +static int > +nicvf_periodic_alarm_start(struct nicvf *nic) > +{ > + int ret = -EBUSY; > + > + nic->intr_handle.type = RTE_INTR_HANDLE_ALARM; > + nic->intr_handle.fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); > + if (nic->intr_handle.fd == -1) > + goto error; > + ret = rte_intr_callback_register(&nic->intr_handle, > + nicvf_interrupt, nic); > + ret |= timerfd_settime(nic->intr_handle.fd, 0, &alarm_time, NULL); > +error: > + return ret; > +} > + > +static int > +nicvf_periodic_alarm_stop(struct nicvf *nic) > +{ > + int ret; > + > + ret = rte_intr_callback_unregister(&nic->intr_handle, > + nicvf_interrupt, nic); > + ret |= close(nic->intr_handle.fd); > + return ret; > +} It would be good to have real link status interrupts or just report that device does not support Link State interrupt and let application poll. Having another thing going on (timerfd callback) seems like it would add more complexity to the environment of an already complex thread structure with DPDK. Also, timerfd() doesn't exist on all OS's.