changeset 129:518d9c8ac70c

Clean-up the patch queue
author Louis Opter <louis@lse.epita.fr>
date Mon, 02 Sep 2013 22:59:30 -0700
parents 0fdaa93ed62b
children 6359457dce75
files e1000_wip.patch rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch rathaxes_samples_e1000_split_set_up_device.patch series wip_debug.patch
diffstat 5 files changed, 67 insertions(+), 109 deletions(-) [+]
line wrap: on
line diff
--- a/e1000_wip.patch	Mon Aug 26 22:53:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-# HG changeset patch
-# Parent e2e8117a5aede962810a9a561890d2cf80997815
-diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
---- a/rathaxes/samples/e1000/e1000.blt
-+++ b/rathaxes/samples/e1000/e1000.blt
-@@ -186,9 +186,9 @@
-                         goto err_skbuffs_alloc;
-                     }
-                     ${Socket::SKBuff.ref} skbuff = &hw_ctx->rx_ring.skbuffs[i];
--                    // XXX breaks rtxGen: ${local.skbuff.init(local.k_sk_buff)};
--                    skbuff->skbuff = k_sk_buff;
--                    skbuff->dma_handle = 0;
-+                    ${local.skbuff.init(local.k_sk_buff)};
-+                    // skbuff->skbuff = k_sk_buff;
-+                    // *(dma_addr_t *)&(skbuff->dma_handle) = 0;
-                     // XXX #46: ${local.skbuff.map_from(rtx_ether_ctx.device)};
-                     if (rtx_socket_skbuff_map(${local.skbuff}, ${rtx_ether_ctx.device}, RTX_DMA_FROM_DEVICE))
-                     {
-@@ -228,7 +228,7 @@
-                 {
-                     dma_unmap_single(
-                             ${rtx_ether_ctx.device},
--                            hw_ctx->rx_ring.skbuffs[i].dma_handle,
-+                            *((dma_addr_t *)&(hw_ctx->rx_ring.skbuffs[i].dma_handle)),
-                             ${config.rx_buffer_len},
-                             DMA_FROM_DEVICE);
-             err_skbuffs_map:
-@@ -350,7 +350,7 @@
-                         E1000_TXD_CMD_RS   |
-                         skb_headlen(${local.k_skb.k_sk_buff}));
-                 tx_desc->upper.data = 0;
--                tx_desc->buff_addr = cpu_to_le64(skb->dma_handle);
-+                tx_desc->buff_addr = cpu_to_le64(${local.skb.dma_handle.k_dma_handle});
-                 memcpy(&self->skbuffs[self->tail], ${local.k_skb.k_sk_buff}, sizeof(*${local.k_skb.k_sk_buff}));
-                 self->tail = (self->tail + 1) % ${config.tx_ring_size};
-             }
-@@ -890,15 +890,18 @@
-              */
-             for (int i = 0; i != ${config.rx_ring_size}; ++i)
-             {
-+                /*
-+                 * XXX Leaking casts:
-+                 *
-+                 * We should go through the rtx types (Socket::SKBuff,
-+                 * AbstractSKBuff), but we can't because of the array here,
-+                 * which is not supported by the compiler.
-+                 */
-                 dma_unmap_single(
-                         ${rtx_ether_ctx.device},
--                        (dma_addr_t)hw_ctx_->rx_ring.skbuffs[i].dma_handle,
-+                        *((dma_addr_t *)&(hw_ctx_->rx_ring.skbuffs[i].dma_handle)),
-                         ${config.rx_buffer_len},
-                         DMA_FROM_DEVICE);
--                /* XXX Leaking cast
--                 * (We should go through the rtx types (Socket::SKBuff,
--                 * AbstractSKBuff)
--                 */
-                 dev_kfree_skb((struct sk_buff *)hw_ctx_->rx_ring.skbuffs[i].skbuff);
-             }
-             dma_free_coherent(${rtx_ether_ctx.device}, hw_ctx_->rx_ring.size,
--- a/rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch	Mon Aug 26 22:53:34 2013 -0700
+++ b/rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch	Mon Sep 02 22:59:30 2013 -0700
@@ -65,7 +65,21 @@
          if (instanceChunk<chunkTree.instanceKey>(resVals, chunkTree.body, source_tree) == false)
          {
              increment(errcount);
-@@ -716,6 +735,8 @@
+@@ -710,17 +729,29 @@
+             // First, try to retrieve value from previous resVals, otherwise build it from chunk
+             if (varName != "self")
+             {
++                //
++                // XXX Note: Here, we may encounter some issues if the chunk's type_map isnt properly filled
++                // (encountered once, the type was scalar instead of ref)
++                //
++                local self_reftype = "scalar";
++                local self_rtype;
+                 if (rtxNodeArgs_GetArgByName(resolverValues, varName, self) == true)
+                 {
+                     rtxNodeArg_getValue(self, self_value);
++                    rtxNodeArg_getRType(self, self_rtype);
++                    self_reftype = self_rtype.qualifier;
                  }
                  else
                  {
@@ -74,3 +88,12 @@
                      clearVariable(self_value);
                      cnormNode_TerminalId(self_value, varName);
                  }
+-                rtxNodeArgs_AppendArg(resVal, "self", theChunk.type_map[varName], self_value);
+-                setall self_type = theChunk.type_map[varName];
++                setall self_rtype = theChunk.type_map[varName];
++                self_rtype.qualifier = self_reftype;
++                rtxNodeArgs_AppendArg(resVal, "self", self_rtype, self_value);
++                setall self_type = self_rtype;
+             }
+             else
+             {
--- a/rathaxes_samples_e1000_split_set_up_device.patch	Mon Aug 26 22:53:34 2013 -0700
+++ b/rathaxes_samples_e1000_split_set_up_device.patch	Mon Sep 02 22:59:30 2013 -0700
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent d62a08753da7cec4d44246b747ff79847d9b4238
+# Parent 2bb3ee06ef16e410c364238ccdccf43a6a2acceb
 rathaxes: split and refactor e1000::set_up_device in {Rx,Tx}Ring methods
 
 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
@@ -11,7 +11,7 @@
  {
      template type   e1000::RxDescriptor()
      {
-@@ -96,8 +96,163 @@
+@@ -96,8 +96,164 @@
          {
          }
  
@@ -107,7 +107,7 @@
 +                    ${Socket::SKBuff.ref} skbuff = &hw_ctx->rx_ring.skbuffs[i];
 +                    // XXX breaks rtxGen: ${local.skbuff.init(local.k_sk_buff)};
 +                    skbuff->skbuff = k_sk_buff;
-+                    skbuff->dma_handle = 0;
++                    *(dma_addr_t *)&(skbuff->dma_handle) = 0;
 +                    // XXX #46: ${local.skbuff.map_from(rtx_ether_ctx.device)};
 +                    if (rtx_socket_skbuff_map(${local.skbuff}, ${rtx_ether_ctx.device}, RTX_DMA_FROM_DEVICE))
 +                    {
@@ -147,7 +147,8 @@
 +                {
 +                    dma_unmap_single(
 +                            ${rtx_ether_ctx.device},
-+                            hw_ctx->rx_ring.skbuffs[i].dma_handle,
++                            /* XXX Leaking cast because of the array: */
++                            *((dma_addr_t *)&(hw_ctx->rx_ring.skbuffs[i].dma_handle)),
 +                            ${config.rx_buffer_len},
 +                            DMA_FROM_DEVICE);
 +            err_skbuffs_map:
@@ -175,7 +176,16 @@
          }
      }
  
-@@ -208,7 +363,62 @@
+@@ -195,7 +351,7 @@
+                         E1000_TXD_CMD_RS   |
+                         skb_headlen(${local.k_skb.k_sk_buff}));
+                 tx_desc->upper.data = 0;
+-                tx_desc->buff_addr = cpu_to_le64(skb->dma_handle);
++                tx_desc->buff_addr = cpu_to_le64(${local.skb.dma_handle.k_dma_handle});
+                 memcpy(&self->skbuffs[self->tail], ${local.k_skb.k_sk_buff}, sizeof(*${local.k_skb.k_sk_buff}));
+                 self->tail = (self->tail + 1) % ${config.tx_ring_size};
+             }
+@@ -208,7 +364,62 @@
              }
          }
  
@@ -239,7 +249,7 @@
          {
              rtx_e1000_tx_ring_clean(${self});
          }
-@@ -247,9 +457,8 @@
+@@ -247,9 +458,8 @@
          {
              int                         bars;
              unsigned char /* __iomem */ *ioaddr;
@@ -251,7 +261,7 @@
          }
  
          chunk   Ethernet::HardwareContext()
-@@ -309,10 +518,53 @@
+@@ -309,10 +519,53 @@
              }
          }
  
@@ -306,7 +316,7 @@
      }
  
      template type   e1000::Register()
-@@ -615,269 +867,6 @@
+@@ -615,269 +868,6 @@
          }
      }
  
@@ -576,6 +586,30 @@
      /* TODO:
       *
       * Refactor into two methods (one in RxRing and one in TxRing) and make use
+@@ -901,15 +891,18 @@
+              */
+             for (int i = 0; i != ${config.rx_ring_size}; ++i)
+             {
++                /*
++                 * XXX Leaking casts:
++                 *
++                 * We should go through the rtx types (Socket::SKBuff,
++                 * AbstractSKBuff), but we can't because of the array here,
++                 * which is not supported by the compiler.
++                 */
+                 dma_unmap_single(
+                         ${rtx_ether_ctx.device},
+-                        (dma_addr_t)hw_ctx_->rx_ring.skbuffs[i].dma_handle,
++                        *((dma_addr_t *)&(hw_ctx_->rx_ring.skbuffs[i].dma_handle)),
+                         ${config.rx_buffer_len},
+                         DMA_FROM_DEVICE);
+-                /* XXX Leaking cast
+-                 * (We should go through the rtx types (Socket::SKBuff,
+-                 * AbstractSKBuff)
+-                 */
+                 dev_kfree_skb((struct sk_buff *)hw_ctx_->rx_ring.skbuffs[i].skbuff);
+             }
+             dma_free_coherent(${rtx_ether_ctx.device}, hw_ctx_->rx_ring.size,
 diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti
 --- a/rathaxes/samples/e1000/e1000.rti
 +++ b/rathaxes/samples/e1000/e1000.rti
--- a/series	Mon Aug 26 22:53:34 2013 -0700
+++ b/series	Mon Sep 02 22:59:30 2013 -0700
@@ -6,10 +6,8 @@
 rathaxes_compiler_passes_fix_reference_reuse.patch
 rathaxes_compiler_passes_fix_local_variable_resolution_on_method_call.patch
 rathaxes_compiler_passes_fix_cases_where_self_would_be_incorrectly_resolved.patch
+rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch
 rathaxes_samples_e1000_add_a_dma_abstraction.patch
 rathaxes_samples_e1000_use_the_dma_abstraction_in_socket.patch
 rathaxes_samples_e1000_add_ethernet_device_alloc_rx_skbuff.patch
 rathaxes_samples_e1000_split_set_up_device.patch
-rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch
-wip_debug.patch
-e1000_wip.patch
--- a/wip_debug.patch	Mon Aug 26 22:53:34 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-# HG changeset patch
-# Parent ea807d6831821c5fb094e7ae9258f5a282ec15e6
-
-diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
---- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws
-+++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
-@@ -729,9 +729,17 @@
-             // First, try to retrieve value from previous resVals, otherwise build it from chunk
-             if (varName != "self")
-             {
-+                //
-+                // XXX Note: Here, we may encounter some issues if the chunk's type_map isnt properly filled
-+                // (encountered once, the type was scalar instead of ref)
-+                //
-+                local self_reftype = "scalar";
-+                local self_rtype;
-                 if (rtxNodeArgs_GetArgByName(resolverValues, varName, self) == true)
-                 {
-                     rtxNodeArg_getValue(self, self_value);
-+                    rtxNodeArg_getRType(self, self_rtype);
-+                    self_reftype = self_rtype.qualifier;
-                 }
-                 else
-                 {
-@@ -740,8 +748,10 @@
-                     clearVariable(self_value);
-                     cnormNode_TerminalId(self_value, varName);
-                 }
--                rtxNodeArgs_AppendArg(resVal, "self", theChunk.type_map[varName], self_value);
--                setall self_type = theChunk.type_map[varName];
-+                setall self_rtype = theChunk.type_map[varName];
-+                self_rtype.qualifier = self_reftype;
-+                rtxNodeArgs_AppendArg(resVal, "self", self_rtype, self_value);
-+                setall self_type = self_rtype;
-             }
-             else
-             {