<commit_before>module(...,package.seeall)

local Intel82599 = require("apps.intel.intel_app").Intel82599
local VhostUser = require("apps.vhost.vhost_user").VhostUser
local PacketFilter = require("apps.packet_filter.packet_filter").PacketFilter
local RateLimiter = require("apps.rate_limiter.rate_limiter").RateLimiter
local nd_light = require("apps.ipv6.nd_light").nd_light
local L2TPv3 = require("apps.keyed_ipv6_tunnel.tunnel").SimpleKeyedTunnel
local ffi = require("ffi")
local C = ffi.C
local lib = require("core.lib")

-- Return name of port in <port_config>.
function port_name (port_config)
   return port_config.port_id:gsub("-", "_")
end

-- Compile app configuration from <file> for <pciaddr> and vhost_user
-- <socket>. Returns configuration and zerocopy pairs.
function load (file, pciaddr, sockpath)
   local ports = lib.load_conf(file)
   local c = config.new()
   for _,t in ipairs(ports) do
      local vlan, mac_address = t.vlan, t.mac_address
      local name = port_name(t)
      local NIC = "NIC_"..name
      local Virtio = "Virtio_"..name
      config.app(c, NIC, Intel82599, {pciaddr = pciaddr,
                                      vmdq = true,
                                      macaddr = mac_address,
                                      vlan = vlan})
      config.app(c, Virtio, VhostUser, {socket_path=sockpath:format(t.port_id)})
      local VM_rx, VM_tx = Virtio..".rx", Virtio..".tx"
      if t.ingress_filter and #t.ingress_filter > 0 then
         local Filter = "Filter_in_"..name
         config.app(c, Filter, PacketFilter, t.ingress_filter)
         config.link(c, Filter..".tx -> " .. VM_rx)
         VM_rx = Filter..".rx"
      end
      if t.egress_filter and #t.egress_filter > 0 then
         local Filter = 'Filter_out_'..name<commit_msg>nfv/config: VMDQ is not supported now, fix it and reenable<commit_after>module(...,package.seeall)

local Intel82599 = require("apps.intel.intel_app").Intel82599
local VhostUser = require("apps.vhost.vhost_user").VhostUser
local PacketFilter = require("apps.packet_filter.packet_filter").PacketFilter
local RateLimiter = require("apps.rate_limiter.rate_limiter").RateLimiter
local nd_light = require("apps.ipv6.nd_light").nd_light
local L2TPv3 = require("apps.keyed_ipv6_tunnel.tunnel").SimpleKeyedTunnel
local ffi = require("ffi")
local C = ffi.C
local lib = require("core.lib")

-- Return name of port in <port_config>.
function port_name (port_config)
   return port_config.port_id:gsub("-", "_")
end

-- Compile app configuration from <file> for <pciaddr> and vhost_user
-- <socket>. Returns configuration and zerocopy pairs.
function load (file, pciaddr, sockpath)
   local ports = lib.load_conf(file)
   local c = config.new()
   for _,t in ipairs(ports) do
      local vlan, mac_address = t.vlan, t.mac_address
      local name = port_name(t)
      local NIC = "NIC_"..name
      local Virtio = "Virtio_"..name
      config.app(c, NIC, Intel82599, {pciaddr = pciaddr,
                                      vmdq = false,
                                      macaddr = mac_address,
                                      vlan = vlan})
      config.app(c, Virtio, VhostUser, {socket_path=sockpath:format(t.port_id)})
      local VM_rx, VM_tx = Virtio..".rx", Virtio..".tx"
      if t.ingress_filter and #t.ingress_filter > 0 then
         local Filter = "Filter_in_"..name
         config.app(c, Filter, PacketFilter, t.ingress_filter)
         config.link(c, Filter..".tx -> " .. VM_rx)
         VM_rx = Filter..".rx"
      end
      if t.egress_filter and #t.egress_filter > 0 then
         local Filter = 'Filter_out_'..name
{'fraction_non_alphanumeric': 0.12140486725663717, 'fraction_numerical': 0.011615044247787611, 'mean_word_length': 2.803364879074658, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7283385', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1183, 'n_words': 274}