get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/719920/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 719920,
    "url": "http://patchwork.ozlabs.org/api/patches/719920/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1485392057-3261-6-git-send-email-sridhar.samudrala@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1485392057-3261-6-git-send-email-sridhar.samudrala@intel.com>",
    "list_archive_url": null,
    "date": "2017-01-26T00:54:15",
    "name": "[next-queue,v5,5/7] i40e: Add TX and RX support in switchdev mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "50925f74207c1851dd77ad2200c0003a817d0705",
    "submitter": {
        "id": 65219,
        "url": "http://patchwork.ozlabs.org/api/people/65219/?format=api",
        "name": "Samudrala, Sridhar",
        "email": "sridhar.samudrala@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1485392057-3261-6-git-send-email-sridhar.samudrala@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/719920/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/719920/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3v83NW3FR9z9sDg\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 26 Jan 2017 11:54:51 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 00A0D2A12E;\n\tThu, 26 Jan 2017 00:54:50 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id EQ9sh1i6zTvX; Thu, 26 Jan 2017 00:54:45 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 85C8130DF4;\n\tThu, 26 Jan 2017 00:54:35 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id ACDBF1C04AB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 26 Jan 2017 00:54:32 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4F7F830D3B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 26 Jan 2017 00:54:32 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 5epFLJ1H9grh for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 26 Jan 2017 00:54:29 +0000 (UTC)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby silver.osuosl.org (Postfix) with ESMTPS id D45062A12E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 26 Jan 2017 00:54:28 +0000 (UTC)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jan 2017 16:54:27 -0800",
            "from sri-mi-02.jf.intel.com ([10.166.188.51])\n\tby orsmga002.jf.intel.com with ESMTP; 25 Jan 2017 16:54:27 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.33,287,1477983600\"; d=\"scan'208\";a=\"35554990\"",
        "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 25 Jan 2017 16:54:15 -0800",
        "Message-Id": "<1485392057-3261-6-git-send-email-sridhar.samudrala@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1485392057-3261-1-git-send-email-sridhar.samudrala@intel.com>",
        "References": "<1485392057-3261-1-git-send-email-sridhar.samudrala@intel.com>",
        "Subject": "[Intel-wired-lan] [next-queue v5 PATCH 5/7] i40e: Add TX and RX\n\tsupport in switchdev mode",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "In switchdev mode, broadcast filter is not enabled on VFs. The broadcasts\nand unknown frames from VFs are received by the PF and passed to\ncorresponding VF port representator netdev.\nA host based switching entity like a linux bridge or OVS redirects these\nframes to the right VFs via VFPR netdevs. Any frames sent via VFPR netdevs\nare sent as directed transmits to the corresponding VFs. To enable directed\ntransmit, skb metadata dst is used to pass the VF id and the frame is\nrequeued to call the PFs transmit routine.\n\nSmall script to demonstrate inter VF pings in switchdev mode.\nPF: enp5s0f0, VFs: enp5s2,enp5s2f1 VFPRs:enp5s0f0-vf0, enp5s0f0-vf1\n\n# rmmod i40e; modprobe i40e\n# devlink dev eswitch set pci/0000:05:00.0 mode switchdev\n# echo 2 > /sys/class/net/enp5s0f0/device/sriov_numvfs\n# ip link set enp5s0f0 vf 0 mac 00:11:22:33:44:55\n# ip link set enp5s0f0 vf 1 mac 00:11:22:33:44:56\n# rmmod i40evf; modprobe i40evf\n\n/* Create 2 namespaces and move the VFs to the corresponding ns. */\n# ip netns add ns0\n# ip link set enp5s2 netns ns0\n# ip netns exec ns0 ip addr add 192.168.1.10/24 dev enp5s2\n# ip netns exec ns0 ip link set enp5s2 up\n# ip netns add ns1\n# ip link set enp5s2f1 netns ns1\n# ip netns exec ns1 ip addr add 192.168.1.11/24 dev enp5s2f1\n# ip netns exec ns1 ip link set enp5s2f1 up\n\n/* bring up pf and vfpr netdevs */\n# ip link set enp5s0f0 up\n# ip link set enp5s0f0-vf0 up\n# ip link set enp5s0f0-vf1 up\n\n/* Create a linux bridge and add vfpr netdevs to it. */\n# ip link add vfpr-br type bridge\n# ip link set enp5s0f0-vf0 master vfpr-br\n# ip link set enp5s0f0-vf1 master vfpr-br\n# ip addr add 192.168.1.1/24 dev vfpr-br\n# ip link set vfpr-br up\n\n# ip netns exec ns0 ping -c3 192.168.1.11\n# ip netns exec ns1 ping -c3 192.168.1.10\n\nSigned-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>\nSigned-off-by: Anjali Singhai <anjali.singhai@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h             |   1 +\n drivers/net/ethernet/intel/i40e/i40e_main.c        |   4 +\n drivers/net/ethernet/intel/i40e/i40e_txrx.c        | 106 ++++++++++++++++++++-\n drivers/net/ethernet/intel/i40e/i40e_txrx.h        |   2 +\n drivers/net/ethernet/intel/i40e/i40e_type.h        |   3 +\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  17 +++-\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |   1 +\n 7 files changed, 127 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 0786f78..081154a 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -55,6 +55,7 @@\n #include <linux/net_tstamp.h>\n #include <linux/ptp_clock_kernel.h>\n #include <net/devlink.h>\n+#include <net/dst_metadata.h>\n \n #include \"i40e_type.h\"\n #include \"i40e_prototype.h\"\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex e62472f..19f373e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -11358,6 +11358,7 @@ static int i40e_devlink_eswitch_mode_get(struct devlink *devlink, u16 *mode)\n static int i40e_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode)\n {\n \tstruct i40e_pf *pf = devlink_priv(devlink);\n+\tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n \tstruct i40e_vf *vf;\n \tint i, j, err = 0;\n \n@@ -11371,6 +11372,8 @@ static int i40e_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode)\n \t\t\ti40e_free_vfpr_netdev(vf);\n \t\t}\n \t\tpf->eswitch_mode = mode;\n+\t\tvsi->netdev->priv_flags |=\n+\t\t\t(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM);\n \t\tbreak;\n \tcase DEVLINK_ESWITCH_MODE_SWITCHDEV:\n \t\tfor (i = 0; i < pf->num_alloc_vfs; i++) {\n@@ -11385,6 +11388,7 @@ static int i40e_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode)\n \t\t\t}\n \t\t}\n \t\tpf->eswitch_mode = mode;\n+\t\tnetif_keep_dst(vsi->netdev);\n \t\tbreak;\n \tdefault:\n \t\terr = -EOPNOTSUPP;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 0291ed4..f43d1df 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1283,16 +1283,39 @@ static bool i40e_alloc_mapped_page(struct i40e_ring *rx_ring,\n  * @rx_ring:  rx ring in play\n  * @skb: packet to send up\n  * @vlan_tag: vlan tag for packet\n+ * @lpbk: is it a loopback frame?\n  **/\n static void i40e_receive_skb(struct i40e_ring *rx_ring,\n-\t\t\t     struct sk_buff *skb, u16 vlan_tag)\n+\t\t\t     struct sk_buff *skb, u16 vlan_tag, bool lpbk)\n {\n \tstruct i40e_q_vector *q_vector = rx_ring->q_vector;\n+\tstruct i40e_pf *pf = rx_ring->vsi->back;\n+\tstruct i40e_vf *vf;\n+\tstruct ethhdr *eth;\n+\tint vf_id;\n \n \tif ((rx_ring->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) &&\n \t    (vlan_tag & VLAN_VID_MASK))\n \t\t__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);\n \n+\tif ((pf->eswitch_mode == DEVLINK_ESWITCH_MODE_LEGACY) || !lpbk)\n+\t\tgoto gro_receive;\n+\n+\t/* If a loopback packet is received from a VF in switchdev mode, pass\n+\t * the frame to the corresponding VFPR netdev based on the source MAC\n+\t * in the frame.\n+\t */\n+\teth = (struct ethhdr *)skb_mac_header(skb);\n+\tfor (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) {\n+\t\tvf = &pf->vf[vf_id];\n+\t\tif (ether_addr_equal(eth->h_source,\n+\t\t\t\t     vf->default_lan_addr.addr)) {\n+\t\t\tskb->dev = vf->vfpr_netdev;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+gro_receive:\n \tnapi_gro_receive(&q_vector->napi, skb);\n }\n \n@@ -1501,6 +1524,7 @@ static inline void i40e_rx_hash(struct i40e_ring *ring,\n  * @rx_desc: pointer to the EOP Rx descriptor\n  * @skb: pointer to current skb being populated\n  * @rx_ptype: the packet type decoded by hardware\n+ * @lpbk: is it a loopback frame?\n  *\n  * This function checks the ring, descriptor, and packet information in\n  * order to populate the hash, checksum, VLAN, protocol, and\n@@ -1509,7 +1533,7 @@ static inline void i40e_rx_hash(struct i40e_ring *ring,\n static inline\n void i40e_process_skb_fields(struct i40e_ring *rx_ring,\n \t\t\t     union i40e_rx_desc *rx_desc, struct sk_buff *skb,\n-\t\t\t     u8 rx_ptype)\n+\t\t\t     u8 rx_ptype, bool *lpbk)\n {\n \tu64 qword = le64_to_cpu(rx_desc->wb.qword1.status_error_len);\n \tu32 rx_status = (qword & I40E_RXD_QW1_STATUS_MASK) >>\n@@ -1518,6 +1542,9 @@ void i40e_process_skb_fields(struct i40e_ring *rx_ring,\n \tu32 tsyn = (rx_status & I40E_RXD_QW1_STATUS_TSYNINDX_MASK) >>\n \t\t   I40E_RXD_QW1_STATUS_TSYNINDX_SHIFT;\n \n+\t*lpbk = !!((rx_status & I40E_RXD_QW1_STATUS_LPBK_MASK) >>\n+\t\tI40E_RXD_QW1_STATUS_LPBK_SHIFT);\n+\n \tif (unlikely(tsynvalid))\n \t\ti40e_ptp_rx_hwtstamp(rx_ring->vsi->back, skb, tsyn);\n \n@@ -2045,6 +2072,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\tu8 rx_ptype;\n \t\tu64 qword;\n \t\tunsigned int xdp_consumed_bytes = 0;\n+\t\tbool lpbk;\n \n \t\t/* return some buffers to hardware, one at a time is too slow */\n \t\tif (cleaned_count >= I40E_RX_BUFFER_WRITE) {\n@@ -2113,7 +2141,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t\t   I40E_RXD_QW1_PTYPE_SHIFT;\n \n \t\t/* populate checksum, VLAN, and protocol */\n-\t\ti40e_process_skb_fields(rx_ring, rx_desc, skb, rx_ptype);\n+\t\ti40e_process_skb_fields(rx_ring, rx_desc, skb, rx_ptype, &lpbk);\n \n #ifdef I40E_FCOE\n \t\tif (unlikely(\n@@ -2127,7 +2155,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\tvlan_tag = (qword & BIT(I40E_RX_DESC_STATUS_L2TAG1P_SHIFT)) ?\n \t\t\t   le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) : 0;\n \n-\t\ti40e_receive_skb(rx_ring, skb, vlan_tag);\n+\t\ti40e_receive_skb(rx_ring, skb, vlan_tag, lpbk);\n \t\tskb = NULL;\n \n \t\t/* update budget accounting */\n@@ -2692,6 +2720,27 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,\n }\n \n /**\n+ * i40e_tvsi - set up the target vsi in TX context descriptor\n+ * @tx_ring:  ptr to the target vsi\n+ * @cd_type_cmd_tso_mss: Quad Word 1\n+ *\n+ * Returns 0\n+ **/\n+static int i40e_tvsi(struct i40e_vsi *tvsi, u64 *cd_type_cmd_tso_mss)\n+{\n+\tu64 cd_cmd, cd_tvsi;\n+\n+\tcd_cmd = I40E_TX_CTX_DESC_SWTCH_VSI;\n+\tcd_tvsi = tvsi->id;\n+\tcd_tvsi = (cd_tvsi << I40E_TXD_CTX_QW1_VSI_SHIFT) &\n+\t\t  I40E_TXD_CTX_QW1_VSI_MASK;\n+\t*cd_type_cmd_tso_mss |= (cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |\n+\t\t\t\t cd_tvsi;\n+\n+\treturn 0;\n+}\n+\n+/**\n  * i40e_tsyn - set up the tsyn context descriptor\n  * @tx_ring:  ptr to the ring to send\n  * @skb:      ptr to the skb we're sending\n@@ -3223,8 +3272,12 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \t\t\t\t\tstruct i40e_ring *tx_ring)\n {\n \tu64 cd_type_cmd_tso_mss = I40E_TX_DESC_DTYPE_CONTEXT;\n+\tstruct metadata_dst *md_dst = skb_metadata_dst(skb);\n \tu32 cd_tunneling = 0, cd_l2tag2 = 0;\n \tstruct i40e_tx_buffer *first;\n+\tstruct i40e_vsi *t_vsi = NULL;\n+\tstruct i40e_vf *t_vf;\n+\tstruct i40e_pf *pf;\n \tu32 td_offset = 0;\n \tu32 tx_flags = 0;\n \t__be16 protocol;\n@@ -3276,7 +3329,26 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \telse if (protocol == htons(ETH_P_IPV6))\n \t\ttx_flags |= I40E_TX_FLAGS_IPV6;\n \n-\ttso = i40e_tso(first, &hdr_len, &cd_type_cmd_tso_mss);\n+\t/* If skb metadata dst points to a VF id, do a directed transmit to\n+\t * that VSI. TSO is mutually exclusive with this option. So TSO is not\n+\t * enabled when doing a directed transmit.\n+\t */\n+\tif (md_dst && (md_dst->type == METADATA_HW_PORT_MUX)) {\n+\t\tpf = tx_ring->vsi->back;\n+\t\tif (md_dst->u.port_info.port_id >= pf->num_alloc_vfs) {\n+\t\t\tWARN_ONCE(1, \"Unexpected port_id: %d num_vfs:%d\\n\",\n+\t\t\t\t  md_dst->u.port_info.port_id,\n+\t\t\t\t  pf->num_alloc_vfs);\n+\t\t\tgoto out_drop;\n+\t\t}\n+\t\tt_vf = &pf->vf[md_dst->u.port_info.port_id];\n+\t\tt_vsi = pf->vsi[t_vf->lan_vsi_idx];\n+\t}\n+\n+\tif (t_vsi)\n+\t\ttso = i40e_tvsi(t_vsi, &cd_type_cmd_tso_mss);\n+\telse\n+\t\ttso = i40e_tso(first, &hdr_len, &cd_type_cmd_tso_mss);\n \n \tif (tso < 0)\n \t\tgoto out_drop;\n@@ -3340,3 +3412,27 @@ netdev_tx_t i40e_lan_xmit_frame(struct sk_buff *skb, struct net_device *netdev)\n \n \treturn i40e_xmit_frame_ring(skb, tx_ring);\n }\n+\n+/**\n+ * i40e_vfpr_netdev_start_xmit\n+ * @skb:    send buffer\n+ * @netdev: network interface device structure\n+ *\n+ * Sets skb->dev to PF netdev, VF id in the skb->dst and requeues\n+ * skb via dev_queue_xmit()\n+ **/\n+netdev_tx_t i40e_vfpr_netdev_start_xmit(struct sk_buff *skb,\n+\t\t\t\t\tstruct net_device *netdev)\n+{\n+\tstruct i40e_vfpr_netdev_priv *priv = netdev_priv(netdev);\n+\tstruct i40e_vf *vf = priv->vf;\n+\tstruct i40e_pf *pf = vf->pf;\n+\tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n+\n+\tskb_dst_drop(skb);\n+\tdst_hold(&priv->vfpr_dst->dst);\n+\tskb_dst_set(skb, &priv->vfpr_dst->dst);\n+\tskb->dev = vsi->netdev;\n+\n+\treturn dev_queue_xmit(skb);\n+}\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\nindex 3250be7..5e24aef 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n@@ -393,6 +393,8 @@ struct i40e_ring_container {\n \n bool i40e_alloc_rx_buffers(struct i40e_ring *rxr, u16 cleaned_count);\n netdev_tx_t i40e_lan_xmit_frame(struct sk_buff *skb, struct net_device *netdev);\n+netdev_tx_t i40e_vfpr_netdev_start_xmit(struct sk_buff *skb,\n+\t\t\t\t\tstruct net_device *netdev);\n void i40e_clean_tx_ring(struct i40e_ring *tx_ring);\n void i40e_clean_rx_ring(struct i40e_ring *rx_ring);\n int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h\nindex 939f9fd..251f57e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h\n@@ -729,6 +729,9 @@ enum i40e_rx_desc_status_bits {\n #define I40E_RXD_QW1_STATUS_TSYNVALID_SHIFT  I40E_RX_DESC_STATUS_TSYNVALID_SHIFT\n #define I40E_RXD_QW1_STATUS_TSYNVALID_MASK \\\n \t\t\t\t    BIT_ULL(I40E_RXD_QW1_STATUS_TSYNVALID_SHIFT)\n+#define I40E_RXD_QW1_STATUS_LPBK_SHIFT  I40E_RX_DESC_STATUS_LPBK_SHIFT\n+#define I40E_RXD_QW1_STATUS_LPBK_MASK \\\n+\t\t\t\tBIT_ULL(I40E_RXD_QW1_STATUS_LPBK_SHIFT)\n \n enum i40e_rx_desc_fltstat_values {\n \tI40E_RX_DESC_FLTSTAT_NO_DATA\t= 0,\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 63c9fdf..6c991ae 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1060,6 +1060,7 @@ static int i40e_vfpr_netdev_stop(struct net_device *dev)\n static const struct net_device_ops i40e_vfpr_netdev_ops = {\n \t.ndo_open\t\t= i40e_vfpr_netdev_open,\n \t.ndo_stop\t\t= i40e_vfpr_netdev_stop,\n+\t.ndo_start_xmit         = i40e_vfpr_netdev_start_xmit,\n };\n \n /**\n@@ -1119,6 +1120,10 @@ int i40e_alloc_vfpr_netdev(struct i40e_vf *vf, u16 vf_num)\n \n \tpriv = netdev_priv(vfpr_netdev);\n \tpriv->vf = &pf->vf[vf_num];\n+\tpriv->vfpr_dst = metadata_dst_alloc(0, METADATA_HW_PORT_MUX,\n+\t\t\t\t\t    GFP_KERNEL);\n+\tpriv->vfpr_dst->u.port_info.lower_dev = vsi->netdev;\n+\tpriv->vfpr_dst->u.port_info.port_id = vf->vf_id;\n \n \tvfpr_netdev->netdev_ops = &i40e_vfpr_netdev_ops;\n \teth_hw_addr_inherit(vfpr_netdev, vsi->netdev);\n@@ -1130,6 +1135,7 @@ int i40e_alloc_vfpr_netdev(struct i40e_vf *vf, u16 vf_num)\n \tif (err) {\n \t\tdev_err(&pf->pdev->dev, \"register_netdev failed for vf: %s\\n\",\n \t\t\tvf->vfpr_netdev->name);\n+\t\tdst_release((struct dst_entry *)priv->vfpr_dst);\n \t\tfree_netdev(vfpr_netdev);\n \t\treturn err;\n \t}\n@@ -1158,6 +1164,7 @@ int i40e_alloc_vfpr_netdev(struct i40e_vf *vf, u16 vf_num)\n  **/\n void i40e_free_vfpr_netdev(struct i40e_vf *vf)\n {\n+\tstruct i40e_vfpr_netdev_priv *priv;\n \tstruct i40e_pf *pf = vf->pf;\n \n \tif (!vf->vfpr_netdev)\n@@ -1166,6 +1173,8 @@ void i40e_free_vfpr_netdev(struct i40e_vf *vf)\n \tdev_info(&pf->pdev->dev, \"Freeing VF Port representor(%s)\\n\",\n \t\t vf->vfpr_netdev->name);\n \n+\tpriv = netdev_priv(vf->vfpr_netdev);\n+\tdst_release((struct dst_entry *)priv->vfpr_dst);\n \tunregister_netdev(vf->vfpr_netdev);\n \tfree_netdev(vf->vfpr_netdev);\n \n@@ -1935,8 +1944,10 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \tif (i40e_vsi_start_rings(pf->vsi[vf->lan_vsi_idx]))\n \t\taq_ret = I40E_ERR_TIMEOUT;\n \n-\tif ((aq_ret == 0) && vf->vfpr_netdev)\n+\tif ((aq_ret == 0) && vf->vfpr_netdev) {\n+\t\tnetif_tx_start_all_queues(vf->vfpr_netdev);\n \t\tnetif_carrier_on(vf->vfpr_netdev);\n+\t}\n \n error_param:\n \t/* send the response to the VF */\n@@ -1977,8 +1988,10 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \n \ti40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]);\n \n-\tif ((aq_ret == 0) && vf->vfpr_netdev)\n+\tif ((aq_ret == 0) && vf->vfpr_netdev) {\n+\t\tnetif_tx_stop_all_queues(vf->vfpr_netdev);\n \t\tnetif_carrier_off(vf->vfpr_netdev);\n+\t}\n \n error_param:\n \t/* send the response to the VF */\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\nindex 25ce93c..3dea207 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n@@ -74,6 +74,7 @@ enum i40e_vf_capabilities {\n \n /* VF Port representator netdev private structure */\n struct i40e_vfpr_netdev_priv {\n+\tstruct metadata_dst *vfpr_dst;\n \tstruct i40e_vf *vf;\n };\n \n",
    "prefixes": [
        "next-queue",
        "v5",
        "5/7"
    ]
}